qti3-item-player-vue3 0.2.15 → 0.2.17
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.
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(l,et){typeof exports=="object"&&typeof module<"u"?module.exports=et(require("vue")):typeof define=="function"&&define.amd?define(["vue"],et):(l=typeof globalThis<"u"?globalThis:l||self,l.Qti3Player=et(l.Vue))})(this,function(l){"use strict";var J3=Object.defineProperty;var e4=(l,et,Os)=>et in l?J3(l,et,{enumerable:!0,configurable:!0,writable:!0,value:Os}):l[et]=Os;var te=(l,et,Os)=>e4(l,typeof et!="symbol"?et+"":et,Os);class et{constructor(t,i,s){this.fieldIdentifier=t,this.value=s,this.baseType=i,this.cardinality="single"}getValue(){return this.value}setValue(t){this.value=t}getBaseType(){return this.baseType}setBaseType(t){this.baseType=t}getCardinality(){return this.cardinality}getFieldIdentifier(){return this.fieldIdentifier}setFieldIdentifier(t){this.fieldIdentifier=t}}class Os{constructor(){te(this,"constants",{COLOR_DEFAULT:"qti3-player-color-default",COLOR_DEFAULT_REVERSE:"qti3-player-color-defaultreverse",COLOR_BLACK_WHITE:"qti3-player-color-blackwhite",COLOR_WHITE_BLACK:"qti3-player-color-whiteblack",COLOR_BLACK_ROSE:"qti3-player-color-blackrose",COLOR_ROSE_BLACK:"qti3-player-color-roseblack",COLOR_YELLOW_BLUE:"qti3-player-color-yellowblue",COLOR_BLUE_YELLOW:"qti3-player-color-blueyellow",COLOR_MGRAY_DGRAY:"qti3-player-color-mgraydgray",COLOR_DGRAY_MGRAY:"qti3-player-color-dgraymgray",COLOR_BLACK_CYAN:"qti3-player-color-blackcyan",COLOR_CYAN_BLACK:"qti3-player-color-cyanblack",COLOR_BLACK_CREAM:"qti3-player-color-blackcream",COLOR_CREAM_BLACK:"qti3-player-color-creamblack",GLOSSARY_ON:"glossary-on",GLOSSARY_OFF:"glossary-off",KEYWORD_TRANS_OFF:"ktlang-off",KEYWORD_TRANS_AR:"ktlang-ar",KEYWORD_TRANS_CMN:"ktlang-cmn",KEYWORD_TRANS_DE:"ktlang-de",KEYWORD_TRANS_EN:"ktlang-en",KEYWORD_TRANS_ES:"ktlang-es",KEYWORD_TRANS_FR:"ktlang-fr",KEYWORD_TRANS_HMN:"ktlang-hmn",KEYWORD_TRANS_IT:"ktlang-it",KEYWORD_TRANS_JA:"ktlang-ja",KEYWORD_TRANS_KO:"ktlang-ko",KEYWORD_TRANS_MY:"ktlang-my",KEYWORD_TRANS_NL:"ktlang-nl",KEYWORD_TRANS_PA:"ktlang-pa",KEYWORD_TRANS_RU:"ktlang-ru",KEYWORD_TRANS_SO:"ktlang-so",KEYWORD_TRANS_TL:"ktlang-tl",KEYWORD_TRANS_UK:"ktlang-uk",KEYWORD_TRANS_VI:"ktlang-vi",KEYWORD_TRANS_YUE:"ktlang-yue",KEYWORD_TRANS_ZH:"ktlang-zh",EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:"sbacGlossaryIllustration-on",EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:"sbacGlossaryIllustration-off"});return this.pnp=this.defaultPnp(),this}defaultPnp(){return{textAppearance:{colorStyle:this.constants.COLOR_DEFAULT},glossaryOnScreen:!0,keywordTranslationLanguage:"",extSbacGlossaryIllustration:!1,layoutSingleColumn:!1}}setPnp(t){typeof t>"u"||(t===null&&(this.pnp=this.defaultPnp()),"textAppearance"in t&&t.textAppearance!==null&&"colorStyle"in t.textAppearance&&this.setColorStyle(t.textAppearance.colorStyle),"glossaryOnScreen"in t&&t.glossaryOnScreen!==null&&this.setGlossaryOnScreen(t.glossaryOnScreen),"keywordTranslationLanguage"in t&&this.setKeywordTranslationLanguage(t.keywordTranslationLanguage),"extSbacGlossaryIllustration"in t&&t.extSbacGlossaryIllustration!==null&&this.setExtSbacGlossaryIllustration(t.extSbacGlossaryIllustration),"layoutSingleColumn"in t&&t.layoutSingleColumn!==null&&this.setLayoutSingleColumn(t.layoutSingleColumn))}getPnp(){return this.pnp}getAfaPnp(){const t={"ext:sbac-illustrated-glossary":this.getExtSbacGlossaryIllustration()?"on":"off","keyword-translation":this.getKeywordTranslationLanguage(),"text-appearance":{"color-theme":this.convertColorStyleToTheme()}},i=this.getProhibitSet();return i!==null&&(t["prohibit-set"]=i),{"access-for-all-pnp":t}}getColorStyle(){return this.pnp.textAppearance.colorStyle}setColorStyle(t){this.pnp.textAppearance.colorStyle=t}getGlossaryOnScreen(){return this.pnp.glossaryOnScreen}setGlossaryOnScreen(t){this.pnp.glossaryOnScreen=t}getKeywordTranslationLanguage(){return this.pnp.keywordTranslationLanguage}setKeywordTranslationLanguage(t){this.pnp.keywordTranslationLanguage=t}getExtSbacGlossaryIllustration(){return this.pnp.extSbacGlossaryIllustration}setExtSbacGlossaryIllustration(t){this.pnp.extSbacGlossaryIllustration=t}getLayoutSingleColumn(){return this.pnp.layoutSingleColumn}setLayoutSingleColumn(t){this.pnp.layoutSingleColumn=t}convertColorStyleToTheme(){const t=this.getColorStyle().split("-");if(t.length!==4)return"default";switch(t[3]){case"default":return"default";case"defaultreverse":return"default-reverse";case"blackwhite":return"high-contrast";case"whiteblack":return"high-contrast-reverse";case"blackrose":return"black-rose";case"roseblack":return"rose-black";case"yellowblue":return"yellow-blue";case"blueyellow":return"blue-yellow";case"mgraydgray":return"medgray-darkgray";case"dgraymgray":return"darkgray-medgray";case"blackcyan":return"black-cyan";case"cyanblack":return"cyan-black";case"blackcream":return"black-cream";case"creamblack":return"cream-black";default:return"default"}}getProhibitSet(){return this.getGlossaryOnScreen()?null:{"glossary-on-screen":"active"}}evaluatePnpEvent(t){let i=!1;switch(t){case this.constants.GLOSSARY_ON:this.getGlossaryOnScreen()===!1&&(this.setGlossaryOnScreen(!0),i=!0);break;case this.constants.GLOSSARY_OFF:this.getGlossaryOnScreen()===!0&&(this.setGlossaryOnScreen(!1),i=!0);break;case this.constants.KEYWORD_TRANS_OFF:this.getKeywordTranslationLanguage()!==""&&(this.setKeywordTranslationLanguage(""),i=!0);break;case this.constants.KEYWORD_TRANS_AR:this.getKeywordTranslationLanguage()!=="ar"&&(this.setKeywordTranslationLanguage("ar"),i=!0);break;case this.constants.KEYWORD_TRANS_CMN:this.getKeywordTranslationLanguage()!=="cmn"&&(this.setKeywordTranslationLanguage("cmn"),i=!0);break;case this.constants.KEYWORD_TRANS_DE:this.getKeywordTranslationLanguage()!=="de"&&(this.setKeywordTranslationLanguage("de"),i=!0);break;case this.constants.KEYWORD_TRANS_EN:this.getKeywordTranslationLanguage()!=="en"&&(this.setKeywordTranslationLanguage("en"),i=!0);break;case this.constants.KEYWORD_TRANS_ES:this.getKeywordTranslationLanguage()!=="es"&&(this.setKeywordTranslationLanguage("es"),i=!0);break;case this.constants.KEYWORD_TRANS_FR:this.getKeywordTranslationLanguage()!=="fr"&&(this.setKeywordTranslationLanguage("fr"),i=!0);break;case this.constants.KEYWORD_TRANS_HMN:this.getKeywordTranslationLanguage()!=="hmn"&&(this.setKeywordTranslationLanguage("hmn"),i=!0);break;case this.constants.KEYWORD_TRANS_IT:this.getKeywordTranslationLanguage()!=="it"&&(this.setKeywordTranslationLanguage("it"),i=!0);break;case this.constants.KEYWORD_TRANS_JA:this.getKeywordTranslationLanguage()!=="ja"&&(this.setKeywordTranslationLanguage("ja"),i=!0);break;case this.constants.KEYWORD_TRANS_KO:this.getKeywordTranslationLanguage()!=="ko"&&(this.setKeywordTranslationLanguage("ko"),i=!0);break;case this.constants.KEYWORD_TRANS_MY:this.getKeywordTranslationLanguage()!=="my"&&(this.setKeywordTranslationLanguage("my"),i=!0);break;case this.constants.KEYWORD_TRANS_NL:this.getKeywordTranslationLanguage()!=="nl"&&(this.setKeywordTranslationLanguage("nl"),i=!0);break;case this.constants.KEYWORD_TRANS_PA:this.getKeywordTranslationLanguage()!=="pa"&&(this.setKeywordTranslationLanguage("pa"),i=!0);break;case this.constants.KEYWORD_TRANS_RU:this.getKeywordTranslationLanguage()!=="ru"&&(this.setKeywordTranslationLanguage("ru"),i=!0);break;case this.constants.KEYWORD_TRANS_SO:this.getKeywordTranslationLanguage()!=="so"&&(this.setKeywordTranslationLanguage("so"),i=!0);break;case this.constants.KEYWORD_TRANS_TL:this.getKeywordTranslationLanguage()!=="tl"&&(this.setKeywordTranslationLanguage("tl"),i=!0);break;case this.constants.KEYWORD_TRANS_UK:this.getKeywordTranslationLanguage()!=="uk"&&(this.setKeywordTranslationLanguage("uk"),i=!0);break;case this.constants.KEYWORD_TRANS_VI:this.getKeywordTranslationLanguage()!=="vi"&&(this.setKeywordTranslationLanguage("vi"),i=!0);break;case this.constants.KEYWORD_TRANS_YUE:this.getKeywordTranslationLanguage()!=="yue"&&(this.setKeywordTranslationLanguage("yue"),i=!0);break;case this.constants.KEYWORD_TRANS_ZH:this.getKeywordTranslationLanguage()!=="zh"&&(this.setKeywordTranslationLanguage("zh"),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:this.getExtSbacGlossaryIllustration()===!1&&(this.setExtSbacGlossaryIllustration(!0),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:this.getExtSbacGlossaryIllustration()===!0&&(this.setExtSbacGlossaryIllustration(!1),i=!0);break}return i}}class Ob{constructor(){te(this,"constants",{TIME_LIMITS_DEFAULT:{min_time:null,max_time:null,allow_late_submission:!1},ATTEMPTS_UNLIMITED:0});return this.sc=this.defaultSessionControl(),this}defaultSessionControl(){return this.sc={allow_comment:!1,allow_review:!0,allow_skipping:!0,max_attempts:this.constants.ATTEMPTS_UNLIMITED,show_feedback:!1,show_solution:!1,time_limits:this.constants.TIME_LIMITS_DEFAULT,validate_responses:!1},this.sc}setSessionControl(t){if(!(typeof t>"u")){if(t===null)return this.sc=this.defaultSessionControl();"allow_comment"in t&&t.allow_comment!==null&&this.setAllowComment(t.allow_comment),"allow_review"in t&&t.allow_review!==null&&this.setAllowReview(t.allow_review),"allow_skipping"in t&&t.allow_skipping!==null&&this.setAllowSkipping(t.allow_skipping),"max_attempts"in t&&t.max_attempts!==null&&this.setMaxAttempts(t.max_attempts),"show_feedback"in t&&t.show_feedback!==null&&this.setShowFeedback(t.show_feedback),"show_solution"in t&&t.show_solution!==null&&this.setShowSolution(t.show_solution),"time_limits"in t&&t.time_limits!==null&&("min_time"in t.time_limits&&this.setTimeLimitsMinTime(t.time_limits.min_time),"max_time"in t.time_limits&&this.setTimeLimitsMaxTime(t.time_limits.max_time),"allow_late_submission"in t.time_limits&&this.setTimeLimitsAllowLateSubmission(t.time_limits.allow_late_submission)),"validate_responses"in t&&t.validate_responses!==null&&this.setValidateResponses(t.validate_responses)}}getSessionControl(){return{allow_comment:this.getAllowComment(),allow_review:this.getAllowReview(),allow_skipping:this.getAllowSkipping(),max_attempts:this.getMaxAttempts(),show_feedback:this.getShowFeedback(),show_solution:this.getShowSolution(),time_limits:this.getTimeLimits(),validate_responses:this.getValidateResponses()}}getAllowComment(){return this.sc.allow_comment}setAllowComment(t){this.sc.allow_comment=t}getAllowReview(){return this.sc.allow_review}setAllowReview(t){this.sc.allow_review=t}getAllowSkipping(){return this.sc.allow_skipping}setAllowSkipping(t){this.sc.allow_skipping=t}getMaxAttempts(){return this.sc.max_attempts}setMaxAttempts(t){this.sc.max_attempts=t}getShowFeedback(){return this.sc.show_feedback}setShowFeedback(t){this.sc.show_feedback=t}getShowSolution(){return this.sc.show_solution}setShowSolution(t){this.sc.show_solution=t}getTimeLimits(){return this.sc.time_limits}setTimeLimits(t=null,i=null,s=!1){this.setTimeLimitsMinTime(t),this.setTimeLimitsMaxTime(i),this.setTimeLimitsAllowLateSubmission(s)}getTimeLimitsMinTime(){return this.sc.time_limits.min_time}setTimeLimitsMinTime(t){this.sc.time_limits.min_time=t}getTimeLimitsMaxTime(){return this.sc.time_limits.max_time}setTimeLimitsMaxTime(t){this.sc.time_limits.max_time=t}getTimeLimitsAllowLateSubmission(){return this.sc.time_limits.allow_late_submission}setTimeLimitsAllowLateSubmission(t){this.sc.time_limits.allow_late_submission=t}getValidateResponses(){return this.sc.validate_responses}setValidateResponses(t){this.sc.validate_responses=t}}class Ec{constructor(t,i){return typeof t>"u"?this:(this.identifier=t,this.guid=i.getItemContextGuid(),this.contextVariables=i.getContextDeclarations(),this.responseVariables=i.getResponseDeclarations(),this.templateVariables=i.getTemplateDeclarations(),this.outcomeVariables=i.getOutcomeDeclarations(),this.validationMessages=i.getItemContextValidationMessages(),this)}createStateFromState(t){return this.identifier=t.identifier,this.guid=t.guid,this.contextVariables=t.contextVariables,this.responseVariables=t.responseVariables,this.templateVariables=t.templateVariables,this.outcomeVariables=t.outcomeVariables,this.validationMessages=t.validationMessages,this.getSerializedState()}getSerializedState(){return{identifier:this.identifier,guid:this.guid,contextVariables:this.serializeVariables(this.contextVariables),responseVariables:this.serializeResponseVariables(this.responseVariables),outcomeVariables:this.serializeOutcomeVariables(this.outcomeVariables),templateVariables:this.serializeVariables(this.templateVariables),validationMessages:this.serializeValidationMessages(this.validationMessages)}}serializeResponseVariables(t){let i=[];return t.forEach(s=>{let n={identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),state:this.serializeVariableState(s.state)};"correctResponse"in s&&(n.correctResponse=this.serializeVariableValue(s.cardinality,s.correctResponse)),i.push(n)}),i}serializeOutcomeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),view:s.view,interpretation:s.interpretation,longInterpretation:s.longInterpretation,normalMaximum:s.normalMaximum,normalMinimum:s.normalMinimum,masteryValue:s.masteryValue,externalScored:s.externalScored,variableIdentifierRef:s.variableIdentifierRef})}),i}serializeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value)})}),i}serializeValidationMessages(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,message:s.message})}),i}serializeVariableValue(t,i){return t!=="record"?JSON.parse(JSON.stringify(i)):this.serializeRecordVariableValue(i)}serializeVariableState(t){return JSON.parse(JSON.stringify(t))}resolveBaseType(t){return typeof t>"u"?null:t}serializeRecordVariableValue(t){const i=this.strMapToJson(t);return this.jsonToStrMap(i)}strMapToJson(t){return JSON.stringify(this.strMapToObj(t))}jsonToStrMap(t){return this.objToStrMap(JSON.parse(t))}strMapToObj(t){let i=Object.create(null);for(let[s,n]of t)i[s]=typeof n=="object"&&n!==null?n.getValue():n;return i}objToStrMap(t){let i=new Map;for(let s of Object.keys(t))i.set(s,t[s]);return i}}class Pb{constructor(){te(this,"itemTimer");te(this,"itemDuration");this.setTime(0)}getTime(){return this.itemDuration}setTime(t){this.itemDuration=t}startTimer(){this.clearTimer(),this.setTime(0),this.itemTimer=setInterval(this.updateTime.bind(this),1e3)}updateTime(){++this.itemDuration}resetTimer(){this.clearTimer(),this.setTime(0)}clearTimer(){clearInterval(this.itemTimer)}}var Bb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Cc=Math.ceil,Wt=Math.floor,Et="[BigNumber Error] ",cf=Et+"Number primitive has more than 15 significant digits: ",ui=1e14,Se=14,uf=9007199254740991,Tc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gs=1e7,kt=1e9;function hf(e){var t,i,s,n=N.prototype={constructor:N,toString:null,valueOf:null},r=new N(1),a=20,o=4,u=-7,d=21,f=-1e7,y=1e7,m=!1,b=1,E=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function N(w,C){var I,p,T,g,L,x,S,_,A=this;if(!(A instanceof N))return new N(w,C);if(C==null){if(w&&w._isBigNumber===!0){A.s=w.s,!w.c||w.e>y?A.c=A.e=null:w.e<f?A.c=[A.e=0]:(A.e=w.e,A.c=w.c.slice());return}if((x=typeof w=="number")&&w*0==0){if(A.s=1/w<0?(w=-w,-1):1,w===~~w){for(g=0,L=w;L>=10;L/=10,g++);g>y?A.c=A.e=null:(A.e=g,A.c=[w]);return}_=String(w)}else{if(!Bb.test(_=String(w)))return s(A,_,x);A.s=_.charCodeAt(0)==45?(_=_.slice(1),-1):1}(g=_.indexOf("."))>-1&&(_=_.replace(".","")),(L=_.search(/e/i))>0?(g<0&&(g=L),g+=+_.slice(L+1),_=_.substring(0,L)):g<0&&(g=_.length)}else{if(Ge(C,2,R.length,"Base"),C==10&&O)return A=new N(w),K(A,a+A.e+1,o);if(_=String(w),x=typeof w=="number"){if(w*0!=0)return s(A,_,x,C);if(A.s=1/w<0?(_=_.slice(1),-1):1,N.DEBUG&&_.replace(/^0\.0*|\./,"").length>15)throw Error(cf+w)}else A.s=_.charCodeAt(0)===45?(_=_.slice(1),-1):1;for(I=R.slice(0,C),g=L=0,S=_.length;L<S;L++)if(I.indexOf(p=_.charAt(L))<0){if(p=="."){if(L>g){g=S;continue}}else if(!T&&(_==_.toUpperCase()&&(_=_.toLowerCase())||_==_.toLowerCase()&&(_=_.toUpperCase()))){T=!0,L=-1,g=0;continue}return s(A,String(w),x,C)}x=!1,_=i(_,C,10,A.s),(g=_.indexOf("."))>-1?_=_.replace(".",""):g=_.length}for(L=0;_.charCodeAt(L)===48;L++);for(S=_.length;_.charCodeAt(--S)===48;);if(_=_.slice(L,++S)){if(S-=L,x&&N.DEBUG&&S>15&&(w>uf||w!==Wt(w)))throw Error(cf+A.s*w);if((g=g-L-1)>y)A.c=A.e=null;else if(g<f)A.c=[A.e=0];else{if(A.e=g,A.c=[],L=(g+1)%Se,g<0&&(L+=Se),L<S){for(L&&A.c.push(+_.slice(0,L)),S-=Se;L<S;)A.c.push(+_.slice(L,L+=Se));L=Se-(_=_.slice(L)).length}else L-=S;for(;L--;_+="0");A.c.push(+_)}}else A.c=[A.e=0]}N.clone=hf,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(w){var C,I;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(C="DECIMAL_PLACES")&&(I=w[C],Ge(I,0,kt,C),a=I),w.hasOwnProperty(C="ROUNDING_MODE")&&(I=w[C],Ge(I,0,8,C),o=I),w.hasOwnProperty(C="EXPONENTIAL_AT")&&(I=w[C],I&&I.pop?(Ge(I[0],-1e9,0,C),Ge(I[1],0,kt,C),u=I[0],d=I[1]):(Ge(I,-1e9,kt,C),u=-(d=I<0?-I:I))),w.hasOwnProperty(C="RANGE"))if(I=w[C],I&&I.pop)Ge(I[0],-1e9,-1,C),Ge(I[1],1,kt,C),f=I[0],y=I[1];else if(Ge(I,-1e9,kt,C),I)f=-(y=I<0?-I:I);else throw Error(Et+C+" cannot be zero: "+I);if(w.hasOwnProperty(C="CRYPTO"))if(I=w[C],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=I;else throw m=!I,Error(Et+"crypto unavailable");else m=I;else throw Error(Et+C+" not true or false: "+I);if(w.hasOwnProperty(C="MODULO_MODE")&&(I=w[C],Ge(I,0,9,C),b=I),w.hasOwnProperty(C="POW_PRECISION")&&(I=w[C],Ge(I,0,kt,C),E=I),w.hasOwnProperty(C="FORMAT"))if(I=w[C],typeof I=="object")$=I;else throw Error(Et+C+" not an object: "+I);if(w.hasOwnProperty(C="ALPHABET"))if(I=w[C],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))O=I.slice(0,10)=="0123456789",R=I;else throw Error(Et+C+" invalid: "+I)}else throw Error(Et+"Object expected: "+w);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[u,d],RANGE:[f,y],CRYPTO:m,MODULO_MODE:b,POW_PRECISION:E,FORMAT:$,ALPHABET:R}},N.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var C,I,p=w.c,T=w.e,g=w.s;e:if({}.toString.call(p)=="[object Array]"){if((g===1||g===-1)&&T>=-1e9&&T<=kt&&T===Wt(T)){if(p[0]===0){if(T===0&&p.length===1)return!0;break e}if(C=(T+1)%Se,C<1&&(C+=Se),String(p[0]).length==C){for(C=0;C<p.length;C++)if(I=p[C],I<0||I>=ui||I!==Wt(I))break e;if(I!==0)return!0}}}else if(p===null&&T===null&&(g===null||g===1||g===-1))return!0;throw Error(Et+"Invalid BigNumber: "+w)},N.maximum=N.max=function(){return V(arguments,-1)},N.minimum=N.min=function(){return V(arguments,1)},N.random=function(){var w=9007199254740992,C=Math.random()*w&2097151?function(){return Wt(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var p,T,g,L,x,S=0,_=[],A=new N(r);if(I==null?I=a:Ge(I,0,kt),L=Cc(I/Se),m)if(crypto.getRandomValues){for(p=crypto.getRandomValues(new Uint32Array(L*=2));S<L;)x=p[S]*131072+(p[S+1]>>>11),x>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),p[S]=T[0],p[S+1]=T[1]):(_.push(x%1e14),S+=2);S=L/2}else if(crypto.randomBytes){for(p=crypto.randomBytes(L*=7);S<L;)x=(p[S]&31)*281474976710656+p[S+1]*1099511627776+p[S+2]*4294967296+p[S+3]*16777216+(p[S+4]<<16)+(p[S+5]<<8)+p[S+6],x>=9e15?crypto.randomBytes(7).copy(p,S):(_.push(x%1e14),S+=7);S=L/7}else throw m=!1,Error(Et+"crypto unavailable");if(!m)for(;S<L;)x=C(),x<9e15&&(_[S++]=x%1e14);for(L=_[--S],I%=Se,L&&I&&(x=Tc[Se-I],_[S]=Wt(L/x)*x);_[S]===0;_.pop(),S--);if(S<0)_=[g=0];else{for(g=-1;_[0]===0;_.splice(0,1),g-=Se);for(S=1,x=_[0];x>=10;x/=10,S++);S<Se&&(g-=Se-S)}return A.e=g,A.c=_,A}}(),N.sum=function(){for(var w=1,C=arguments,I=new N(C[0]);w<C.length;)I=I.plus(C[w++]);return I},i=function(){var w="0123456789";function C(I,p,T,g){for(var L,x=[0],S,_=0,A=I.length;_<A;){for(S=x.length;S--;x[S]*=p);for(x[0]+=g.indexOf(I.charAt(_++)),L=0;L<x.length;L++)x[L]>T-1&&(x[L+1]==null&&(x[L+1]=0),x[L+1]+=x[L]/T|0,x[L]%=T)}return x.reverse()}return function(I,p,T,g,L){var x,S,_,A,q,H,J,ee,ae=I.indexOf("."),oe=a,P=o;for(ae>=0&&(A=E,E=0,I=I.replace(".",""),ee=new N(p),H=ee.pow(I.length-ae),E=A,ee.c=C(Xi(Kt(H.c),H.e,"0"),10,T,w),ee.e=ee.c.length),J=C(I,p,T,L?(x=R,w):(x=w,R)),_=A=J.length;J[--A]==0;J.pop());if(!J[0])return x.charAt(0);if(ae<0?--_:(H.c=J,H.e=_,H.s=g,H=t(H,ee,oe,P,T),J=H.c,q=H.r,_=H.e),S=_+oe+1,ae=J[S],A=T/2,q=q||S<0||J[S+1]!=null,q=P<4?(ae!=null||q)&&(P==0||P==(H.s<0?3:2)):ae>A||ae==A&&(P==4||q||P==6&&J[S-1]&1||P==(H.s<0?8:7)),S<1||!J[0])I=q?Xi(x.charAt(1),-oe,x.charAt(0)):x.charAt(0);else{if(J.length=S,q)for(--T;++J[--S]>T;)J[S]=0,S||(++_,J=[1].concat(J));for(A=J.length;!J[--A];);for(ae=0,I="";ae<=A;I+=x.charAt(J[ae++]));I=Xi(I,_,x.charAt(0))}return I}}(),t=function(){function w(p,T,g){var L,x,S,_,A=0,q=p.length,H=T%gs,J=T/gs|0;for(p=p.slice();q--;)S=p[q]%gs,_=p[q]/gs|0,L=J*S+_*H,x=H*S+L%gs*gs+A,A=(x/g|0)+(L/gs|0)+J*_,p[q]=x%g;return A&&(p=[A].concat(p)),p}function C(p,T,g,L){var x,S;if(g!=L)S=g>L?1:-1;else for(x=S=0;x<g;x++)if(p[x]!=T[x]){S=p[x]>T[x]?1:-1;break}return S}function I(p,T,g,L){for(var x=0;g--;)p[g]-=x,x=p[g]<T[g]?1:0,p[g]=x*L+p[g]-T[g];for(;!p[0]&&p.length>1;p.splice(0,1));}return function(p,T,g,L,x){var S,_,A,q,H,J,ee,ae,oe,P,Q,we,fe,_e,Ce,be,$e,ve=p.s==T.s?1:-1,Ve=p.c,Te=T.c;if(!Ve||!Ve[0]||!Te||!Te[0])return new N(!p.s||!T.s||(Ve?Te&&Ve[0]==Te[0]:!Te)?NaN:Ve&&Ve[0]==0||!Te?ve*0:ve/0);for(ae=new N(ve),oe=ae.c=[],_=p.e-T.e,ve=g+_+1,x||(x=ui,_=zt(p.e/Se)-zt(T.e/Se),ve=ve/Se|0),A=0;Te[A]==(Ve[A]||0);A++);if(Te[A]>(Ve[A]||0)&&_--,ve<0)oe.push(1),q=!0;else{for(_e=Ve.length,be=Te.length,A=0,ve+=2,H=Wt(x/(Te[0]+1)),H>1&&(Te=w(Te,H,x),Ve=w(Ve,H,x),be=Te.length,_e=Ve.length),fe=be,P=Ve.slice(0,be),Q=P.length;Q<be;P[Q++]=0);$e=Te.slice(),$e=[0].concat($e),Ce=Te[0],Te[1]>=x/2&&Ce++;do{if(H=0,S=C(Te,P,be,Q),S<0){if(we=P[0],be!=Q&&(we=we*x+(P[1]||0)),H=Wt(we/Ce),H>1)for(H>=x&&(H=x-1),J=w(Te,H,x),ee=J.length,Q=P.length;C(J,P,ee,Q)==1;)H--,I(J,be<ee?$e:Te,ee,x),ee=J.length,S=1;else H==0&&(S=H=1),J=Te.slice(),ee=J.length;if(ee<Q&&(J=[0].concat(J)),I(P,J,Q,x),Q=P.length,S==-1)for(;C(Te,P,be,Q)<1;)H++,I(P,be<Q?$e:Te,Q,x),Q=P.length}else S===0&&(H++,P=[0]);oe[A++]=H,P[0]?P[Q++]=Ve[fe]||0:(P=[Ve[fe]],Q=1)}while((fe++<_e||P[0]!=null)&&ve--);q=P[0]!=null,oe[0]||oe.splice(0,1)}if(x==ui){for(A=1,ve=oe[0];ve>=10;ve/=10,A++);K(ae,g+(ae.e=A+_*Se-1)+1,L,q)}else ae.e=_,ae.r=+q;return ae}}();function z(w,C,I,p){var T,g,L,x,S;if(I==null?I=o:Ge(I,0,8),!w.c)return w.toString();if(T=w.c[0],L=w.e,C==null)S=Kt(w.c),S=p==1||p==2&&(L<=u||L>=d)?To(S,L):Xi(S,L,"0");else if(w=K(new N(w),C,I),g=w.e,S=Kt(w.c),x=S.length,p==1||p==2&&(C<=g||g<=u)){for(;x<C;S+="0",x++);S=To(S,g)}else if(C-=L,S=Xi(S,g,"0"),g+1>x){if(--C>0)for(S+=".";C--;S+="0");}else if(C+=g-x,C>0)for(g+1==x&&(S+=".");C--;S+="0");return w.s<0&&T?"-"+S:S}function V(w,C){for(var I,p,T=1,g=new N(w[0]);T<w.length;T++)p=new N(w[T]),(!p.s||(I=Ps(g,p))===C||I===0&&g.s===C)&&(g=p);return g}function Z(w,C,I){for(var p=1,T=C.length;!C[--T];C.pop());for(T=C[0];T>=10;T/=10,p++);return(I=p+I*Se-1)>y?w.c=w.e=null:I<f?w.c=[w.e=0]:(w.e=I,w.c=C),w}s=function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,I=/^\.([^.]+)$/,p=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,L,x,S){var _,A=x?L:L.replace(T,"");if(p.test(A))g.s=isNaN(A)?null:A<0?-1:1;else{if(!x&&(A=A.replace(w,function(q,H,J){return _=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!S||S==_?H:q}),S&&(_=S,A=A.replace(C,"$1").replace(I,"0.$1")),L!=A))return new N(A,_);if(N.DEBUG)throw Error(Et+"Not a"+(S?" base "+S:"")+" number: "+L);g.s=null}g.c=g.e=null}}();function K(w,C,I,p){var T,g,L,x,S,_,A,q=w.c,H=Tc;if(q){e:{for(T=1,x=q[0];x>=10;x/=10,T++);if(g=C-T,g<0)g+=Se,L=C,S=q[_=0],A=Wt(S/H[T-L-1]%10);else if(_=Cc((g+1)/Se),_>=q.length)if(p){for(;q.length<=_;q.push(0));S=A=0,T=1,g%=Se,L=g-Se+1}else break e;else{for(S=x=q[_],T=1;x>=10;x/=10,T++);g%=Se,L=g-Se+T,A=L<0?0:Wt(S/H[T-L-1]%10)}if(p=p||C<0||q[_+1]!=null||(L<0?S:S%H[T-L-1]),p=I<4?(A||p)&&(I==0||I==(w.s<0?3:2)):A>5||A==5&&(I==4||p||I==6&&(g>0?L>0?S/H[T-L]:0:q[_-1])%10&1||I==(w.s<0?8:7)),C<1||!q[0])return q.length=0,p?(C-=w.e+1,q[0]=H[(Se-C%Se)%Se],w.e=-C||0):q[0]=w.e=0,w;if(g==0?(q.length=_,x=1,_--):(q.length=_+1,x=H[Se-g],q[_]=L>0?Wt(S/H[T-L]%H[L])*x:0),p)for(;;)if(_==0){for(g=1,L=q[0];L>=10;L/=10,g++);for(L=q[0]+=x,x=1;L>=10;L/=10,x++);g!=x&&(w.e++,q[0]==ui&&(q[0]=1));break}else{if(q[_]+=x,q[_]!=ui)break;q[_--]=0,x=1}for(g=q.length;q[--g]===0;q.pop());}w.e>y?w.c=w.e=null:w.e<f&&(w.c=[w.e=0])}return w}function re(w){var C,I=w.e;return I===null?w.toString():(C=Kt(w.c),C=I<=u||I>=d?To(C,I):Xi(C,I,"0"),w.s<0?"-"+C:C)}return n.absoluteValue=n.abs=function(){var w=new N(this);return w.s<0&&(w.s=1),w},n.comparedTo=function(w,C){return Ps(this,new N(w,C))},n.decimalPlaces=n.dp=function(w,C){var I,p,T,g=this;if(w!=null)return Ge(w,0,kt),C==null?C=o:Ge(C,0,8),K(new N(g),w+g.e+1,C);if(!(I=g.c))return null;if(p=((T=I.length-1)-zt(this.e/Se))*Se,T=I[T])for(;T%10==0;T/=10,p--);return p<0&&(p=0),p},n.dividedBy=n.div=function(w,C){return t(this,new N(w,C),a,o)},n.dividedToIntegerBy=n.idiv=function(w,C){return t(this,new N(w,C),0,1)},n.exponentiatedBy=n.pow=function(w,C){var I,p,T,g,L,x,S,_,A,q=this;if(w=new N(w),w.c&&!w.isInteger())throw Error(Et+"Exponent not an integer: "+re(w));if(C!=null&&(C=new N(C)),x=w.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!w.c||!w.c[0])return A=new N(Math.pow(+re(q),x?w.s*(2-Co(w)):+re(w))),C?A.mod(C):A;if(S=w.s<0,C){if(C.c?!C.c[0]:!C.s)return new N(NaN);p=!S&&q.isInteger()&&C.isInteger(),p&&(q=q.mod(C))}else{if(w.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||x&&q.c[1]>=24e7:q.c[0]<8e13||x&&q.c[0]<=9999975e7)))return g=q.s<0&&Co(w)?-0:0,q.e>-1&&(g=1/g),new N(S?1/g:g);E&&(g=Cc(E/Se+2))}for(x?(I=new N(.5),S&&(w.s=1),_=Co(w)):(T=Math.abs(+re(w)),_=T%2),A=new N(r);;){if(_){if(A=A.times(q),!A.c)break;g?A.c.length>g&&(A.c.length=g):p&&(A=A.mod(C))}if(T){if(T=Wt(T/2),T===0)break;_=T%2}else if(w=w.times(I),K(w,w.e+1,1),w.e>14)_=Co(w);else{if(T=+re(w),T===0)break;_=T%2}q=q.times(q),g?q.c&&q.c.length>g&&(q.c.length=g):p&&(q=q.mod(C))}return p?A:(S&&(A=r.div(A)),C?A.mod(C):g?K(A,E,o,L):A)},n.integerValue=function(w){var C=new N(this);return w==null?w=o:Ge(w,0,8),K(C,C.e+1,w)},n.isEqualTo=n.eq=function(w,C){return Ps(this,new N(w,C))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(w,C){return Ps(this,new N(w,C))>0},n.isGreaterThanOrEqualTo=n.gte=function(w,C){return(C=Ps(this,new N(w,C)))===1||C===0},n.isInteger=function(){return!!this.c&&zt(this.e/Se)>this.c.length-2},n.isLessThan=n.lt=function(w,C){return Ps(this,new N(w,C))<0},n.isLessThanOrEqualTo=n.lte=function(w,C){return(C=Ps(this,new N(w,C)))===-1||C===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(w,C){var I,p,T,g,L=this,x=L.s;if(w=new N(w,C),C=w.s,!x||!C)return new N(NaN);if(x!=C)return w.s=-C,L.plus(w);var S=L.e/Se,_=w.e/Se,A=L.c,q=w.c;if(!S||!_){if(!A||!q)return A?(w.s=-C,w):new N(q?L:NaN);if(!A[0]||!q[0])return q[0]?(w.s=-C,w):new N(A[0]?L:o==3?-0:0)}if(S=zt(S),_=zt(_),A=A.slice(),x=S-_){for((g=x<0)?(x=-x,T=A):(_=S,T=q),T.reverse(),C=x;C--;T.push(0));T.reverse()}else for(p=(g=(x=A.length)<(C=q.length))?x:C,x=C=0;C<p;C++)if(A[C]!=q[C]){g=A[C]<q[C];break}if(g&&(T=A,A=q,q=T,w.s=-w.s),C=(p=q.length)-(I=A.length),C>0)for(;C--;A[I++]=0);for(C=ui-1;p>x;){if(A[--p]<q[p]){for(I=p;I&&!A[--I];A[I]=C);--A[I],A[p]+=ui}A[p]-=q[p]}for(;A[0]==0;A.splice(0,1),--_);return A[0]?Z(w,A,_):(w.s=o==3?-1:1,w.c=[w.e=0],w)},n.modulo=n.mod=function(w,C){var I,p,T=this;return w=new N(w,C),!T.c||!w.s||w.c&&!w.c[0]?new N(NaN):!w.c||T.c&&!T.c[0]?new N(T):(b==9?(p=w.s,w.s=1,I=t(T,w,0,3),w.s=p,I.s*=p):I=t(T,w,0,b),w=T.minus(I.times(w)),!w.c[0]&&b==1&&(w.s=T.s),w)},n.multipliedBy=n.times=function(w,C){var I,p,T,g,L,x,S,_,A,q,H,J,ee,ae,oe,P=this,Q=P.c,we=(w=new N(w,C)).c;if(!Q||!we||!Q[0]||!we[0])return!P.s||!w.s||Q&&!Q[0]&&!we||we&&!we[0]&&!Q?w.c=w.e=w.s=null:(w.s*=P.s,!Q||!we?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(p=zt(P.e/Se)+zt(w.e/Se),w.s*=P.s,S=Q.length,q=we.length,S<q&&(ee=Q,Q=we,we=ee,T=S,S=q,q=T),T=S+q,ee=[];T--;ee.push(0));for(ae=ui,oe=gs,T=q;--T>=0;){for(I=0,H=we[T]%oe,J=we[T]/oe|0,L=S,g=T+L;g>T;)_=Q[--L]%oe,A=Q[L]/oe|0,x=J*_+A*H,_=H*_+x%oe*oe+ee[g]+I,I=(_/ae|0)+(x/oe|0)+J*A,ee[g--]=_%ae;ee[g]=I}return I?++p:ee.splice(0,1),Z(w,ee,p)},n.negated=function(){var w=new N(this);return w.s=-w.s||null,w},n.plus=function(w,C){var I,p=this,T=p.s;if(w=new N(w,C),C=w.s,!T||!C)return new N(NaN);if(T!=C)return w.s=-C,p.minus(w);var g=p.e/Se,L=w.e/Se,x=p.c,S=w.c;if(!g||!L){if(!x||!S)return new N(T/0);if(!x[0]||!S[0])return S[0]?w:new N(x[0]?p:T*0)}if(g=zt(g),L=zt(L),x=x.slice(),T=g-L){for(T>0?(L=g,I=S):(T=-T,I=x),I.reverse();T--;I.push(0));I.reverse()}for(T=x.length,C=S.length,T-C<0&&(I=S,S=x,x=I,C=T),T=0;C;)T=(x[--C]=x[C]+S[C]+T)/ui|0,x[C]=ui===x[C]?0:x[C]%ui;return T&&(x=[T].concat(x),++L),Z(w,x,L)},n.precision=n.sd=function(w,C){var I,p,T,g=this;if(w!=null&&w!==!!w)return Ge(w,1,kt),C==null?C=o:Ge(C,0,8),K(new N(g),w,C);if(!(I=g.c))return null;if(T=I.length-1,p=T*Se+1,T=I[T]){for(;T%10==0;T/=10,p--);for(T=I[0];T>=10;T/=10,p++);}return w&&g.e+1>p&&(p=g.e+1),p},n.shiftedBy=function(w){return Ge(w,-9007199254740991,uf),this.times("1e"+w)},n.squareRoot=n.sqrt=function(){var w,C,I,p,T,g=this,L=g.c,x=g.s,S=g.e,_=a+4,A=new N("0.5");if(x!==1||!L||!L[0])return new N(!x||x<0&&(!L||L[0])?NaN:L?g:1/0);if(x=Math.sqrt(+re(g)),x==0||x==1/0?(C=Kt(L),(C.length+S)%2==0&&(C+="0"),x=Math.sqrt(+C),S=zt((S+1)/2)-(S<0||S%2),x==1/0?C="5e"+S:(C=x.toExponential(),C=C.slice(0,C.indexOf("e")+1)+S),I=new N(C)):I=new N(x+""),I.c[0]){for(S=I.e,x=S+_,x<3&&(x=0);;)if(T=I,I=A.times(T.plus(t(g,T,_,1))),Kt(T.c).slice(0,x)===(C=Kt(I.c)).slice(0,x))if(I.e<S&&--x,C=C.slice(x-3,x+1),C=="9999"||!p&&C=="4999"){if(!p&&(K(T,T.e+a+2,0),T.times(T).eq(g))){I=T;break}_+=4,x+=4,p=1}else{(!+C||!+C.slice(1)&&C.charAt(0)=="5")&&(K(I,I.e+a+2,1),w=!I.times(I).eq(g));break}}return K(I,I.e+a+1,o,w)},n.toExponential=function(w,C){return w!=null&&(Ge(w,0,kt),w++),z(this,w,C,1)},n.toFixed=function(w,C){return w!=null&&(Ge(w,0,kt),w=w+this.e+1),z(this,w,C)},n.toFormat=function(w,C,I){var p,T=this;if(I==null)w!=null&&C&&typeof C=="object"?(I=C,C=null):w&&typeof w=="object"?(I=w,w=C=null):I=$;else if(typeof I!="object")throw Error(Et+"Argument not an object: "+I);if(p=T.toFixed(w,C),T.c){var g,L=p.split("."),x=+I.groupSize,S=+I.secondaryGroupSize,_=I.groupSeparator||"",A=L[0],q=L[1],H=T.s<0,J=H?A.slice(1):A,ee=J.length;if(S&&(g=x,x=S,S=g,ee-=g),x>0&&ee>0){for(g=ee%x||x,A=J.substr(0,g);g<ee;g+=x)A+=_+J.substr(g,x);S>0&&(A+=_+J.slice(g)),H&&(A="-"+A)}p=q?A+(I.decimalSeparator||"")+((S=+I.fractionGroupSize)?q.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):q):A}return(I.prefix||"")+p+(I.suffix||"")},n.toFraction=function(w){var C,I,p,T,g,L,x,S,_,A,q,H,J=this,ee=J.c;if(w!=null&&(x=new N(w),!x.isInteger()&&(x.c||x.s!==1)||x.lt(r)))throw Error(Et+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+re(x));if(!ee)return new N(J);for(C=new N(r),_=I=new N(r),p=S=new N(r),H=Kt(ee),g=C.e=H.length-J.e-1,C.c[0]=Tc[(L=g%Se)<0?Se+L:L],w=!w||x.comparedTo(C)>0?g>0?C:_:x,L=y,y=1/0,x=new N(H),S.c[0]=0;A=t(x,C,0,1),T=I.plus(A.times(p)),T.comparedTo(w)!=1;)I=p,p=T,_=S.plus(A.times(T=_)),S=T,C=x.minus(A.times(T=C)),x=T;return T=t(w.minus(I),p,0,1),S=S.plus(T.times(_)),I=I.plus(T.times(p)),S.s=_.s=J.s,g=g*2,q=t(_,p,g,o).minus(J).abs().comparedTo(t(S,I,g,o).minus(J).abs())<1?[_,p]:[S,I],y=L,q},n.toNumber=function(){return+re(this)},n.toPrecision=function(w,C){return w!=null&&Ge(w,1,kt),z(this,w,C,2)},n.toString=function(w){var C,I=this,p=I.s,T=I.e;return T===null?p?(C="Infinity",p<0&&(C="-"+C)):C="NaN":(w==null?C=T<=u||T>=d?To(Kt(I.c),T):Xi(Kt(I.c),T,"0"):w===10&&O?(I=K(new N(I),a+T+1,o),C=Xi(Kt(I.c),I.e,"0")):(Ge(w,2,R.length,"Base"),C=i(Xi(Kt(I.c),T,"0"),10,w,p,!0)),p<0&&I.c[0]&&(C="-"+C)),C},n.valueOf=n.toJSON=function(){return re(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&N.set(e),N}function zt(e){var t=e|0;return e>0||e===t?t:t-1}function Kt(e){for(var t,i,s=1,n=e.length,r=e[0]+"";s<n;){for(t=e[s++]+"",i=Se-t.length;i--;t="0"+t);r+=t}for(n=r.length;r.charCodeAt(--n)===48;);return r.slice(0,n+1||1)}function Ps(e,t){var i,s,n=e.c,r=t.c,a=e.s,o=t.s,u=e.e,d=t.e;if(!a||!o)return null;if(i=n&&!n[0],s=r&&!r[0],i||s)return i?s?0:-o:a;if(a!=o)return a;if(i=a<0,s=u==d,!n||!r)return s?0:!n^i?1:-1;if(!s)return u>d^i?1:-1;for(o=(u=n.length)<(d=r.length)?u:d,a=0;a<o;a++)if(n[a]!=r[a])return n[a]>r[a]^i?1:-1;return u==d?0:u>d^i?1:-1}function Ge(e,t,i,s){if(e<t||e>i||e!==Wt(e))throw Error(Et+(s||"Argument")+(typeof e=="number"?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Co(e){var t=e.c.length-1;return zt(e.e/Se)==t&&e.c[t]%2!=0}function To(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Xi(e,t,i){var s,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(s=e.length,++t>s){for(n=i,t-=s;--t;n+=i);e+=n}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=hf();class B extends Error{constructor(t){super(t),this.name="QtiEvaluationException"}}class ie{QTI_RESPONSE_RULES(){return["qti-response-processing-fragment","qti-response-condition","qti-set-outcome-value","qti-lookup-outcome-value","qti-get-outcome-value","qti-exit-response"]}QTI_TEMPLATE_RULES(){return["qti-set-template-value","qti-exit-template","qti-template-condition","qti-set-default-value","qti-set-correct-response","qti-template-constraint"]}QTI_EXPRESSIONS(){return["qti-base-value","qti-variable","qti-correct","qti-default","qti-is-null","qti-null","qti-and","qti-or","qti-not","qti-match","qti-map-response","qti-member","qti-subtract","qti-sum","qti-random","qti-random-float","qti-random-integer","qti-index","qti-integer-divide","qti-integer-modulus","qti-integer-to-float","qti-equal","qti-equal-rounded","qti-field-value","qti-multiple","qti-ordered","qti-map-response-point","qti-product","qti-delete","qti-string-match","qti-pattern-match","qti-substring","qti-round","qti-round-to","qti-truncate","qti-divide","qti-gt","qti-gte","qti-lt","qti-lte","qti-max","qti-min","qti-custom-operator","qti-math-operator","qti-math-constant","qti-repeat","qti-gcd","qti-lcm","qti-stats-operator","qti-power","qti-any-n","qti-inside","qti-test-variables"]}constructor(){}isExpressionNode(t){return this.QTI_EXPRESSIONS().includes(t)}isResponseRuleNode(t){return this.QTI_RESPONSE_RULES().includes(t)}isTemplateRuleNode(t){return this.QTI_TEMPLATE_RULES().includes(t)}nullValue(){return null}isNullValue(t){return typeof t>"u"||t===null}isBaseTypeNumeric(t){return t==="float"||t==="integer"}isSingleValuesMatch(t,i,s){if(this.isBaseTypeNumeric(t)){let n=new j(i),r=new j(s);return n.comparedTo(r)==0}return i===s}isMultipleValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;const n=i.concat().sort(),r=s.concat().sort();if(this.isBaseTypeNumeric(t)){for(let a=0;a<n.length;a++)if(!this.isSingleValuesMatch(t,n[a],r[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==r[a])return!1;return!0}isOrderedValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;if(this.isBaseTypeNumeric(t)){for(let n=0;n<i.length;n++)if(!this.isSingleValuesMatch(t,i[n],s[n]))return!1}else for(let n=0;n<i.length;n++)if(i[n]!==s[n])return!1;return!0}mapResponse(t){if(this.isNullValue(t.value))return t.mapping.getDefaultValue();const i=t.mapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.isBaseTypeNumeric(t.baseType)?new j(t.value).toString():t.value;for(let r=0;r<s;r++){const a=i[r];if(this.isSingleValuesMatch("string",a.caseSensitive?a.mapKey:a.mapKey.toLowerCase(),a.caseSensitive?n:n.toLowerCase()))return t.mapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"||t.cardinality==="ordered"){let n=new j(0),r=t.value;if(this.isBaseTypeNumeric(t.baseType))for(let a=0;a<r.length;a++)r[a]!==null&&(r[a]=new j(r[a]).toString());r=this.mappingEliminateNullsAndDuplicates(r);for(let a=0;a<s;a++){const o=i[a];for(let u=0;u<r.length;u++)this.isSingleValuesMatch("string",o.caseSensitive?o.mapKey:o.mapKey.toLowerCase(),o.caseSensitive?r[u]:r[u].toLowerCase())&&(n=n.plus(o.mappedValue))}return t.mapping.applyConstraints(n)}return t.mapping.getDefaultValue()}mappingEliminateNullsAndDuplicates(t){let i=t.length,s=[],n={};for(let r=0;r<i;r++)t[r]!==null&&(n[t[r]]=0);for(let r in n)s.push(r);return s}mapValueFromLookupTable(t,i){if(this.isNullValue(t.lookupTable))return this.nullValue();if(this.isNullValue(i))return t.lookupTable.getDefaultValue();const s=t.lookupTable.getValue(),n=t.lookupTable.getTableType();if(i=new j(i),n==="interpolation"){s.sort(function(r,a){return r.sourceValue-a.sourceValue});for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)<0||a.includeBoundary&&i.comparedTo(o)===0)return a.targetValue}}else if(n==="match"){i=new j(i);for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)===0)return a.targetValue}}return t.lookupTable.getDefaultValue()}mapResponsePoint(t){if(this.isNullValue(t.value))return t.areaMapping.getDefaultValue();const i=t.areaMapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.toPointObject(t.value);for(let r=0;r<s;r++){const a=i[r];if(this.isPointInside(a.mapShape,a.mapCoords,n))return t.areaMapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"){let n=new j(0),r=t.value,a=Array.from(r);for(let o=0;o<s;o++){const u=i[o];let d=!0;for(let f=0;f<r.length;f++){let y=this.toPointObject(r[f]);if(this.isPointInside(u.mapShape,u.mapCoords,y)){d&&(n=n.plus(u.mappedValue),d=!1);const m=a.indexOf(r[f]);m>-1&&a.splice(m,1)}}}return n=n.plus(new j(t.areaMapping.getDefaultValue()).times(a.length)),t.areaMapping.applyConstraints(n)}return t.areaMapping.getDefaultValue()}toPointObject(t){if(t===null||typeof t!="string")return null;const i=t.split(" ");if(i.length!=2)return null;const s=new j(i[0]).toNumber(),n=new j(i[1]).toNumber();return{x:s,y:n}}shuffleArray(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}}shuffleArrayFixed(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1));if(t[i].fixed||t[s].fixed)continue;let n=t[i];t[i]=t[s],t[s]=n}}generalizedLcm(t,i){let s=i[0];for(let n=1;n<t;n++){if(s===0||i[n]===0)return 0;s=this.lcm(s,i[n])}return s}lcm(t,i){return new j(t).multipliedBy(i).dividedBy(this.gcd(t,i)).toNumber()}generalizedGcd(t,i){let s=i[0];for(let n=1;n<t;n++)s=this.gcd(s,i[n]);return s}gcd(t,i){return i=new j(i),i.isZero()?t:this.gcd(i.toNumber(),new j(t).modulo(i).toNumber())}getParametersFromDefinition(t){let i=new Map;if(typeof t>"u"||(t=t.trim(),t.length===0))return i;let s=t.split("|||");for(let n=0;n<s.length;n++){const r=s[n].split("=");i.set(r[0],r.length<2?"":r[1].replaceAll("=","="))}return i}computeWordCount(t){const i=t.match(/\S+/g);return i===null?0:i.length}isPointInside(t,i,s){const n={COORDS_LENGTH:3,CENTER_X:0,CENTER_Y:1,RADIUS:2,isInside(u,d){const f=Math.pow(d.x-u[this.CENTER_X],2),y=Math.pow(d.y-u[this.CENTER_Y],2);return f+y<=Math.pow(u[this.RADIUS],2)}},r={COORDS_LENGTH:4,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(u,d){return d.x>=u[this.LEFT_X]&&d.x<=u[this.RIGHT_X]&&d.y>=u[this.TOP_Y]&&d.y<=u[this.BOTTOM_Y]}},a={COORDS_LENGTH:4,CENTER_X:0,CENTER_Y:1,H_RADIUS:2,V_RADIUS:3,isInside(u,d){const f=new j(Math.pow(d.x-u[this.CENTER_X],2)/Math.pow(u[this.H_RADIUS],2)),y=new j(Math.pow(d.y-u[this.CENTER_Y],2)/Math.pow(u[this.V_RADIUS],2));return f.plus(y).lte(new j(1))}},o={MINIMUM_COORDS_LENGTH:6,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(u,d){let f=u;if(f[0]!=f[f.length-2]||f[1]!=f[f.length-1]){let $=f;$.push(f[0]),$.push(f[1]),f=$}let y=new j(0);const m=new j(d.x).integerValue(),b=new j(d.y).integerValue();for(let $=0;$<f.length-3;$+=2){const R=new j(f[$]).integerValue(),O=new j(f[$+1]).integerValue(),N=new j(f[$+2]).integerValue(),z=new j(f[$+3]).integerValue(),V=m.minus(N).pow(2).plus(b.minus(z).pow(2)).sqrt(),Z=N.minus(R).pow(2).plus(z.minus(O).pow(2)).sqrt(),K=R.minus(m).pow(2).plus(O.minus(b).pow(2)).sqrt(),re=new j(Math.acos((Math.pow(V.toNumber(),2)-Math.pow(Z.toNumber(),2)+Math.pow(K.toNumber(),2))/(2*V.toNumber()*K.toNumber()))*180/Math.PI),w=N.minus(m).times(b.minus(O)),C=z.minus(b).times(m.minus(R)),I=w.minus(C);if(re.isNaN())return!0;I.gte(new j(0))?y=y.plus(re):y=y.minus(re)}let E=new j(y);return E=E.dp(6,j.ROUND_HALF_UP),!E.isZero()}};return t==="circle"?n.isInside(i,s):t==="rect"?r.isInside(i,s):t==="poly"?o.isInside(i,s):t==="ellipse"?a.isInside(i,s):t==="default"}valueToPciJson(t,i,s){return t===null?{base:null}:s==="single"?{base:this.baseValueToPciJson(t,i)}:s==="multiple"||s==="ordered"?{list:this.baseValueToPciJson(t,i)}:s==="record"?{record:this.recordValueToPciJson(t)}:{base:null}}baseValueToPciJson(t,i){let s={};switch(i){case"string":case"identifier":case"integer":case"float":case"duration":case"boolean":case"uri":case"file":return s[i]=t,s;case"point":s[i]=n=>n.split(" ").map(Number);return;case"directedPair":case"pair":return s[i]=t.split(" "),s;case"intOrIdentifier":return s[i]=null,s;default:return s[i]=null,s}}recordValueToPciJson(t){let i=[];for(let s of t.values())i.push({name:s.fieldIdentifier,base:s.value===null?null:this.valueToPciJson(s.value,s.baseType,s.cardinality)});return i}processInteractionResponse(t,i){return t.interactionType==="PortableCustom"?this.getValueFromPciJson(t.node.getResponse(),i):t.node.getResponse()}getValueFromPciJson(t,i){if(console.log("[GetValueFromPciJson][Value]",t,i),t===null||typeof i>"u")return this.nullValue();try{if(typeof t!="object")throw new B("Improper value encoding. Must be an Object.");if(Array.isArray(t))throw new B("Improper value encoding. Found Array. Must be an Object.");if(t.base!==void 0){if(i.cardinality==="single")return this.baseValueFromPciJson(t.base,i.baseType,!0);throw new B("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.")}if(t.list!==void 0){if(i.cardinality==="multiple"||i.cardinality==="ordered")return this.baseValueFromPciJson(t.list,i.baseType,!1);throw new B("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.")}if(t.record!==void 0){if(i.cardinality==="record")return this.recordValueFromPciJson(t.record,i);throw new B("Inconsistent value cardinality [record] for this variable. Variable must be record cardinality.")}throw new B('Improper value encoding. Must be one of "base", "list", "record".')}catch({name:s,message:n}){return console.log("[PciDecodingException][ValueFromJson] ",n),this.nullValue()}}baseValueFromPciJson(t,i,s){if(t===null)return this.nullValue();try{if(typeof t!="object")throw new B("Invalid value. Must be an Object.");if(Array.isArray(t))throw new B("Invalid value. Found Array. Must be an Object.");if(t[i]!==void 0){if(i==="point"||i==="directedPair"||i==="pair"){if(!Array.isArray(t[i]))throw new B(`Invalid value. For baseType "${i}", must be an Array`);if(s){if(t[i].length!==2)throw new B(`Invalid value. For baseType "${i}", Array must have 2 elements`);return`${t[i][0]} ${t[i][1]}`}let n=[];return t[i].forEach(r=>{if(r.length!==2)throw new B(`Invalid value. For baseType "${i}", Array must have 2 elements`);n.push(`${r[0]} ${r[1]}`)}),n}return t[i]}throw new B(`Value does not have the required base-type. Expecting ${i}.`)}catch({name:n,message:r}){return console.log("[PciDecodingException][BaseValueFromJson] ",r,t),this.nullValue()}}recordValueFromPciJson(t,i){try{let s=this.getRecordVariableFieldDefinition(i);if(s===null)throw new B(`Unable to retrieve ${i.identifier} record field definition.`);if(typeof t!="object")throw new B("Improper record value encoding. Must be an Array.");if(!Array.isArray(t))throw new B("Improper record value encoding. Must be an Array.");const n=new Map;for(let[r,a]of s)for(let o=0;o<t.length;o++)if(t[o].name!==void 0&&t[o].base!==void 0&&t[o].name===r){const u=this.baseValueFromPciJson(t[o].base,a.getBaseType(),!0),d=new et(r,a.getBaseType(),u);n.set(r,d);break}return n}catch({name:s,message:n}){return console.log("[VariableDecodingException][RecordValueFromJson] ",n),new Map}}getRecordVariableFieldDefinition(t){return t==null?null:t.defaultValue!==null?t.defaultValue:t.correctResponse}computeProcessingContext(t){return this.computeProcessingType(t)==="OUTCOME"?"TEST":"ITEM"}computeProcessingType(t){return t===null?"UNKNOWN":t.$options.name==="QtiOutcomeProcessing"?"OUTCOME":t.$options.name==="QtiResponseProcessing"?"RESPONSE":t.$options.name==="QtiTemplateProcessing"?"TEMPLATE":t.$options.name==="QtiBranchRule"?"OUTCOME":this.computeProcessingType(t.$parent)}computeNodeContext(t){return t===null||t.$options.name==="QtiAssessmentItem"?"ITEM":t.$options.name==="QtiAssessmentTest"?"TEST":this.computeNodeContext(t.$parent)}base64ToBytes(t){const i=atob(t);return Uint8Array.from(i,s=>s.codePointAt(0))}bytesToBase64(t){const i=Array.from(t,s=>String.fromCodePoint(s)).join("");return btoa(i)}encodeBytesToBase64(t){const i=new TextEncoder;return this.bytesToBase64(i.encode(t))}decodeBase64ToBytes(t){return new TextDecoder().decode(this.base64ToBytes(t))}}const Db=new ie,M={player:null,state:{item:null,itemBody:null,identifier:"",title:"",responseDeclarations:[],outcomeDeclarations:[],templateDeclarations:[],contextDeclarations:[],stimulusRefs:[],interactions:[],processing:[],feedbacks:[],templates:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[],asyncStateMap:new Map},itemContext:{guid:null,pnp:null,sc:null,state:null,validationMessages:[],lifecycleStatus:null},itemTimer:new Pb,pciContext:{renderer2p0:"assets/pci/pci.html"},pciMessageHandler:null,windowResizeHandler:null,getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getTemplateDeclarations(){return this.state.templateDeclarations},getTemplateMathParameterVariables(){return this.state.templateDeclarations.filter(e=>e.mathVariable===!0)},getTemplateDeclaration(e){return this.state.templateDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getStimulusRefs(){return this.state.stimulusRefs},getStimulusRef(e){return this.state.stimulusRefs.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.templateDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getInteraction(e){return this.state.interactions.find(t=>t.identifier===e)},getInteractions(){return this.state.interactions},getProcessing(e){return this.state.processing.find(t=>t.processingType===e)},getFeedbacks(){return this.state.feedbacks},getTemplates(){return this.state.templates},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},getItem(){return this.state.item},setItem(e){this.state.item=e.item},getItemBody(){return this.state.itemBody},setItemBody(e){this.state.itemBody=e},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTemplateDeclaration(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.templateDeclarations[t]=e:this.state.templateDeclarations.push(e)},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineStimulusRef(e){let t=this.state.stimulusRefs.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.stimulusRefs[t]=e:this.state.stimulusRefs.push(e)},defineInteraction(e){let t=this.state.interactions.findIndex(s=>s.identifier==e.identifier);if(t<0){console.log("[DefineInteraction]["+e.identifier+"]"),this.state.interactions.push(e);return}let i=this.state.interactions[t];i.interactionType=e.interactionType,i.isValidResponse=e.isValidResponse,i.invalidResponseMessage=e.invalidResponseMessage,i.maxSelectionsMessage=e.maxSelectionsMessage,i.node=e.node,i.resetValue=e.resetValue},defineProcessing(e){let t=e.processingType,i=this.state.processing.findIndex(s=>s.processingType==t);i>-1?this.state.processing[i]=e:this.state.processing.push(e),t=="response"?console.log("[QtiResponseProcessing][Defined]",e):t=="template"?console.log("[QtiTemplateProcessing][Defined]",e):t=="outcome"&&console.log("[QtiOutcomeProcessing][Defined]",e)},defineResponseProcessing(e){this.defineProcessing({processingType:"response",node:e.node})},defineTemplateProcessing(e){this.defineProcessing({processingType:"template",node:e.node})},defineItemBody(e){this.setItemBody(e.node)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},defineTemplate(e){this.state.templates.push(e)},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.item=null,this.state.itemBody=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.templateDeclarations.splice(0,this.state.templateDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.stimulusRefs.splice(0,this.state.stimulusRefs.length),this.state.interactions.splice(0,this.state.interactions.length),this.state.processing.splice(0,this.state.processing.length),this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.templates.splice(0,this.state.templates.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.state.asyncStateMap.clear(),this.resetItemTimer(),this.itemContext.guid=null,this.itemContext.state=null,this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length),this.itemContext.lifecycleStatus=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new et("candidateIdentifier","string",null)),t.set("testIdentifier",new et("testIdentifier","string",null)),t.set("environmentIdentifier",new et("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentItem][QTI_CONTEXT] initialized"),this.defineOutcomeDeclaration({identifier:"SCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][SCORE] initialized"),this.defineOutcomeDeclaration({identifier:"MAXSCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][MAXSCORE] initialized"),this.defineOutcomeDeclaration({identifier:"completionStatus",baseType:"identifier",cardinality:"single",value:"not_attempted",defaultValue:"not_attempted",lookupTable:null,lookupTableType:null,normalMaximum:null,normalMinimum:null,externalScored:null,interpretation:null}),console.log("[QtiAssessmentItem][completionStatus] initialized"),this.defineResponseDeclaration({identifier:"numAttempts",baseType:"integer",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][numAttempts] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][duration] initialized")},restoreContextVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"contextVariables"in e&&e.contextVariables!==null&&e.contextVariables.forEach(t=>{let i=this.state.contextDeclarations.findIndex(s=>s.identifier==t.identifier);i<0||(this.state.contextDeclarations[i].value=t.value)},this)},restoreOutcomeVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"outcomeVariables"in e&&e.outcomeVariables!==null&&e.outcomeVariables.forEach(t=>{this.setOutcomeVariableValue({identifier:t.identifier,value:t.value})},this)},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e);return t<0?null:this.state.responseDeclarations[t].correctResponse},setResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.correctResponse=e.value},setInteractionIsValidResponse(e){let t=this.state.interactions.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.interactions[t].isValidResponse=e.isValidResponse)},resetInteractionStateIsValidResponse(){this.state.interactions.forEach(e=>{e.interactionType!=="EndAttemptInteraction"&&(e.isValidResponse=!1)})},restoreResponseVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"responseVariables"in e&&e.responseVariables!==null&&e.responseVariables.forEach(t=>{this.setResponseVariableValue({identifier:t.identifier,value:t.value,state:t.state}),"correctResponse"in t&&this.setResponseVariableCorrectResponse({identifier:t.identifier,value:t.correctResponse})},this)},setResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=e.value,i.state=e.state},resetResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=i.defaultValue!==null?i.defaultValue:null},incrementNumAttempts(){let e=this.state.responseDeclarations.findIndex(t=>t.identifier=="numAttempts");this.state.responseDeclarations[e].value+=1},updateItemDuration(){const e=this.getResponseDeclaration("duration");e.value+=this.itemTimer.getTime(),this.restartItemTimer()},restartItemTimer(){this.itemTimer.startTimer()},resetItemTimer(){this.itemTimer.resetTimer()},setTemplateVariableValue(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.templateDeclarations[t].value=e.value)},resetTemplateVariables(){this.state.templateDeclarations.forEach(e=>{e.node.reset()})},setVariableDefaultValue(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);if(t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}if(t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier),t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}},getPciContext(){return this.pciContext},setPciContext(e){this.pciContext=e},getPciContextRenderer(){return this.pciContext.renderer2p0},setPciContextRenderer(e){this.pciContext.renderer2p0=e},initializePciMessageListener(){this.pciMessageHandler=this.PciMessageListener.bind(this),this.windowResizeHandler=this.WindowResize.bind(this),window.addEventListener("message",this.pciMessageHandler),window.addEventListener("resize",this.windowResizeHandler)},removePciMessageListener(){this.pciMessageHandler!==null&&window.removeEventListener("message",this.pciMessageHandler),this.windowResizeHandler!==null&&window.removeEventListener("resize",this.windowResizeHandler)},PciMessageListener(e){switch(e.data.message){case"PciChildLoaded":console.log("[PCI Parent] PCI Frame Loaded: "+e.data.identifier),this.pciInitialize(e.data.identifier);break;case"PciReady":console.log("[PCI Parent] PCI Ready: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciReady(e.data.identifier),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!0);break;case"PciResize":console.log("[PCI Parent] PCI Resize: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!1);break;case"PciGetState_Reply":console.log("[PCI Parent] PCI GetState Reply: "+e.data.identifier+", state:",e.data.state),this.pciSaveState(e.data.identifier,e.data.state);break;case"PciInteractionChanged":console.log("[PCI Parent] PCI InteractionChanged: "+e.data.identifier+", state: "+e.data.state),this.pciInteractionChanged(e.data.identifier,e.data.state);break}},WindowResize(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciResizeIframeWidthToContainer()})},pciSetRenderingProperties(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciSetRenderingProperties()})},pciInitialize(e){let t=M.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciInitialize()},pciReady(e){let t=M.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciSetReady()},pciResizeIframe(e,t,i,s){let n=M.getInteraction(e);typeof n>"u"||n.interactionType!=="PortableCustom"||(s?n.node.pciResizeIframe(t,n.node.initialWidth):n.node.pciResizeIframe(t,i))},pciSaveState(e,t){let i=M.getInteraction(e);typeof i>"u"||i.interactionType!=="PortableCustom"||i.node.pciSaveState(t)},pciInteractionChanged(e,t){let i=M.getInteraction(e);if(typeof i>"u"||i.interactionType!=="PortableCustom")return;const s=JSON.parse(t);typeof s.valid<"u"&&i.node.pciUpdateValidity(s.valid),typeof s.value<"u"&&i.node.pciUpdateResponse(s.value)},getAsyncStateMap(){return this.state.asyncStateMap},getItemContextGuid(){return this.itemContext.guid},setItemContextGuid(e){this.itemContext.guid=e},initializeItemContextPnp(){this.itemContext.pnp=new Os},getItemContextPnp(){return this.itemContext.pnp},setItemContextPnp(e){this.itemContext.pnp===null&&this.initializeItemContextPnp(),this.itemContext.pnp.setPnp(e)},initializeItemContextSessionControl(){this.itemContext.sc=new Ob},getItemContextSessionControl(){return this.itemContext.sc},setItemContextSessionControl(e){this.itemContext.sc===null&&this.initializeItemContextSessionControl(),this.itemContext.sc.setSessionControl(e)},getItemContextState(){return this.itemContext.state},setItemContextState(e){const t=new Ec,i=e===null?e:t.createStateFromState(e);this.itemContext.state=i},getItemContextStateVariable(e){if(!this.hasItemContextState())return null;const t=this.getItemContextState();let i=t.outcomeVariables.find(s=>s.identifier===e);return typeof i<"u"||(i=t.responseVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.templateVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.contextDeclarations.find(s=>s.identifier===e),typeof i<"u")?i:null},hasItemContextState(){return this.getItemContextState()!==null},getItemContextValidationMessages(){return this.itemContext.validationMessages},addItemContextValidationMessage(e){this.itemContext.validationMessages.push(e)},resetItemContextValidationMessages(){this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length)},getItemLifecycleStatus(){return this.lifecycleStatus},setItemLifecycleStatus(e){this.lifecycleStatus=e},NotifyPlayerReady(e){this.player=e.player},NotifyEndAttempt(e){this.state.item.endAttempt(e,(function(){this.state.item.notifyEndAttemptInteractionResults("itemEndAttemptReady")}).bind(this))},NotifyNewTemplate(e){this.state.item.newTemplate(e)},NotifyItemReady(e){this.setItem(e),this.getItem().isAdaptive||this.restartItemTimer(),this.getItem().isAdaptiveItemCompleted()||this.restartItemTimer()},NotifyInteractionSelectionsLimit(e){const t={icon:"warning",message:e};this.player.displayAlertMessage(t)},NotifyInteractionStateReady(e){console.log("[InteractionStateReady][Interaction]",e.identifier);const t=this.getInteraction(e.identifier);typeof t>"u"||typeof this.getAsyncStateMap().get(t.identifier)>"u"||(this.setResponseVariableValue({identifier:t.identifier,value:Db.processInteractionResponse(t,this.getResponseDeclaration(t.identifier)),state:t.node.getState()}),this.getAsyncStateMap().delete(t.identifier),this.getAsyncStateMap().size===0&&this.getItem().triggerGetResponsesComplete())}},tt={player:null,state:{test:null,identifier:"",title:"",responseDeclarations:[],contextDeclarations:[],outcomeDeclarations:[],timeLimit:null,testParts:[],outcomeProcessing:null,feedbacks:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[]},testContext:{guid:null,pnp:null},sectionItemStates:new Map,getTest(){return this.state.test},setTest(e){this.state.test=e.test},getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getTimeLimit(){return this.timeLimit},getTestParts(){return this.state.testParts},getTestPart(e){return this.state.testParts.find(t=>t.identifier===e)},getOutcomeProcessing(){return this.state.outcomeProcessing},getFeedbacks(){return this.state.feedbacks},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTimeLimit(e){this.state.timeLimit=e.node},defineTestPart(e){let t=this.state.testParts.findIndex(i=>i.identifier==e.identifier);if(t<0){this.state.testParts.push(e.testPart);return}this.state.testParts[t]=e.testPart},defineProcessing(e){this.state.processing=e,console.log("[QtiOutcomeProcessing][Defined]",e)},defineOutcomeProcessing(e){const t={processingType:"outcome",node:e.node};this.state.outcomeProcessing=t,console.log("[QtiOutcomeProcessing][Defined]",t)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.test=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.timeLimit=null,this.state.testParts.splice(0,this.state.testParts.length),this.state.outcomeProcessing=null,this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.testContext.guid=null,this.testContext.state=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new et("candidateIdentifier","string",null)),t.set("testIdentifier",new et("testIdentifier","string",null)),t.set("environmentIdentifier",new et("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentTest][QTI_CONTEXT] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentTest][duration] initialized")},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getTestContextGuid(){return this.testContext.guid},setTestContextGuid(e){this.testContext.guid=e},initializeTestContextPnp(){this.testContext.pnp=new Os},getTestContextPnp(){return this.testContext.pnp},setTestContextPnp(e){this.testContext.pnp===null&&this.initializeTestContextPnp(),this.testContext.pnp.setPnp(e)},getAllTestStateItemStatesMap(){return this.sectionItemStates},setTestStateItemState(e,t,i,s){console.log("[TestStore][SetState][Part:"+e+"][Section:"+t+"][Item:"+i+"]",s);const n=`${e}~~${t}`;let r=this.getItemStateMapBySectionIdentifier(n);r!=null&&r.set(i,s)},getItemStateMapBySectionIdentifier(e){return this.sectionItemStates.has(e)?this.sectionItemStates.get(e):this.initializePartSectionItemStateMap(e)},getPartSectionMapBySectionIdentifier(e){for(let[t,i]of this.sectionItemStates)if(t.endsWith(e))return i;return null},initializePartSectionItemStateMap(e){return this.sectionItemStates.set(e,new Map),this.sectionItemStates.get(e)},findItemVariableValueByIdentifier(e,t){const i=this.findVariableByIdentifier(e.contextVariables,t);if(typeof i<"u")return i;const s=this.findVariableByIdentifier(e.outcomeVariables,t);if(typeof s<"u")return s;const n=this.findVariableByIdentifier(e.responseVariables,t);if(typeof n<"u")return n;const r=this.findVariableByIdentifier(e.templateVariables,t);return typeof r<"u"?r:null},findVariableByIdentifier(e,t){return e.find(i=>i.identifier===t)},getSerializedState(){return{contextVariables:this.serializeVariables(this.getContextDeclarations()),outcomeVariables:this.serializeVariables(this.getOutcomeDeclarations())}},serializeVariables(e){let t=[];return e.forEach(i=>{t.push({identifier:i.identifier,cardinality:i.cardinality,baseType:i.baseType,value:this.serializeVariableValue(i.cardinality,i.value)})}),t},serializeVariableValue(e,t){return e!=="record"?JSON.parse(JSON.stringify(t)):this.serializeRecordVariableValue(t)},serializeVariableState(e){return JSON.parse(JSON.stringify(e))},serializeRecordVariableValue(e){const t=this.strMapToJson(e);return this.jsonToStrMap(t)},strMapToJson(e){return JSON.stringify(this.strMapToObj(e))},jsonToStrMap(e){return this.objToStrMap(JSON.parse(e))},strMapToObj(e){let t=Object.create(null);for(let[i,s]of e)t[i]=s;return t},objToStrMap(e){let t=new Map;for(let i of Object.keys(e))t.set(i,e[i]);return t},NotifyTestPlayerReady(e){this.player=e.player},NotifyTestReady(e){this.setTest(e)}};class Qb{constructor(){te(this,"xmlDeclaration",null);te(this,"rxTrackSource",null);this.xmlDeclaration=new RegExp(/<\?xml.*?\?>/s),this.rxTrackSource=new RegExp(/<(track|source)[^>]+?\/>/g)}filterXmlDeclaration(t){return t.replace(this.xmlDeclaration,"")}filterCdata(t){return t.replaceAll("<![CDATA[","").replaceAll("]]>","")}filterStyle(t){return t.replaceAll("<style>","<amp-style>").replaceAll("</style>","</amp-style>")}filterMedia(t){return t=t.replaceAll("<video>","<amp-video>").replaceAll("<video ","<amp-video ").replaceAll("</video>","</amp-video>").replaceAll("<audio>","<amp-audio>").replaceAll("<audio ","<amp-audio ").replaceAll("</audio>","</amp-audio>"),this.filterTrackSource(t)}filterTrackSource(t){return t.replace(this.rxTrackSource,i=>i.replace(/\/>/g,">"))}}/*!
|
1
|
+
(function(l,Ge){typeof exports=="object"&&typeof module<"u"?module.exports=Ge(require("vue")):typeof define=="function"&&define.amd?define(["vue"],Ge):(l=typeof globalThis<"u"?globalThis:l||self,l.Qti3Player=Ge(l.Vue))})(this,function(l){"use strict";var J3=Object.defineProperty;var e4=(l,Ge,Os)=>Ge in l?J3(l,Ge,{enumerable:!0,configurable:!0,writable:!0,value:Os}):l[Ge]=Os;var te=(l,Ge,Os)=>e4(l,typeof Ge!="symbol"?Ge+"":Ge,Os);class Ge{constructor(t,i,s){this.fieldIdentifier=t,this.value=s,this.baseType=i,this.cardinality="single"}getValue(){return this.value}setValue(t){this.value=t}getBaseType(){return this.baseType}setBaseType(t){this.baseType=t}getCardinality(){return this.cardinality}getFieldIdentifier(){return this.fieldIdentifier}setFieldIdentifier(t){this.fieldIdentifier=t}}class Os{constructor(){te(this,"constants",{COLOR_DEFAULT:"qti3-player-color-default",COLOR_DEFAULT_REVERSE:"qti3-player-color-defaultreverse",COLOR_BLACK_WHITE:"qti3-player-color-blackwhite",COLOR_WHITE_BLACK:"qti3-player-color-whiteblack",COLOR_BLACK_ROSE:"qti3-player-color-blackrose",COLOR_ROSE_BLACK:"qti3-player-color-roseblack",COLOR_YELLOW_BLUE:"qti3-player-color-yellowblue",COLOR_BLUE_YELLOW:"qti3-player-color-blueyellow",COLOR_MGRAY_DGRAY:"qti3-player-color-mgraydgray",COLOR_DGRAY_MGRAY:"qti3-player-color-dgraymgray",COLOR_BLACK_CYAN:"qti3-player-color-blackcyan",COLOR_CYAN_BLACK:"qti3-player-color-cyanblack",COLOR_BLACK_CREAM:"qti3-player-color-blackcream",COLOR_CREAM_BLACK:"qti3-player-color-creamblack",GLOSSARY_ON:"glossary-on",GLOSSARY_OFF:"glossary-off",KEYWORD_TRANS_OFF:"ktlang-off",KEYWORD_TRANS_AR:"ktlang-ar",KEYWORD_TRANS_CMN:"ktlang-cmn",KEYWORD_TRANS_DE:"ktlang-de",KEYWORD_TRANS_EN:"ktlang-en",KEYWORD_TRANS_ES:"ktlang-es",KEYWORD_TRANS_FR:"ktlang-fr",KEYWORD_TRANS_HMN:"ktlang-hmn",KEYWORD_TRANS_IT:"ktlang-it",KEYWORD_TRANS_JA:"ktlang-ja",KEYWORD_TRANS_KO:"ktlang-ko",KEYWORD_TRANS_MY:"ktlang-my",KEYWORD_TRANS_NL:"ktlang-nl",KEYWORD_TRANS_PA:"ktlang-pa",KEYWORD_TRANS_RU:"ktlang-ru",KEYWORD_TRANS_SO:"ktlang-so",KEYWORD_TRANS_TL:"ktlang-tl",KEYWORD_TRANS_UK:"ktlang-uk",KEYWORD_TRANS_VI:"ktlang-vi",KEYWORD_TRANS_YUE:"ktlang-yue",KEYWORD_TRANS_ZH:"ktlang-zh",EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:"sbacGlossaryIllustration-on",EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:"sbacGlossaryIllustration-off"});return this.pnp=this.defaultPnp(),this}defaultPnp(){return{textAppearance:{colorStyle:this.constants.COLOR_DEFAULT},glossaryOnScreen:!0,keywordTranslationLanguage:"",extSbacGlossaryIllustration:!1,layoutSingleColumn:!1}}setPnp(t){typeof t>"u"||(t===null&&(this.pnp=this.defaultPnp()),"textAppearance"in t&&t.textAppearance!==null&&"colorStyle"in t.textAppearance&&this.setColorStyle(t.textAppearance.colorStyle),"glossaryOnScreen"in t&&t.glossaryOnScreen!==null&&this.setGlossaryOnScreen(t.glossaryOnScreen),"keywordTranslationLanguage"in t&&this.setKeywordTranslationLanguage(t.keywordTranslationLanguage),"extSbacGlossaryIllustration"in t&&t.extSbacGlossaryIllustration!==null&&this.setExtSbacGlossaryIllustration(t.extSbacGlossaryIllustration),"layoutSingleColumn"in t&&t.layoutSingleColumn!==null&&this.setLayoutSingleColumn(t.layoutSingleColumn))}getPnp(){return this.pnp}getAfaPnp(){const t={"ext:sbac-illustrated-glossary":this.getExtSbacGlossaryIllustration()?"on":"off","keyword-translation":this.getKeywordTranslationLanguage(),"text-appearance":{"color-theme":this.convertColorStyleToTheme()}},i=this.getProhibitSet();return i!==null&&(t["prohibit-set"]=i),{"access-for-all-pnp":t}}getColorStyle(){return this.pnp.textAppearance.colorStyle}setColorStyle(t){this.pnp.textAppearance.colorStyle=t}getGlossaryOnScreen(){return this.pnp.glossaryOnScreen}setGlossaryOnScreen(t){this.pnp.glossaryOnScreen=t}getKeywordTranslationLanguage(){return this.pnp.keywordTranslationLanguage}setKeywordTranslationLanguage(t){this.pnp.keywordTranslationLanguage=t}getExtSbacGlossaryIllustration(){return this.pnp.extSbacGlossaryIllustration}setExtSbacGlossaryIllustration(t){this.pnp.extSbacGlossaryIllustration=t}getLayoutSingleColumn(){return this.pnp.layoutSingleColumn}setLayoutSingleColumn(t){this.pnp.layoutSingleColumn=t}convertColorStyleToTheme(){const t=this.getColorStyle().split("-");if(t.length!==4)return"default";switch(t[3]){case"default":return"default";case"defaultreverse":return"default-reverse";case"blackwhite":return"high-contrast";case"whiteblack":return"high-contrast-reverse";case"blackrose":return"black-rose";case"roseblack":return"rose-black";case"yellowblue":return"yellow-blue";case"blueyellow":return"blue-yellow";case"mgraydgray":return"medgray-darkgray";case"dgraymgray":return"darkgray-medgray";case"blackcyan":return"black-cyan";case"cyanblack":return"cyan-black";case"blackcream":return"black-cream";case"creamblack":return"cream-black";default:return"default"}}getProhibitSet(){return this.getGlossaryOnScreen()?null:{"glossary-on-screen":"active"}}evaluatePnpEvent(t){let i=!1;switch(t){case this.constants.GLOSSARY_ON:this.getGlossaryOnScreen()===!1&&(this.setGlossaryOnScreen(!0),i=!0);break;case this.constants.GLOSSARY_OFF:this.getGlossaryOnScreen()===!0&&(this.setGlossaryOnScreen(!1),i=!0);break;case this.constants.KEYWORD_TRANS_OFF:this.getKeywordTranslationLanguage()!==""&&(this.setKeywordTranslationLanguage(""),i=!0);break;case this.constants.KEYWORD_TRANS_AR:this.getKeywordTranslationLanguage()!=="ar"&&(this.setKeywordTranslationLanguage("ar"),i=!0);break;case this.constants.KEYWORD_TRANS_CMN:this.getKeywordTranslationLanguage()!=="cmn"&&(this.setKeywordTranslationLanguage("cmn"),i=!0);break;case this.constants.KEYWORD_TRANS_DE:this.getKeywordTranslationLanguage()!=="de"&&(this.setKeywordTranslationLanguage("de"),i=!0);break;case this.constants.KEYWORD_TRANS_EN:this.getKeywordTranslationLanguage()!=="en"&&(this.setKeywordTranslationLanguage("en"),i=!0);break;case this.constants.KEYWORD_TRANS_ES:this.getKeywordTranslationLanguage()!=="es"&&(this.setKeywordTranslationLanguage("es"),i=!0);break;case this.constants.KEYWORD_TRANS_FR:this.getKeywordTranslationLanguage()!=="fr"&&(this.setKeywordTranslationLanguage("fr"),i=!0);break;case this.constants.KEYWORD_TRANS_HMN:this.getKeywordTranslationLanguage()!=="hmn"&&(this.setKeywordTranslationLanguage("hmn"),i=!0);break;case this.constants.KEYWORD_TRANS_IT:this.getKeywordTranslationLanguage()!=="it"&&(this.setKeywordTranslationLanguage("it"),i=!0);break;case this.constants.KEYWORD_TRANS_JA:this.getKeywordTranslationLanguage()!=="ja"&&(this.setKeywordTranslationLanguage("ja"),i=!0);break;case this.constants.KEYWORD_TRANS_KO:this.getKeywordTranslationLanguage()!=="ko"&&(this.setKeywordTranslationLanguage("ko"),i=!0);break;case this.constants.KEYWORD_TRANS_MY:this.getKeywordTranslationLanguage()!=="my"&&(this.setKeywordTranslationLanguage("my"),i=!0);break;case this.constants.KEYWORD_TRANS_NL:this.getKeywordTranslationLanguage()!=="nl"&&(this.setKeywordTranslationLanguage("nl"),i=!0);break;case this.constants.KEYWORD_TRANS_PA:this.getKeywordTranslationLanguage()!=="pa"&&(this.setKeywordTranslationLanguage("pa"),i=!0);break;case this.constants.KEYWORD_TRANS_RU:this.getKeywordTranslationLanguage()!=="ru"&&(this.setKeywordTranslationLanguage("ru"),i=!0);break;case this.constants.KEYWORD_TRANS_SO:this.getKeywordTranslationLanguage()!=="so"&&(this.setKeywordTranslationLanguage("so"),i=!0);break;case this.constants.KEYWORD_TRANS_TL:this.getKeywordTranslationLanguage()!=="tl"&&(this.setKeywordTranslationLanguage("tl"),i=!0);break;case this.constants.KEYWORD_TRANS_UK:this.getKeywordTranslationLanguage()!=="uk"&&(this.setKeywordTranslationLanguage("uk"),i=!0);break;case this.constants.KEYWORD_TRANS_VI:this.getKeywordTranslationLanguage()!=="vi"&&(this.setKeywordTranslationLanguage("vi"),i=!0);break;case this.constants.KEYWORD_TRANS_YUE:this.getKeywordTranslationLanguage()!=="yue"&&(this.setKeywordTranslationLanguage("yue"),i=!0);break;case this.constants.KEYWORD_TRANS_ZH:this.getKeywordTranslationLanguage()!=="zh"&&(this.setKeywordTranslationLanguage("zh"),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:this.getExtSbacGlossaryIllustration()===!1&&(this.setExtSbacGlossaryIllustration(!0),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:this.getExtSbacGlossaryIllustration()===!0&&(this.setExtSbacGlossaryIllustration(!1),i=!0);break}return i}}class Ob{constructor(){te(this,"constants",{TIME_LIMITS_DEFAULT:{min_time:null,max_time:null,allow_late_submission:!1},ATTEMPTS_UNLIMITED:0});return this.sc=this.defaultSessionControl(),this}defaultSessionControl(){return this.sc={allow_comment:!1,allow_review:!0,allow_skipping:!0,max_attempts:this.constants.ATTEMPTS_UNLIMITED,show_feedback:!1,show_solution:!1,time_limits:this.constants.TIME_LIMITS_DEFAULT,validate_responses:!1},this.sc}setSessionControl(t){if(!(typeof t>"u")){if(t===null)return this.sc=this.defaultSessionControl();"allow_comment"in t&&t.allow_comment!==null&&this.setAllowComment(t.allow_comment),"allow_review"in t&&t.allow_review!==null&&this.setAllowReview(t.allow_review),"allow_skipping"in t&&t.allow_skipping!==null&&this.setAllowSkipping(t.allow_skipping),"max_attempts"in t&&t.max_attempts!==null&&this.setMaxAttempts(t.max_attempts),"show_feedback"in t&&t.show_feedback!==null&&this.setShowFeedback(t.show_feedback),"show_solution"in t&&t.show_solution!==null&&this.setShowSolution(t.show_solution),"time_limits"in t&&t.time_limits!==null&&("min_time"in t.time_limits&&this.setTimeLimitsMinTime(t.time_limits.min_time),"max_time"in t.time_limits&&this.setTimeLimitsMaxTime(t.time_limits.max_time),"allow_late_submission"in t.time_limits&&this.setTimeLimitsAllowLateSubmission(t.time_limits.allow_late_submission)),"validate_responses"in t&&t.validate_responses!==null&&this.setValidateResponses(t.validate_responses)}}getSessionControl(){return{allow_comment:this.getAllowComment(),allow_review:this.getAllowReview(),allow_skipping:this.getAllowSkipping(),max_attempts:this.getMaxAttempts(),show_feedback:this.getShowFeedback(),show_solution:this.getShowSolution(),time_limits:this.getTimeLimits(),validate_responses:this.getValidateResponses()}}getAllowComment(){return this.sc.allow_comment}setAllowComment(t){this.sc.allow_comment=t}getAllowReview(){return this.sc.allow_review}setAllowReview(t){this.sc.allow_review=t}getAllowSkipping(){return this.sc.allow_skipping}setAllowSkipping(t){this.sc.allow_skipping=t}getMaxAttempts(){return this.sc.max_attempts}setMaxAttempts(t){this.sc.max_attempts=t}getShowFeedback(){return this.sc.show_feedback}setShowFeedback(t){this.sc.show_feedback=t}getShowSolution(){return this.sc.show_solution}setShowSolution(t){this.sc.show_solution=t}getTimeLimits(){return this.sc.time_limits}setTimeLimits(t=null,i=null,s=!1){this.setTimeLimitsMinTime(t),this.setTimeLimitsMaxTime(i),this.setTimeLimitsAllowLateSubmission(s)}getTimeLimitsMinTime(){return this.sc.time_limits.min_time}setTimeLimitsMinTime(t){this.sc.time_limits.min_time=t}getTimeLimitsMaxTime(){return this.sc.time_limits.max_time}setTimeLimitsMaxTime(t){this.sc.time_limits.max_time=t}getTimeLimitsAllowLateSubmission(){return this.sc.time_limits.allow_late_submission}setTimeLimitsAllowLateSubmission(t){this.sc.time_limits.allow_late_submission=t}getValidateResponses(){return this.sc.validate_responses}setValidateResponses(t){this.sc.validate_responses=t}}class Ec{constructor(t,i){return typeof t>"u"?this:(this.identifier=t,this.guid=i.getItemContextGuid(),this.contextVariables=i.getContextDeclarations(),this.responseVariables=i.getResponseDeclarations(),this.templateVariables=i.getTemplateDeclarations(),this.outcomeVariables=i.getOutcomeDeclarations(),this.validationMessages=i.getItemContextValidationMessages(),this)}createStateFromState(t){return this.identifier=t.identifier,this.guid=t.guid,this.contextVariables=t.contextVariables,this.responseVariables=t.responseVariables,this.templateVariables=t.templateVariables,this.outcomeVariables=t.outcomeVariables,this.validationMessages=t.validationMessages,this.getSerializedState()}getSerializedState(){return{identifier:this.identifier,guid:this.guid,contextVariables:this.serializeVariables(this.contextVariables),responseVariables:this.serializeResponseVariables(this.responseVariables),outcomeVariables:this.serializeOutcomeVariables(this.outcomeVariables),templateVariables:this.serializeVariables(this.templateVariables),validationMessages:this.serializeValidationMessages(this.validationMessages)}}serializeResponseVariables(t){let i=[];return t.forEach(s=>{let n={identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),state:this.serializeVariableState(s.state)};"correctResponse"in s&&(n.correctResponse=this.serializeVariableValue(s.cardinality,s.correctResponse)),i.push(n)}),i}serializeOutcomeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),view:s.view,interpretation:s.interpretation,longInterpretation:s.longInterpretation,normalMaximum:s.normalMaximum,normalMinimum:s.normalMinimum,masteryValue:s.masteryValue,externalScored:s.externalScored,variableIdentifierRef:s.variableIdentifierRef})}),i}serializeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value)})}),i}serializeValidationMessages(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,message:s.message})}),i}serializeVariableValue(t,i){return t!=="record"?JSON.parse(JSON.stringify(i)):this.serializeRecordVariableValue(i)}serializeVariableState(t){return JSON.parse(JSON.stringify(t))}resolveBaseType(t){return typeof t>"u"?null:t}serializeRecordVariableValue(t){const i=this.strMapToJson(t);return this.jsonToStrMap(i)}strMapToJson(t){return JSON.stringify(this.strMapToObj(t))}jsonToStrMap(t){return this.objToStrMap(JSON.parse(t))}strMapToObj(t){let i=Object.create(null);for(let[s,n]of t)i[s]=typeof n=="object"&&n!==null?n.getValue():n;return i}objToStrMap(t){let i=new Map;for(let s of Object.keys(t))i.set(s,t[s]);return i}}class Pb{constructor(){te(this,"itemTimer");te(this,"itemDuration");this.setTime(0)}getTime(){return this.itemDuration}setTime(t){this.itemDuration=t}startTimer(){this.clearTimer(),this.setTime(0),this.itemTimer=setInterval(this.updateTime.bind(this),1e3)}updateTime(){++this.itemDuration}resetTimer(){this.clearTimer(),this.setTime(0)}clearTimer(){clearInterval(this.itemTimer)}}var Bb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Cc=Math.ceil,Wt=Math.floor,Et="[BigNumber Error] ",cf=Et+"Number primitive has more than 15 significant digits: ",ui=1e14,Se=14,uf=9007199254740991,Tc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gs=1e7,kt=1e9;function hf(e){var t,i,s,n=N.prototype={constructor:N,toString:null,valueOf:null},r=new N(1),a=20,o=4,u=-7,d=21,f=-1e7,y=1e7,m=!1,b=1,E=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function N(w,C){var I,p,T,g,L,x,S,_,A=this;if(!(A instanceof N))return new N(w,C);if(C==null){if(w&&w._isBigNumber===!0){A.s=w.s,!w.c||w.e>y?A.c=A.e=null:w.e<f?A.c=[A.e=0]:(A.e=w.e,A.c=w.c.slice());return}if((x=typeof w=="number")&&w*0==0){if(A.s=1/w<0?(w=-w,-1):1,w===~~w){for(g=0,L=w;L>=10;L/=10,g++);g>y?A.c=A.e=null:(A.e=g,A.c=[w]);return}_=String(w)}else{if(!Bb.test(_=String(w)))return s(A,_,x);A.s=_.charCodeAt(0)==45?(_=_.slice(1),-1):1}(g=_.indexOf("."))>-1&&(_=_.replace(".","")),(L=_.search(/e/i))>0?(g<0&&(g=L),g+=+_.slice(L+1),_=_.substring(0,L)):g<0&&(g=_.length)}else{if(je(C,2,R.length,"Base"),C==10&&O)return A=new N(w),K(A,a+A.e+1,o);if(_=String(w),x=typeof w=="number"){if(w*0!=0)return s(A,_,x,C);if(A.s=1/w<0?(_=_.slice(1),-1):1,N.DEBUG&&_.replace(/^0\.0*|\./,"").length>15)throw Error(cf+w)}else A.s=_.charCodeAt(0)===45?(_=_.slice(1),-1):1;for(I=R.slice(0,C),g=L=0,S=_.length;L<S;L++)if(I.indexOf(p=_.charAt(L))<0){if(p=="."){if(L>g){g=S;continue}}else if(!T&&(_==_.toUpperCase()&&(_=_.toLowerCase())||_==_.toLowerCase()&&(_=_.toUpperCase()))){T=!0,L=-1,g=0;continue}return s(A,String(w),x,C)}x=!1,_=i(_,C,10,A.s),(g=_.indexOf("."))>-1?_=_.replace(".",""):g=_.length}for(L=0;_.charCodeAt(L)===48;L++);for(S=_.length;_.charCodeAt(--S)===48;);if(_=_.slice(L,++S)){if(S-=L,x&&N.DEBUG&&S>15&&(w>uf||w!==Wt(w)))throw Error(cf+A.s*w);if((g=g-L-1)>y)A.c=A.e=null;else if(g<f)A.c=[A.e=0];else{if(A.e=g,A.c=[],L=(g+1)%Se,g<0&&(L+=Se),L<S){for(L&&A.c.push(+_.slice(0,L)),S-=Se;L<S;)A.c.push(+_.slice(L,L+=Se));L=Se-(_=_.slice(L)).length}else L-=S;for(;L--;_+="0");A.c.push(+_)}}else A.c=[A.e=0]}N.clone=hf,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(w){var C,I;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(C="DECIMAL_PLACES")&&(I=w[C],je(I,0,kt,C),a=I),w.hasOwnProperty(C="ROUNDING_MODE")&&(I=w[C],je(I,0,8,C),o=I),w.hasOwnProperty(C="EXPONENTIAL_AT")&&(I=w[C],I&&I.pop?(je(I[0],-1e9,0,C),je(I[1],0,kt,C),u=I[0],d=I[1]):(je(I,-1e9,kt,C),u=-(d=I<0?-I:I))),w.hasOwnProperty(C="RANGE"))if(I=w[C],I&&I.pop)je(I[0],-1e9,-1,C),je(I[1],1,kt,C),f=I[0],y=I[1];else if(je(I,-1e9,kt,C),I)f=-(y=I<0?-I:I);else throw Error(Et+C+" cannot be zero: "+I);if(w.hasOwnProperty(C="CRYPTO"))if(I=w[C],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=I;else throw m=!I,Error(Et+"crypto unavailable");else m=I;else throw Error(Et+C+" not true or false: "+I);if(w.hasOwnProperty(C="MODULO_MODE")&&(I=w[C],je(I,0,9,C),b=I),w.hasOwnProperty(C="POW_PRECISION")&&(I=w[C],je(I,0,kt,C),E=I),w.hasOwnProperty(C="FORMAT"))if(I=w[C],typeof I=="object")$=I;else throw Error(Et+C+" not an object: "+I);if(w.hasOwnProperty(C="ALPHABET"))if(I=w[C],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))O=I.slice(0,10)=="0123456789",R=I;else throw Error(Et+C+" invalid: "+I)}else throw Error(Et+"Object expected: "+w);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[u,d],RANGE:[f,y],CRYPTO:m,MODULO_MODE:b,POW_PRECISION:E,FORMAT:$,ALPHABET:R}},N.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var C,I,p=w.c,T=w.e,g=w.s;e:if({}.toString.call(p)=="[object Array]"){if((g===1||g===-1)&&T>=-1e9&&T<=kt&&T===Wt(T)){if(p[0]===0){if(T===0&&p.length===1)return!0;break e}if(C=(T+1)%Se,C<1&&(C+=Se),String(p[0]).length==C){for(C=0;C<p.length;C++)if(I=p[C],I<0||I>=ui||I!==Wt(I))break e;if(I!==0)return!0}}}else if(p===null&&T===null&&(g===null||g===1||g===-1))return!0;throw Error(Et+"Invalid BigNumber: "+w)},N.maximum=N.max=function(){return V(arguments,-1)},N.minimum=N.min=function(){return V(arguments,1)},N.random=function(){var w=9007199254740992,C=Math.random()*w&2097151?function(){return Wt(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var p,T,g,L,x,S=0,_=[],A=new N(r);if(I==null?I=a:je(I,0,kt),L=Cc(I/Se),m)if(crypto.getRandomValues){for(p=crypto.getRandomValues(new Uint32Array(L*=2));S<L;)x=p[S]*131072+(p[S+1]>>>11),x>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),p[S]=T[0],p[S+1]=T[1]):(_.push(x%1e14),S+=2);S=L/2}else if(crypto.randomBytes){for(p=crypto.randomBytes(L*=7);S<L;)x=(p[S]&31)*281474976710656+p[S+1]*1099511627776+p[S+2]*4294967296+p[S+3]*16777216+(p[S+4]<<16)+(p[S+5]<<8)+p[S+6],x>=9e15?crypto.randomBytes(7).copy(p,S):(_.push(x%1e14),S+=7);S=L/7}else throw m=!1,Error(Et+"crypto unavailable");if(!m)for(;S<L;)x=C(),x<9e15&&(_[S++]=x%1e14);for(L=_[--S],I%=Se,L&&I&&(x=Tc[Se-I],_[S]=Wt(L/x)*x);_[S]===0;_.pop(),S--);if(S<0)_=[g=0];else{for(g=-1;_[0]===0;_.splice(0,1),g-=Se);for(S=1,x=_[0];x>=10;x/=10,S++);S<Se&&(g-=Se-S)}return A.e=g,A.c=_,A}}(),N.sum=function(){for(var w=1,C=arguments,I=new N(C[0]);w<C.length;)I=I.plus(C[w++]);return I},i=function(){var w="0123456789";function C(I,p,T,g){for(var L,x=[0],S,_=0,A=I.length;_<A;){for(S=x.length;S--;x[S]*=p);for(x[0]+=g.indexOf(I.charAt(_++)),L=0;L<x.length;L++)x[L]>T-1&&(x[L+1]==null&&(x[L+1]=0),x[L+1]+=x[L]/T|0,x[L]%=T)}return x.reverse()}return function(I,p,T,g,L){var x,S,_,A,q,H,J,ee,ae=I.indexOf("."),oe=a,P=o;for(ae>=0&&(A=E,E=0,I=I.replace(".",""),ee=new N(p),H=ee.pow(I.length-ae),E=A,ee.c=C(Xi(Kt(H.c),H.e,"0"),10,T,w),ee.e=ee.c.length),J=C(I,p,T,L?(x=R,w):(x=w,R)),_=A=J.length;J[--A]==0;J.pop());if(!J[0])return x.charAt(0);if(ae<0?--_:(H.c=J,H.e=_,H.s=g,H=t(H,ee,oe,P,T),J=H.c,q=H.r,_=H.e),S=_+oe+1,ae=J[S],A=T/2,q=q||S<0||J[S+1]!=null,q=P<4?(ae!=null||q)&&(P==0||P==(H.s<0?3:2)):ae>A||ae==A&&(P==4||q||P==6&&J[S-1]&1||P==(H.s<0?8:7)),S<1||!J[0])I=q?Xi(x.charAt(1),-oe,x.charAt(0)):x.charAt(0);else{if(J.length=S,q)for(--T;++J[--S]>T;)J[S]=0,S||(++_,J=[1].concat(J));for(A=J.length;!J[--A];);for(ae=0,I="";ae<=A;I+=x.charAt(J[ae++]));I=Xi(I,_,x.charAt(0))}return I}}(),t=function(){function w(p,T,g){var L,x,S,_,A=0,q=p.length,H=T%gs,J=T/gs|0;for(p=p.slice();q--;)S=p[q]%gs,_=p[q]/gs|0,L=J*S+_*H,x=H*S+L%gs*gs+A,A=(x/g|0)+(L/gs|0)+J*_,p[q]=x%g;return A&&(p=[A].concat(p)),p}function C(p,T,g,L){var x,S;if(g!=L)S=g>L?1:-1;else for(x=S=0;x<g;x++)if(p[x]!=T[x]){S=p[x]>T[x]?1:-1;break}return S}function I(p,T,g,L){for(var x=0;g--;)p[g]-=x,x=p[g]<T[g]?1:0,p[g]=x*L+p[g]-T[g];for(;!p[0]&&p.length>1;p.splice(0,1));}return function(p,T,g,L,x){var S,_,A,q,H,J,ee,ae,oe,P,Q,we,fe,_e,Ce,be,$e,ve=p.s==T.s?1:-1,Ve=p.c,Te=T.c;if(!Ve||!Ve[0]||!Te||!Te[0])return new N(!p.s||!T.s||(Ve?Te&&Ve[0]==Te[0]:!Te)?NaN:Ve&&Ve[0]==0||!Te?ve*0:ve/0);for(ae=new N(ve),oe=ae.c=[],_=p.e-T.e,ve=g+_+1,x||(x=ui,_=zt(p.e/Se)-zt(T.e/Se),ve=ve/Se|0),A=0;Te[A]==(Ve[A]||0);A++);if(Te[A]>(Ve[A]||0)&&_--,ve<0)oe.push(1),q=!0;else{for(_e=Ve.length,be=Te.length,A=0,ve+=2,H=Wt(x/(Te[0]+1)),H>1&&(Te=w(Te,H,x),Ve=w(Ve,H,x),be=Te.length,_e=Ve.length),fe=be,P=Ve.slice(0,be),Q=P.length;Q<be;P[Q++]=0);$e=Te.slice(),$e=[0].concat($e),Ce=Te[0],Te[1]>=x/2&&Ce++;do{if(H=0,S=C(Te,P,be,Q),S<0){if(we=P[0],be!=Q&&(we=we*x+(P[1]||0)),H=Wt(we/Ce),H>1)for(H>=x&&(H=x-1),J=w(Te,H,x),ee=J.length,Q=P.length;C(J,P,ee,Q)==1;)H--,I(J,be<ee?$e:Te,ee,x),ee=J.length,S=1;else H==0&&(S=H=1),J=Te.slice(),ee=J.length;if(ee<Q&&(J=[0].concat(J)),I(P,J,Q,x),Q=P.length,S==-1)for(;C(Te,P,be,Q)<1;)H++,I(P,be<Q?$e:Te,Q,x),Q=P.length}else S===0&&(H++,P=[0]);oe[A++]=H,P[0]?P[Q++]=Ve[fe]||0:(P=[Ve[fe]],Q=1)}while((fe++<_e||P[0]!=null)&&ve--);q=P[0]!=null,oe[0]||oe.splice(0,1)}if(x==ui){for(A=1,ve=oe[0];ve>=10;ve/=10,A++);K(ae,g+(ae.e=A+_*Se-1)+1,L,q)}else ae.e=_,ae.r=+q;return ae}}();function z(w,C,I,p){var T,g,L,x,S;if(I==null?I=o:je(I,0,8),!w.c)return w.toString();if(T=w.c[0],L=w.e,C==null)S=Kt(w.c),S=p==1||p==2&&(L<=u||L>=d)?To(S,L):Xi(S,L,"0");else if(w=K(new N(w),C,I),g=w.e,S=Kt(w.c),x=S.length,p==1||p==2&&(C<=g||g<=u)){for(;x<C;S+="0",x++);S=To(S,g)}else if(C-=L,S=Xi(S,g,"0"),g+1>x){if(--C>0)for(S+=".";C--;S+="0");}else if(C+=g-x,C>0)for(g+1==x&&(S+=".");C--;S+="0");return w.s<0&&T?"-"+S:S}function V(w,C){for(var I,p,T=1,g=new N(w[0]);T<w.length;T++)p=new N(w[T]),(!p.s||(I=Ps(g,p))===C||I===0&&g.s===C)&&(g=p);return g}function Z(w,C,I){for(var p=1,T=C.length;!C[--T];C.pop());for(T=C[0];T>=10;T/=10,p++);return(I=p+I*Se-1)>y?w.c=w.e=null:I<f?w.c=[w.e=0]:(w.e=I,w.c=C),w}s=function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,I=/^\.([^.]+)$/,p=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,L,x,S){var _,A=x?L:L.replace(T,"");if(p.test(A))g.s=isNaN(A)?null:A<0?-1:1;else{if(!x&&(A=A.replace(w,function(q,H,J){return _=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!S||S==_?H:q}),S&&(_=S,A=A.replace(C,"$1").replace(I,"0.$1")),L!=A))return new N(A,_);if(N.DEBUG)throw Error(Et+"Not a"+(S?" base "+S:"")+" number: "+L);g.s=null}g.c=g.e=null}}();function K(w,C,I,p){var T,g,L,x,S,_,A,q=w.c,H=Tc;if(q){e:{for(T=1,x=q[0];x>=10;x/=10,T++);if(g=C-T,g<0)g+=Se,L=C,S=q[_=0],A=Wt(S/H[T-L-1]%10);else if(_=Cc((g+1)/Se),_>=q.length)if(p){for(;q.length<=_;q.push(0));S=A=0,T=1,g%=Se,L=g-Se+1}else break e;else{for(S=x=q[_],T=1;x>=10;x/=10,T++);g%=Se,L=g-Se+T,A=L<0?0:Wt(S/H[T-L-1]%10)}if(p=p||C<0||q[_+1]!=null||(L<0?S:S%H[T-L-1]),p=I<4?(A||p)&&(I==0||I==(w.s<0?3:2)):A>5||A==5&&(I==4||p||I==6&&(g>0?L>0?S/H[T-L]:0:q[_-1])%10&1||I==(w.s<0?8:7)),C<1||!q[0])return q.length=0,p?(C-=w.e+1,q[0]=H[(Se-C%Se)%Se],w.e=-C||0):q[0]=w.e=0,w;if(g==0?(q.length=_,x=1,_--):(q.length=_+1,x=H[Se-g],q[_]=L>0?Wt(S/H[T-L]%H[L])*x:0),p)for(;;)if(_==0){for(g=1,L=q[0];L>=10;L/=10,g++);for(L=q[0]+=x,x=1;L>=10;L/=10,x++);g!=x&&(w.e++,q[0]==ui&&(q[0]=1));break}else{if(q[_]+=x,q[_]!=ui)break;q[_--]=0,x=1}for(g=q.length;q[--g]===0;q.pop());}w.e>y?w.c=w.e=null:w.e<f&&(w.c=[w.e=0])}return w}function re(w){var C,I=w.e;return I===null?w.toString():(C=Kt(w.c),C=I<=u||I>=d?To(C,I):Xi(C,I,"0"),w.s<0?"-"+C:C)}return n.absoluteValue=n.abs=function(){var w=new N(this);return w.s<0&&(w.s=1),w},n.comparedTo=function(w,C){return Ps(this,new N(w,C))},n.decimalPlaces=n.dp=function(w,C){var I,p,T,g=this;if(w!=null)return je(w,0,kt),C==null?C=o:je(C,0,8),K(new N(g),w+g.e+1,C);if(!(I=g.c))return null;if(p=((T=I.length-1)-zt(this.e/Se))*Se,T=I[T])for(;T%10==0;T/=10,p--);return p<0&&(p=0),p},n.dividedBy=n.div=function(w,C){return t(this,new N(w,C),a,o)},n.dividedToIntegerBy=n.idiv=function(w,C){return t(this,new N(w,C),0,1)},n.exponentiatedBy=n.pow=function(w,C){var I,p,T,g,L,x,S,_,A,q=this;if(w=new N(w),w.c&&!w.isInteger())throw Error(Et+"Exponent not an integer: "+re(w));if(C!=null&&(C=new N(C)),x=w.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!w.c||!w.c[0])return A=new N(Math.pow(+re(q),x?w.s*(2-Co(w)):+re(w))),C?A.mod(C):A;if(S=w.s<0,C){if(C.c?!C.c[0]:!C.s)return new N(NaN);p=!S&&q.isInteger()&&C.isInteger(),p&&(q=q.mod(C))}else{if(w.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||x&&q.c[1]>=24e7:q.c[0]<8e13||x&&q.c[0]<=9999975e7)))return g=q.s<0&&Co(w)?-0:0,q.e>-1&&(g=1/g),new N(S?1/g:g);E&&(g=Cc(E/Se+2))}for(x?(I=new N(.5),S&&(w.s=1),_=Co(w)):(T=Math.abs(+re(w)),_=T%2),A=new N(r);;){if(_){if(A=A.times(q),!A.c)break;g?A.c.length>g&&(A.c.length=g):p&&(A=A.mod(C))}if(T){if(T=Wt(T/2),T===0)break;_=T%2}else if(w=w.times(I),K(w,w.e+1,1),w.e>14)_=Co(w);else{if(T=+re(w),T===0)break;_=T%2}q=q.times(q),g?q.c&&q.c.length>g&&(q.c.length=g):p&&(q=q.mod(C))}return p?A:(S&&(A=r.div(A)),C?A.mod(C):g?K(A,E,o,L):A)},n.integerValue=function(w){var C=new N(this);return w==null?w=o:je(w,0,8),K(C,C.e+1,w)},n.isEqualTo=n.eq=function(w,C){return Ps(this,new N(w,C))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(w,C){return Ps(this,new N(w,C))>0},n.isGreaterThanOrEqualTo=n.gte=function(w,C){return(C=Ps(this,new N(w,C)))===1||C===0},n.isInteger=function(){return!!this.c&&zt(this.e/Se)>this.c.length-2},n.isLessThan=n.lt=function(w,C){return Ps(this,new N(w,C))<0},n.isLessThanOrEqualTo=n.lte=function(w,C){return(C=Ps(this,new N(w,C)))===-1||C===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(w,C){var I,p,T,g,L=this,x=L.s;if(w=new N(w,C),C=w.s,!x||!C)return new N(NaN);if(x!=C)return w.s=-C,L.plus(w);var S=L.e/Se,_=w.e/Se,A=L.c,q=w.c;if(!S||!_){if(!A||!q)return A?(w.s=-C,w):new N(q?L:NaN);if(!A[0]||!q[0])return q[0]?(w.s=-C,w):new N(A[0]?L:o==3?-0:0)}if(S=zt(S),_=zt(_),A=A.slice(),x=S-_){for((g=x<0)?(x=-x,T=A):(_=S,T=q),T.reverse(),C=x;C--;T.push(0));T.reverse()}else for(p=(g=(x=A.length)<(C=q.length))?x:C,x=C=0;C<p;C++)if(A[C]!=q[C]){g=A[C]<q[C];break}if(g&&(T=A,A=q,q=T,w.s=-w.s),C=(p=q.length)-(I=A.length),C>0)for(;C--;A[I++]=0);for(C=ui-1;p>x;){if(A[--p]<q[p]){for(I=p;I&&!A[--I];A[I]=C);--A[I],A[p]+=ui}A[p]-=q[p]}for(;A[0]==0;A.splice(0,1),--_);return A[0]?Z(w,A,_):(w.s=o==3?-1:1,w.c=[w.e=0],w)},n.modulo=n.mod=function(w,C){var I,p,T=this;return w=new N(w,C),!T.c||!w.s||w.c&&!w.c[0]?new N(NaN):!w.c||T.c&&!T.c[0]?new N(T):(b==9?(p=w.s,w.s=1,I=t(T,w,0,3),w.s=p,I.s*=p):I=t(T,w,0,b),w=T.minus(I.times(w)),!w.c[0]&&b==1&&(w.s=T.s),w)},n.multipliedBy=n.times=function(w,C){var I,p,T,g,L,x,S,_,A,q,H,J,ee,ae,oe,P=this,Q=P.c,we=(w=new N(w,C)).c;if(!Q||!we||!Q[0]||!we[0])return!P.s||!w.s||Q&&!Q[0]&&!we||we&&!we[0]&&!Q?w.c=w.e=w.s=null:(w.s*=P.s,!Q||!we?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(p=zt(P.e/Se)+zt(w.e/Se),w.s*=P.s,S=Q.length,q=we.length,S<q&&(ee=Q,Q=we,we=ee,T=S,S=q,q=T),T=S+q,ee=[];T--;ee.push(0));for(ae=ui,oe=gs,T=q;--T>=0;){for(I=0,H=we[T]%oe,J=we[T]/oe|0,L=S,g=T+L;g>T;)_=Q[--L]%oe,A=Q[L]/oe|0,x=J*_+A*H,_=H*_+x%oe*oe+ee[g]+I,I=(_/ae|0)+(x/oe|0)+J*A,ee[g--]=_%ae;ee[g]=I}return I?++p:ee.splice(0,1),Z(w,ee,p)},n.negated=function(){var w=new N(this);return w.s=-w.s||null,w},n.plus=function(w,C){var I,p=this,T=p.s;if(w=new N(w,C),C=w.s,!T||!C)return new N(NaN);if(T!=C)return w.s=-C,p.minus(w);var g=p.e/Se,L=w.e/Se,x=p.c,S=w.c;if(!g||!L){if(!x||!S)return new N(T/0);if(!x[0]||!S[0])return S[0]?w:new N(x[0]?p:T*0)}if(g=zt(g),L=zt(L),x=x.slice(),T=g-L){for(T>0?(L=g,I=S):(T=-T,I=x),I.reverse();T--;I.push(0));I.reverse()}for(T=x.length,C=S.length,T-C<0&&(I=S,S=x,x=I,C=T),T=0;C;)T=(x[--C]=x[C]+S[C]+T)/ui|0,x[C]=ui===x[C]?0:x[C]%ui;return T&&(x=[T].concat(x),++L),Z(w,x,L)},n.precision=n.sd=function(w,C){var I,p,T,g=this;if(w!=null&&w!==!!w)return je(w,1,kt),C==null?C=o:je(C,0,8),K(new N(g),w,C);if(!(I=g.c))return null;if(T=I.length-1,p=T*Se+1,T=I[T]){for(;T%10==0;T/=10,p--);for(T=I[0];T>=10;T/=10,p++);}return w&&g.e+1>p&&(p=g.e+1),p},n.shiftedBy=function(w){return je(w,-9007199254740991,uf),this.times("1e"+w)},n.squareRoot=n.sqrt=function(){var w,C,I,p,T,g=this,L=g.c,x=g.s,S=g.e,_=a+4,A=new N("0.5");if(x!==1||!L||!L[0])return new N(!x||x<0&&(!L||L[0])?NaN:L?g:1/0);if(x=Math.sqrt(+re(g)),x==0||x==1/0?(C=Kt(L),(C.length+S)%2==0&&(C+="0"),x=Math.sqrt(+C),S=zt((S+1)/2)-(S<0||S%2),x==1/0?C="5e"+S:(C=x.toExponential(),C=C.slice(0,C.indexOf("e")+1)+S),I=new N(C)):I=new N(x+""),I.c[0]){for(S=I.e,x=S+_,x<3&&(x=0);;)if(T=I,I=A.times(T.plus(t(g,T,_,1))),Kt(T.c).slice(0,x)===(C=Kt(I.c)).slice(0,x))if(I.e<S&&--x,C=C.slice(x-3,x+1),C=="9999"||!p&&C=="4999"){if(!p&&(K(T,T.e+a+2,0),T.times(T).eq(g))){I=T;break}_+=4,x+=4,p=1}else{(!+C||!+C.slice(1)&&C.charAt(0)=="5")&&(K(I,I.e+a+2,1),w=!I.times(I).eq(g));break}}return K(I,I.e+a+1,o,w)},n.toExponential=function(w,C){return w!=null&&(je(w,0,kt),w++),z(this,w,C,1)},n.toFixed=function(w,C){return w!=null&&(je(w,0,kt),w=w+this.e+1),z(this,w,C)},n.toFormat=function(w,C,I){var p,T=this;if(I==null)w!=null&&C&&typeof C=="object"?(I=C,C=null):w&&typeof w=="object"?(I=w,w=C=null):I=$;else if(typeof I!="object")throw Error(Et+"Argument not an object: "+I);if(p=T.toFixed(w,C),T.c){var g,L=p.split("."),x=+I.groupSize,S=+I.secondaryGroupSize,_=I.groupSeparator||"",A=L[0],q=L[1],H=T.s<0,J=H?A.slice(1):A,ee=J.length;if(S&&(g=x,x=S,S=g,ee-=g),x>0&&ee>0){for(g=ee%x||x,A=J.substr(0,g);g<ee;g+=x)A+=_+J.substr(g,x);S>0&&(A+=_+J.slice(g)),H&&(A="-"+A)}p=q?A+(I.decimalSeparator||"")+((S=+I.fractionGroupSize)?q.replace(new RegExp("\\d{"+S+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):q):A}return(I.prefix||"")+p+(I.suffix||"")},n.toFraction=function(w){var C,I,p,T,g,L,x,S,_,A,q,H,J=this,ee=J.c;if(w!=null&&(x=new N(w),!x.isInteger()&&(x.c||x.s!==1)||x.lt(r)))throw Error(Et+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+re(x));if(!ee)return new N(J);for(C=new N(r),_=I=new N(r),p=S=new N(r),H=Kt(ee),g=C.e=H.length-J.e-1,C.c[0]=Tc[(L=g%Se)<0?Se+L:L],w=!w||x.comparedTo(C)>0?g>0?C:_:x,L=y,y=1/0,x=new N(H),S.c[0]=0;A=t(x,C,0,1),T=I.plus(A.times(p)),T.comparedTo(w)!=1;)I=p,p=T,_=S.plus(A.times(T=_)),S=T,C=x.minus(A.times(T=C)),x=T;return T=t(w.minus(I),p,0,1),S=S.plus(T.times(_)),I=I.plus(T.times(p)),S.s=_.s=J.s,g=g*2,q=t(_,p,g,o).minus(J).abs().comparedTo(t(S,I,g,o).minus(J).abs())<1?[_,p]:[S,I],y=L,q},n.toNumber=function(){return+re(this)},n.toPrecision=function(w,C){return w!=null&&je(w,1,kt),z(this,w,C,2)},n.toString=function(w){var C,I=this,p=I.s,T=I.e;return T===null?p?(C="Infinity",p<0&&(C="-"+C)):C="NaN":(w==null?C=T<=u||T>=d?To(Kt(I.c),T):Xi(Kt(I.c),T,"0"):w===10&&O?(I=K(new N(I),a+T+1,o),C=Xi(Kt(I.c),I.e,"0")):(je(w,2,R.length,"Base"),C=i(Xi(Kt(I.c),T,"0"),10,w,p,!0)),p<0&&I.c[0]&&(C="-"+C)),C},n.valueOf=n.toJSON=function(){return re(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&N.set(e),N}function zt(e){var t=e|0;return e>0||e===t?t:t-1}function Kt(e){for(var t,i,s=1,n=e.length,r=e[0]+"";s<n;){for(t=e[s++]+"",i=Se-t.length;i--;t="0"+t);r+=t}for(n=r.length;r.charCodeAt(--n)===48;);return r.slice(0,n+1||1)}function Ps(e,t){var i,s,n=e.c,r=t.c,a=e.s,o=t.s,u=e.e,d=t.e;if(!a||!o)return null;if(i=n&&!n[0],s=r&&!r[0],i||s)return i?s?0:-o:a;if(a!=o)return a;if(i=a<0,s=u==d,!n||!r)return s?0:!n^i?1:-1;if(!s)return u>d^i?1:-1;for(o=(u=n.length)<(d=r.length)?u:d,a=0;a<o;a++)if(n[a]!=r[a])return n[a]>r[a]^i?1:-1;return u==d?0:u>d^i?1:-1}function je(e,t,i,s){if(e<t||e>i||e!==Wt(e))throw Error(Et+(s||"Argument")+(typeof e=="number"?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Co(e){var t=e.c.length-1;return zt(e.e/Se)==t&&e.c[t]%2!=0}function To(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Xi(e,t,i){var s,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(s=e.length,++t>s){for(n=i,t-=s;--t;n+=i);e+=n}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=hf();class B extends Error{constructor(t){super(t),this.name="QtiEvaluationException"}}class ie{QTI_RESPONSE_RULES(){return["qti-response-processing-fragment","qti-response-condition","qti-set-outcome-value","qti-lookup-outcome-value","qti-get-outcome-value","qti-exit-response"]}QTI_TEMPLATE_RULES(){return["qti-set-template-value","qti-exit-template","qti-template-condition","qti-set-default-value","qti-set-correct-response","qti-template-constraint"]}QTI_EXPRESSIONS(){return["qti-base-value","qti-variable","qti-correct","qti-default","qti-is-null","qti-null","qti-and","qti-or","qti-not","qti-match","qti-map-response","qti-member","qti-subtract","qti-sum","qti-random","qti-random-float","qti-random-integer","qti-index","qti-integer-divide","qti-integer-modulus","qti-integer-to-float","qti-equal","qti-equal-rounded","qti-field-value","qti-multiple","qti-ordered","qti-map-response-point","qti-product","qti-delete","qti-string-match","qti-pattern-match","qti-substring","qti-round","qti-round-to","qti-truncate","qti-divide","qti-gt","qti-gte","qti-lt","qti-lte","qti-max","qti-min","qti-custom-operator","qti-math-operator","qti-math-constant","qti-repeat","qti-gcd","qti-lcm","qti-stats-operator","qti-power","qti-any-n","qti-inside","qti-test-variables"]}constructor(){}isExpressionNode(t){return this.QTI_EXPRESSIONS().includes(t)}isResponseRuleNode(t){return this.QTI_RESPONSE_RULES().includes(t)}isTemplateRuleNode(t){return this.QTI_TEMPLATE_RULES().includes(t)}nullValue(){return null}isNullValue(t){return typeof t>"u"||t===null}isBaseTypeNumeric(t){return t==="float"||t==="integer"}isSingleValuesMatch(t,i,s){if(this.isBaseTypeNumeric(t)){let n=new j(i),r=new j(s);return n.comparedTo(r)==0}return i===s}isMultipleValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;const n=i.concat().sort(),r=s.concat().sort();if(this.isBaseTypeNumeric(t)){for(let a=0;a<n.length;a++)if(!this.isSingleValuesMatch(t,n[a],r[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==r[a])return!1;return!0}isOrderedValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;if(this.isBaseTypeNumeric(t)){for(let n=0;n<i.length;n++)if(!this.isSingleValuesMatch(t,i[n],s[n]))return!1}else for(let n=0;n<i.length;n++)if(i[n]!==s[n])return!1;return!0}mapResponse(t){if(this.isNullValue(t.value))return t.mapping.getDefaultValue();const i=t.mapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.isBaseTypeNumeric(t.baseType)?new j(t.value).toString():t.value;for(let r=0;r<s;r++){const a=i[r];if(this.isSingleValuesMatch("string",a.caseSensitive?a.mapKey:a.mapKey.toLowerCase(),a.caseSensitive?n:n.toLowerCase()))return t.mapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"||t.cardinality==="ordered"){let n=new j(0),r=t.value;if(this.isBaseTypeNumeric(t.baseType))for(let a=0;a<r.length;a++)r[a]!==null&&(r[a]=new j(r[a]).toString());r=this.mappingEliminateNullsAndDuplicates(r);for(let a=0;a<s;a++){const o=i[a];for(let u=0;u<r.length;u++)this.isSingleValuesMatch("string",o.caseSensitive?o.mapKey:o.mapKey.toLowerCase(),o.caseSensitive?r[u]:r[u].toLowerCase())&&(n=n.plus(o.mappedValue))}return t.mapping.applyConstraints(n)}return t.mapping.getDefaultValue()}mappingEliminateNullsAndDuplicates(t){let i=t.length,s=[],n={};for(let r=0;r<i;r++)t[r]!==null&&(n[t[r]]=0);for(let r in n)s.push(r);return s}mapValueFromLookupTable(t,i){if(this.isNullValue(t.lookupTable))return this.nullValue();if(this.isNullValue(i))return t.lookupTable.getDefaultValue();const s=t.lookupTable.getValue(),n=t.lookupTable.getTableType();if(i=new j(i),n==="interpolation"){s.sort(function(r,a){return r.sourceValue-a.sourceValue});for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)<0||a.includeBoundary&&i.comparedTo(o)===0)return a.targetValue}}else if(n==="match"){i=new j(i);for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)===0)return a.targetValue}}return t.lookupTable.getDefaultValue()}mapResponsePoint(t){if(this.isNullValue(t.value))return t.areaMapping.getDefaultValue();const i=t.areaMapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.toPointObject(t.value);for(let r=0;r<s;r++){const a=i[r];if(this.isPointInside(a.mapShape,a.mapCoords,n))return t.areaMapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"){let n=new j(0),r=t.value,a=Array.from(r);for(let o=0;o<s;o++){const u=i[o];let d=!0;for(let f=0;f<r.length;f++){let y=this.toPointObject(r[f]);if(this.isPointInside(u.mapShape,u.mapCoords,y)){d&&(n=n.plus(u.mappedValue),d=!1);const m=a.indexOf(r[f]);m>-1&&a.splice(m,1)}}}return n=n.plus(new j(t.areaMapping.getDefaultValue()).times(a.length)),t.areaMapping.applyConstraints(n)}return t.areaMapping.getDefaultValue()}toPointObject(t){if(t===null||typeof t!="string")return null;const i=t.split(" ");if(i.length!=2)return null;const s=new j(i[0]).toNumber(),n=new j(i[1]).toNumber();return{x:s,y:n}}shuffleArray(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}}shuffleArrayFixed(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1));if(t[i].fixed||t[s].fixed)continue;let n=t[i];t[i]=t[s],t[s]=n}}generalizedLcm(t,i){let s=i[0];for(let n=1;n<t;n++){if(s===0||i[n]===0)return 0;s=this.lcm(s,i[n])}return s}lcm(t,i){return new j(t).multipliedBy(i).dividedBy(this.gcd(t,i)).toNumber()}generalizedGcd(t,i){let s=i[0];for(let n=1;n<t;n++)s=this.gcd(s,i[n]);return s}gcd(t,i){return i=new j(i),i.isZero()?t:this.gcd(i.toNumber(),new j(t).modulo(i).toNumber())}getParametersFromDefinition(t){let i=new Map;if(typeof t>"u"||(t=t.trim(),t.length===0))return i;let s=t.split("|||");for(let n=0;n<s.length;n++){const r=s[n].split("=");i.set(r[0],r.length<2?"":r[1].replaceAll("=","="))}return i}computeWordCount(t){const i=t.match(/\S+/g);return i===null?0:i.length}isPointInside(t,i,s){const n={COORDS_LENGTH:3,CENTER_X:0,CENTER_Y:1,RADIUS:2,isInside(u,d){const f=Math.pow(d.x-u[this.CENTER_X],2),y=Math.pow(d.y-u[this.CENTER_Y],2);return f+y<=Math.pow(u[this.RADIUS],2)}},r={COORDS_LENGTH:4,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(u,d){return d.x>=u[this.LEFT_X]&&d.x<=u[this.RIGHT_X]&&d.y>=u[this.TOP_Y]&&d.y<=u[this.BOTTOM_Y]}},a={COORDS_LENGTH:4,CENTER_X:0,CENTER_Y:1,H_RADIUS:2,V_RADIUS:3,isInside(u,d){const f=new j(Math.pow(d.x-u[this.CENTER_X],2)/Math.pow(u[this.H_RADIUS],2)),y=new j(Math.pow(d.y-u[this.CENTER_Y],2)/Math.pow(u[this.V_RADIUS],2));return f.plus(y).lte(new j(1))}},o={MINIMUM_COORDS_LENGTH:6,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(u,d){let f=u;if(f[0]!=f[f.length-2]||f[1]!=f[f.length-1]){let $=f;$.push(f[0]),$.push(f[1]),f=$}let y=new j(0);const m=new j(d.x).integerValue(),b=new j(d.y).integerValue();for(let $=0;$<f.length-3;$+=2){const R=new j(f[$]).integerValue(),O=new j(f[$+1]).integerValue(),N=new j(f[$+2]).integerValue(),z=new j(f[$+3]).integerValue(),V=m.minus(N).pow(2).plus(b.minus(z).pow(2)).sqrt(),Z=N.minus(R).pow(2).plus(z.minus(O).pow(2)).sqrt(),K=R.minus(m).pow(2).plus(O.minus(b).pow(2)).sqrt(),re=new j(Math.acos((Math.pow(V.toNumber(),2)-Math.pow(Z.toNumber(),2)+Math.pow(K.toNumber(),2))/(2*V.toNumber()*K.toNumber()))*180/Math.PI),w=N.minus(m).times(b.minus(O)),C=z.minus(b).times(m.minus(R)),I=w.minus(C);if(re.isNaN())return!0;I.gte(new j(0))?y=y.plus(re):y=y.minus(re)}let E=new j(y);return E=E.dp(6,j.ROUND_HALF_UP),!E.isZero()}};return t==="circle"?n.isInside(i,s):t==="rect"?r.isInside(i,s):t==="poly"?o.isInside(i,s):t==="ellipse"?a.isInside(i,s):t==="default"}valueToPciJson(t,i,s){return t===null?{base:null}:s==="single"?{base:this.baseValueToPciJson(t,i)}:s==="multiple"||s==="ordered"?{list:this.baseValueToPciJson(t,i)}:s==="record"?{record:this.recordValueToPciJson(t)}:{base:null}}baseValueToPciJson(t,i){let s={};switch(i){case"string":case"identifier":case"integer":case"float":case"duration":case"boolean":case"uri":case"file":return s[i]=t,s;case"point":s[i]=n=>n.split(" ").map(Number);return;case"directedPair":case"pair":return s[i]=t.split(" "),s;case"intOrIdentifier":return s[i]=null,s;default:return s[i]=null,s}}recordValueToPciJson(t){let i=[];for(let s of t.values())i.push({name:s.fieldIdentifier,base:s.value===null?null:this.baseValueToPciJson(s.value,s.baseType)});return i}processInteractionResponse(t,i){return t.interactionType==="PortableCustom"?this.getValueFromPciJson(t.node.getResponse(),i):t.node.getResponse()}getValueFromPciJson(t,i){if(console.log("[GetValueFromPciJson][Value]",t,i),t===null||typeof i>"u")return this.nullValue();try{if(typeof t!="object")throw new B("Improper value encoding. Must be an Object.");if(Array.isArray(t))throw new B("Improper value encoding. Found Array. Must be an Object.");if(t.base!==void 0){if(i.cardinality==="single")return this.baseValueFromPciJson(t.base,i.baseType,!0);throw new B("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.")}if(t.list!==void 0){if(i.cardinality==="multiple"||i.cardinality==="ordered")return this.baseValueFromPciJson(t.list,i.baseType,!1);throw new B("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.")}if(t.record!==void 0){if(i.cardinality==="record")return this.recordValueFromPciJson(t.record,i);throw new B("Inconsistent value cardinality [record] for this variable. Variable must be record cardinality.")}throw new B('Improper value encoding. Must be one of "base", "list", "record".')}catch({name:s,message:n}){return console.log("[PciDecodingException][ValueFromJson] ",n),this.nullValue()}}baseValueFromPciJson(t,i,s){if(t===null)return this.nullValue();try{if(typeof t!="object")throw new B("Invalid value. Must be an Object.");if(Array.isArray(t))throw new B("Invalid value. Found Array. Must be an Object.");if(t[i]!==void 0){if(i==="point"||i==="directedPair"||i==="pair"){if(!Array.isArray(t[i]))throw new B(`Invalid value. For baseType "${i}", must be an Array`);if(s){if(t[i].length!==2)throw new B(`Invalid value. For baseType "${i}", Array must have 2 elements`);return`${t[i][0]} ${t[i][1]}`}let n=[];return t[i].forEach(r=>{if(r.length!==2)throw new B(`Invalid value. For baseType "${i}", Array must have 2 elements`);n.push(`${r[0]} ${r[1]}`)}),n}return t[i]}throw new B(`Value does not have the required base-type. Expecting ${i}.`)}catch({name:n,message:r}){return console.log("[PciDecodingException][BaseValueFromJson] ",r,t),this.nullValue()}}recordValueFromPciJson(t,i){try{let s=this.getRecordVariableFieldDefinition(i);if(s===null)throw new B(`Unable to retrieve ${i.identifier} record field definition.`);if(typeof t!="object")throw new B("Improper record value encoding. Must be an Array.");if(!Array.isArray(t))throw new B("Improper record value encoding. Must be an Array.");const n=new Map;for(let[r,a]of s)for(let o=0;o<t.length;o++)if(t[o].name!==void 0&&t[o].base!==void 0&&t[o].name===r){const u=this.baseValueFromPciJson(t[o].base,a.getBaseType(),!0),d=new Ge(r,a.getBaseType(),u);n.set(r,d);break}return n}catch({name:s,message:n}){return console.log("[VariableDecodingException][RecordValueFromJson] ",n),new Map}}getRecordVariableFieldDefinition(t){return t==null?null:t.defaultValue!==null?t.defaultValue:t.correctResponse}computeProcessingContext(t){return this.computeProcessingType(t)==="OUTCOME"?"TEST":"ITEM"}computeProcessingType(t){return t===null?"UNKNOWN":t.$options.name==="QtiOutcomeProcessing"?"OUTCOME":t.$options.name==="QtiResponseProcessing"?"RESPONSE":t.$options.name==="QtiTemplateProcessing"?"TEMPLATE":t.$options.name==="QtiBranchRule"?"OUTCOME":this.computeProcessingType(t.$parent)}computeNodeContext(t){return t===null||t.$options.name==="QtiAssessmentItem"?"ITEM":t.$options.name==="QtiAssessmentTest"?"TEST":this.computeNodeContext(t.$parent)}base64ToBytes(t){const i=atob(t);return Uint8Array.from(i,s=>s.codePointAt(0))}bytesToBase64(t){const i=Array.from(t,s=>String.fromCodePoint(s)).join("");return btoa(i)}encodeBytesToBase64(t){const i=new TextEncoder;return this.bytesToBase64(i.encode(t))}decodeBase64ToBytes(t){return new TextDecoder().decode(this.base64ToBytes(t))}}const Db=new ie,M={player:null,state:{item:null,itemBody:null,identifier:"",title:"",responseDeclarations:[],outcomeDeclarations:[],templateDeclarations:[],contextDeclarations:[],stimulusRefs:[],interactions:[],processing:[],feedbacks:[],templates:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[],asyncStateMap:new Map},itemContext:{guid:null,pnp:null,sc:null,state:null,validationMessages:[],lifecycleStatus:null},itemTimer:new Pb,pciContext:{renderer2p0:"assets/pci/pci.html"},pciMessageHandler:null,windowResizeHandler:null,getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getTemplateDeclarations(){return this.state.templateDeclarations},getTemplateMathParameterVariables(){return this.state.templateDeclarations.filter(e=>e.mathVariable===!0)},getTemplateDeclaration(e){return this.state.templateDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getStimulusRefs(){return this.state.stimulusRefs},getStimulusRef(e){return this.state.stimulusRefs.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.templateDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getInteraction(e){return this.state.interactions.find(t=>t.identifier===e)},getInteractions(){return this.state.interactions},getProcessing(e){return this.state.processing.find(t=>t.processingType===e)},getFeedbacks(){return this.state.feedbacks},getTemplates(){return this.state.templates},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},getItem(){return this.state.item},setItem(e){this.state.item=e.item},getItemBody(){return this.state.itemBody},setItemBody(e){this.state.itemBody=e},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTemplateDeclaration(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.templateDeclarations[t]=e:this.state.templateDeclarations.push(e)},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineStimulusRef(e){let t=this.state.stimulusRefs.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.stimulusRefs[t]=e:this.state.stimulusRefs.push(e)},defineInteraction(e){let t=this.state.interactions.findIndex(s=>s.identifier==e.identifier);if(t<0){console.log("[DefineInteraction]["+e.identifier+"]"),this.state.interactions.push(e);return}let i=this.state.interactions[t];i.interactionType=e.interactionType,i.isValidResponse=e.isValidResponse,i.invalidResponseMessage=e.invalidResponseMessage,i.maxSelectionsMessage=e.maxSelectionsMessage,i.node=e.node,i.resetValue=e.resetValue},defineProcessing(e){let t=e.processingType,i=this.state.processing.findIndex(s=>s.processingType==t);i>-1?this.state.processing[i]=e:this.state.processing.push(e),t=="response"?console.log("[QtiResponseProcessing][Defined]",e):t=="template"?console.log("[QtiTemplateProcessing][Defined]",e):t=="outcome"&&console.log("[QtiOutcomeProcessing][Defined]",e)},defineResponseProcessing(e){this.defineProcessing({processingType:"response",node:e.node})},defineTemplateProcessing(e){this.defineProcessing({processingType:"template",node:e.node})},defineItemBody(e){this.setItemBody(e.node)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},defineTemplate(e){this.state.templates.push(e)},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.item=null,this.state.itemBody=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.templateDeclarations.splice(0,this.state.templateDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.stimulusRefs.splice(0,this.state.stimulusRefs.length),this.state.interactions.splice(0,this.state.interactions.length),this.state.processing.splice(0,this.state.processing.length),this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.templates.splice(0,this.state.templates.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.state.asyncStateMap.clear(),this.resetItemTimer(),this.itemContext.guid=null,this.itemContext.state=null,this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length),this.itemContext.lifecycleStatus=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Ge("candidateIdentifier","string",null)),t.set("testIdentifier",new Ge("testIdentifier","string",null)),t.set("environmentIdentifier",new Ge("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentItem][QTI_CONTEXT] initialized"),this.defineOutcomeDeclaration({identifier:"SCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][SCORE] initialized"),this.defineOutcomeDeclaration({identifier:"MAXSCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][MAXSCORE] initialized"),this.defineOutcomeDeclaration({identifier:"completionStatus",baseType:"identifier",cardinality:"single",value:"not_attempted",defaultValue:"not_attempted",lookupTable:null,lookupTableType:null,normalMaximum:null,normalMinimum:null,externalScored:null,interpretation:null}),console.log("[QtiAssessmentItem][completionStatus] initialized"),this.defineResponseDeclaration({identifier:"numAttempts",baseType:"integer",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][numAttempts] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][duration] initialized")},restoreContextVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"contextVariables"in e&&e.contextVariables!==null&&e.contextVariables.forEach(t=>{let i=this.state.contextDeclarations.findIndex(s=>s.identifier==t.identifier);i<0||(this.state.contextDeclarations[i].value=t.value)},this)},restoreOutcomeVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"outcomeVariables"in e&&e.outcomeVariables!==null&&e.outcomeVariables.forEach(t=>{this.setOutcomeVariableValue({identifier:t.identifier,value:t.value})},this)},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e);return t<0?null:this.state.responseDeclarations[t].correctResponse},setResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.correctResponse=e.value},setInteractionIsValidResponse(e){let t=this.state.interactions.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.interactions[t].isValidResponse=e.isValidResponse)},resetInteractionStateIsValidResponse(){this.state.interactions.forEach(e=>{e.interactionType!=="EndAttemptInteraction"&&(e.isValidResponse=!1)})},restoreResponseVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"responseVariables"in e&&e.responseVariables!==null&&e.responseVariables.forEach(t=>{this.setResponseVariableValue({identifier:t.identifier,value:t.value,state:t.state}),"correctResponse"in t&&this.setResponseVariableCorrectResponse({identifier:t.identifier,value:t.correctResponse})},this)},setResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=e.value,i.state=e.state},resetResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=i.defaultValue!==null?i.defaultValue:null},incrementNumAttempts(){let e=this.state.responseDeclarations.findIndex(t=>t.identifier=="numAttempts");this.state.responseDeclarations[e].value+=1},updateItemDuration(){const e=this.getResponseDeclaration("duration");e.value+=this.itemTimer.getTime(),this.restartItemTimer()},restartItemTimer(){this.itemTimer.startTimer()},resetItemTimer(){this.itemTimer.resetTimer()},setTemplateVariableValue(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.templateDeclarations[t].value=e.value)},resetTemplateVariables(){this.state.templateDeclarations.forEach(e=>{e.node.reset()})},setVariableDefaultValue(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);if(t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}if(t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier),t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}},getPciContext(){return this.pciContext},setPciContext(e){this.pciContext=e},getPciContextRenderer(){return this.pciContext.renderer2p0},setPciContextRenderer(e){this.pciContext.renderer2p0=e},initializePciMessageListener(){this.pciMessageHandler=this.PciMessageListener.bind(this),this.windowResizeHandler=this.WindowResize.bind(this),window.addEventListener("message",this.pciMessageHandler),window.addEventListener("resize",this.windowResizeHandler)},removePciMessageListener(){this.pciMessageHandler!==null&&window.removeEventListener("message",this.pciMessageHandler),this.windowResizeHandler!==null&&window.removeEventListener("resize",this.windowResizeHandler)},PciMessageListener(e){switch(e.data.message){case"PciChildLoaded":console.log("[PCI Parent] PCI Frame Loaded: "+e.data.identifier),this.pciInitialize(e.data.identifier);break;case"PciReady":console.log("[PCI Parent] PCI Ready: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciReady(e.data.identifier),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!0);break;case"PciResize":console.log("[PCI Parent] PCI Resize: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!1);break;case"PciGetState_Reply":console.log("[PCI Parent] PCI GetState Reply: "+e.data.identifier+", state:",e.data.state),this.pciSaveState(e.data.identifier,e.data.state);break;case"PciInteractionChanged":console.log("[PCI Parent] PCI InteractionChanged: "+e.data.identifier+", state: "+e.data.state),this.pciInteractionChanged(e.data.identifier,e.data.state);break}},WindowResize(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciResizeIframeWidthToContainer()})},pciSetRenderingProperties(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciSetRenderingProperties()})},pciInitialize(e){let t=M.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciInitialize()},pciReady(e){let t=M.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciSetReady()},pciResizeIframe(e,t,i,s){let n=M.getInteraction(e);typeof n>"u"||n.interactionType!=="PortableCustom"||(s?n.node.pciResizeIframe(t,n.node.initialWidth):n.node.pciResizeIframe(t,i))},pciSaveState(e,t){let i=M.getInteraction(e);typeof i>"u"||i.interactionType!=="PortableCustom"||i.node.pciSaveState(t)},pciInteractionChanged(e,t){let i=M.getInteraction(e);if(typeof i>"u"||i.interactionType!=="PortableCustom")return;const s=JSON.parse(t);typeof s.valid<"u"&&i.node.pciUpdateValidity(s.valid),typeof s.value<"u"&&i.node.pciUpdateResponse(s.value)},getAsyncStateMap(){return this.state.asyncStateMap},getItemContextGuid(){return this.itemContext.guid},setItemContextGuid(e){this.itemContext.guid=e},initializeItemContextPnp(){this.itemContext.pnp=new Os},getItemContextPnp(){return this.itemContext.pnp},setItemContextPnp(e){this.itemContext.pnp===null&&this.initializeItemContextPnp(),this.itemContext.pnp.setPnp(e)},initializeItemContextSessionControl(){this.itemContext.sc=new Ob},getItemContextSessionControl(){return this.itemContext.sc},setItemContextSessionControl(e){this.itemContext.sc===null&&this.initializeItemContextSessionControl(),this.itemContext.sc.setSessionControl(e)},getItemContextState(){return this.itemContext.state},setItemContextState(e){const t=new Ec,i=e===null?e:t.createStateFromState(e);this.itemContext.state=i},getItemContextStateVariable(e){if(!this.hasItemContextState())return null;const t=this.getItemContextState();let i=t.outcomeVariables.find(s=>s.identifier===e);return typeof i<"u"||(i=t.responseVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.templateVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.contextDeclarations.find(s=>s.identifier===e),typeof i<"u")?i:null},hasItemContextState(){return this.getItemContextState()!==null},getItemContextValidationMessages(){return this.itemContext.validationMessages},addItemContextValidationMessage(e){this.itemContext.validationMessages.push(e)},resetItemContextValidationMessages(){this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length)},getItemLifecycleStatus(){return this.lifecycleStatus},setItemLifecycleStatus(e){this.lifecycleStatus=e},NotifyPlayerReady(e){this.player=e.player},NotifyEndAttempt(e){this.state.item.endAttempt(e,(function(){this.state.item.notifyEndAttemptInteractionResults("itemEndAttemptReady")}).bind(this))},NotifyNewTemplate(e){this.state.item.newTemplate(e)},NotifyItemReady(e){this.setItem(e),this.getItem().isAdaptive||this.restartItemTimer(),this.getItem().isAdaptiveItemCompleted()||this.restartItemTimer()},NotifyInteractionSelectionsLimit(e){const t={icon:"warning",message:e};this.player.displayAlertMessage(t)},NotifyInteractionStateReady(e){console.log("[InteractionStateReady][Interaction]",e.identifier);const t=this.getInteraction(e.identifier);typeof t>"u"||typeof this.getAsyncStateMap().get(t.identifier)>"u"||(this.setResponseVariableValue({identifier:t.identifier,value:Db.processInteractionResponse(t,this.getResponseDeclaration(t.identifier)),state:t.node.getState()}),this.getAsyncStateMap().delete(t.identifier),this.getAsyncStateMap().size===0&&this.getItem().triggerGetResponsesComplete())}},tt={player:null,state:{test:null,identifier:"",title:"",responseDeclarations:[],contextDeclarations:[],outcomeDeclarations:[],timeLimit:null,testParts:[],outcomeProcessing:null,feedbacks:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[]},testContext:{guid:null,pnp:null},sectionItemStates:new Map,getTest(){return this.state.test},setTest(e){this.state.test=e.test},getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getTimeLimit(){return this.timeLimit},getTestParts(){return this.state.testParts},getTestPart(e){return this.state.testParts.find(t=>t.identifier===e)},getOutcomeProcessing(){return this.state.outcomeProcessing},getFeedbacks(){return this.state.feedbacks},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTimeLimit(e){this.state.timeLimit=e.node},defineTestPart(e){let t=this.state.testParts.findIndex(i=>i.identifier==e.identifier);if(t<0){this.state.testParts.push(e.testPart);return}this.state.testParts[t]=e.testPart},defineProcessing(e){this.state.processing=e,console.log("[QtiOutcomeProcessing][Defined]",e)},defineOutcomeProcessing(e){const t={processingType:"outcome",node:e.node};this.state.outcomeProcessing=t,console.log("[QtiOutcomeProcessing][Defined]",t)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.test=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.timeLimit=null,this.state.testParts.splice(0,this.state.testParts.length),this.state.outcomeProcessing=null,this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.testContext.guid=null,this.testContext.state=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Ge("candidateIdentifier","string",null)),t.set("testIdentifier",new Ge("testIdentifier","string",null)),t.set("environmentIdentifier",new Ge("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentTest][QTI_CONTEXT] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentTest][duration] initialized")},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getTestContextGuid(){return this.testContext.guid},setTestContextGuid(e){this.testContext.guid=e},initializeTestContextPnp(){this.testContext.pnp=new Os},getTestContextPnp(){return this.testContext.pnp},setTestContextPnp(e){this.testContext.pnp===null&&this.initializeTestContextPnp(),this.testContext.pnp.setPnp(e)},getAllTestStateItemStatesMap(){return this.sectionItemStates},setTestStateItemState(e,t,i,s){console.log("[TestStore][SetState][Part:"+e+"][Section:"+t+"][Item:"+i+"]",s);const n=`${e}~~${t}`;let r=this.getItemStateMapBySectionIdentifier(n);r!=null&&r.set(i,s)},getItemStateMapBySectionIdentifier(e){return this.sectionItemStates.has(e)?this.sectionItemStates.get(e):this.initializePartSectionItemStateMap(e)},getPartSectionMapBySectionIdentifier(e){for(let[t,i]of this.sectionItemStates)if(t.endsWith(e))return i;return null},initializePartSectionItemStateMap(e){return this.sectionItemStates.set(e,new Map),this.sectionItemStates.get(e)},findItemVariableValueByIdentifier(e,t){const i=this.findVariableByIdentifier(e.contextVariables,t);if(typeof i<"u")return i;const s=this.findVariableByIdentifier(e.outcomeVariables,t);if(typeof s<"u")return s;const n=this.findVariableByIdentifier(e.responseVariables,t);if(typeof n<"u")return n;const r=this.findVariableByIdentifier(e.templateVariables,t);return typeof r<"u"?r:null},findVariableByIdentifier(e,t){return e.find(i=>i.identifier===t)},getSerializedState(){return{contextVariables:this.serializeVariables(this.getContextDeclarations()),outcomeVariables:this.serializeVariables(this.getOutcomeDeclarations())}},serializeVariables(e){let t=[];return e.forEach(i=>{t.push({identifier:i.identifier,cardinality:i.cardinality,baseType:i.baseType,value:this.serializeVariableValue(i.cardinality,i.value)})}),t},serializeVariableValue(e,t){return e!=="record"?JSON.parse(JSON.stringify(t)):this.serializeRecordVariableValue(t)},serializeVariableState(e){return JSON.parse(JSON.stringify(e))},serializeRecordVariableValue(e){const t=this.strMapToJson(e);return this.jsonToStrMap(t)},strMapToJson(e){return JSON.stringify(this.strMapToObj(e))},jsonToStrMap(e){return this.objToStrMap(JSON.parse(e))},strMapToObj(e){let t=Object.create(null);for(let[i,s]of e)t[i]=s;return t},objToStrMap(e){let t=new Map;for(let i of Object.keys(e))t.set(i,e[i]);return t},NotifyTestPlayerReady(e){this.player=e.player},NotifyTestReady(e){this.setTest(e)}};class Qb{constructor(){te(this,"xmlDeclaration",null);te(this,"rxTrackSource",null);this.xmlDeclaration=new RegExp(/<\?xml.*?\?>/s),this.rxTrackSource=new RegExp(/<(track|source)[^>]+?\/>/g)}filterXmlDeclaration(t){return t.replace(this.xmlDeclaration,"")}filterCdata(t){return t.replaceAll("<![CDATA[","").replaceAll("]]>","")}filterStyle(t){return t.replaceAll("<style>","<amp-style>").replaceAll("</style>","</amp-style>")}filterMedia(t){return t=t.replaceAll("<video>","<amp-video>").replaceAll("<video ","<amp-video ").replaceAll("</video>","</amp-video>").replaceAll("<audio>","<amp-audio>").replaceAll("<audio ","<amp-audio ").replaceAll("</audio>","</amp-audio>"),this.filterTrackSource(t)}filterTrackSource(t){return t.replace(this.rxTrackSource,i=>i.replace(/\/>/g,">"))}}/*!
|
2
2
|
* sweetalert2 v11.14.0
|
3
3
|
* Released under the MIT License.
|
4
4
|
*/function df(e,t,i){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}function Hb(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ff(e,t){return e.get(df(e,t))}function Ub(e,t,i){Hb(e,t),t.set(e,i)}function Fb(e,t,i){return e.set(df(e,t),i),i}const Gb=100,me={},jb=()=>{me.previousActiveElement instanceof HTMLElement?(me.previousActiveElement.focus(),me.previousActiveElement=null):document.body&&document.body.focus()},Wb=e=>new Promise(t=>{if(!e)return t();const i=window.scrollX,s=window.scrollY;me.restoreFocusTimeout=setTimeout(()=>{jb(),t()},Gb),window.scrollTo(i,s)}),pf="swal2-",U=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce((e,t)=>(e[t]=pf+t,e),{}),So=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=pf+t,e),{}),mf="SweetAlert2:",Sc=e=>e.charAt(0).toUpperCase()+e.slice(1),Ct=e=>{console.warn(`${mf} ${typeof e=="object"?e.join(" "):e}`)},Bs=e=>{console.error(`${mf} ${e}`)},gf=[],zb=e=>{gf.includes(e)||(gf.push(e),Ct(e))},yf=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;zb(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},xo=e=>typeof e=="function"?e():e,xc=e=>e&&typeof e.toPromise=="function",$r=e=>xc(e)?e.toPromise():Promise.resolve(e),Ic=e=>e&&Promise.resolve(e)===e,Tt=()=>document.body.querySelector(`.${U.container}`),Lr=e=>{const t=Tt();return t?t.querySelector(e):null},qt=e=>Lr(`.${e}`),Be=()=>qt(U.popup),Mr=()=>qt(U.icon),Kb=()=>qt(U["icon-content"]),wf=()=>qt(U.title),_c=()=>qt(U["html-container"]),bf=()=>qt(U.image),Vc=()=>qt(U["progress-steps"]),Io=()=>qt(U["validation-message"]),Vi=()=>Lr(`.${U.actions} .${U.confirm}`),Sn=()=>Lr(`.${U.actions} .${U.cancel}`),Ds=()=>Lr(`.${U.actions} .${U.deny}`),Yb=()=>qt(U["input-label"]),xn=()=>Lr(`.${U.loader}`),Rr=()=>qt(U.actions),vf=()=>qt(U.footer),_o=()=>qt(U["timer-progress-bar"]),Ac=()=>qt(U.close),Xb=`
|
@@ -49,7 +49,7 @@
|
|
49
49
|
<div class="${U["timer-progress-bar"]}"></div>
|
50
50
|
</div>
|
51
51
|
</div>
|
52
|
-
`.replace(/(^|\n)\s*/g,""),sv=()=>{const e=Tt();return e?(e.remove(),Ai([document.documentElement,document.body],[U["no-backdrop"],U["toast-shown"],U["has-column"]]),!0):!1},Hs=()=>{me.currentInstance.resetValidationMessage()},nv=()=>{const e=Be(),t=ys(e,U.input),i=ys(e,U.file),s=e.querySelector(`.${U.range} input`),n=e.querySelector(`.${U.range} output`),r=ys(e,U.select),a=e.querySelector(`.${U.checkbox} input`),o=ys(e,U.textarea);t.oninput=Hs,i.onchange=Hs,r.onchange=Hs,a.onchange=Hs,o.oninput=Hs,s.oninput=()=>{Hs(),n.value=s.value},s.onchange=()=>{Hs(),n.value=s.value}},rv=e=>typeof e=="string"?document.querySelector(e):e,av=e=>{const t=Be();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ov=e=>{window.getComputedStyle(e).direction==="rtl"&&Ne(Tt(),U.rtl)},lv=e=>{const t=sv();if(If()){Bs("SweetAlert2 requires document to initialize");return}const i=document.createElement("div");i.className=U.container,t&&Ne(i,U["no-transition"]),Ot(i,iv);const s=rv(e.target);s.appendChild(i),av(e),ov(s),nv()},Nc=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?cv(e,t):e&&Ot(t,e)},cv=(e,t)=>{e.jquery?uv(t,e):Ot(t,e.toString())},uv=(e,t)=>{if(e.textContent="",0 in t)for(let i=0;i in t;i++)e.appendChild(t[i].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Us=(()=>{if(If())return!1;const e=document.createElement("div");return typeof e.style.webkitAnimation<"u"?"webkitAnimationEnd":typeof e.style.animation<"u"?"animationend":!1})(),hv=(e,t)=>{const i=Rr(),s=xn();!i||!s||(!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?ct(i):nt(i),Pt(i,t,"actions"),dv(i,s,t),Ot(s,t.loaderHtml||""),Pt(s,t,"loader"))};function dv(e,t,i){const s=Vi(),n=Ds(),r=Sn();!s||!n||!r||(kc(s,"confirm",i),kc(n,"deny",i),kc(r,"cancel",i),fv(s,n,r,i),i.reverseButtons&&(i.toast?(e.insertBefore(r,s),e.insertBefore(n,s)):(e.insertBefore(r,t),e.insertBefore(n,t),e.insertBefore(s,t))))}function fv(e,t,i,s){if(!s.buttonsStyling){Ai([e,t,i],U.styled);return}Ne([e,t,i],U.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ne(e,U["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ne(t,U["default-outline"])),s.cancelButtonColor&&(i.style.backgroundColor=s.cancelButtonColor,Ne(i,U["default-outline"]))}function kc(e,t,i){const s=Sc(t);Nr(e,i[`show${s}Button`],"inline-block"),Ot(e,i[`${t}ButtonText`]||""),e.setAttribute("aria-label",i[`${t}ButtonAriaLabel`]||""),e.className=U[t],Pt(e,i,`${t}Button`)}const pv=(e,t)=>{const i=Ac();i&&(Ot(i,t.closeButtonHtml||""),Pt(i,t,"closeButton"),Nr(i,t.showCloseButton),i.setAttribute("aria-label",t.closeButtonAriaLabel||""))},mv=(e,t)=>{const i=Tt();i&&(gv(i,t.backdrop),yv(i,t.position),wv(i,t.grow),Pt(i,t,"container"))};function gv(e,t){typeof t=="string"?e.style.background=t:t||Ne([document.documentElement,document.body],U["no-backdrop"])}function yv(e,t){t&&(t in U?Ne(e,U[t]):(Ct('The "position" parameter is not valid, defaulting to "center"'),Ne(e,U.center)))}function wv(e,t){t&&Ne(e,U[`grow-${t}`])}var Qe={innerParams:new WeakMap,domCache:new WeakMap};const bv=["input","file","range","select","radio","checkbox","textarea"],vv=(e,t)=>{const i=Be();if(!i)return;const s=Qe.innerParams.get(e),n=!s||t.input!==s.input;bv.forEach(r=>{const a=ys(i,U[r]);a&&(Tv(r,t.inputAttributes),a.className=U[r],n&&ct(a))}),t.input&&(n&&Ev(t),Sv(t))},Ev=e=>{if(!e.input)return;if(!
|
52
|
+
`.replace(/(^|\n)\s*/g,""),sv=()=>{const e=Tt();return e?(e.remove(),Ai([document.documentElement,document.body],[U["no-backdrop"],U["toast-shown"],U["has-column"]]),!0):!1},Hs=()=>{me.currentInstance.resetValidationMessage()},nv=()=>{const e=Be(),t=ys(e,U.input),i=ys(e,U.file),s=e.querySelector(`.${U.range} input`),n=e.querySelector(`.${U.range} output`),r=ys(e,U.select),a=e.querySelector(`.${U.checkbox} input`),o=ys(e,U.textarea);t.oninput=Hs,i.onchange=Hs,r.onchange=Hs,a.onchange=Hs,o.oninput=Hs,s.oninput=()=>{Hs(),n.value=s.value},s.onchange=()=>{Hs(),n.value=s.value}},rv=e=>typeof e=="string"?document.querySelector(e):e,av=e=>{const t=Be();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ov=e=>{window.getComputedStyle(e).direction==="rtl"&&Ne(Tt(),U.rtl)},lv=e=>{const t=sv();if(If()){Bs("SweetAlert2 requires document to initialize");return}const i=document.createElement("div");i.className=U.container,t&&Ne(i,U["no-transition"]),Ot(i,iv);const s=rv(e.target);s.appendChild(i),av(e),ov(s),nv()},Nc=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?cv(e,t):e&&Ot(t,e)},cv=(e,t)=>{e.jquery?uv(t,e):Ot(t,e.toString())},uv=(e,t)=>{if(e.textContent="",0 in t)for(let i=0;i in t;i++)e.appendChild(t[i].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Us=(()=>{if(If())return!1;const e=document.createElement("div");return typeof e.style.webkitAnimation<"u"?"webkitAnimationEnd":typeof e.style.animation<"u"?"animationend":!1})(),hv=(e,t)=>{const i=Rr(),s=xn();!i||!s||(!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?ct(i):nt(i),Pt(i,t,"actions"),dv(i,s,t),Ot(s,t.loaderHtml||""),Pt(s,t,"loader"))};function dv(e,t,i){const s=Vi(),n=Ds(),r=Sn();!s||!n||!r||(kc(s,"confirm",i),kc(n,"deny",i),kc(r,"cancel",i),fv(s,n,r,i),i.reverseButtons&&(i.toast?(e.insertBefore(r,s),e.insertBefore(n,s)):(e.insertBefore(r,t),e.insertBefore(n,t),e.insertBefore(s,t))))}function fv(e,t,i,s){if(!s.buttonsStyling){Ai([e,t,i],U.styled);return}Ne([e,t,i],U.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,Ne(e,U["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,Ne(t,U["default-outline"])),s.cancelButtonColor&&(i.style.backgroundColor=s.cancelButtonColor,Ne(i,U["default-outline"]))}function kc(e,t,i){const s=Sc(t);Nr(e,i[`show${s}Button`],"inline-block"),Ot(e,i[`${t}ButtonText`]||""),e.setAttribute("aria-label",i[`${t}ButtonAriaLabel`]||""),e.className=U[t],Pt(e,i,`${t}Button`)}const pv=(e,t)=>{const i=Ac();i&&(Ot(i,t.closeButtonHtml||""),Pt(i,t,"closeButton"),Nr(i,t.showCloseButton),i.setAttribute("aria-label",t.closeButtonAriaLabel||""))},mv=(e,t)=>{const i=Tt();i&&(gv(i,t.backdrop),yv(i,t.position),wv(i,t.grow),Pt(i,t,"container"))};function gv(e,t){typeof t=="string"?e.style.background=t:t||Ne([document.documentElement,document.body],U["no-backdrop"])}function yv(e,t){t&&(t in U?Ne(e,U[t]):(Ct('The "position" parameter is not valid, defaulting to "center"'),Ne(e,U.center)))}function wv(e,t){t&&Ne(e,U[`grow-${t}`])}var Qe={innerParams:new WeakMap,domCache:new WeakMap};const bv=["input","file","range","select","radio","checkbox","textarea"],vv=(e,t)=>{const i=Be();if(!i)return;const s=Qe.innerParams.get(e),n=!s||t.input!==s.input;bv.forEach(r=>{const a=ys(i,U[r]);a&&(Tv(r,t.inputAttributes),a.className=U[r],n&&ct(a))}),t.input&&(n&&Ev(t),Sv(t))},Ev=e=>{if(!e.input)return;if(!Ke[e.input]){Bs(`Unexpected type of input! Expected ${Object.keys(Ke).join(" | ")}, got "${e.input}"`);return}const t=_f(e.input);if(!t)return;const i=Ke[e.input](t,e);nt(t),e.inputAutoFocus&&setTimeout(()=>{Ef(i)})},Cv=e=>{for(let t=0;t<e.attributes.length;t++){const i=e.attributes[t].name;["id","type","value","style"].includes(i)||e.removeAttribute(i)}},Tv=(e,t)=>{const i=Be();if(!i)return;const s=Ao(i,e);if(s){Cv(s);for(const n in t)s.setAttribute(n,t[n])}},Sv=e=>{if(!e.input)return;const t=_f(e.input);t&&Pt(t,e,"input")},qc=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},kr=(e,t,i)=>{if(i.inputLabel){const s=document.createElement("label"),n=U["input-label"];s.setAttribute("for",e.id),s.className=n,typeof i.customClass=="object"&&Ne(s,i.customClass.inputLabel),s.innerText=i.inputLabel,t.insertAdjacentElement("beforebegin",s)}},_f=e=>{const t=Be();if(t)return ys(t,U[e]||U.input)},$o=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:Ic(t)||Ct(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ke={};Ke.text=Ke.email=Ke.password=Ke.number=Ke.tel=Ke.url=Ke.search=Ke.date=Ke["datetime-local"]=Ke.time=Ke.week=Ke.month=(e,t)=>($o(e,t.inputValue),kr(e,e,t),qc(e,t),e.type=t.input,e),Ke.file=(e,t)=>(kr(e,e,t),qc(e,t),e),Ke.range=(e,t)=>{const i=e.querySelector("input"),s=e.querySelector("output");return $o(i,t.inputValue),i.type=t.input,$o(s,t.inputValue),kr(i,e,t),e},Ke.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const i=document.createElement("option");Ot(i,t.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,e.appendChild(i)}return kr(e,e,t),e},Ke.radio=e=>(e.textContent="",e),Ke.checkbox=(e,t)=>{const i=Ao(Be(),"checkbox");i.value="1",i.checked=!!t.inputValue;const s=e.querySelector("span");return Ot(s,t.inputPlaceholder||t.inputLabel),i},Ke.textarea=(e,t)=>{$o(e,t.inputValue),qc(e,t),kr(e,e,t);const i=s=>parseInt(window.getComputedStyle(s).marginLeft)+parseInt(window.getComputedStyle(s).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const s=parseInt(window.getComputedStyle(Be()).width),n=()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+i(e);r>s?Be().style.width=`${r}px`:Qs(Be(),"width",t.width)};new MutationObserver(n).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const xv=(e,t)=>{const i=_c();i&&(Mc(i),Pt(i,t,"htmlContainer"),t.html?(Nc(t.html,i),nt(i,"block")):t.text?(i.textContent=t.text,nt(i,"block")):ct(i),vv(e,t))},Iv=(e,t)=>{const i=vf();i&&(Mc(i),Nr(i,t.footer,"block"),t.footer&&Nc(t.footer,i),Pt(i,t,"footer"))},_v=(e,t)=>{const i=Qe.innerParams.get(e),s=Mr();if(s){if(i&&t.icon===i.icon){Af(s,t),Vf(s,t);return}if(!t.icon&&!t.iconHtml){ct(s);return}if(t.icon&&Object.keys(So).indexOf(t.icon)===-1){Bs(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),ct(s);return}nt(s),Af(s,t),Vf(s,t),Ne(s,t.showClass&&t.showClass.icon)}},Vf=(e,t)=>{for(const[i,s]of Object.entries(So))t.icon!==i&&Ai(e,s);Ne(e,t.icon&&So[t.icon]),Lv(e,t),Vv(),Pt(e,t,"icon")},Vv=()=>{const e=Be();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),i=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let s=0;s<i.length;s++)i[s].style.backgroundColor=t},Av=`
|
53
53
|
<div class="swal2-success-circular-line-left"></div>
|
54
54
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
55
55
|
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
@@ -62,7 +62,7 @@
|
|
62
62
|
`,Af=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let i=e.innerHTML,s="";t.iconHtml?s=$f(t.iconHtml):t.icon==="success"?(s=Av,i=i.replace(/ style=".*?"/g,"")):t.icon==="error"?s=$v:t.icon&&(s=$f({question:"?",warning:"!",info:"i"}[t.icon])),i.trim()!==s.trim()&&Ot(e,s)},Lv=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const i of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Tf(e,i,"background-color",t.iconColor);Tf(e,".swal2-success-ring","border-color",t.iconColor)}},$f=e=>`<div class="${U["icon-content"]}">${e}</div>`,Mv=(e,t)=>{const i=bf();if(i){if(!t.imageUrl){ct(i);return}nt(i,""),i.setAttribute("src",t.imageUrl),i.setAttribute("alt",t.imageAlt||""),Qs(i,"width",t.imageWidth),Qs(i,"height",t.imageHeight),i.className=U.image,Pt(i,t,"image")}},Rv=(e,t)=>{const i=Tt(),s=Be();if(!(!i||!s)){if(t.toast){Qs(i,"width",t.width),s.style.width="100%";const n=xn();n&&s.insertBefore(n,Mr())}else Qs(s,"width",t.width);Qs(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),ct(Io()),Nv(s,t)}},Nv=(e,t)=>{const i=t.showClass||{};e.className=`${U.popup} ${St(e)?i.popup:""}`,t.toast?(Ne([document.documentElement,document.body],U["toast-shown"]),Ne(e,U.toast)):Ne(e,U.modal),Pt(e,t,"popup"),typeof t.customClass=="string"&&Ne(e,t.customClass),t.icon&&Ne(e,U[`icon-${t.icon}`])},kv=(e,t)=>{const i=Vc();if(!i)return;const{progressSteps:s,currentProgressStep:n}=t;if(!s||s.length===0||n===void 0){ct(i);return}nt(i),i.textContent="",n>=s.length&&Ct("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((r,a)=>{const o=qv(r);if(i.appendChild(o),a===n&&Ne(o,U["active-progress-step"]),a!==s.length-1){const u=Ov(t);i.appendChild(u)}})},qv=e=>{const t=document.createElement("li");return Ne(t,U["progress-step"]),Ot(t,e),t},Ov=e=>{const t=document.createElement("li");return Ne(t,U["progress-step-line"]),e.progressStepsDistance&&Qs(t,"width",e.progressStepsDistance),t},Pv=(e,t)=>{const i=wf();i&&(Mc(i),Nr(i,t.title||t.titleText,"block"),t.title&&Nc(t.title,i),t.titleText&&(i.innerText=t.titleText),Pt(i,t,"title"))},Lf=(e,t)=>{Rv(e,t),mv(e,t),kv(e,t),_v(e,t),Mv(e,t),Pv(e,t),pv(e,t),xv(e,t),hv(e,t),Iv(e,t);const i=Be();typeof t.didRender=="function"&&i&&t.didRender(i),me.eventEmitter.emit("didRender",i)},Bv=()=>St(Be()),Mf=()=>{var e;return(e=Vi())===null||e===void 0?void 0:e.click()},Dv=()=>{var e;return(e=Ds())===null||e===void 0?void 0:e.click()},Qv=()=>{var e;return(e=Sn())===null||e===void 0?void 0:e.click()},In=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Rf=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Hv=(e,t,i)=>{Rf(e),t.toast||(e.keydownHandler=s=>Fv(t,s,i),e.keydownTarget=t.keydownListenerCapture?window:Be(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Oc=(e,t)=>{var i;const s=$c();if(s.length){e=e+t,e===s.length?e=0:e===-1&&(e=s.length-1),s[e].focus();return}(i=Be())===null||i===void 0||i.focus()},Nf=["ArrowRight","ArrowDown"],Uv=["ArrowLeft","ArrowUp"],Fv=(e,t,i)=>{e&&(t.isComposing||t.keyCode===229||(e.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?Gv(t,e):t.key==="Tab"?jv(t):[...Nf,...Uv].includes(t.key)?Wv(t.key):t.key==="Escape"&&zv(t,e,i)))},Gv=(e,t)=>{if(!xo(t.allowEnterKey))return;const i=Ao(Be(),t.input);if(e.target&&i&&e.target instanceof HTMLElement&&e.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(t.input))return;Mf(),e.preventDefault()}},jv=e=>{const t=e.target,i=$c();let s=-1;for(let n=0;n<i.length;n++)if(t===i[n]){s=n;break}e.shiftKey?Oc(s,-1):Oc(s,1),e.stopPropagation(),e.preventDefault()},Wv=e=>{const t=Rr(),i=Vi(),s=Ds(),n=Sn();if(!t||!i||!s||!n)return;const r=[i,s,n];if(document.activeElement instanceof HTMLElement&&!r.includes(document.activeElement))return;const a=Nf.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let u=0;u<t.children.length;u++){if(o=o[a],!o)return;if(o instanceof HTMLButtonElement&&St(o))break}o instanceof HTMLButtonElement&&o.focus()}},zv=(e,t,i)=>{xo(t.allowEscapeKey)&&(e.preventDefault(),i(In.esc))};var _n={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Kv=()=>{const e=Tt();Array.from(document.body.children).forEach(i=>{i.contains(e)||(i.hasAttribute("aria-hidden")&&i.setAttribute("data-previous-aria-hidden",i.getAttribute("aria-hidden")||""),i.setAttribute("aria-hidden","true"))})},kf=()=>{Array.from(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")||""),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},qf=typeof window<"u"&&!!window.GestureEvent,Yv=()=>{if(qf&&!Zi(document.body,U.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,Ne(document.body,U.iosfix),Xv()}},Xv=()=>{const e=Tt();if(!e)return;let t;e.ontouchstart=i=>{t=Zv(i)},e.ontouchmove=i=>{t&&(i.preventDefault(),i.stopPropagation())}},Zv=e=>{const t=e.target,i=Tt(),s=_c();return!i||!s||Jv(e)||eE(e)?!1:t===i||!Sf(i)&&t instanceof HTMLElement&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(Sf(s)&&s.contains(t))},Jv=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",eE=e=>e.touches&&e.touches.length>1,tE=()=>{if(Zi(document.body,U.iosfix)){const e=parseInt(document.body.style.top,10);Ai(document.body,U.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},iE=()=>{const e=document.createElement("div");e.className=U["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Vn=null;const sE=e=>{Vn===null&&(document.body.scrollHeight>window.innerHeight||e==="scroll")&&(Vn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Vn+iE()}px`)},nE=()=>{Vn!==null&&(document.body.style.paddingRight=`${Vn}px`,Vn=null)};function Of(e,t,i,s){Vo()?Bf(e,s):(Wb(i).then(()=>Bf(e,s)),Rf(me)),qf?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),Lc()&&(nE(),tE(),kf()),rE()}function rE(){Ai([document.documentElement,document.body],[U.shown,U["height-auto"],U["no-backdrop"],U["toast-shown"]])}function ws(e){e=oE(e);const t=_n.swalPromiseResolve.get(this),i=aE(this);this.isAwaitingPromise?e.isDismissed||(qr(this),t(e)):i&&t(e)}const aE=e=>{const t=Be();if(!t)return!1;const i=Qe.innerParams.get(e);if(!i||Zi(t,i.hideClass.popup))return!1;Ai(t,i.showClass.popup),Ne(t,i.hideClass.popup);const s=Tt();return Ai(s,i.showClass.backdrop),Ne(s,i.hideClass.backdrop),lE(e,t,i),!0};function Pf(e){const t=_n.swalPromiseReject.get(this);qr(this),t&&t(e)}const qr=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,Qe.innerParams.get(e)||e._destroy())},oE=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),lE=(e,t,i)=>{const s=Tt(),n=Us&&xf(t);typeof i.willClose=="function"&&i.willClose(t),me.eventEmitter.emit("willClose",t),n?cE(e,t,s,i.returnFocus,i.didClose):Of(e,s,i.returnFocus,i.didClose)},cE=(e,t,i,s,n)=>{Us&&(me.swalCloseEventFinishedCallback=Of.bind(null,e,i,s,n),t.addEventListener(Us,function(r){r.target===t&&(me.swalCloseEventFinishedCallback(),delete me.swalCloseEventFinishedCallback)}))},Bf=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),me.eventEmitter.emit("didClose"),e._destroy&&e._destroy()})},An=e=>{let t=Be();if(t||new Or,t=Be(),!t)return;const i=xn();Vo()?ct(Mr()):uE(t,e),nt(i),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},uE=(e,t)=>{const i=Rr(),s=xn();!i||!s||(!t&&St(Vi())&&(t=Vi()),nt(i),t&&(ct(t),s.setAttribute("data-button-to-replace",t.className),i.insertBefore(s,t)),Ne([e,i],U.loading))},hE=(e,t)=>{t.input==="select"||t.input==="radio"?gE(e,t):["text","email","number","tel","textarea"].some(i=>i===t.input)&&(xc(t.inputValue)||Ic(t.inputValue))&&(An(Vi()),yE(e,t))},dE=(e,t)=>{const i=e.getInput();if(!i)return null;switch(t.input){case"checkbox":return fE(i);case"radio":return pE(i);case"file":return mE(i);default:return t.inputAutoTrim?i.value.trim():i.value}},fE=e=>e.checked?1:0,pE=e=>e.checked?e.value:null,mE=e=>e.files&&e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,gE=(e,t)=>{const i=Be();if(!i)return;const s=n=>{t.input==="select"?wE(i,Lo(n),t):t.input==="radio"&&bE(i,Lo(n),t)};xc(t.inputOptions)||Ic(t.inputOptions)?(An(Vi()),$r(t.inputOptions).then(n=>{e.hideLoading(),s(n)})):typeof t.inputOptions=="object"?s(t.inputOptions):Bs(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`)},yE=(e,t)=>{const i=e.getInput();i&&(ct(i),$r(t.inputValue).then(s=>{i.value=t.input==="number"?`${parseFloat(s)||0}`:`${s}`,nt(i),i.focus(),e.hideLoading()}).catch(s=>{Bs(`Error in inputValue promise: ${s}`),i.value="",nt(i),i.focus(),e.hideLoading()}))};function wE(e,t,i){const s=ys(e,U.select);if(!s)return;const n=(r,a,o)=>{const u=document.createElement("option");u.value=o,Ot(u,a),u.selected=Df(o,i.inputValue),r.appendChild(u)};t.forEach(r=>{const a=r[0],o=r[1];if(Array.isArray(o)){const u=document.createElement("optgroup");u.label=a,u.disabled=!1,s.appendChild(u),o.forEach(d=>n(u,d[1],d[0]))}else n(s,o,a)}),s.focus()}function bE(e,t,i){const s=ys(e,U.radio);if(!s)return;t.forEach(r=>{const a=r[0],o=r[1],u=document.createElement("input"),d=document.createElement("label");u.type="radio",u.name=U.radio,u.value=a,Df(a,i.inputValue)&&(u.checked=!0);const f=document.createElement("span");Ot(f,o),f.className=U.label,d.appendChild(u),d.appendChild(f),s.appendChild(d)});const n=s.querySelectorAll("input");n.length&&n[0].focus()}const Lo=e=>{const t=[];return e instanceof Map?e.forEach((i,s)=>{let n=i;typeof n=="object"&&(n=Lo(n)),t.push([s,n])}):Object.keys(e).forEach(i=>{let s=e[i];typeof s=="object"&&(s=Lo(s)),t.push([i,s])}),t},Df=(e,t)=>!!t&&t.toString()===e.toString(),vE=e=>{const t=Qe.innerParams.get(e);e.disableButtons(),t.input?Qf(e,"confirm"):Bc(e,!0)},EE=e=>{const t=Qe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Qf(e,"deny"):Pc(e,!1)},CE=(e,t)=>{e.disableButtons(),t(In.cancel)},Qf=(e,t)=>{const i=Qe.innerParams.get(e);if(!i.input){Bs(`The "input" parameter is needed to be set when using returnInputValueOn${Sc(t)}`);return}const s=e.getInput(),n=dE(e,i);i.inputValidator?TE(e,n,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(i.validationMessage||s.validationMessage)):t==="deny"?Pc(e,n):Bc(e,n)},TE=(e,t,i)=>{const s=Qe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>$r(s.inputValidator(t,s.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):i==="deny"?Pc(e,t):Bc(e,t)})},Pc=(e,t)=>{const i=Qe.innerParams.get(e||void 0);i.showLoaderOnDeny&&An(Ds()),i.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>$r(i.preDeny(t,i.validationMessage))).then(n=>{n===!1?(e.hideLoading(),qr(e)):e.close({isDenied:!0,value:typeof n>"u"?t:n})}).catch(n=>Uf(e||void 0,n))):e.close({isDenied:!0,value:t})},Hf=(e,t)=>{e.close({isConfirmed:!0,value:t})},Uf=(e,t)=>{e.rejectPromise(t)},Bc=(e,t)=>{const i=Qe.innerParams.get(e||void 0);i.showLoaderOnConfirm&&An(),i.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>$r(i.preConfirm(t,i.validationMessage))).then(n=>{St(Io())||n===!1?(e.hideLoading(),qr(e)):Hf(e,typeof n>"u"?t:n)}).catch(n=>Uf(e||void 0,n))):Hf(e,t)};function Mo(){const e=Qe.innerParams.get(this);if(!e)return;const t=Qe.domCache.get(this);ct(t.loader),Vo()?e.icon&&nt(Mr()):SE(t),Ai([t.popup,t.actions],U.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const SE=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?nt(t[0],"inline-block"):ev()&&ct(e.actions)};function Ff(){const e=Qe.innerParams.get(this),t=Qe.domCache.get(this);return t?Ao(t.popup,e.input):null}function Gf(e,t,i){const s=Qe.domCache.get(e);t.forEach(n=>{s[n].disabled=i})}function jf(e,t){const i=Be();if(!(!i||!e))if(e.type==="radio"){const s=i.querySelectorAll(`[name="${U.radio}"]`);for(let n=0;n<s.length;n++)s[n].disabled=t}else e.disabled=t}function Wf(){Gf(this,["confirmButton","denyButton","cancelButton"],!1)}function zf(){Gf(this,["confirmButton","denyButton","cancelButton"],!0)}function Kf(){jf(this.getInput(),!1)}function Yf(){jf(this.getInput(),!0)}function Xf(e){const t=Qe.domCache.get(this),i=Qe.innerParams.get(this);Ot(t.validationMessage,e),t.validationMessage.className=U["validation-message"],i.customClass&&i.customClass.validationMessage&&Ne(t.validationMessage,i.customClass.validationMessage),nt(t.validationMessage);const s=this.getInput();s&&(s.setAttribute("aria-invalid","true"),s.setAttribute("aria-describedby",U["validation-message"]),Ef(s),Ne(s,U.inputerror))}function Zf(){const e=Qe.domCache.get(this);e.validationMessage&&ct(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),Ai(t,U.inputerror))}const $n={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},xE=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],IE={allowEnterKey:void 0},_E=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Jf=e=>Object.prototype.hasOwnProperty.call($n,e),ep=e=>xE.indexOf(e)!==-1,tp=e=>IE[e],VE=e=>{Jf(e)||Ct(`Unknown parameter "${e}"`)},AE=e=>{_E.includes(e)&&Ct(`The parameter "${e}" is incompatible with toasts`)},$E=e=>{const t=tp(e);t&&yf(e,t)},LE=e=>{e.backdrop===!1&&e.allowOutsideClick&&Ct('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)VE(t),e.toast&&AE(t),$E(t)};function ip(e){const t=Be(),i=Qe.innerParams.get(this);if(!t||Zi(t,i.hideClass.popup)){Ct("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");return}const s=ME(e),n=Object.assign({},i,s);Lf(this,n),Qe.innerParams.set(this,n),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const ME=e=>{const t={};return Object.keys(e).forEach(i=>{ep(i)?t[i]=e[i]:Ct(`Invalid parameter to update: ${i}`)}),t};function sp(){const e=Qe.domCache.get(this),t=Qe.innerParams.get(this);if(!t){np(this);return}e.popup&&me.swalCloseEventFinishedCallback&&(me.swalCloseEventFinishedCallback(),delete me.swalCloseEventFinishedCallback),typeof t.didDestroy=="function"&&t.didDestroy(),me.eventEmitter.emit("didDestroy"),RE(this)}const RE=e=>{np(e),delete e.params,delete me.keydownHandler,delete me.keydownTarget,delete me.currentInstance},np=e=>{e.isAwaitingPromise?(Dc(Qe,e),e.isAwaitingPromise=!0):(Dc(_n,e),Dc(Qe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Dc=(e,t)=>{for(const i in e)e[i].delete(t)};var NE=Object.freeze({__proto__:null,_destroy:sp,close:ws,closeModal:ws,closePopup:ws,closeToast:ws,disableButtons:zf,disableInput:Yf,disableLoading:Mo,enableButtons:Wf,enableInput:Kf,getInput:Ff,handleAwaitingPromise:qr,hideLoading:Mo,rejectPromise:Pf,resetValidationMessage:Zf,showValidationMessage:Xf,update:ip});const kE=(e,t,i)=>{e.toast?qE(e,t,i):(PE(t),BE(t),DE(e,t,i))},qE=(e,t,i)=>{t.popup.onclick=()=>{e&&(OE(e)||e.timer||e.input)||i(In.close)}},OE=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Ro=!1;const PE=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Ro=!0)}}},BE=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(i){e.popup.onmouseup=()=>{},(i.target===e.popup||i.target instanceof HTMLElement&&e.popup.contains(i.target))&&(Ro=!0)}}},DE=(e,t,i)=>{t.container.onclick=s=>{if(Ro){Ro=!1;return}s.target===t.container&&xo(e.allowOutsideClick)&&i(In.backdrop)}},QE=e=>typeof e=="object"&&e.jquery,rp=e=>e instanceof Element||QE(e),HE=e=>{const t={};return typeof e[0]=="object"&&!rp(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((i,s)=>{const n=e[s];typeof n=="string"||rp(n)?t[i]=n:n!==void 0&&Bs(`Unexpected type of ${i}! Expected "string" or "Element", got ${typeof n}`)}),t};function UE(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new this(...t)}function FE(e){class t extends this{_main(s,n){return super._main(s,Object.assign({},e,n))}}return t}const GE=()=>me.timeout&&me.timeout.getTimerLeft(),ap=()=>{if(me.timeout)return tv(),me.timeout.stop()},op=()=>{if(me.timeout){const e=me.timeout.start();return Rc(e),e}},jE=()=>{const e=me.timeout;return e&&(e.running?ap():op())},WE=e=>{if(me.timeout){const t=me.timeout.increase(e);return Rc(t,!0),t}},zE=()=>!!(me.timeout&&me.timeout.isRunning());let lp=!1;const Qc={};function KE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";Qc[e]=this,lp||(document.body.addEventListener("click",YE),lp=!0)}const YE=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const i in Qc){const s=t.getAttribute(i);if(s){Qc[i].fire({template:s});return}}};let XE=class{constructor(){this.events={}}_getHandlersByEventName(t){return typeof this.events[t]>"u"&&(this.events[t]=[]),this.events[t]}on(t,i){const s=this._getHandlersByEventName(t);s.includes(i)||s.push(i)}once(t,i){var s=this;const n=function(){s.removeListener(t,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];i.apply(s,a)};this.on(t,n)}emit(t){for(var i=arguments.length,s=new Array(i>1?i-1:0),n=1;n<i;n++)s[n-1]=arguments[n];this._getHandlersByEventName(t).forEach(r=>{try{r.apply(this,s)}catch(a){console.error(a)}})}removeListener(t,i){const s=this._getHandlersByEventName(t),n=s.indexOf(i);n>-1&&s.splice(n,1)}removeAllListeners(t){this.events[t]!==void 0&&(this.events[t].length=0)}reset(){this.events={}}};me.eventEmitter=new XE;var ZE=Object.freeze({__proto__:null,argsToParams:HE,bindClickHandler:KE,clickCancel:Qv,clickConfirm:Mf,clickDeny:Dv,enableLoading:An,fire:UE,getActions:Rr,getCancelButton:Sn,getCloseButton:Ac,getConfirmButton:Vi,getContainer:Tt,getDenyButton:Ds,getFocusableElements:$c,getFooter:vf,getHtmlContainer:_c,getIcon:Mr,getIconContent:Kb,getImage:bf,getInputLabel:Yb,getLoader:xn,getPopup:Be,getProgressSteps:Vc,getTimerLeft:GE,getTimerProgressBar:_o,getTitle:wf,getValidationMessage:Io,increaseTimer:WE,isDeprecatedParameter:tp,isLoading:Zb,isTimerRunning:zE,isUpdatableParameter:ep,isValidParameter:Jf,isVisible:Bv,mixin:FE,off:(e,t)=>{if(!e){me.eventEmitter.reset();return}t?me.eventEmitter.removeListener(e,t):me.eventEmitter.removeAllListeners(e)},on:(e,t)=>{me.eventEmitter.on(e,t)},once:(e,t)=>{me.eventEmitter.once(e,t)},resumeTimer:op,showLoading:An,stopTimer:ap,toggleTimer:jE});class JE{constructor(t,i){this.callback=t,this.remaining=i,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const i=this.running;return i&&this.stop(),this.remaining+=t,i&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const cp=["swal-title","swal-html","swal-footer"],eC=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const i=t.content;return lC(i),Object.assign(tC(i),iC(i),sC(i),nC(i),rC(i),aC(i),oC(i,cp))},tC=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(s=>{Fs(s,["name","value"]);const n=s.getAttribute("name"),r=s.getAttribute("value");!n||!r||(typeof $n[n]=="boolean"?t[n]=r!=="false":typeof $n[n]=="object"?t[n]=JSON.parse(r):t[n]=r)}),t},iC=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(s=>{const n=s.getAttribute("name"),r=s.getAttribute("value");!n||!r||(t[n]=new Function(`return ${r}`)())}),t},sC=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(s=>{Fs(s,["type","color","aria-label"]);const n=s.getAttribute("type");!n||!["confirm","cancel","deny"].includes(n)||(t[`${n}ButtonText`]=s.innerHTML,t[`show${Sc(n)}Button`]=!0,s.hasAttribute("color")&&(t[`${n}ButtonColor`]=s.getAttribute("color")),s.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=s.getAttribute("aria-label")))}),t},nC=e=>{const t={},i=e.querySelector("swal-image");return i&&(Fs(i,["src","width","height","alt"]),i.hasAttribute("src")&&(t.imageUrl=i.getAttribute("src")||void 0),i.hasAttribute("width")&&(t.imageWidth=i.getAttribute("width")||void 0),i.hasAttribute("height")&&(t.imageHeight=i.getAttribute("height")||void 0),i.hasAttribute("alt")&&(t.imageAlt=i.getAttribute("alt")||void 0)),t},rC=e=>{const t={},i=e.querySelector("swal-icon");return i&&(Fs(i,["type","color"]),i.hasAttribute("type")&&(t.icon=i.getAttribute("type")),i.hasAttribute("color")&&(t.iconColor=i.getAttribute("color")),t.iconHtml=i.innerHTML),t},aC=e=>{const t={},i=e.querySelector("swal-input");i&&(Fs(i,["type","label","placeholder","value"]),t.input=i.getAttribute("type")||"text",i.hasAttribute("label")&&(t.inputLabel=i.getAttribute("label")),i.hasAttribute("placeholder")&&(t.inputPlaceholder=i.getAttribute("placeholder")),i.hasAttribute("value")&&(t.inputValue=i.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach(n=>{Fs(n,["value"]);const r=n.getAttribute("value");if(!r)return;const a=n.innerHTML;t.inputOptions[r]=a})),t},oC=(e,t)=>{const i={};for(const s in t){const n=t[s],r=e.querySelector(n);r&&(Fs(r,[]),i[n.replace(/^swal-/,"")]=r.innerHTML.trim())}return i},lC=e=>{const t=cp.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(i=>{const s=i.tagName.toLowerCase();t.includes(s)||Ct(`Unrecognized element <${s}>`)})},Fs=(e,t)=>{Array.from(e.attributes).forEach(i=>{t.indexOf(i.name)===-1&&Ct([`Unrecognized attribute "${i.name}" on <${e.tagName.toLowerCase()}>.`,`${t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."}`])})},up=10,cC=e=>{const t=Tt(),i=Be();typeof e.willOpen=="function"&&e.willOpen(i),me.eventEmitter.emit("willOpen",i);const n=window.getComputedStyle(document.body).overflowY;dC(t,i,e),setTimeout(()=>{uC(t,i)},up),Lc()&&(hC(t,e.scrollbarPadding,n),Kv()),!Vo()&&!me.previousActiveElement&&(me.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(i)),me.eventEmitter.emit("didOpen",i),Ai(t,U["no-transition"])},hp=e=>{const t=Be();if(e.target!==t||!Us)return;const i=Tt();t.removeEventListener(Us,hp),i.style.overflowY="auto"},uC=(e,t)=>{Us&&xf(t)?(e.style.overflowY="hidden",t.addEventListener(Us,hp)):e.style.overflowY="auto"},hC=(e,t,i)=>{Yv(),t&&i!=="hidden"&&sE(i),setTimeout(()=>{e.scrollTop=0})},dC=(e,t,i)=>{Ne(e,i.showClass.backdrop),i.animation?(t.style.setProperty("opacity","0","important"),nt(t,"grid"),setTimeout(()=>{Ne(t,i.showClass.popup),t.style.removeProperty("opacity")},up)):nt(t,"grid"),Ne([document.documentElement,document.body],U.shown),i.heightAuto&&i.backdrop&&!i.toast&&Ne([document.documentElement,document.body],U["height-auto"])};var dp={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function fC(e){e.inputValidator||(e.input==="email"&&(e.inputValidator=dp.email),e.input==="url"&&(e.inputValidator=dp.url))}function pC(e){(!e.target||typeof e.target=="string"&&!document.querySelector(e.target)||typeof e.target!="string"&&!e.target.appendChild)&&(Ct('Target parameter is not valid, defaulting to "body"'),e.target="body")}function mC(e){fC(e),e.showLoaderOnConfirm&&!e.preConfirm&&Ct(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
63
63
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
64
64
|
https://sweetalert2.github.io/#ajax-request`),pC(e),typeof e.title=="string"&&(e.title=e.title.split(`
|
65
|
-
`).join("<br />")),lv(e)}let $i;var No=new WeakMap;class Ke{constructor(){if(Ub(this,No,void 0),typeof window>"u")return;$i=this;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Object.freeze(this.constructor.argsToParams(i));this.params=n,this.isAwaitingPromise=!1,Fb(No,this,this._main($i.params))}_main(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(LE(Object.assign({},i,t)),me.currentInstance){const r=_n.swalPromiseResolve.get(me.currentInstance),{isAwaitingPromise:a}=me.currentInstance;me.currentInstance._destroy(),a||r({isDismissed:!0}),Lc()&&kf()}me.currentInstance=$i;const s=yC(t,i);mC(s),Object.freeze(s),me.timeout&&(me.timeout.stop(),delete me.timeout),clearTimeout(me.restoreFocusTimeout);const n=wC($i);return Lf($i,s),Qe.innerParams.set($i,s),gC($i,n,s)}then(t){return ff(No,this).then(t)}finally(t){return ff(No,this).finally(t)}}const gC=(e,t,i)=>new Promise((s,n)=>{const r=a=>{e.close({isDismissed:!0,dismiss:a})};_n.swalPromiseResolve.set(e,s),_n.swalPromiseReject.set(e,n),t.confirmButton.onclick=()=>{vE(e)},t.denyButton.onclick=()=>{EE(e)},t.cancelButton.onclick=()=>{CE(e,r)},t.closeButton.onclick=()=>{r(In.close)},kE(i,t,r),Hv(me,i,r),hE(e,i),cC(i),bC(me,i,r),vC(t,i),setTimeout(()=>{t.container.scrollTop=0})}),yC=(e,t)=>{const i=eC(e),s=Object.assign({},$n,t,i,e);return s.showClass=Object.assign({},$n.showClass,s.showClass),s.hideClass=Object.assign({},$n.hideClass,s.hideClass),s.animation===!1&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wC=e=>{const t={popup:Be(),container:Tt(),actions:Rr(),confirmButton:Vi(),denyButton:Ds(),cancelButton:Sn(),loader:xn(),closeButton:Ac(),validationMessage:Io(),progressSteps:Vc()};return Qe.domCache.set(e,t),t},bC=(e,t,i)=>{const s=_o();ct(s),t.timer&&(e.timeout=new JE(()=>{i("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(nt(s),Pt(s,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&Rc(t.timer)})))},vC=(e,t)=>{if(!t.toast){if(!xo(t.allowEnterKey)){yf("allowEnterKey"),TC();return}EC(e)||CC(e,t)||Oc(-1,1)}},EC=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const i of t)if(i instanceof HTMLElement&&St(i))return i.focus(),!0;return!1},CC=(e,t)=>t.focusDeny&&St(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&St(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&St(e.confirmButton)?(e.confirmButton.focus(),!0):!1,TC=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};if(typeof window<"u"&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/(1e3*60*60*24)>3&&setTimeout(()=>{document.body.style.pointerEvents="none";const i=document.createElement("audio");i.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",i.loop=!0,document.body.appendChild(i),setTimeout(()=>{i.play().catch(()=>{})},2500)},500):localStorage.setItem("swal-initiation",`${e}`)}Ke.prototype.disableButtons=zf,Ke.prototype.enableButtons=Wf,Ke.prototype.getInput=Ff,Ke.prototype.disableInput=Yf,Ke.prototype.enableInput=Kf,Ke.prototype.hideLoading=Mo,Ke.prototype.disableLoading=Mo,Ke.prototype.showValidationMessage=Xf,Ke.prototype.resetValidationMessage=Zf,Ke.prototype.close=ws,Ke.prototype.closePopup=ws,Ke.prototype.closeModal=ws,Ke.prototype.closeToast=ws,Ke.prototype.rejectPromise=Pf,Ke.prototype.update=ip,Ke.prototype._destroy=sp,Object.assign(Ke,ZE),Object.keys(NE).forEach(e=>{Ke[e]=function(){return $i&&$i[e]?$i[e](...arguments):null}}),Ke.DismissReason=In,Ke.version="11.14.0";const Or=Ke;Or.default=Or,typeof document<"u"&&function(e,t){var i=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=t);else try{i.innerHTML=t}catch{i.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}');class c extends Error{constructor(t){super(t),this.name="QtiValidationException"}}class se extends Error{constructor(t){super(t),this.name="QtiParseException"}}class F{QTI_BASE_TYPES(){return["boolean","directedPair","duration","file","float","identifier","integer","pair","point","string","uri"]}QTI_CARDINALITIES(){return["single","multiple","ordered","record"]}QTI_MATH_OPERATORS(){return["abs","acos","acot","acsc","asec","asin","atan","atan2","ceil","cos","cosh","cot","coth","csc","csch","exp","floor","ln","log","sec","sech","signum","sin","sinh","tan","tanh","toDegrees","toRadians"]}QTI_MATH_CONSTANTS(){return["pi","e"]}QTI_STATS_OPERATORS(){return["mean","sampleVariance","sampleSD","popVariance","popSD"]}QTI_RUBRICBLOCK_VIEWS(){return["author","candidate","proctor","scorer","testConstructor","tutor"]}constructor(){}validateBaseType(t){if(!this.QTI_BASE_TYPES().includes(t))throw new c('Invalid base-type: "'+t+'".')}validateCardinality(t){if(!this.QTI_CARDINALITIES().includes(t))throw new c('Invalid cardinality: "'+t+'".')}validateBaseTypeAndCardinality(t,i){if(i&&typeof t<"u")throw new c('base-type not permitted for "record" cardinality.');if(!i&&typeof t>"u")throw new c("base-type is a required attribute.");!i&&typeof t<"u"&&this.validateBaseType(t)}validateFieldIdentifierAndCardinality(t,i){if(i&&typeof t>"u")throw new c("field-identifier is required for record cardinality.");if(!i&&typeof t<"u")throw new c("field-identifier only permitted for record cardinality.")}validatePositiveIntegerAttribute(t,i,s){let n=/^\d+$/,r;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return}if(n.test(i))r=this.IntegerValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');if(r<0)throw new c("Invalid "+t+" attribute. Must be greater than or equal to 0");return r}validateIntegerAttribute(t,i,s,n){let r=/^-?\d+$/,a;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return n}if(r.test(i))a=this.IntegerValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');return a}validateIdentifierAttribute(t){if(t!=null&&t.length!=t.trim().length)throw new c('Invalid identifier "'+t+'". Whitespace not permitted.');if(t==null||t.length==0)throw new c('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new c('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new c('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.")}validateFloatAttribute(t,i,s,n){let r=/^[-+]?([0-9]*\.[0-9]+|[0-9]+)$/,a;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return n}if(r.test(i))a=this.FloatValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');return a}validateResponseIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getResponseDeclaration(i);if(typeof s>"u")throw new c('No response declaration found for response-identifier: "'+i+'"');return s}validateOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s>"u")throw new c('No outcome declaration found for identifier: "'+i+'"');return s}validateTemplateIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getTemplateDeclaration(i);if(typeof s>"u")throw new c('No template declaration found for identifier: "'+i+'"');return s}validateTemplateOrOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getTemplateDeclaration(i);if(typeof s<"u"||(s=t.getOutcomeDeclaration(i),typeof s<"u"))return s;throw new c('No outcome or template declaration found for identifier: "'+i+'"')}validateVariableIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s<"u"||(s=t.getResponseDeclaration(i),typeof s<"u")||(s=t.getContextDeclaration(i),typeof s<"u")||(s=t.getTemplateDeclaration(i),typeof s<"u"))return s;throw new c('No declaration found for identifier: "'+i+'"')}validatePrintedVariableIdentifierAttribute(t,i){if(typeof i>"u")throw new c('Attribute "identifier" is undefined');this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s<"u"||(s=t.getTemplateDeclaration(i),typeof s<"u")||(s=t.getContextDeclaration(i),typeof s<"u"))return s;throw new c('No declaration found for identifier: "'+i+'"')}validateMaxMinChoices(t,i){let s=this.validatePositiveIntegerAttribute("max-choices",t),n=this.validatePositiveIntegerAttribute("min-choices",i);if(s>0&&n>s)throw new c('Invalid min-choices attribute "'+i+'". Must be less than or equal to max-choices attribute when max-choices attribute is greater than 0')}validateMaxMinStrings(t,i){let s=this.validatePositiveIntegerAttribute("max-strings",t),n=this.validatePositiveIntegerAttribute("min-strings",i);if(s>0&&n>s)throw new c('Invalid min-strings attribute "'+i+'". Must be less than or equal to max-strings attribute when max-strings attribute is greater than 0')}validateMaxMinPlays(t,i){let s=this.validatePositiveIntegerAttribute("max-plays",t),n=this.validatePositiveIntegerAttribute("min-plays",i);if(s>0&&n>s)throw new c('Invalid min-plays attribute "'+i+'". Must be less than or equal to max-plays attribute when max-plays attribute is greater than 0')}validatePattern(t,i){if(typeof i>"u")return null;if(i==null||i.length==0)throw new se("Invalid "+t+' "'+i+'". Length is not valid.');let s=i.trim();if(s.length==0)throw new se("Invalid "+t+' "'+i+'".');s=s.startsWith("^")?s.substring(1):s,s=s.endsWith("$")?s.substring(0,s.length-1):s,s=s.replaceAll("/","\\/");try{return new RegExp("^"+s+"$")}catch{throw new se("Unable to parse "+t+': "'+i+'""')}}validatePlaceholderText(t,i){return typeof t<"u"?t:i}validatePatternmaskMessage(t,i){return typeof t<"u"?t:i}validateCaseSensitive(t,i){if(typeof t>"u"){if(i)throw new c('Attribute "case-sensitive" is a required attribute');return!1}if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new c("Invalid case-sensitive attribute. Must be a Boolean value.")}validateIncludeBoundary(t,i){if(typeof t>"u"||t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new c("Invalid "+i+" attribute. Must be a Boolean value.")}validateValueFromBaseType(t,i){let s=null;try{switch(t){case"string":if(i===null||i.length===0)throw new se('Null string "'+i+'".');s=i;break;case"identifier":this.validateIdentifierAttribute(i),s=i;break;case"integer":s=this.IntegerValue(i);break;case"float":s=this.FloatValue(i);break;case"duration":s=this.DurationValue(i);break;default:throw new se('[Unhandled Attribute Value BaseType]: "'+t+'"')}}catch(n){if(n.name==="QtiValidationException")throw new c(n.message);if(n.name==="QtiParseException")throw new se(n.message)}return s}validateShowHideAttribute(t){if(typeof t>"u"||t==="show")return!0;if(t==="hide")return!1;throw new c('Invalid show-hide attribute: "'+t+'" Value must be "show" or "hide".')}validateShapeAttribute(t){if(typeof t>"u")return"";if(t==="circle")return"circle";if(t==="rect")return"rect";if(t==="poly")return"poly";if(t==="default")return"default";if(t==="ellipse")return"ellipse";throw new c('Invalid shape attribute: "'+t+'" Value must be "circle", "rect", "poly", "default", or "ellipse".')}validateToleranceModeAttribute(t){if(typeof t>"u")return!0;if(t==="exact")return"exact";if(t==="absolute")return"absoluate";if(t==="relative")return"relative";throw new c('Invalid tolerance-mode attribute: "'+t+'" Value must be "exact", "absolute", or "relative".')}validateRoundingModeAttribute(t){if(typeof t>"u")return!0;if(t==="decimalPlaces")return"decimalPlaces";if(t==="significantFigures")return"significantFigures";throw new c('Invalid rounding-mode attribute: "'+t+'" Value must be "decimalPlaces" or "significantFigures".')}validateMathOperatorNameAttribute(t){if(this.QTI_MATH_OPERATORS().includes(t))return!0;throw new c('Unsupported qti-math-operator "name" attribute: "'+t+'".')}validateMathConstantNameAttribute(t){if(this.QTI_MATH_CONSTANTS().includes(t))return!0;throw new c('Unsupported qti-math-constant "name" attribute: "'+t+'".')}validateStatsOperatorNameAttribute(t){if(this.QTI_STATS_OPERATORS().includes(t))return!0;throw new c('Unsupported qti-stats-operator "name" attribute: "'+t+'".')}validateToleranceAttribute(t){if(t===null||t.length===0)return[];const i=t.split(" ");if(i.length===0)throw new c('Unable to parse tolerance attribute: "'+t+'"');if(i.length<3)try{if(i.length===1){const s=new j(this.FloatValue(i[0]));if(s.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+s.valueOf()+'" cannot be negative.');return[s,s]}else if(i.length===2){const s=new j(this.FloatValue(i[0]));if(s.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+s.valueOf()+'" cannot be negative.');const n=new j(this.FloatValue(i[1]));if(n.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+n.valueOf()+'" cannot be negative.');return[s,n]}}catch(s){if(s.name==="QtiValidationException")throw new c(s.message);if(s.name==="QtiParseException")throw new se(s.message)}else if(i.length>=3)throw new c('Invalid tolerance attribute: "'+t+'". Value must contain 1 or 2 tolerances.')}validateRubricBlockViewAttribute(t){if(!this.QTI_RUBRICBLOCK_VIEWS().includes(t))throw new c('Invalid view attribute: "'+t+'".')}parseXmlLangAttribute(t){return typeof t>"u"?null:t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new se('Invalid integer "'+t+'". ');return i}catch(i){throw new se(i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new se('Invalid float "'+t+'". ');return i}catch(i){throw new se(i.message)}}DurationValue(t){try{let i=new j(t);if(i.isZero()&&i.isNegative()&&(i=new j(0)),i.comparedTo(0)<0)throw new se('Invalid duration "'+i+'". Duration cannot be negative.');return i.toNumber()}catch(i){throw new se(i.message)}}randomString(t,i){i=i&&i.toLowerCase();let s="";const n=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let o=Math.random()*(r-n)+n<<0;s+=String.fromCharCode(o+=o>9?o<36?55:61:48)}return s}kebabCase(t){return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}isValidSlot(t){if(typeof t.type.name<"u")return!0;if(typeof t.type=="symbol"&&t.children.trim().length>0){if(t.type.toString()==="Symbol(v-cmt)")return!1;throw new c('Invalid Child Node: "'+t.children.trim()+'"')}return!1}}class SC{constructor(t){te(this,"constants",{keys:{ENTER:13,SPACE:32}});return this.audioElement=t,this.isPaused=!0,this.onPlayPauseClick=this.playPauseClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onEnded=this.endedHandler.bind(this),this}create(){return this.createAudioTemplate(this.isNestedAmpAudioElement(this.audioElement)),this}isNestedAmpAudioElement(t){return t.parentNode.classList.contains("amp-audio__holder")}createAudioTemplate(t){this.outerWrapper=t?this.createNestedAmpAudioWrapper(this.audioElement):this.createAudioWrapper(this.audioElement),this.playerContainer=this.createPlayerContainer(),this.outerWrapper.appendChild(this.playerContainer),this.addListeners()}createNestedAmpAudioWrapper(t){const i=t.parentNode.parentNode;i.classList.add("cat-audio__wrapper");const s=i.querySelector(".amp-audio-captions__container");s!=null&&s.remove();const n=i.querySelector(".amp-audio__container");return n!=null&&n.remove(),i}createAudioWrapper(t){const i=document.createElement("div");i.classList.add("cat-audio__wrapper");const s=document.createElement("div");return s.classList.add("cat-audio__holder"),t.parentNode.appendChild(i),t.setAttribute("tabindex","-1"),i.appendChild(s),s.appendChild(t),i}createPlayerContainer(){const t=document.createElement("div");return t.classList.add("cat-audio__container"),t.appendChild(this.createPlayPauseButton()),t}createPlayPauseButton(){const t=document.createElement("button");return t.classList.add("cat-audio-playpause__container"),t.classList.add("play"),t.setAttribute("tabindex","0"),t}addListeners(){this.playButton=this.playerContainer.querySelector(".cat-audio-playpause__container"),this.playButton.addEventListener("click",this.onPlayPauseClick),this.playButton.addEventListener("keydown",this.onKeyDown),this.audioElement.addEventListener("ended",this.onEnded)}removeListeners(){this.playButton.removeEventListener("click",this.onPlayPauseClick),this.playButton.removeEventListener("keydown",this.onKeyDown),this.audioElement.removeEventListener("ended",this.onEnded)}playPauseClickHandler(){this.toggleAudio()}keydownHandler(t){let i=!1;switch(t.keyCode){case this.constants.keys.SPACE:case this.constants.keys.ENTER:this.toggleAudio(),i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}endedHandler(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0}toggleAudio(){this.isPaused?this.play():this.pause()}play(){this.playButton.classList.remove("play"),this.playButton.classList.add("pause"),this.isPaused=!1,this.audioElement.play()}pause(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0,this.audioElement.pause()}}class xC{constructor(t){te(this,"constants",{labels:{GLOSSARY:"Glossary",KEYWORD_TRANSLATION:"Translation",GLOSSARY_ILLUSTRATION:"Illustration"},cards:{GLOSSARY:"glossary",KEYWORD_TRANSLATION:"keywordTranslation",GLOSSARY_ILLUSTRATION:"glossaryIllustration"},keys:{ENTER:13,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},direction:{37:-1,38:-1,39:1,40:1}});return this.element=t,this.idList=this.createIds(),this.tabElements=[],this.tabPanelElements=[],this.audioPlayers=[],this.onTabClick=this.tabClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onKeyUp=this.keyupHandler.bind(this),this}create(t){this.unbindTabListEvents();const i=this.constants.cards.GLOSSARY in t,s=this.constants.cards.KEYWORD_TRANSLATION in t,n=this.constants.cards.GLOSSARY_ILLUSTRATION in t,r=this.tabList(i,s,n);if(r.length==0){this.element.innerHTML="";return}let a="",o="",u="",d="",f="",y="";for(let b=0;b<r.length;b++)b==0&&(a=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!0),o=this.tabPanel(r[b],b,t,0)),b==1&&(u=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!1),d=this.tabPanel(r[b],b,t,-1)),b==2&&(f=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!1),y=this.tabPanel(r[b],b,t,-1));const m=`<div id="${this.idList.tabWrapperId}" class="qti3-player-cat-tabs">
|
65
|
+
`).join("<br />")),lv(e)}let $i;var No=new WeakMap;class Ye{constructor(){if(Ub(this,No,void 0),typeof window>"u")return;$i=this;for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];const n=Object.freeze(this.constructor.argsToParams(i));this.params=n,this.isAwaitingPromise=!1,Fb(No,this,this._main($i.params))}_main(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(LE(Object.assign({},i,t)),me.currentInstance){const r=_n.swalPromiseResolve.get(me.currentInstance),{isAwaitingPromise:a}=me.currentInstance;me.currentInstance._destroy(),a||r({isDismissed:!0}),Lc()&&kf()}me.currentInstance=$i;const s=yC(t,i);mC(s),Object.freeze(s),me.timeout&&(me.timeout.stop(),delete me.timeout),clearTimeout(me.restoreFocusTimeout);const n=wC($i);return Lf($i,s),Qe.innerParams.set($i,s),gC($i,n,s)}then(t){return ff(No,this).then(t)}finally(t){return ff(No,this).finally(t)}}const gC=(e,t,i)=>new Promise((s,n)=>{const r=a=>{e.close({isDismissed:!0,dismiss:a})};_n.swalPromiseResolve.set(e,s),_n.swalPromiseReject.set(e,n),t.confirmButton.onclick=()=>{vE(e)},t.denyButton.onclick=()=>{EE(e)},t.cancelButton.onclick=()=>{CE(e,r)},t.closeButton.onclick=()=>{r(In.close)},kE(i,t,r),Hv(me,i,r),hE(e,i),cC(i),bC(me,i,r),vC(t,i),setTimeout(()=>{t.container.scrollTop=0})}),yC=(e,t)=>{const i=eC(e),s=Object.assign({},$n,t,i,e);return s.showClass=Object.assign({},$n.showClass,s.showClass),s.hideClass=Object.assign({},$n.hideClass,s.hideClass),s.animation===!1&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},wC=e=>{const t={popup:Be(),container:Tt(),actions:Rr(),confirmButton:Vi(),denyButton:Ds(),cancelButton:Sn(),loader:xn(),closeButton:Ac(),validationMessage:Io(),progressSteps:Vc()};return Qe.domCache.set(e,t),t},bC=(e,t,i)=>{const s=_o();ct(s),t.timer&&(e.timeout=new JE(()=>{i("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(nt(s),Pt(s,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&Rc(t.timer)})))},vC=(e,t)=>{if(!t.toast){if(!xo(t.allowEnterKey)){yf("allowEnterKey"),TC();return}EC(e)||CC(e,t)||Oc(-1,1)}},EC=e=>{const t=e.popup.querySelectorAll("[autofocus]");for(const i of t)if(i instanceof HTMLElement&&St(i))return i.focus(),!0;return!1},CC=(e,t)=>t.focusDeny&&St(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&St(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&St(e.confirmButton)?(e.confirmButton.focus(),!0):!1,TC=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};if(typeof window<"u"&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/(1e3*60*60*24)>3&&setTimeout(()=>{document.body.style.pointerEvents="none";const i=document.createElement("audio");i.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",i.loop=!0,document.body.appendChild(i),setTimeout(()=>{i.play().catch(()=>{})},2500)},500):localStorage.setItem("swal-initiation",`${e}`)}Ye.prototype.disableButtons=zf,Ye.prototype.enableButtons=Wf,Ye.prototype.getInput=Ff,Ye.prototype.disableInput=Yf,Ye.prototype.enableInput=Kf,Ye.prototype.hideLoading=Mo,Ye.prototype.disableLoading=Mo,Ye.prototype.showValidationMessage=Xf,Ye.prototype.resetValidationMessage=Zf,Ye.prototype.close=ws,Ye.prototype.closePopup=ws,Ye.prototype.closeModal=ws,Ye.prototype.closeToast=ws,Ye.prototype.rejectPromise=Pf,Ye.prototype.update=ip,Ye.prototype._destroy=sp,Object.assign(Ye,ZE),Object.keys(NE).forEach(e=>{Ye[e]=function(){return $i&&$i[e]?$i[e](...arguments):null}}),Ye.DismissReason=In,Ye.version="11.14.0";const Or=Ye;Or.default=Or,typeof document<"u"&&function(e,t){var i=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=t);else try{i.innerHTML=t}catch{i.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}');class c extends Error{constructor(t){super(t),this.name="QtiValidationException"}}class se extends Error{constructor(t){super(t),this.name="QtiParseException"}}class F{QTI_BASE_TYPES(){return["boolean","directedPair","duration","file","float","identifier","integer","pair","point","string","uri"]}QTI_CARDINALITIES(){return["single","multiple","ordered","record"]}QTI_MATH_OPERATORS(){return["abs","acos","acot","acsc","asec","asin","atan","atan2","ceil","cos","cosh","cot","coth","csc","csch","exp","floor","ln","log","sec","sech","signum","sin","sinh","tan","tanh","toDegrees","toRadians"]}QTI_MATH_CONSTANTS(){return["pi","e"]}QTI_STATS_OPERATORS(){return["mean","sampleVariance","sampleSD","popVariance","popSD"]}QTI_RUBRICBLOCK_VIEWS(){return["author","candidate","proctor","scorer","testConstructor","tutor"]}constructor(){}validateBaseType(t){if(!this.QTI_BASE_TYPES().includes(t))throw new c('Invalid base-type: "'+t+'".')}validateCardinality(t){if(!this.QTI_CARDINALITIES().includes(t))throw new c('Invalid cardinality: "'+t+'".')}validateBaseTypeAndCardinality(t,i){if(i&&typeof t<"u")throw new c('base-type not permitted for "record" cardinality.');if(!i&&typeof t>"u")throw new c("base-type is a required attribute.");!i&&typeof t<"u"&&this.validateBaseType(t)}validateFieldIdentifierAndCardinality(t,i){if(i&&typeof t>"u")throw new c("field-identifier is required for record cardinality.");if(!i&&typeof t<"u")throw new c("field-identifier only permitted for record cardinality.")}validatePositiveIntegerAttribute(t,i,s){let n=/^\d+$/,r;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return}if(n.test(i))r=this.IntegerValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');if(r<0)throw new c("Invalid "+t+" attribute. Must be greater than or equal to 0");return r}validateIntegerAttribute(t,i,s,n){let r=/^-?\d+$/,a;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return n}if(r.test(i))a=this.IntegerValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');return a}validateIdentifierAttribute(t){if(t!=null&&t.length!=t.trim().length)throw new c('Invalid identifier "'+t+'". Whitespace not permitted.');if(t==null||t.length==0)throw new c('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new c('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new c('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.")}validateFloatAttribute(t,i,s,n){let r=/^[-+]?([0-9]*\.[0-9]+|[0-9]+)$/,a;if(typeof i>"u"){if(s)throw new c("attribute: "+t+" is a required attribute");return n}if(r.test(i))a=this.FloatValue(i);else throw new se("Invalid "+t+' attribute "'+i+'"');return a}validateResponseIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getResponseDeclaration(i);if(typeof s>"u")throw new c('No response declaration found for response-identifier: "'+i+'"');return s}validateOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s>"u")throw new c('No outcome declaration found for identifier: "'+i+'"');return s}validateTemplateIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getTemplateDeclaration(i);if(typeof s>"u")throw new c('No template declaration found for identifier: "'+i+'"');return s}validateTemplateOrOutcomeIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getTemplateDeclaration(i);if(typeof s<"u"||(s=t.getOutcomeDeclaration(i),typeof s<"u"))return s;throw new c('No outcome or template declaration found for identifier: "'+i+'"')}validateVariableIdentifierAttribute(t,i){this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s<"u"||(s=t.getResponseDeclaration(i),typeof s<"u")||(s=t.getContextDeclaration(i),typeof s<"u")||(s=t.getTemplateDeclaration(i),typeof s<"u"))return s;throw new c('No declaration found for identifier: "'+i+'"')}validatePrintedVariableIdentifierAttribute(t,i){if(typeof i>"u")throw new c('Attribute "identifier" is undefined');this.validateIdentifierAttribute(i);let s=t.getOutcomeDeclaration(i);if(typeof s<"u"||(s=t.getTemplateDeclaration(i),typeof s<"u")||(s=t.getContextDeclaration(i),typeof s<"u"))return s;throw new c('No declaration found for identifier: "'+i+'"')}validateMaxMinChoices(t,i){let s=this.validatePositiveIntegerAttribute("max-choices",t),n=this.validatePositiveIntegerAttribute("min-choices",i);if(s>0&&n>s)throw new c('Invalid min-choices attribute "'+i+'". Must be less than or equal to max-choices attribute when max-choices attribute is greater than 0')}validateMaxMinStrings(t,i){let s=this.validatePositiveIntegerAttribute("max-strings",t),n=this.validatePositiveIntegerAttribute("min-strings",i);if(s>0&&n>s)throw new c('Invalid min-strings attribute "'+i+'". Must be less than or equal to max-strings attribute when max-strings attribute is greater than 0')}validateMaxMinPlays(t,i){let s=this.validatePositiveIntegerAttribute("max-plays",t),n=this.validatePositiveIntegerAttribute("min-plays",i);if(s>0&&n>s)throw new c('Invalid min-plays attribute "'+i+'". Must be less than or equal to max-plays attribute when max-plays attribute is greater than 0')}validatePattern(t,i){if(typeof i>"u")return null;if(i==null||i.length==0)throw new se("Invalid "+t+' "'+i+'". Length is not valid.');let s=i.trim();if(s.length==0)throw new se("Invalid "+t+' "'+i+'".');s=s.startsWith("^")?s.substring(1):s,s=s.endsWith("$")?s.substring(0,s.length-1):s,s=s.replaceAll("/","\\/");try{return new RegExp("^"+s+"$")}catch{throw new se("Unable to parse "+t+': "'+i+'""')}}validatePlaceholderText(t,i){return typeof t<"u"?t:i}validatePatternmaskMessage(t,i){return typeof t<"u"?t:i}validateCaseSensitive(t,i){if(typeof t>"u"){if(i)throw new c('Attribute "case-sensitive" is a required attribute');return!1}if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new c("Invalid case-sensitive attribute. Must be a Boolean value.")}validateIncludeBoundary(t,i){if(typeof t>"u"||t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new c("Invalid "+i+" attribute. Must be a Boolean value.")}validateValueFromBaseType(t,i){let s=null;try{switch(t){case"string":if(i===null||i.length===0)throw new se('Null string "'+i+'".');s=i;break;case"identifier":this.validateIdentifierAttribute(i),s=i;break;case"integer":s=this.IntegerValue(i);break;case"float":s=this.FloatValue(i);break;case"duration":s=this.DurationValue(i);break;default:throw new se('[Unhandled Attribute Value BaseType]: "'+t+'"')}}catch(n){if(n.name==="QtiValidationException")throw new c(n.message);if(n.name==="QtiParseException")throw new se(n.message)}return s}validateShowHideAttribute(t){if(typeof t>"u"||t==="show")return!0;if(t==="hide")return!1;throw new c('Invalid show-hide attribute: "'+t+'" Value must be "show" or "hide".')}validateShapeAttribute(t){if(typeof t>"u")return"";if(t==="circle")return"circle";if(t==="rect")return"rect";if(t==="poly")return"poly";if(t==="default")return"default";if(t==="ellipse")return"ellipse";throw new c('Invalid shape attribute: "'+t+'" Value must be "circle", "rect", "poly", "default", or "ellipse".')}validateToleranceModeAttribute(t){if(typeof t>"u")return!0;if(t==="exact")return"exact";if(t==="absolute")return"absoluate";if(t==="relative")return"relative";throw new c('Invalid tolerance-mode attribute: "'+t+'" Value must be "exact", "absolute", or "relative".')}validateRoundingModeAttribute(t){if(typeof t>"u")return!0;if(t==="decimalPlaces")return"decimalPlaces";if(t==="significantFigures")return"significantFigures";throw new c('Invalid rounding-mode attribute: "'+t+'" Value must be "decimalPlaces" or "significantFigures".')}validateMathOperatorNameAttribute(t){if(this.QTI_MATH_OPERATORS().includes(t))return!0;throw new c('Unsupported qti-math-operator "name" attribute: "'+t+'".')}validateMathConstantNameAttribute(t){if(this.QTI_MATH_CONSTANTS().includes(t))return!0;throw new c('Unsupported qti-math-constant "name" attribute: "'+t+'".')}validateStatsOperatorNameAttribute(t){if(this.QTI_STATS_OPERATORS().includes(t))return!0;throw new c('Unsupported qti-stats-operator "name" attribute: "'+t+'".')}validateToleranceAttribute(t){if(t===null||t.length===0)return[];const i=t.split(" ");if(i.length===0)throw new c('Unable to parse tolerance attribute: "'+t+'"');if(i.length<3)try{if(i.length===1){const s=new j(this.FloatValue(i[0]));if(s.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+s.valueOf()+'" cannot be negative.');return[s,s]}else if(i.length===2){const s=new j(this.FloatValue(i[0]));if(s.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+s.valueOf()+'" cannot be negative.');const n=new j(this.FloatValue(i[1]));if(n.comparedTo(new j(0))<0)throw new c('Tolerance attribute: "'+n.valueOf()+'" cannot be negative.');return[s,n]}}catch(s){if(s.name==="QtiValidationException")throw new c(s.message);if(s.name==="QtiParseException")throw new se(s.message)}else if(i.length>=3)throw new c('Invalid tolerance attribute: "'+t+'". Value must contain 1 or 2 tolerances.')}validateRubricBlockViewAttribute(t){if(!this.QTI_RUBRICBLOCK_VIEWS().includes(t))throw new c('Invalid view attribute: "'+t+'".')}parseXmlLangAttribute(t){return typeof t>"u"?null:t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new se('Invalid integer "'+t+'". ');return i}catch(i){throw new se(i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new se('Invalid float "'+t+'". ');return i}catch(i){throw new se(i.message)}}DurationValue(t){try{let i=new j(t);if(i.isZero()&&i.isNegative()&&(i=new j(0)),i.comparedTo(0)<0)throw new se('Invalid duration "'+i+'". Duration cannot be negative.');return i.toNumber()}catch(i){throw new se(i.message)}}randomString(t,i){i=i&&i.toLowerCase();let s="";const n=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let o=Math.random()*(r-n)+n<<0;s+=String.fromCharCode(o+=o>9?o<36?55:61:48)}return s}kebabCase(t){return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}isValidSlot(t){if(typeof t.type.name<"u")return!0;if(typeof t.type=="symbol"&&t.children.trim().length>0){if(t.type.toString()==="Symbol(v-cmt)")return!1;throw new c('Invalid Child Node: "'+t.children.trim()+'"')}return!1}}class SC{constructor(t){te(this,"constants",{keys:{ENTER:13,SPACE:32}});return this.audioElement=t,this.isPaused=!0,this.onPlayPauseClick=this.playPauseClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onEnded=this.endedHandler.bind(this),this}create(){return this.createAudioTemplate(this.isNestedAmpAudioElement(this.audioElement)),this}isNestedAmpAudioElement(t){return t.parentNode.classList.contains("amp-audio__holder")}createAudioTemplate(t){this.outerWrapper=t?this.createNestedAmpAudioWrapper(this.audioElement):this.createAudioWrapper(this.audioElement),this.playerContainer=this.createPlayerContainer(),this.outerWrapper.appendChild(this.playerContainer),this.addListeners()}createNestedAmpAudioWrapper(t){const i=t.parentNode.parentNode;i.classList.add("cat-audio__wrapper");const s=i.querySelector(".amp-audio-captions__container");s!=null&&s.remove();const n=i.querySelector(".amp-audio__container");return n!=null&&n.remove(),i}createAudioWrapper(t){const i=document.createElement("div");i.classList.add("cat-audio__wrapper");const s=document.createElement("div");return s.classList.add("cat-audio__holder"),t.parentNode.appendChild(i),t.setAttribute("tabindex","-1"),i.appendChild(s),s.appendChild(t),i}createPlayerContainer(){const t=document.createElement("div");return t.classList.add("cat-audio__container"),t.appendChild(this.createPlayPauseButton()),t}createPlayPauseButton(){const t=document.createElement("button");return t.classList.add("cat-audio-playpause__container"),t.classList.add("play"),t.setAttribute("tabindex","0"),t}addListeners(){this.playButton=this.playerContainer.querySelector(".cat-audio-playpause__container"),this.playButton.addEventListener("click",this.onPlayPauseClick),this.playButton.addEventListener("keydown",this.onKeyDown),this.audioElement.addEventListener("ended",this.onEnded)}removeListeners(){this.playButton.removeEventListener("click",this.onPlayPauseClick),this.playButton.removeEventListener("keydown",this.onKeyDown),this.audioElement.removeEventListener("ended",this.onEnded)}playPauseClickHandler(){this.toggleAudio()}keydownHandler(t){let i=!1;switch(t.keyCode){case this.constants.keys.SPACE:case this.constants.keys.ENTER:this.toggleAudio(),i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}endedHandler(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0}toggleAudio(){this.isPaused?this.play():this.pause()}play(){this.playButton.classList.remove("play"),this.playButton.classList.add("pause"),this.isPaused=!1,this.audioElement.play()}pause(){this.playButton.classList.remove("pause"),this.playButton.classList.add("play"),this.isPaused=!0,this.audioElement.pause()}}class xC{constructor(t){te(this,"constants",{labels:{GLOSSARY:"Glossary",KEYWORD_TRANSLATION:"Translation",GLOSSARY_ILLUSTRATION:"Illustration"},cards:{GLOSSARY:"glossary",KEYWORD_TRANSLATION:"keywordTranslation",GLOSSARY_ILLUSTRATION:"glossaryIllustration"},keys:{ENTER:13,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},direction:{37:-1,38:-1,39:1,40:1}});return this.element=t,this.idList=this.createIds(),this.tabElements=[],this.tabPanelElements=[],this.audioPlayers=[],this.onTabClick=this.tabClickHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this.onKeyUp=this.keyupHandler.bind(this),this}create(t){this.unbindTabListEvents();const i=this.constants.cards.GLOSSARY in t,s=this.constants.cards.KEYWORD_TRANSLATION in t,n=this.constants.cards.GLOSSARY_ILLUSTRATION in t,r=this.tabList(i,s,n);if(r.length==0){this.element.innerHTML="";return}let a="",o="",u="",d="",f="",y="";for(let b=0;b<r.length;b++)b==0&&(a=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!0),o=this.tabPanel(r[b],b,t,0)),b==1&&(u=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!1),d=this.tabPanel(r[b],b,t,-1)),b==2&&(f=this.createTabButton(this.idList.tabIds[b],this.idList.tabPanelIds[b],r[b],!1),y=this.tabPanel(r[b],b,t,-1));const m=`<div id="${this.idList.tabWrapperId}" class="qti3-player-cat-tabs">
|
66
66
|
<div role="tablist" aria-orientation="horizontal" aria-label="Glossary Tab List">
|
67
67
|
${a}
|
68
68
|
${u}
|
@@ -79,12 +79,12 @@ https://sweetalert2.github.io/#ajax-request`),pC(e),typeof e.title=="string"&&(e
|
|
79
79
|
role="tabpanel"
|
80
80
|
class="${n===-1?"hidden":""}"
|
81
81
|
id="${i}"
|
82
|
-
aria-labelledby="${t}">${s}</div>`}createIds(){const t={tabWrapperId:"",tabIds:[],tabPanelIds:[]};t.tabWrapperId="catalog-tabwrapper-"+this.randomString(5,"a");for(let i=0;i<3;i++){const s=this.randomString(5,"a");t.tabIds.push("catalog-"+i+"-tab-"+s),t.tabPanelIds.push("catalog-"+i+"-tabpanel-"+s)}return t}tabList(t,i,s){let n=[];return t&&n.push(this.constants.labels.GLOSSARY),i&&n.push(this.constants.labels.KEYWORD_TRANSLATION),s&&n.push(this.constants.labels.GLOSSARY_ILLUSTRATION),n}bindTabListEvents(){const t=document.getElementById(this.idList.tabWrapperId);if(t!==null&&(this.tabElements=t.querySelectorAll('[role="tab"]'),this.tabPanelElements=t.querySelectorAll('[role="tabpanel"]'),this.tabElements.length==this.tabPanelElements.length)){for(let i=0;i<this.tabElements.length;++i)this.addListeners(this.tabElements[i],this.tabPanelElements[i],i);this.bindTabAudioPlayers()}}unbindTabListEvents(){this.removeListeners(),this.unbindTabAudioPlayers()}bindTabAudioPlayers(){this.element.querySelectorAll("audio").forEach(i=>{const s=new SC(i).create();this.audioPlayers.push(s)},this)}unbindTabAudioPlayers(){this.audioPlayers.forEach(t=>{t.removeListeners()},this),this.audioPlayers.splice(0,this.audioPlayers.length)}addListeners(t,i,s){t.addEventListener("click",this.onTabClick),t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp),t.index=s}removeListeners(){this.tabElements.forEach(t=>{t.removeEventListener("click",this.onTabClick),t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp)},this)}tabClickHandler(t){var i=t.target;this.activateTab(i,!1)}keydownHandler(t){switch(t.keyCode){case this.constants.keys.END:t.preventDefault(),this.focusLastTab();break;case this.constants.keys.HOME:t.preventDefault(),this.focusFirstTab();break;case this.constants.keys.UP:case this.constants.keys.DOWN:this.switchTabOnArrowPress(t);break}}switchTabOnArrowPress(t){const i=t.keyCode;if(this.constants.direction[i]){let s=t.target;if(s.index!==void 0){if(this.tabElements[s.index+this.constants.direction[i]]){this.tabElements[s.index+this.constants.direction[i]].focus();return}if(i===this.constants.keys.LEFT||i===this.constants.keys.UP){this.focusLastTab();return}(i===this.constants.keys.RIGHT||i==this.constants.keys.DOWN)&&this.focusFirstTab()}}}keyupHandler(t){switch(t.keyCode){case this.constants.keys.LEFT:case this.constants.keys.RIGHT:this.switchTabOnArrowPress(t);break;case this.constants.keys.ENTER:case this.constants.keys.SPACE:this.activateTab(t.target);break}}activateTab(t,i){i=i||!0,this.deactivateTabs(),t.setAttribute("aria-selected","true");let s=t.getAttribute("aria-controls");document.getElementById(s).classList.remove("hidden"),i&&t.focus()}deactivateTabs(){this.audioPlayers.forEach(t=>{t.pause()},this),this.tabElements.forEach(t=>{t.setAttribute("aria-selected","false")},this),this.tabPanelElements.forEach(t=>{t.classList.add("hidden")},this)}focusFirstTab(){this.tabElements[0].focus()}focusLastTab(){this.tabElements[this.tabElements.length-1].focus()}randomString(t,i){i=i&&i.toLowerCase();let s="";const n=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let o=Math.random()*(r-n)+n<<0;s+=String.fromCharCode(o+=o>9?o<36?55:61:48)}return s}}const D=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},IC={name:"CatalogDialog",data(){return{state:{isShown:!1,dragging:!1,hidden:!0,xDiff:0,yDiff:0,x:0,y:0},content:{term:""},tabs:null}},methods:{setContent(e){this.resetDialogContent(),this.setDialogTerm(e.term),this.setDialogContent(e),this.createTabs(this.content)},setDialogContent(e){"data"in e&&e.data.forEach(t=>{switch(t.support){case"glossary-on-screen":this.setDialogGlossary(t.card);break;case"keyword-translation":this.setDialogKeywordTranslation(t.card);break;case"ext:sbac-glossary-illustration":this.setDialogGlossaryIllustration(t.card);break}},this)},resetDialogContent(){"glossary"in this.content&&delete this.content.glossary,"keywordTranslation"in this.content&&delete this.content.keywordTranslation,"glossaryIllustration"in this.content&&delete this.content.glossaryIllustration},setDialogTerm(e){this.content.term=e},setDialogGlossary(e){this.content.glossary=e},setDialogKeywordTranslation(e){this.content.keywordTranslation=e},setDialogGlossaryIllustration(e){this.content.glossaryIllustration=e},createTabs(e){this.tabs.create(e)},focusFirstTab(){this.tabs!==null&&this.tabs.focusFirstTab()},show(){this.state.hidden=!1,this.render(),this.focusFirstTab(),this.state.isShown||(this.state.isShown=!0,this.center())},hide(){this.state.hidden=!0,this.render()},center(){this.$refs.dialog.style.top=window.innerHeight/2-this.$refs.dialog.offsetHeight/2+"px",this.$refs.dialog.style.left=window.innerWidth/2-this.$refs.dialog.offsetWidth/2+"px"},reset(){this.state.x=0,this.state.y=0,this.state.isShown=!1,this.state.hidden=!0,this.render()},render(){this.state.hidden?this.$refs.dialog.style.display="none":this.$refs.dialog.style.display="",this.$refs.dialog.style.transform="translate("+this.state.x+"px, "+this.state.y+"px)"},addListeners(){this.$refs.header.addEventListener("mousedown",this.onMouseDown.bind(this)),this.$refs.header.addEventListener("mousemove",this.onMouseMove.bind(this)),this.$refs.header.addEventListener("mouseup",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("mouseleave",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("touchstart",this.onTouchStart.bind(this)),this.$refs.header.addEventListener("touchmove",this.onTouchMove.bind(this)),this.$refs.header.addEventListener("touchend",this.onTouchEnd.bind(this)),this.$refs.close.addEventListener("click",this.hide.bind(this)),this.$refs.close.addEventListener("touchend",this.hide.bind(this))},removeListeners(){this.$refs.header.removeEventListener("mousedown",this.onMouseDown),this.$refs.header.removeEventListener("mousemove",this.onMouseMove),this.$refs.header.removeEventListener("mouseup",this.onMouseUp),this.$refs.header.removeEventListener("mouseleave",this.onMouseUp),this.$refs.header.removeEventListener("touchstart",this.onTouchStart),this.$refs.header.removeEventListener("touchmove",this.onTouchMove),this.$refs.header.removeEventListener("touchend",this.onTouchEnd),this.$refs.close.removeEventListener("click",this.hide),this.$refs.close.removeEventListener("touchend",this.hide)},onMouseDown(e){this.state.dragging=!0,this.state.xDiff=e.pageX-this.state.x,this.state.yDiff=e.pageY-this.state.y},onTouchStart(e){e.preventDefault(),this.state.dragging=!0,this.state.xDiff=e.targetTouches[0].pageX-this.state.x,this.state.yDiff=e.targetTouches[0].pageY-this.state.y},onMouseMove(e){this.state.dragging&&(this.state.x=e.pageX-this.state.xDiff,this.state.y=e.pageY-this.state.yDiff),this.render()},onTouchMove(e){e.preventDefault(),e.stopPropagation(),this.state.dragging&&(this.state.x=e.targetTouches[0].pageX-this.state.xDiff,this.state.y=e.targetTouches[0].pageY-this.state.yDiff),this.render()},onMouseUp(){this.state.dragging=!1},onTouchEnd(e){e.preventDefault(),this.state.dragging=!1}},mounted(){this.tabs=new xC(this.$refs.body),this.addListeners()},beforeUnmount(){this.tabs.removeListeners(),this.removeListeners()}},_C={ref:"dialog",class:"qti3-player-cat-dialog",role:"dialog",style:{display:"none"}},VC={ref:"header",class:"qti3-player-cat-dialog-header"},AC={class:"qti3-player-cat-dialog-term"},$C={ref:"close",type:"button",class:"qti3-player-cat-dialog-close","aria-label":"Close"},LC={ref:"body",class:"qti3-player-cat-dialog-body"};function MC(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",_C,[l.createElementVNode("div",VC,[l.createElementVNode("span",AC,l.toDisplayString(n.content.term),1),l.createElementVNode("button",$C,"×",512)],512),l.createElementVNode("div",LC,null,512)],512)}const RC=D(IC,[["render",MC]]),NC={name:"AmpStyle",render(){return l.h("style",{},this.$slots.default())}},kC=new F,qC={name:"AmpAudio",emits:["mediaLoaded","mediaEnded","mediaMounted"],props:{},data(){return{audio:null,audioSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",audioLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseAudio(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),(this.isMediaInteractionChild()||this.audioSubType==="audioprogress")&&(this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled"))},handleLoaded(){this.audio&&(this.addControllerEventListeners(),this.duration=Math.round(this.audio.duration),this.displayDuration=this.convertTime(this.duration),this.isMediaInteractionChild()&&this.$parent.$emit("mediaLoaded",{node:this}))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.audioLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening)return;let e=Math.round(this.audio.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleAudio()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleAudio(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.audio.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.audio.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.audio.paused&&(this.wasPlaying=!1,this.toggleAudio()))},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(e){const t=e.target.activeCues;if(t.length>0&&this.showCaptions){const i=t[0].text.replace(/\n/g,"<br/>");console.log("[AmpAudio][currentCue]",i),this.$refs.captions.innerHTML=i}},setPosition(e){this.audio.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleAudio(){this.audio&&(this.isPlaying?(this.isPlaying=!1,this.audio.pause()):(this.isPlaying=!0,this.audio.play()))},playAudio(){this.audio&&(this.audio.play(),this.isPlaying=!0)},pauseAudio(){this.audio&&(this.audio.pause(),this.isPlaying=!1)},toggleVolume(){this.audio&&(this.audio.muted?(this.audio.muted=!1,this.isMuted=!1):(this.audio.muted=!0,this.isMuted=!0))},initSlider(){this.audio&&(this.duration=Math.round(this.audio.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},setAudioSubType(e){this.audioSubType=e,this.audioSubType==="audioprogress"&&(this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0)},getAudioSubType(e){if(e===null)return null;const t=e.class;if(typeof t>"u"||t===null||t.length==0)return null;const i=t.split(" ");for(let s=0;s<i.length;s++)switch(i[s]){case"sbaudio":case"audioprogress":return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"audioprogress"}return null},detectAudioSubType(e){return this.getAudioSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){this.audio=this.$refs.player,this.audio.removeAttribute("controls"),this.audio.removeAttribute("autoplay"),this.textTracksMap=this.filterTextTracks(this.audio.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+kC.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.addEventListener("cuechange",this.handleCueChange);return}},this)},removeTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.removeEventListener("cuechange",this.handleCueChange);return}},this)},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.setAudioSubType(this.detectAudioSubType(this.$.vnode.props))},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.audio&&(this.audio.addEventListener("loadedmetadata",this.handleLoaded),this.audio.addEventListener("canplay",this.handleCanPlay),this.audio.addEventListener("timeupdate",this.handleTimeUpdate),this.audio.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"audio"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new c(e.message)}},beforeUnmount(){this.audio&&(this.audio.removeEventListener("loadedmetadata",this.handleLoaded),this.audio.removeEventListener("canplay",this.handleCanPlay),this.audio.removeEventListener("timeupdate",this.handleTimeUpdate),this.audio.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},OC={class:"amp-audio"},PC={class:"amp-audio__holder"},BC={ref:"controller",class:"amp-audio__container"},DC={ref:"playpause",class:"amp-audio-playpause__container"},QC={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},HC={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},UC={ref:"playtimer",class:"amp-playtimer__container"},FC={class:"amp-progress__container"},GC=["max"],jC={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},WC={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},zC={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},KC={class:"amp-audio-captions__container hidden"},YC={class:"amp-audio-captions",ref:"captions"};function XC(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",OC,[l.createElementVNode("div",PC,[l.createElementVNode("audio",l.mergeProps({ref:"player",tabIndex:"-1"},e.$attrs),[l.renderSlot(e.$slots,"default",{},void 0,!0)],16)]),l.createElementVNode("div",BC,[l.createElementVNode("button",DC,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",QC,t[1]||(t[1]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,!n.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",HC,t[2]||(t[2]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,n.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",UC,[l.createElementVNode("span",null,l.toDisplayString(n.displayCurrentTime),1),t[3]||(t[3]=l.createElementVNode("span",null," / ",-1)),l.createElementVNode("span",null,l.toDisplayString(n.displayDuration),1)],512),[[l.vShow,n.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",FC,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>n.currentTime=a),type:"range",min:"0",max:n.duration,class:"slider"},null,8,GC),[[l.vModelText,n.currentTime]])],512),[[l.vShow,n.showProgress]]),l.withDirectives(l.createElementVNode("div",jC,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",WC,t[4]||(t[4]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1)]),512)),[[l.vShow,!n.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",zC,t[5]||(t[5]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1)]),512)),[[l.vShow,n.isMuted]])],512),[[l.vShow,n.showVolumeMute]])],512),l.createElementVNode("div",KC,[l.createElementVNode("div",YC,null,512)])])}const ZC=D(qC,[["render",XC],["__scopeId","data-v-a1958132"]]),JC=new F,eT={name:"AmpVideo",emits:["mediaLoaded","mediaEnded","mediaMounted"],props:{},data(){return{video:null,playerSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",videoLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,subtitlesMenu:null,subtitleMenuButtons:[],isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseVideo(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.cc.setAttribute("tabindex","-1"),this.$refs.cc.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.cc.setAttribute("tabindex","0"),this.$refs.cc.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled")},handleLoaded(){this.video&&(this.addControllerEventListeners(),this.duration=Math.round(this.video.duration),this.displayDuration=this.convertTime(this.duration),this.isMediaInteractionChild()&&this.$parent.$emit("mediaLoaded",{node:this}))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.videoLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening||!this.video)return;let e=Math.round(this.video.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleVideo()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVideo(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.video.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.video.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.video.paused&&(this.wasPlaying=!1,this.toggleVideo()))},handleCaptionsClick(){this.isDisabled||this.toggleCaptionsMenu()},handleCaptionsKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleCaptionsMenu(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},toggleCaptionsMenu(){this.subtitlesMenu.style.display=this.subtitlesMenu.style.display==="block"?"none":"block"},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(){},setPosition(e){this.video.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleVideo(){this.video&&(this.isPlaying?(this.isPlaying=!1,this.video.pause()):(this.isPlaying=!0,this.video.play()))},playVideo(){this.video&&(this.video.play(),this.isPlaying=!0)},pauseVideo(){this.video&&(this.video.pause(),this.isPlaying=!1)},toggleVolume(){this.video&&(this.video.muted?(this.video.muted=!1,this.isMuted=!1):(this.video.muted=!0,this.isMuted=!0))},initSlider(){this.video&&(this.duration=Math.round(this.video.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},getPlayerSubType(){return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"ampvideo-default"},detectPlayerSubType(e){return this.getPlayerSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){if(this.video=this.$refs.player,this.video.removeAttribute("controls"),this.video.removeAttribute("autoplay"),this.video.hasAttribute("width")){const e=`${this.video.getAttribute("width")}`,t=e.endsWith("%")?`width:${e}`:`width:${e}px`;this.$refs.videocontainer.setAttribute("style",t),this.$refs.controller.setAttribute("style",t)}else this.video.setAttribute("width","100%");this.textTracksMap=this.filterTextTracks(this.video.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+JC.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.showCaptions=!0,this.initializeSubtitlesMenu();for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];t.mode="hidden",this.addSubtitlesMenuItem(t),typeof this.textTracksMap.get(t.id)<"u"&&t.addEventListener("cuechange",this.handleCueChange)}this.$refs.videocontainer.appendChild(this.subtitlesMenu)}},removeTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.subtitleMenuButtons.forEach(e=>{e.removeEventListener("click",this.handleSubtitleButtonClick)});for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];typeof this.textTracksMap.get(t.id)<"u"&&t.removeEventListener("cuechange",this.handleCueChange)}}},initializeSubtitlesMenu(){const e=document.createDocumentFragment();this.subtitlesMenu=e.appendChild(document.createElement("ul")),this.subtitlesMenu.className="ampvideo-subtitles-menu",this.subtitlesMenu.appendChild(this.createMenuItem("subtitles-off","","Off"))},addSubtitlesMenuItem(e){this.subtitlesMenu.appendChild(this.createMenuItem(`subtitles-${e.language}`,e.language,e.label))},createMenuItem(e,t,i){const s=document.createElement("li"),n=s.appendChild(document.createElement("button"));return n.setAttribute("id",e),n.className="ampvideo-subtitles-button",t.length>0&&n.setAttribute("lang",t),n.value=i,t===""?n.setAttribute("data-state","active"):n.setAttribute("data-state","inactive"),n.appendChild(document.createTextNode(i)),n.addEventListener("click",this.handleSubtitleButtonClick),this.subtitleMenuButtons.push(n),s},handleSubtitleButtonClick(e){const t=e.currentTarget;this.subtitleMenuButtons.forEach(s=>{s.setAttribute("data-state","inactive")});const i=t.getAttribute("lang");for(let s=0;s<this.video.textTracks.length;s++)this.video.textTracks[s].language===i?(this.video.textTracks[s].mode="showing",t.setAttribute("data-state","active")):this.video.textTracks[s].mode="hidden";i===null&&t.setAttribute("data-state","active"),this.subtitlesMenu.style.display="none"},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.addEventListener("click",this.handleCaptionsClick),this.$refs.cc.addEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.removeEventListener("click",this.handleCaptionsClick),this.$refs.cc.removeEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.playerSubType=this.detectPlayerSubType(this.$.vnode.props)},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.video&&(this.video.addEventListener("loadedmetadata",this.handleLoaded),this.video.addEventListener("canplay",this.handleCanPlay),this.video.addEventListener("timeupdate",this.handleTimeUpdate),this.video.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"video"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new c(e.message)}},beforeUnmount(){this.video&&(this.video.removeEventListener("loadedmetadata",this.handleLoaded),this.video.removeEventListener("canplay",this.handleCanPlay),this.video.removeEventListener("timeupdate",this.handleTimeUpdate),this.video.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},tT={ref:"videocontainer",class:"amp-video"},iT={class:"amp-video__holder"},sT={ref:"controller",class:"amp-video__container"},nT={ref:"playpause",class:"amp-video-playpause__container"},rT={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},aT={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},oT={ref:"playtimer",class:"amp-playtimer__container"},lT={class:"amp-progress__container"},cT=["max"],uT={ref:"cc",class:"amp-video-cc__container","aria-label":"Captions menu"},hT={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},dT={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},fT={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function pT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tT,[l.createElementVNode("div",iT,[l.createElementVNode("video",l.mergeProps({ref:"player",tabIndex:"-1",class:"amp-video__video"},e.$attrs),[l.renderSlot(e.$slots,"default")],16)]),l.createElementVNode("div",sT,[l.createElementVNode("button",nT,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",rT,t[1]||(t[1]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,!n.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",aT,t[2]||(t[2]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,n.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",oT,[l.createElementVNode("span",null,l.toDisplayString(n.displayCurrentTime),1),t[3]||(t[3]=l.createElementVNode("span",null," / ",-1)),l.createElementVNode("span",null,l.toDisplayString(n.displayDuration),1)],512),[[l.vShow,n.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",lT,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>n.currentTime=a),type:"range",min:"0",max:n.duration,class:"slider"},null,8,cT),[[l.vModelText,n.currentTime]])],512),[[l.vShow,n.showProgress]]),l.withDirectives(l.createElementVNode("div",uT," CC ",512),[[l.vShow,n.showCaptions]]),l.withDirectives(l.createElementVNode("div",hT,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",dT,t[4]||(t[4]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1)]),512)),[[l.vShow,!n.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",fT,t[5]||(t[5]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1)]),512)),[[l.vShow,n.isMuted]])],512),[[l.vShow,n.showVolumeMute]])],512)],512)}const mT=D(eT,[["render",pT]]);class gT{constructor(t,i){te(this,"constants",{supports:{GLOSSARY:"glossary-on-screen",KEYWORD_TRANSLATION:"keyword-translation",EXT_SBAC_GLOSSARY_ILLUSTRATION:"ext:sbac-glossary-illustration"},GLOSSARY_CLICKABLE_CLASS:"qti3-player-catalog-clickable-term",LANGUAGE_OFF:"",keys:{ENTER:13,SPACE:32}});return this.item=t,this.itemElement=t.$refs.item,this.store=i,this.nodeList=null,this.showGlossary=this.showGlossaryHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this}bindAll(){this.store.getCatalogs().length!==0&&(this.resetAll(),this.nodeList=this.itemElement.querySelectorAll("[data-catalog-idref]"),this.nodeList.length!==0&&this.bindGlossary(this.nodeList))}resetAll(){this.nodeList!==null&&(this.nodeList.forEach(t=>{this.unbindGlossaryDOM(t)},this),this.nodeList=null)}getPnpGlossarySupports(t){let i=[];return t.getGlossaryOnScreen()&&i.push(this.constants.supports.GLOSSARY),t.getKeywordTranslationLanguage()!==this.constants.LANGUAGE_OFF&&i.push(`${this.constants.supports.KEYWORD_TRANSLATION}:${t.getKeywordTranslationLanguage()}`),t.getExtSbacGlossaryIllustration()&&i.push(this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION),i}bindGlossary(t){const i=this.getPnpGlossarySupports(this.store.getItemContextPnp());i.length!==0&&t.forEach(s=>{this.bindGlossaryNode(s,i)},this)}bindGlossaryNode(t,i){const s=t.getAttribute("data-catalog-idref"),n=this.store.getCatalog(s);typeof n>"u"||this.hasCatalogGlossarySupport(n,i)&&this.bindGlossaryDOM(t)}bindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)||(t.classList.add(this.constants.GLOSSARY_CLICKABLE_CLASS),t.setAttribute("tabindex","0"),this.setGlossaryTerm(t),t.addEventListener("click",this.showGlossary),t.addEventListener("touchend",this.showGlossary),t.addEventListener("keydown",this.onKeyDown))}unbindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)&&(t.classList.remove(this.constants.GLOSSARY_CLICKABLE_CLASS),t.setAttribute("tabindex","-1"),t.removeEventListener("click",this.showGlossary),t.removeEventListener("touchend",this.showGlossary),t.removeEventListener("keydown",this.keyDownHandler))}setGlossaryTerm(t){if(!t.hasAttribute("data-glossary-term")){if(t.hasAttribute("data-sbac-term")){t.setAttribute("data-glossary-term",t.getAttribute("data-sbac-term"));return}t.setAttribute("data-glossary-term",t.innerText)}}showGlossaryHandler(t){t.preventDefault(),t.stopPropagation(),this.emitShowGlossaryEvent(t)}keydownHandler(t){let i=!1;switch(t.keyCode){case this.constants.keys.SPACE:case this.constants.keys.ENTER:this.emitShowGlossaryEvent(t),i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}emitShowGlossaryEvent(t){const i=t.target.getAttribute("data-catalog-idref"),s=this.createGlossaryData(i);this.item.$parent.$emit("itemCatalogEvent",{type:"glossary",catalogIdRef:i,term:t.target.getAttribute("data-glossary-term"),data:s})}createGlossaryData(t){const i=this.store.getCatalog(t),s=this.getPnpGlossarySupports(this.store.getItemContextPnp());return this.createGlossaryDataFromCatalog(i,s)}createGlossaryDataFromCatalog(t,i){let s=[];return i.forEach(n=>{const r=this.findCatalogCardBySupport(t,n);if(r!==null){if(n===this.constants.supports.GLOSSARY||n===this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION){const a=this.createGlossaryContent(r);if(a===null)return;s.push({support:n,card:a});return}if(n.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)){const a=this.getLanguageCodeFromSupport(n),o=this.createTranslationContent(r,a);if(o===null)return;s.push({support:this.constants.supports.KEYWORD_TRANSLATION,card:o});return}}},this),s}hasCatalogGlossarySupport(t,i){let s=null;return i.forEach(n=>{let r=this.findCatalogCardBySupport(t,n);if(r!==null){s=r;return}},this),s!=null}getLanguageCodeFromSupport(t){const i=t.indexOf(":");return t.length>i+1?t.substring(i+1):""}findCatalogCardBySupport(t,i){return typeof t>"u"?null:this.findCardBySupport(t.node.getCards(),i)}findCardBySupport(t,i){let s=null,n="";return i.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)&&(n=this.getLanguageCodeFromSupport(i),i=this.constants.supports.KEYWORD_TRANSLATION),t.forEach(r=>{if(r.support===i){if(i===this.constants.supports.KEYWORD_TRANSLATION&&this.createTranslationContent(r,n)===null)return;s=r;return}},this),s}createGlossaryContent(t){return this.getGlossaryCardContent(t)}createTranslationContent(t,i){let s=this.getTranslationCardContent(t,i);return s!==null?s:this.getTranslationCardContent(t,i,!0)}getGlossaryCardContent(t){let i=null;return t.getChildren().forEach(s=>{switch(s.$options.name){case"QtiHtmlContent":i=this.createContent("qti-html-content",s);return;case"QtiFileRef":i=this.createContent("qti-file-ref",s);return;case"QtiCardEntry":i=this.getGlossaryCardContent(s);return;default:return}},this),i}getTranslationCardContent(t,i,s=!1,n=0){if(n>1||n==0&&t.getLanguage().length>0&&t.getLanguage()!==i)return null;let r=null;return t.getChildren().forEach(a=>{switch(a.$options.name){case"QtiHtmlContent":r=this.createContent("qti-html-content",a);return;case"QtiFileRef":r=this.createContent("qti-file-ref",a);return;case"QtiCardEntry":if(s&&a.isDefault()){r=this.getTranslationCardContent(a,i,s,n+1);return}if(a.getLanguage()===i){r=this.getTranslationCardContent(a,i,s,n+1);return}return;default:return}},this),r}createContent(t,i){return{properties:{name:t},content:i.getContent()}}}const yT={name:"EventListener",emits:["templateProcessingReady","itemBodyReady"],setup(e,t){return()=>{var i,s;return((s=(i=t.slots).default)==null?void 0:s.call(i))??null}}},wT=new F,bT={name:"QtiAssessmentItem",components:{EventListener:yT},emits:["itemReady","itemCompleted","itemSuspendAttemptReady","itemEndAttemptReady","itemScoreAttemptReady","itemCatalogEvent","itemNewTemplate","itemNewTemplateCompleted"],props:{identifier:{type:String,required:!0},title:{type:String,required:!1},adaptive:{type:String,required:!1},timeDependent:{type:String,required:!1},"xml:lang":{type:String,required:!1}},data(){return{isAdaptive:!1,isTimeDependent:!1,lang:null,locale:null,catalogFactory:null,getResponsesCallback:null}},methods:{getEndAttempt(e){this.endAttempt(void 0,(function(){this.notifyAttemptResults("itemEndAttemptReady",e)}).bind(this))},getSuspendAttempt(e){M.updateItemDuration(),this.getResponses((function(){this.evaluateAttemptValidity(M.getItemContextSessionControl().getValidateResponses()),this.notifyAttemptResults("itemSuspendAttemptReady",e)}).bind(this))},getScoreAttempt(e){this.processResponses(!0),this.notifyAttemptResults("itemScoreAttemptReady",e)},notifyAttemptResults(e,t){const i=new Ec(this.identifier,M);this.$parent.$emit(e,{state:i.getSerializedState(),target:typeof t<"u"?t:null})},notifyEndAttemptInteractionResults(){const t=new Ec(this.identifier,M).getSerializedState();M.getItemContextSessionControl().getValidateResponses()&&t.validationMessages.length>0&&M.getInteractions().forEach(i=>{i.interactionType==="EndAttemptInteraction"&&i.interactionSubType==="endattempt-controller-bar"&&i.enable()}),this.$parent.$emit("itemEndAttemptReady",{state:t,target:null})},handleTemplateProcessingReady(e){console.log("[QtiAssessmentItem][TemplateProcessingReady]"),M.defineTemplateProcessing({node:e.templateProcessing}),M.hasItemContextState()||this.executeTemplateProcessing()},handleItemBodyReady(e){console.log("[QtiAssessmentItem][ItemBodyReady][Adaptive="+this.isAdaptive+"]",e),M.defineItemBody({node:e.itemBody}),this.initializeResponseDeclarations(M.hasItemContextState()),this.initializeOutcomeDeclarations(M.hasItemContextState()),this.isAdaptive&&this.evaluateFeedbacks(),(M.getItemLifecycleStatus()==="closed"||M.getItemLifecycleStatus()==="review"||M.getItemLifecycleStatus()==="solution")&&(M.resetItemTimer(),this.disableInteractions())},getItemBody(){return M.getItemBody()},getTemplateProcessing(){let e=M.getProcessing("template");return typeof e>"u"?null:e.node},getResponseProcessing(){let e=M.getProcessing("response");return typeof e>"u"?null:e.node},newTemplate(){console.log("[QtiAssessmentItem][NewTemplate][Started]"),this.$parent.$emit("itemNewTemplate"),this.resetResponseDeclarations(),this.resetInteractions(),this.resetTemplateDeclarations(),this.executeTemplateProcessing(),this.evaluatePrintedVariables(),this.evaluateTemplateMathVariables(),this.evaluateTemplates(),this.resetOutcomeDeclarations(),this.evaluateFeedbacks(),M.restartItemTimer(),console.log("[QtiAssessmentItem][NewTemplate][Completed]"),this.$parent.$emit("itemNewTemplateCompleted")},evaluateTemplateMathVariables(){if(M.getTemplateMathParameterVariables().length===0)return;const t=this.getItemBody();t!==null&&t.updateTemplateMathVariables(),M.getFeedbacks().forEach(i=>{i.feedbackType==="Modal"&&i.node.updateTemplateMathVariables()})},executeTemplateProcessing(){let e=this.getTemplateProcessing();e!==null&&e.evaluate()},initializeOutcomeDeclarations(e){e?M.restoreOutcomeVariables():this.resetOutcomeDeclarations()},resetOutcomeDeclarations(){M.getOutcomeDeclarations().forEach(e=>{this.resetOutcomeDeclaration(e)},this)},resetOutcomeDeclaration(e){if(e.node!==void 0){e.node.reset();return}M.setOutcomeVariableValue({identifier:e.identifier,value:e.defaultValue})},initializeResponseDeclarations(e){e?M.restoreResponseVariables():this.resetResponseDeclarations()},resetResponseDeclarations(){M.getResponseDeclarations().forEach(e=>{e.resetValue&&e.resetValue()})},resetTemplateDeclarations(){M.getTemplateDeclarations().forEach(e=>{e.node.reset()})},resetInteractions(){M.getInteractions().forEach(e=>{console.log("[ResetInteractions]["+e.identifier+"]",e),e.resetValue&&e.resetValue(),e.node.enable&&e.node.enable()}),M.resetInteractionStateIsValidResponse()},disableInteractions(){M.getInteractions().forEach(e=>{e.node.disable&&e.node.disable()})},showSolutionInteractions(){M.getItemContextSessionControl().getShowSolution()&&M.getItemLifecycleState()==="solution"&&M.getInteractions().forEach(e=>{e.node.showSolution&&e.node.showSolution(M.getResponseVariableCorrectResponse(e.identifier))})},evaluateFeedbacks(){console.log("[EvaluateFeedback][Started]"),M.getFeedbacks().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateFeedback][Completed]")},evaluatePrintedVariables(){console.log("[EvaluatePrintedVariables][Started]"),M.getPrintedVariables().forEach(e=>{e.node.evaluate()}),console.log("[EvaluatePrintedVariables][Completed]")},evaluateTemplates(){console.log("[EvaluateTemplates][Started]"),M.getTemplates().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateTemplates][Completed]")},endAttempt(e,t){console.log("[EndAttempt][Start][Identifier]",this.identifier),M.updateItemDuration(),this.getResponses((function(){if(!this.evaluateAttemptValidity(M.getItemContextSessionControl().getValidateResponses())){console.log("[EndAttempt][InvalidResponses][Identifier]",this.identifier),t&&t();return}this.processResponses(),this.isAdaptive&&this.evaluateItemCompleted(),this.updateItemBodyUI(e),console.log("[EndAttempt][Complete][Identifier]",this.identifier),t&&t()}).bind(this))},updateItemBodyUI(e){typeof e>"u"||e.interactionSubType!=="endattempt-controller-bar"&&M.getInteractions().forEach(t=>{if(t.interactionType==="EndAttemptInteraction"){if(t.interactionSubType==="endattempt-controller-bar"){t.disable();return}if(this.isAdaptive){if(this.isAdaptiveItemCompleted()){t.disable();return}t.enable()}}})},getResponses(e){console.log("[GetResponses][Start]"),M.getAsyncStateMap().clear(),this.getResponsesCallback=e;let t=M.getResponseDeclarations();for(let i=0;i<t.length;i++){const s=t[i],n=M.getInteraction(s.identifier);if(typeof n>"u"){s.identifier!=="numAttempts"&&s.identifier!=="duration"&&M.resetResponseVariableValue({identifier:s.identifier,value:s.defaultValue,state:null});continue}if(n.interactionType!=="PortableCustom"){console.log("[GetResponses]["+s.identifier+"]:",n.node.getResponse()),M.setResponseVariableValue({identifier:s.identifier,value:n.node.getResponse(),state:n.node.getState()});continue}n.node.pciIsReady()?M.getAsyncStateMap().set(n.identifier,{identifier:n.identifier,node:n.node}):M.setResponseVariableValue({identifier:s.identifier,value:n.node.getResponse(),state:n.node.getState()})}this.initiateAsyncGetResponsesRequests()},initiateAsyncGetResponsesRequests(){if(M.getAsyncStateMap().size===0)return this.triggerGetResponsesComplete();for(const[e,t]of M.getAsyncStateMap().entries())console.log("[GetResponses]["+e+"][PCI Initiate]"),t.node.getStateRequest()},triggerGetResponsesComplete(){console.log("[GetResponses][Complete]"),typeof this.getResponsesCallback=="function"&&this.getResponsesCallback()},evaluateItemCompleted(){this.isAdaptiveItemCompleted()&&(M.resetItemTimer(),this.$parent.$emit("itemCompleted"))},isAdaptiveItemCompleted(){return M.getOutcomeDeclaration("completionStatus").value==="completed"},processResponses(e=!1){console.log("[ProcessResponses][Started]"),e||M.incrementNumAttempts(),console.log("[ProcessResponses][IsAdaptive]",this.isAdaptive),this.isAdaptive||this.resetOutcomeDeclarations();let t=this.getResponseProcessing();t!==null&&t.evaluate(),e||(this.printOutcomeDeclarations(),this.evaluatePrintedVariables(),M.getItemContextSessionControl().getShowFeedback()&&this.evaluateFeedbacks()),console.log("[ProcessResponses][Completed]")},evaluateAttemptValidity(e){return e?(M.resetItemContextValidationMessages(),this.evaluateInteractionResponseValidity(M.getInteractions())):!0},evaluateInteractionResponseValidity(e){let t=!0;return e.forEach(i=>{i.isValidResponse||(M.addItemContextValidationMessage({identifier:i.identifier,message:i.invalidResponseMessage}),t=!1)}),t},bindCatalog(){this.catalogFactory!==null&&this.catalogFactory.bindAll()},setLang(e,t){t!==null&&e.setAttribute("lang",t)},coerceItemAttributes(){this.isTimeDependent=typeof this.timeDependent>"u"?!1:this.timeDependent==="true",this.isAdaptive=typeof this.adaptive>"u"?!1:this.adaptive==="true",this.lang=wT.parseXmlLangAttribute(this.$props["xml:lang"]),this.locale=this.lang===null?"en":this.lang},printOutcomeDeclarations(){M.getOutcomeDeclarations().forEach(e=>{(this.isAdaptive||e.identifier!=="completionStatus")&&console.log("[ProcessResponses][Outcomes]["+e.identifier+"][Value]",e.value)})}},errorCaptured(e,t){return console.log("["+e.name+"]["+t.$options.name+"] "+e.message),!1},created(){this.coerceItemAttributes()},mounted(){this.setLang(this.$refs.item,this.lang),this.catalogFactory=new gT(this,M),this.bindCatalog(),this.$parent.$emit("itemReady",{item:this})},beforeUnmount(){this.catalogFactory!==null&&this.catalogFactory.resetAll()}},vT={ref:"item",class:"qti-assessment-item"};function ET(e,t,i,s,n,r){const a=l.resolveComponent("event-listener");return l.openBlock(),l.createElementBlock("div",vT,[l.createVNode(a,{onTemplateProcessingReady:r.handleTemplateProcessingReady,onItemBodyReady:r.handleItemBodyReady},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(e.$slots,"default")])]),_:3},8,["onTemplateProcessingReady","onItemBodyReady"])],512)}const CT=D(bT,[["render",ET]]),ko=new F,TT=new ie,ST={name:"QtiContextDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,defaultValue:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return this.declarationContext},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(TT.nullValue())},reset(){this.initializeValue()},computeDeclarationContext(){var e,t,i;this.declarationContext=((i=(t=(e=this.$parent)==null?void 0:e.$parent)==null?void 0:t.$options)==null?void 0:i.name)==="QtiAssessmentTest"?"TEST":"ITEM"},getStore(){return this.declarationContext==="TEST"?tt:M},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(ko.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}throw new c('Element must be one of qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})}},created:function(){try{this.computeDeclarationContext(),ko.validateCardinality(this.cardinality),ko.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),ko.validateIdentifierAttribute(this.identifier),this.validateChildren(),this.getStore().defineContextDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,resetValue:this.reset,defaultValue:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.initializeValue();const e={identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),resetValue:this.reset,defaultValue:this.defaultValue};this.declarationContext==="TEST"?tt.defineContextDeclaration(e):M.defineContextDeclaration(e),console.log("["+this.$options.name+"]["+this.identifier+"]["+this.declarationContext+"][DefaultValue]",this.defaultValue)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},xT=["identifier"];function IT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-context-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,xT)}const _T=D(ST,[["render",IT]]),qo=new F,VT=new ie,AT={name:"QtiResponseDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},getState(){return this.state},setState(e){this.state=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getCorrectResponse(){return this.correctResponse},getMapping(){return this.mapping},getAreaMapping(){return this.areaMapping},getDeclarationContext(){return"ITEM"},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(VT.nullValue())},validateChildren(){let e=!1,t=!1,i=!1,s=!1;this.$slots.default&&this.$slots.default().forEach(n=>{if(qo.isValidSlot(n)){if(n.type.name==="QtiCorrectResponse"){if(!e)return e=!0;throw new c("Maximum of 1 qti-correct-response element permitted")}if(n.type.name==="QtiDefaultValue"){if(!t)return t=!0;throw new c("Maximum of 1 qti-default-value element permitted")}if(n.type.name==="QtiMapping"){if(!i)return i=!0;throw new c("Maximum of 1 qti-mapping element permitted")}if(n.type.name==="QtiAreaMapping"){if(this.getCardinality()!=="record"&&this.getBaseType()!=="point")throw new c(`Invalid qti-area-mapping definition. Variable base-type is "${this.getBaseType()}", not "point"`);if(!s)return s=!0;throw new c("Maximum of 1 qti-area-mapping element permitted")}throw new c('Element must be one of qti-correct-response, qti-default-value, qti-mapping, qti-area-mapping: "'+n.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiCorrectResponse")return this.correctResponse=t.component.proxy.getValue();if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();if(t.type.name==="QtiMapping")return this.mapping=t.component.proxy;if(t.type.name==="QtiAreaMapping")return this.areaMapping=t.component.proxy;throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(console.log("[ResponseDeclaration]["+e+"][priorState]",t),t===null)return null;if(!("value"in t))throw new B('Variable Restore State Invalid. "value" property not found.');if(!("state"in t))throw new B('Variable Restore State Invalid. "state" property not found.');return this.setValue(t.value),this.setState(t.state),t}},created(){try{qo.validateCardinality(this.cardinality),qo.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),qo.validateIdentifierAttribute(this.identifier),this.validateChildren(),M.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),M.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),state:this.getState(),defaultValue:this.getDefaultValue(),correctResponse:this.getCorrectResponse(),mapping:this.getMapping(),areaMapping:this.getAreaMapping()}),console.log("["+this.$options.name+"]["+this.identifier+"][CorrectResponse]",this.correctResponse,"[Mapping]",this.mapping)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},$T=["identifier"];function LT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-response-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,$T)}const MT=D(AT,[["render",LT]]),Gs=new F,fp=new ie,RT={name:"QtiOutcomeDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},view:{type:String,required:!1,default:null},interpretation:{type:String,required:!1,default:null},longInterpretation:{type:String,required:!1,default:null},normalMaximum:{type:String,required:!1},normalMinimum:{type:String,required:!1},masteryValue:{type:String,required:!1},externalScored:{type:String,required:!1,default:null},variableIdentifierRef:{type:String,required:!1,default:null}},data(){return{value:null,defaultValue:null,lookupTable:null,isQtiValid:!0,normalMaximumValue:null,normalMinimumValue:null,masteryValueValue:null,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getNormalMaximumValue(){return this.normalMaximumValue},getNormalMinimumValue(){return this.normalMinimumValue},getMasteryValueValue(){return this.masteryValueValue},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return this.declarationContext},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}if(this.getCardinality()==="single"&&fp.isBaseTypeNumeric(this.getBaseType())){this.setValue(new j(0).toNumber());return}this.setValue(fp.nullValue())},reset(){this.initializeValue(),this.getStore().setOutcomeVariableValue({identifier:this.identifier,value:this.getValue()})},computeDeclarationContext(){var e,t,i;this.declarationContext=((i=(t=(e=this.$parent)==null?void 0:e.$parent)==null?void 0:t.$options)==null?void 0:i.name)==="QtiAssessmentTest"?"TEST":"ITEM"},getStore(){return this.declarationContext==="TEST"?tt:M},validateChildren(){let e=!1,t=!1,i=!1;this.$slots.default&&this.$slots.default().forEach(s=>{if(Gs.isValidSlot(s)){if(s.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}if(s.type.name==="QtiMatchTable"){if(i)throw new c("Maximum of 1 lookupTable permitted");if(!t)return t=!0;throw new c("Maximum of 1 qti-match-table element permitted")}if(s.type.name==="QtiInterpolationTable"){if(t)throw new c("Maximum of 1 lookupTable permitted");if(!i)return i=!0;throw new c("Maximum of 1 qti-interpolation-table element permitted")}throw new c('Element must be one of qti-default-value, qti-match-table, qti-interpolation-table: "'+s.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();if(t.type.name==="QtiMatchTable"||t.type.name==="QtiInterpolationTable")return this.lookupTable=t.component.proxy;throw new c("["+this.$options.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})}},created(){try{if(this.computeDeclarationContext(),Gs.validateCardinality(this.cardinality),Gs.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Gs.validateIdentifierAttribute(this.identifier),this.validateChildren(),this.normalMaximumValue=Gs.validateFloatAttribute("normal-maximum",this.normalMaximum,!1,null),this.normalMaximumValue!==null&&this.normalMaximumValue<=0)throw new c('Outcome declaration "'+this.identifier+'" has invalid normal-maximum attribute value. Must be a positive value.');if(this.normalMinimumValue=Gs.validateFloatAttribute("normal-minimum",this.normalMinimum,!1,null),this.masteryValueValue=Gs.validateFloatAttribute("mastery-value",this.masteryValue,!1,null),this.identifier==="SCORE"||this.identifier==="MAXSCORE"){if(typeof this.baseType>"u"||this.baseType!=="float")throw new c('Outcome declaration "'+this.identifier+'" has invalid base-type. Must be base-type="float".');if(typeof this.cardinality>"u"||this.cardinality!=="single")throw new c('Outcome declaration "'+this.identifier+'" has invalid cardinality. Must be cardinality="single".')}this.getStore().defineOutcomeDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:null,defaultValue:null,node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.initializeValue();const e={identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:this.getValue(),defaultValue:this.defaultValue,lookupTable:this.lookupTable,lookupTableType:this.lookupTableType,node:this};this.declarationContext==="TEST"?tt.defineOutcomeDeclaration(e):M.defineOutcomeDeclaration(e),console.log("["+this.$options.name+"]["+this.identifier+"]["+this.declarationContext+"][DefaultValue]",this.defaultValue,"[lookupTable]",this.lookupTable)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},NT=["identifier"];function kT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-outcome-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,NT)}const qT=D(RT,[["render",kT]]),Oo=new F,OT=new ie,PT={name:"QtiTemplateDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},paramVariable:{type:String,required:!1,default:"false"},mathVariable:{type:String,required:!1,default:"false"}},data(){return{value:null,defaultValue:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return"ITEM"},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(OT.nullValue())},reset(){this.initializeValue(),M.setTemplateVariableValue({identifier:this.identifier,value:this.getValue()})},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(Oo.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}throw new c('Element must be qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.type.name==="QtiDefaultValue"&&t.component!==null)return this.defaultValue=t.component.proxy.getValue();throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')})},readChildren:function(){this.$children.forEach(e=>{switch(e.$el.className){case"qti-default-value":this.defaultValue=e.getValue();break;default:throw new c("["+this.$options.name+'][Unhandled Child Node]: "'+e.$el.className+'"')}})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Variable Restore State Invalid. "value" property not found.');return this.setValue(t.value),t}},created:function(){try{Oo.validateCardinality(this.cardinality),Oo.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Oo.validateIdentifierAttribute(this.identifier),this.validateChildren(),M.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,defaultValue:null,paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),M.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),defaultValue:this.getDefaultValue(),paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this}),console.log("["+this.$options.name+"]["+this.identifier+"][Value]",this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},BT=["identifier"];function DT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-template-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,BT)}const QT=D(PT,[["render",DT]]);function pp(e,t){return function(){return e.apply(t,arguments)}}const{toString:HT}=Object.prototype,{getPrototypeOf:Hc}=Object,Po=(e=>t=>{const i=HT.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),hi=e=>(e=e.toLowerCase(),t=>Po(t)===e),Bo=e=>t=>typeof t===e,{isArray:Ln}=Array,Pr=Bo("undefined");function UT(e){return e!==null&&!Pr(e)&&e.constructor!==null&&!Pr(e.constructor)&&Bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mp=hi("ArrayBuffer");function FT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mp(e.buffer),t}const GT=Bo("string"),Bt=Bo("function"),gp=Bo("number"),Do=e=>e!==null&&typeof e=="object",jT=e=>e===!0||e===!1,Qo=e=>{if(Po(e)!=="object")return!1;const t=Hc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},WT=hi("Date"),zT=hi("File"),KT=hi("Blob"),YT=hi("FileList"),XT=e=>Do(e)&&Bt(e.pipe),ZT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Bt(e.append)&&((t=Po(e))==="formdata"||t==="object"&&Bt(e.toString)&&e.toString()==="[object FormData]"))},JT=hi("URLSearchParams"),[e0,t0,i0,s0]=["ReadableStream","Request","Response","Headers"].map(hi),n0=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Br(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let s,n;if(typeof e!="object"&&(e=[e]),Ln(e))for(s=0,n=e.length;s<n;s++)t.call(null,e[s],s,e);else{const r=i?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,e[o],o,e)}}function yp(e,t){t=t.toLowerCase();const i=Object.keys(e);let s=i.length,n;for(;s-- >0;)if(n=i[s],t===n.toLowerCase())return n;return null}const js=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wp=e=>!Pr(e)&&e!==js;function Uc(){const{caseless:e}=wp(this)&&this||{},t={},i=(s,n)=>{const r=e&&yp(t,n)||n;Qo(t[r])&&Qo(s)?t[r]=Uc(t[r],s):Qo(s)?t[r]=Uc({},s):Ln(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Br(arguments[s],i);return t}const r0=(e,t,i,{allOwnKeys:s}={})=>(Br(t,(n,r)=>{i&&Bt(n)?e[r]=pp(n,i):e[r]=n},{allOwnKeys:s}),e),a0=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),o0=(e,t,i,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},l0=(e,t,i,s)=>{let n,r,a;const o={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),r=n.length;r-- >0;)a=n[r],(!s||s(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=i!==!1&&Hc(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},c0=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const s=e.indexOf(t,i);return s!==-1&&s===i},u0=e=>{if(!e)return null;if(Ln(e))return e;let t=e.length;if(!gp(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},h0=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Hc(Uint8Array)),d0=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},f0=(e,t)=>{let i;const s=[];for(;(i=e.exec(t))!==null;)s.push(i);return s},p0=hi("HTMLFormElement"),m0=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,s,n){return s.toUpperCase()+n}),bp=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),g0=hi("RegExp"),vp=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),s={};Br(i,(n,r)=>{let a;(a=t(n,r,e))!==!1&&(s[r]=a||n)}),Object.defineProperties(e,s)},y0=e=>{vp(e,(t,i)=>{if(Bt(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=e[i];if(Bt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},w0=(e,t)=>{const i={},s=n=>{n.forEach(r=>{i[r]=!0})};return Ln(e)?s(e):s(String(e).split(t)),i},b0=()=>{},v0=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function E0(e){return!!(e&&Bt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const C0=e=>{const t=new Array(10),i=(s,n)=>{if(Do(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=Ln(s)?[]:{};return Br(s,(a,o)=>{const u=i(a,n+1);!Pr(u)&&(r[o]=u)}),t[n]=void 0,r}}return s};return i(e,0)},T0=hi("AsyncFunction"),S0=e=>e&&(Do(e)||Bt(e))&&Bt(e.then)&&Bt(e.catch),Ep=((e,t)=>e?setImmediate:t?((i,s)=>(js.addEventListener("message",({source:n,data:r})=>{n===js&&r===i&&s.length&&s.shift()()},!1),n=>{s.push(n),js.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Bt(js.postMessage)),x0=typeof queueMicrotask<"u"?queueMicrotask.bind(js):typeof process<"u"&&process.nextTick||Ep,G={isArray:Ln,isArrayBuffer:mp,isBuffer:UT,isFormData:ZT,isArrayBufferView:FT,isString:GT,isNumber:gp,isBoolean:jT,isObject:Do,isPlainObject:Qo,isReadableStream:e0,isRequest:t0,isResponse:i0,isHeaders:s0,isUndefined:Pr,isDate:WT,isFile:zT,isBlob:KT,isRegExp:g0,isFunction:Bt,isStream:XT,isURLSearchParams:JT,isTypedArray:h0,isFileList:YT,forEach:Br,merge:Uc,extend:r0,trim:n0,stripBOM:a0,inherits:o0,toFlatObject:l0,kindOf:Po,kindOfTest:hi,endsWith:c0,toArray:u0,forEachEntry:d0,matchAll:f0,isHTMLForm:p0,hasOwnProperty:bp,hasOwnProp:bp,reduceDescriptors:vp,freezeMethods:y0,toObjectSet:w0,toCamelCase:m0,noop:b0,toFiniteNumber:v0,findKey:yp,global:js,isContextDefined:wp,isSpecCompliantForm:E0,toJSONObject:C0,isAsyncFn:T0,isThenable:S0,setImmediate:Ep,asap:x0};function Ie(e,t,i,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}G.inherits(Ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}});const Cp=Ie.prototype,Tp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Tp[e]={value:e}}),Object.defineProperties(Ie,Tp),Object.defineProperty(Cp,"isAxiosError",{value:!0}),Ie.from=(e,t,i,s,n,r)=>{const a=Object.create(Cp);return G.toFlatObject(e,a,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),Ie.call(a,e.message,t,i,s,n),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};const I0=null;function Fc(e){return G.isPlainObject(e)||G.isArray(e)}function Sp(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function xp(e,t,i){return e?e.concat(t).map(function(n,r){return n=Sp(n),!i&&r?"["+n+"]":n}).join(i?".":""):t}function _0(e){return G.isArray(e)&&!e.some(Fc)}const V0=G.toFlatObject(G,{},null,function(t){return/^is[A-Z]/.test(t)});function Ho(e,t,i){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=G.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function($,R){return!G.isUndefined(R[$])});const s=i.metaTokens,n=i.visitor||f,r=i.dots,a=i.indexes,u=(i.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(n))throw new TypeError("visitor must be a function");function d(E){if(E===null)return"";if(G.isDate(E))return E.toISOString();if(!u&&G.isBlob(E))throw new Ie("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(E)||G.isTypedArray(E)?u&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function f(E,$,R){let O=E;if(E&&!R&&typeof E=="object"){if(G.endsWith($,"{}"))$=s?$:$.slice(0,-2),E=JSON.stringify(E);else if(G.isArray(E)&&_0(E)||(G.isFileList(E)||G.endsWith($,"[]"))&&(O=G.toArray(E)))return $=Sp($),O.forEach(function(z,V){!(G.isUndefined(z)||z===null)&&t.append(a===!0?xp([$],V,r):a===null?$:$+"[]",d(z))}),!1}return Fc(E)?!0:(t.append(xp(R,$,r),d(E)),!1)}const y=[],m=Object.assign(V0,{defaultVisitor:f,convertValue:d,isVisitable:Fc});function b(E,$){if(!G.isUndefined(E)){if(y.indexOf(E)!==-1)throw Error("Circular reference detected in "+$.join("."));y.push(E),G.forEach(E,function(O,N){(!(G.isUndefined(O)||O===null)&&n.call(t,O,G.isString(N)?N.trim():N,$,m))===!0&&b(O,$?$.concat(N):[N])}),y.pop()}}if(!G.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ip(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Gc(e,t){this._pairs=[],e&&Ho(e,this,t)}const _p=Gc.prototype;_p.append=function(t,i){this._pairs.push([t,i])},_p.toString=function(t){const i=t?function(s){return t.call(this,s,Ip)}:Ip;return this._pairs.map(function(n){return i(n[0])+"="+i(n[1])},"").join("&")};function A0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vp(e,t,i){if(!t)return e;const s=i&&i.encode||A0;G.isFunction(i)&&(i={serialize:i});const n=i&&i.serialize;let r;if(n?r=n(t,i):r=G.isURLSearchParams(t)?t.toString():new Gc(t,i).toString(s),r){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class Ap{constructor(){this.handlers=[]}use(t,i,s){return this.handlers.push({fulfilled:t,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,function(s){s!==null&&t(s)})}}const $p={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Gc,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},jc=typeof window<"u"&&typeof document<"u",Wc=typeof navigator=="object"&&navigator||void 0,L0=jc&&(!Wc||["ReactNative","NativeScript","NS"].indexOf(Wc.product)<0),M0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",R0=jc&&window.location.href||"http://localhost",ut={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jc,hasStandardBrowserEnv:L0,hasStandardBrowserWebWorkerEnv:M0,navigator:Wc,origin:R0},Symbol.toStringTag,{value:"Module"})),...$0};function N0(e,t){return Ho(e,new ut.classes.URLSearchParams,Object.assign({visitor:function(i,s,n,r){return ut.isNode&&G.isBuffer(i)?(this.append(s,i.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function k0(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function q0(e){const t={},i=Object.keys(e);let s;const n=i.length;let r;for(s=0;s<n;s++)r=i[s],t[r]=e[r];return t}function Lp(e){function t(i,s,n,r){let a=i[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),u=r>=i.length;return a=!a&&G.isArray(n)?n.length:a,u?(G.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!G.isObject(n[a]))&&(n[a]=[]),t(i,s,n[a],r)&&G.isArray(n[a])&&(n[a]=q0(n[a])),!o)}if(G.isFormData(e)&&G.isFunction(e.entries)){const i={};return G.forEachEntry(e,(s,n)=>{t(k0(s),n,i,0)}),i}return null}function O0(e,t,i){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(e)}const Dr={transitional:$p,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const s=i.getContentType()||"",n=s.indexOf("application/json")>-1,r=G.isObject(t);if(r&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return n?JSON.stringify(Lp(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t)||G.isReadableStream(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return N0(t,this.formSerializer).toString();if((o=G.isFileList(t))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ho(o?{"files[]":t}:t,u&&new u,this.formSerializer)}}return r||n?(i.setContentType("application/json",!1),O0(t)):t}],transformResponse:[function(t){const i=this.transitional||Dr.transitional,s=i&&i.forcedJSONParsing,n=this.responseType==="json";if(G.isResponse(t)||G.isReadableStream(t))return t;if(t&&G.isString(t)&&(s&&!this.responseType||n)){const a=!(i&&i.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?Ie.from(o,Ie.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ut.classes.FormData,Blob:ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{Dr.headers[e]={}});const P0=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),B0=e=>{const t={};let i,s,n;return e&&e.split(`
|
82
|
+
aria-labelledby="${t}">${s}</div>`}createIds(){const t={tabWrapperId:"",tabIds:[],tabPanelIds:[]};t.tabWrapperId="catalog-tabwrapper-"+this.randomString(5,"a");for(let i=0;i<3;i++){const s=this.randomString(5,"a");t.tabIds.push("catalog-"+i+"-tab-"+s),t.tabPanelIds.push("catalog-"+i+"-tabpanel-"+s)}return t}tabList(t,i,s){let n=[];return t&&n.push(this.constants.labels.GLOSSARY),i&&n.push(this.constants.labels.KEYWORD_TRANSLATION),s&&n.push(this.constants.labels.GLOSSARY_ILLUSTRATION),n}bindTabListEvents(){const t=document.getElementById(this.idList.tabWrapperId);if(t!==null&&(this.tabElements=t.querySelectorAll('[role="tab"]'),this.tabPanelElements=t.querySelectorAll('[role="tabpanel"]'),this.tabElements.length==this.tabPanelElements.length)){for(let i=0;i<this.tabElements.length;++i)this.addListeners(this.tabElements[i],this.tabPanelElements[i],i);this.bindTabAudioPlayers()}}unbindTabListEvents(){this.removeListeners(),this.unbindTabAudioPlayers()}bindTabAudioPlayers(){this.element.querySelectorAll("audio").forEach(i=>{const s=new SC(i).create();this.audioPlayers.push(s)},this)}unbindTabAudioPlayers(){this.audioPlayers.forEach(t=>{t.removeListeners()},this),this.audioPlayers.splice(0,this.audioPlayers.length)}addListeners(t,i,s){t.addEventListener("click",this.onTabClick),t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp),t.index=s}removeListeners(){this.tabElements.forEach(t=>{t.removeEventListener("click",this.onTabClick),t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp)},this)}tabClickHandler(t){var i=t.target;this.activateTab(i,!1)}keydownHandler(t){switch(t.keyCode){case this.constants.keys.END:t.preventDefault(),this.focusLastTab();break;case this.constants.keys.HOME:t.preventDefault(),this.focusFirstTab();break;case this.constants.keys.UP:case this.constants.keys.DOWN:this.switchTabOnArrowPress(t);break}}switchTabOnArrowPress(t){const i=t.keyCode;if(this.constants.direction[i]){let s=t.target;if(s.index!==void 0){if(this.tabElements[s.index+this.constants.direction[i]]){this.tabElements[s.index+this.constants.direction[i]].focus();return}if(i===this.constants.keys.LEFT||i===this.constants.keys.UP){this.focusLastTab();return}(i===this.constants.keys.RIGHT||i==this.constants.keys.DOWN)&&this.focusFirstTab()}}}keyupHandler(t){switch(t.keyCode){case this.constants.keys.LEFT:case this.constants.keys.RIGHT:this.switchTabOnArrowPress(t);break;case this.constants.keys.ENTER:case this.constants.keys.SPACE:this.activateTab(t.target);break}}activateTab(t,i){i=i||!0,this.deactivateTabs(),t.setAttribute("aria-selected","true");let s=t.getAttribute("aria-controls");document.getElementById(s).classList.remove("hidden"),i&&t.focus()}deactivateTabs(){this.audioPlayers.forEach(t=>{t.pause()},this),this.tabElements.forEach(t=>{t.setAttribute("aria-selected","false")},this),this.tabPanelElements.forEach(t=>{t.classList.add("hidden")},this)}focusFirstTab(){this.tabElements[0].focus()}focusLastTab(){this.tabElements[this.tabElements.length-1].focus()}randomString(t,i){i=i&&i.toLowerCase();let s="";const n=i=="a"?10:0,r=i=="n"?10:62;for(let a=0;a<t;a++){let o=Math.random()*(r-n)+n<<0;s+=String.fromCharCode(o+=o>9?o<36?55:61:48)}return s}}const D=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},IC={name:"CatalogDialog",data(){return{state:{isShown:!1,dragging:!1,hidden:!0,xDiff:0,yDiff:0,x:0,y:0},content:{term:""},tabs:null}},methods:{setContent(e){this.resetDialogContent(),this.setDialogTerm(e.term),this.setDialogContent(e),this.createTabs(this.content)},setDialogContent(e){"data"in e&&e.data.forEach(t=>{switch(t.support){case"glossary-on-screen":this.setDialogGlossary(t.card);break;case"keyword-translation":this.setDialogKeywordTranslation(t.card);break;case"ext:sbac-glossary-illustration":this.setDialogGlossaryIllustration(t.card);break}},this)},resetDialogContent(){"glossary"in this.content&&delete this.content.glossary,"keywordTranslation"in this.content&&delete this.content.keywordTranslation,"glossaryIllustration"in this.content&&delete this.content.glossaryIllustration},setDialogTerm(e){this.content.term=e},setDialogGlossary(e){this.content.glossary=e},setDialogKeywordTranslation(e){this.content.keywordTranslation=e},setDialogGlossaryIllustration(e){this.content.glossaryIllustration=e},createTabs(e){this.tabs.create(e)},focusFirstTab(){this.tabs!==null&&this.tabs.focusFirstTab()},show(){this.state.hidden=!1,this.render(),this.focusFirstTab(),this.state.isShown||(this.state.isShown=!0,this.center())},hide(){this.state.hidden=!0,this.render()},center(){this.$refs.dialog.style.top=window.innerHeight/2-this.$refs.dialog.offsetHeight/2+"px",this.$refs.dialog.style.left=window.innerWidth/2-this.$refs.dialog.offsetWidth/2+"px"},reset(){this.state.x=0,this.state.y=0,this.state.isShown=!1,this.state.hidden=!0,this.render()},render(){this.state.hidden?this.$refs.dialog.style.display="none":this.$refs.dialog.style.display="",this.$refs.dialog.style.transform="translate("+this.state.x+"px, "+this.state.y+"px)"},addListeners(){this.$refs.header.addEventListener("mousedown",this.onMouseDown.bind(this)),this.$refs.header.addEventListener("mousemove",this.onMouseMove.bind(this)),this.$refs.header.addEventListener("mouseup",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("mouseleave",this.onMouseUp.bind(this)),this.$refs.header.addEventListener("touchstart",this.onTouchStart.bind(this)),this.$refs.header.addEventListener("touchmove",this.onTouchMove.bind(this)),this.$refs.header.addEventListener("touchend",this.onTouchEnd.bind(this)),this.$refs.close.addEventListener("click",this.hide.bind(this)),this.$refs.close.addEventListener("touchend",this.hide.bind(this))},removeListeners(){this.$refs.header.removeEventListener("mousedown",this.onMouseDown),this.$refs.header.removeEventListener("mousemove",this.onMouseMove),this.$refs.header.removeEventListener("mouseup",this.onMouseUp),this.$refs.header.removeEventListener("mouseleave",this.onMouseUp),this.$refs.header.removeEventListener("touchstart",this.onTouchStart),this.$refs.header.removeEventListener("touchmove",this.onTouchMove),this.$refs.header.removeEventListener("touchend",this.onTouchEnd),this.$refs.close.removeEventListener("click",this.hide),this.$refs.close.removeEventListener("touchend",this.hide)},onMouseDown(e){this.state.dragging=!0,this.state.xDiff=e.pageX-this.state.x,this.state.yDiff=e.pageY-this.state.y},onTouchStart(e){e.preventDefault(),this.state.dragging=!0,this.state.xDiff=e.targetTouches[0].pageX-this.state.x,this.state.yDiff=e.targetTouches[0].pageY-this.state.y},onMouseMove(e){this.state.dragging&&(this.state.x=e.pageX-this.state.xDiff,this.state.y=e.pageY-this.state.yDiff),this.render()},onTouchMove(e){e.preventDefault(),e.stopPropagation(),this.state.dragging&&(this.state.x=e.targetTouches[0].pageX-this.state.xDiff,this.state.y=e.targetTouches[0].pageY-this.state.yDiff),this.render()},onMouseUp(){this.state.dragging=!1},onTouchEnd(e){e.preventDefault(),this.state.dragging=!1}},mounted(){this.tabs=new xC(this.$refs.body),this.addListeners()},beforeUnmount(){this.tabs.removeListeners(),this.removeListeners()}},_C={ref:"dialog",class:"qti3-player-cat-dialog",role:"dialog",style:{display:"none"}},VC={ref:"header",class:"qti3-player-cat-dialog-header"},AC={class:"qti3-player-cat-dialog-term"},$C={ref:"close",type:"button",class:"qti3-player-cat-dialog-close","aria-label":"Close"},LC={ref:"body",class:"qti3-player-cat-dialog-body"};function MC(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",_C,[l.createElementVNode("div",VC,[l.createElementVNode("span",AC,l.toDisplayString(n.content.term),1),l.createElementVNode("button",$C,"×",512)],512),l.createElementVNode("div",LC,null,512)],512)}const RC=D(IC,[["render",MC]]),NC={name:"AmpStyle",render(){return l.h("style",{},this.$slots.default())}},kC=new F,qC={name:"AmpAudio",emits:["mediaLoaded","mediaEnded","mediaMounted"],props:{},data(){return{audio:null,audioSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",audioLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseAudio(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),(this.isMediaInteractionChild()||this.audioSubType==="audioprogress")&&(this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled"))},handleLoaded(){this.audio&&(this.addControllerEventListeners(),this.duration=Math.round(this.audio.duration),this.displayDuration=this.convertTime(this.duration),this.isMediaInteractionChild()&&this.$parent.$emit("mediaLoaded",{node:this}))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.audioLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening)return;let e=Math.round(this.audio.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleAudio()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleAudio(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.audio.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.audio.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.audio.paused&&(this.wasPlaying=!1,this.toggleAudio()))},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(e){const t=e.target.activeCues;if(t.length>0&&this.showCaptions){const i=t[0].text.replace(/\n/g,"<br/>");console.log("[AmpAudio][currentCue]",i),this.$refs.captions.innerHTML=i}},setPosition(e){this.audio.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleAudio(){this.audio&&(this.isPlaying?(this.isPlaying=!1,this.audio.pause()):(this.isPlaying=!0,this.audio.play()))},playAudio(){this.audio&&(this.audio.play(),this.isPlaying=!0)},pauseAudio(){this.audio&&(this.audio.pause(),this.isPlaying=!1)},toggleVolume(){this.audio&&(this.audio.muted?(this.audio.muted=!1,this.isMuted=!1):(this.audio.muted=!0,this.isMuted=!0))},initSlider(){this.audio&&(this.duration=Math.round(this.audio.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},setAudioSubType(e){this.audioSubType=e,this.audioSubType==="audioprogress"&&(this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0)},getAudioSubType(e){if(e===null)return null;const t=e.class;if(typeof t>"u"||t===null||t.length==0)return null;const i=t.split(" ");for(let s=0;s<i.length;s++)switch(i[s]){case"sbaudio":case"audioprogress":return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"audioprogress"}return null},detectAudioSubType(e){return this.getAudioSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){this.audio=this.$refs.player,this.audio.removeAttribute("controls"),this.audio.removeAttribute("autoplay"),this.textTracksMap=this.filterTextTracks(this.audio.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+kC.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.addEventListener("cuechange",this.handleCueChange);return}},this)},removeTextTrackCueEventListener(){this.audio&&this.audio.textTracks.length!==0&&this.audio.textTracks.forEach(e=>{const t=this.textTracksMap.get(e.id);if(typeof t<"u"&&this.isDefaultTextTrack(t)){e.removeEventListener("cuechange",this.handleCueChange);return}},this)},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.setAudioSubType(this.detectAudioSubType(this.$.vnode.props))},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.audio&&(this.audio.addEventListener("loadedmetadata",this.handleLoaded),this.audio.addEventListener("canplay",this.handleCanPlay),this.audio.addEventListener("timeupdate",this.handleTimeUpdate),this.audio.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"audio"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new c(e.message)}},beforeUnmount(){this.audio&&(this.audio.removeEventListener("loadedmetadata",this.handleLoaded),this.audio.removeEventListener("canplay",this.handleCanPlay),this.audio.removeEventListener("timeupdate",this.handleTimeUpdate),this.audio.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},OC={class:"amp-audio"},PC={class:"amp-audio__holder"},BC={ref:"controller",class:"amp-audio__container"},DC={ref:"playpause",class:"amp-audio-playpause__container"},QC={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},HC={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},UC={ref:"playtimer",class:"amp-playtimer__container"},FC={class:"amp-progress__container"},GC=["max"],jC={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},WC={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},zC={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},KC={class:"amp-audio-captions__container hidden"},YC={class:"amp-audio-captions",ref:"captions"};function XC(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",OC,[l.createElementVNode("div",PC,[l.createElementVNode("audio",l.mergeProps({ref:"player",tabIndex:"-1"},e.$attrs),[l.renderSlot(e.$slots,"default",{},void 0,!0)],16)]),l.createElementVNode("div",BC,[l.createElementVNode("button",DC,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",QC,t[1]||(t[1]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,!n.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",HC,t[2]||(t[2]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,n.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",UC,[l.createElementVNode("span",null,l.toDisplayString(n.displayCurrentTime),1),t[3]||(t[3]=l.createElementVNode("span",null," / ",-1)),l.createElementVNode("span",null,l.toDisplayString(n.displayDuration),1)],512),[[l.vShow,n.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",FC,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>n.currentTime=a),type:"range",min:"0",max:n.duration,class:"slider"},null,8,GC),[[l.vModelText,n.currentTime]])],512),[[l.vShow,n.showProgress]]),l.withDirectives(l.createElementVNode("div",jC,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",WC,t[4]||(t[4]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1)]),512)),[[l.vShow,!n.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",zC,t[5]||(t[5]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1)]),512)),[[l.vShow,n.isMuted]])],512),[[l.vShow,n.showVolumeMute]])],512),l.createElementVNode("div",KC,[l.createElementVNode("div",YC,null,512)])])}const ZC=D(qC,[["render",XC],["__scopeId","data-v-a1958132"]]),JC=new F,eT={name:"AmpVideo",emits:["mediaLoaded","mediaEnded","mediaMounted"],props:{},data(){return{video:null,playerSubType:null,currentTime:0,duration:0,displayCurrentTime:"00:00",displayDuration:"00:00",videoLoaded:!1,isPlaying:!1,isMuted:!1,isTimeUpdateListening:!0,showPlayTimer:!1,showVolumeMute:!1,showProgress:!1,showCaptions:!1,textTracksMap:null,mediaInteractionChild:!1,subtitlesMenu:null,subtitleMenuButtons:[],isDisabled:!1,isQtiValid:!0}},methods:{disable(){this.isDisabled=!0,this.pauseVideo(),this.disableController()},enable(){this.isDisabled=!1,this.enableController()},disableController(){this.$refs.playpause.setAttribute("tabindex","-1"),this.$refs.playpause.classList.add("disabled"),this.$refs.progress.setAttribute("tabindex","-1"),this.$refs.progress.classList.add("disabled"),this.$refs.cc.setAttribute("tabindex","-1"),this.$refs.cc.classList.add("disabled"),this.$refs.volume.setAttribute("tabindex","-1"),this.$refs.volume.classList.add("disabled"),this.$refs.playtimer.classList.add("disabled")},enableController(){this.$refs.playpause.setAttribute("tabindex","0"),this.$refs.playpause.classList.remove("disabled"),this.$refs.progress.setAttribute("tabindex","0"),this.$refs.progress.classList.remove("disabled"),this.$refs.cc.setAttribute("tabindex","0"),this.$refs.cc.classList.remove("disabled"),this.$refs.volume.setAttribute("tabindex","0"),this.$refs.volume.classList.remove("disabled"),this.$refs.playtimer.classList.remove("disabled")},handleLoaded(){this.video&&(this.addControllerEventListeners(),this.duration=Math.round(this.video.duration),this.displayDuration=this.convertTime(this.duration),this.isMediaInteractionChild()&&this.$parent.$emit("mediaLoaded",{node:this}))},handleEnded(){this.isPlaying=!1,this.isMediaInteractionChild()&&this.$parent.$emit("mediaEnded",{})},handleCanPlay(){this.videoLoaded=!0},handleTimeUpdate(){if(!this.isTimeUpdateListening||!this.video)return;let e=Math.round(this.video.currentTime);this.currentTime=e,this.displayCurrentTime=this.convertTime(e)},handlePlayPauseClick(){this.isDisabled||this.toggleVideo()},handlePlayPauseKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVideo(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleProgressMouseDown(){this.isDisabled||(this.isTimeUpdateListening=!1,this.video.paused?this.wasPlaying=!1:(this.wasPlaying=!0,this.video.pause(),this.isPlaying=!1))},handleProgressInput(e){this.isDisabled||(this.displayCurrentTime=this.convertTime(e.target.valueAsNumber))},handleProgressChange(e){this.isDisabled||(this.setPosition(e.target.valueAsNumber),this.isTimeUpdateListening=!0,this.wasPlaying&&this.video.paused&&(this.wasPlaying=!1,this.toggleVideo()))},handleCaptionsClick(){this.isDisabled||this.toggleCaptionsMenu()},handleCaptionsKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleCaptionsMenu(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},toggleCaptionsMenu(){this.subtitlesMenu.style.display=this.subtitlesMenu.style.display==="block"?"none":"block"},handleVolumeMuteClick(){this.isDisabled||this.toggleVolume()},handleVolumeMuteKeydown(e){if(this.isDisabled)return;let t=!1;switch(e.code){case"Space":case"Enter":this.toggleVolume(),t=!0;break}t&&(e.stopPropagation(),e.preventDefault())},handleCueChange(){},setPosition(e){this.video.currentTime=e,this.displayCurrentTime=this.convertTime(e)},toggleVideo(){this.video&&(this.isPlaying?(this.isPlaying=!1,this.video.pause()):(this.isPlaying=!0,this.video.play()))},playVideo(){this.video&&(this.video.play(),this.isPlaying=!0)},pauseVideo(){this.video&&(this.video.pause(),this.isPlaying=!1)},toggleVolume(){this.video&&(this.video.muted?(this.video.muted=!1,this.isMuted=!1):(this.video.muted=!0,this.isMuted=!0))},initSlider(){this.video&&(this.duration=Math.round(this.video.duration))},convertTime(e){let t=new Date(e*1e3).toISOString().substr(11,8);return t.indexOf("00:")===0&&(t=t.substr(3)),t},getPlayerSubType(){return this.showProgress=!0,this.showPlayTimer=!0,this.showVolumeMute=!0,"ampvideo-default"},detectPlayerSubType(e){return this.getPlayerSubType(e)},isMediaInteractionChild(){return this.mediaInteractionChild},detectMediaInteractionChild(){this.mediaInteractionChild=this.$parent.$el.classList.contains("qti3-player-media-group")},processChildren(){if(this.video=this.$refs.player,this.video.removeAttribute("controls"),this.video.removeAttribute("autoplay"),this.video.hasAttribute("width")){const e=`${this.video.getAttribute("width")}`,t=e.endsWith("%")?`width:${e}`:`width:${e}px`;this.$refs.videocontainer.setAttribute("style",t),this.$refs.controller.setAttribute("style",t)}else this.video.setAttribute("width","100%");this.textTracksMap=this.filterTextTracks(this.video.querySelectorAll("track"))},filterTextTracks(e){let t=new Map;return e.forEach(i=>{switch(i.getAttribute("kind")){case"subtitles":case"captions":i.hasAttribute("id")||i.setAttribute("id","track-"+JC.randomString(5,"a")),t.set(i.getAttribute("id"),i);break}},this),t},isDefaultTextTrack(e){return e.hasAttribute("default")},addTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.showCaptions=!0,this.initializeSubtitlesMenu();for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];t.mode="hidden",this.addSubtitlesMenuItem(t),typeof this.textTracksMap.get(t.id)<"u"&&t.addEventListener("cuechange",this.handleCueChange)}this.$refs.videocontainer.appendChild(this.subtitlesMenu)}},removeTextTrackCueEventListener(){if(this.video&&this.video.textTracks.length!==0){this.subtitleMenuButtons.forEach(e=>{e.removeEventListener("click",this.handleSubtitleButtonClick)});for(let e=0;e<this.video.textTracks.length;e++){const t=this.video.textTracks[e];typeof this.textTracksMap.get(t.id)<"u"&&t.removeEventListener("cuechange",this.handleCueChange)}}},initializeSubtitlesMenu(){const e=document.createDocumentFragment();this.subtitlesMenu=e.appendChild(document.createElement("ul")),this.subtitlesMenu.className="ampvideo-subtitles-menu",this.subtitlesMenu.appendChild(this.createMenuItem("subtitles-off","","Off"))},addSubtitlesMenuItem(e){this.subtitlesMenu.appendChild(this.createMenuItem(`subtitles-${e.language}`,e.language,e.label))},createMenuItem(e,t,i){const s=document.createElement("li"),n=s.appendChild(document.createElement("button"));return n.setAttribute("id",e),n.className="ampvideo-subtitles-button",t.length>0&&n.setAttribute("lang",t),n.value=i,t===""?n.setAttribute("data-state","active"):n.setAttribute("data-state","inactive"),n.appendChild(document.createTextNode(i)),n.addEventListener("click",this.handleSubtitleButtonClick),this.subtitleMenuButtons.push(n),s},handleSubtitleButtonClick(e){const t=e.currentTarget;this.subtitleMenuButtons.forEach(s=>{s.setAttribute("data-state","inactive")});const i=t.getAttribute("lang");for(let s=0;s<this.video.textTracks.length;s++)this.video.textTracks[s].language===i?(this.video.textTracks[s].mode="showing",t.setAttribute("data-state","active")):this.video.textTracks[s].mode="hidden";i===null&&t.setAttribute("data-state","active"),this.subtitlesMenu.style.display="none"},addControllerEventListeners(){this.$refs.playpause.addEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.addEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.addEventListener("input",this.handleProgressInput),this.$refs.progress.addEventListener("change",this.handleProgressChange),this.$refs.progress.addEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.addEventListener("click",this.handleCaptionsClick),this.$refs.cc.addEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.addEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.addEventListener("keydown",this.handleVolumeMuteKeydown)},removeControllerEventListeners(){this.$refs.playpause.removeEventListener("click",this.handlePlayPauseClick),this.$refs.playpause.removeEventListener("keydown",this.handlePlayPauseKeydown),this.$refs.progress.removeEventListener("input",this.handleProgressInput),this.$refs.progress.removeEventListener("change",this.handleProgressChange),this.$refs.progress.removeEventListener("mousedown",this.handleProgressMouseDown),this.$refs.cc.removeEventListener("click",this.handleCaptionsClick),this.$refs.cc.removeEventListener("keydown",this.handleCaptionsKeydown),this.$refs.volume.removeEventListener("click",this.handleVolumeMuteClick),this.$refs.volume.removeEventListener("keydown",this.handleVolumeMuteKeydown)}},created(){this.playerSubType=this.detectPlayerSubType(this.$.vnode.props)},mounted(){if(this.isQtiValid)try{if(this.detectMediaInteractionChild(),this.processChildren(),this.$nextTick(function(){this.video&&(this.video.addEventListener("loadedmetadata",this.handleLoaded),this.video.addEventListener("canplay",this.handleCanPlay),this.video.addEventListener("timeupdate",this.handleTimeUpdate),this.video.addEventListener("ended",this.handleEnded),this.addTextTrackCueEventListener())}),this.isMediaInteractionChild()){this.$parent.$emit("mediaMounted",{node:this,mediaType:"video"});return}this.enable()}catch(e){throw this.isQtiValid=!1,new c(e.message)}},beforeUnmount(){this.video&&(this.video.removeEventListener("loadedmetadata",this.handleLoaded),this.video.removeEventListener("canplay",this.handleCanPlay),this.video.removeEventListener("timeupdate",this.handleTimeUpdate),this.video.removeEventListener("ended",this.handleEnded),this.removeTextTrackCueEventListener()),this.removeControllerEventListeners()}},tT={ref:"videocontainer",class:"amp-video"},iT={class:"amp-video__holder"},sT={ref:"controller",class:"amp-video__container"},nT={ref:"playpause",class:"amp-video-playpause__container"},rT={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},aT={class:"amp-playpause-button",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},oT={ref:"playtimer",class:"amp-playtimer__container"},lT={class:"amp-progress__container"},cT=["max"],uT={ref:"cc",class:"amp-video-cc__container","aria-label":"Captions menu"},hT={ref:"volume",class:"amp-video-volumemute__container","aria-label":"Volume mute or unmute"},dT={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},fT={class:"amp-volumemute-button","aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function pT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tT,[l.createElementVNode("div",iT,[l.createElementVNode("video",l.mergeProps({ref:"player",tabIndex:"-1",class:"amp-video__video"},e.$attrs),[l.renderSlot(e.$slots,"default")],16)]),l.createElementVNode("div",sT,[l.createElementVNode("button",nT,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",rT,t[1]||(t[1]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,!n.isPlaying]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",aT,t[2]||(t[2]=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)]),512)),[[l.vShow,n.isPlaying]])],512),l.withDirectives(l.createElementVNode("div",oT,[l.createElementVNode("span",null,l.toDisplayString(n.displayCurrentTime),1),t[3]||(t[3]=l.createElementVNode("span",null," / ",-1)),l.createElementVNode("span",null,l.toDisplayString(n.displayDuration),1)],512),[[l.vShow,n.showPlayTimer]]),l.withDirectives(l.createElementVNode("div",lT,[l.withDirectives(l.createElementVNode("input",{ref:"progress","onUpdate:modelValue":t[0]||(t[0]=a=>n.currentTime=a),type:"range",min:"0",max:n.duration,class:"slider"},null,8,cT),[[l.vModelText,n.currentTime]])],512),[[l.vShow,n.showProgress]]),l.withDirectives(l.createElementVNode("div",uT," CC ",512),[[l.vShow,n.showCaptions]]),l.withDirectives(l.createElementVNode("div",hT,[l.withDirectives((l.openBlock(),l.createElementBlock("svg",dT,t[4]||(t[4]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},null,-1)]),512)),[[l.vShow,!n.isMuted]]),l.withDirectives((l.openBlock(),l.createElementBlock("svg",fT,t[5]||(t[5]=[l.createElementVNode("path",{fill:"currentColor",d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},null,-1)]),512)),[[l.vShow,n.isMuted]])],512),[[l.vShow,n.showVolumeMute]])],512)],512)}const mT=D(eT,[["render",pT]]);class gT{constructor(t,i){te(this,"constants",{supports:{GLOSSARY:"glossary-on-screen",KEYWORD_TRANSLATION:"keyword-translation",EXT_SBAC_GLOSSARY_ILLUSTRATION:"ext:sbac-glossary-illustration"},GLOSSARY_CLICKABLE_CLASS:"qti3-player-catalog-clickable-term",LANGUAGE_OFF:"",keys:{ENTER:13,SPACE:32}});return this.item=t,this.itemElement=t.$refs.item,this.store=i,this.nodeList=null,this.showGlossary=this.showGlossaryHandler.bind(this),this.onKeyDown=this.keydownHandler.bind(this),this}bindAll(){this.store.getCatalogs().length!==0&&(this.resetAll(),this.nodeList=this.itemElement.querySelectorAll("[data-catalog-idref]"),this.nodeList.length!==0&&this.bindGlossary(this.nodeList))}resetAll(){this.nodeList!==null&&(this.nodeList.forEach(t=>{this.unbindGlossaryDOM(t)},this),this.nodeList=null)}getPnpGlossarySupports(t){let i=[];return t.getGlossaryOnScreen()&&i.push(this.constants.supports.GLOSSARY),t.getKeywordTranslationLanguage()!==this.constants.LANGUAGE_OFF&&i.push(`${this.constants.supports.KEYWORD_TRANSLATION}:${t.getKeywordTranslationLanguage()}`),t.getExtSbacGlossaryIllustration()&&i.push(this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION),i}bindGlossary(t){const i=this.getPnpGlossarySupports(this.store.getItemContextPnp());i.length!==0&&t.forEach(s=>{this.bindGlossaryNode(s,i)},this)}bindGlossaryNode(t,i){const s=t.getAttribute("data-catalog-idref"),n=this.store.getCatalog(s);typeof n>"u"||this.hasCatalogGlossarySupport(n,i)&&this.bindGlossaryDOM(t)}bindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)||(t.classList.add(this.constants.GLOSSARY_CLICKABLE_CLASS),t.setAttribute("tabindex","0"),this.setGlossaryTerm(t),t.addEventListener("click",this.showGlossary),t.addEventListener("touchend",this.showGlossary),t.addEventListener("keydown",this.onKeyDown))}unbindGlossaryDOM(t){t.classList.contains(this.constants.GLOSSARY_CLICKABLE_CLASS)&&(t.classList.remove(this.constants.GLOSSARY_CLICKABLE_CLASS),t.setAttribute("tabindex","-1"),t.removeEventListener("click",this.showGlossary),t.removeEventListener("touchend",this.showGlossary),t.removeEventListener("keydown",this.keyDownHandler))}setGlossaryTerm(t){if(!t.hasAttribute("data-glossary-term")){if(t.hasAttribute("data-sbac-term")){t.setAttribute("data-glossary-term",t.getAttribute("data-sbac-term"));return}t.setAttribute("data-glossary-term",t.innerText)}}showGlossaryHandler(t){t.preventDefault(),t.stopPropagation(),this.emitShowGlossaryEvent(t)}keydownHandler(t){let i=!1;switch(t.keyCode){case this.constants.keys.SPACE:case this.constants.keys.ENTER:this.emitShowGlossaryEvent(t),i=!0;break}i&&(t.stopPropagation(),t.preventDefault())}emitShowGlossaryEvent(t){const i=t.target.getAttribute("data-catalog-idref"),s=this.createGlossaryData(i);this.item.$parent.$emit("itemCatalogEvent",{type:"glossary",catalogIdRef:i,term:t.target.getAttribute("data-glossary-term"),data:s})}createGlossaryData(t){const i=this.store.getCatalog(t),s=this.getPnpGlossarySupports(this.store.getItemContextPnp());return this.createGlossaryDataFromCatalog(i,s)}createGlossaryDataFromCatalog(t,i){let s=[];return i.forEach(n=>{const r=this.findCatalogCardBySupport(t,n);if(r!==null){if(n===this.constants.supports.GLOSSARY||n===this.constants.supports.EXT_SBAC_GLOSSARY_ILLUSTRATION){const a=this.createGlossaryContent(r);if(a===null)return;s.push({support:n,card:a});return}if(n.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)){const a=this.getLanguageCodeFromSupport(n),o=this.createTranslationContent(r,a);if(o===null)return;s.push({support:this.constants.supports.KEYWORD_TRANSLATION,card:o});return}}},this),s}hasCatalogGlossarySupport(t,i){let s=null;return i.forEach(n=>{let r=this.findCatalogCardBySupport(t,n);if(r!==null){s=r;return}},this),s!=null}getLanguageCodeFromSupport(t){const i=t.indexOf(":");return t.length>i+1?t.substring(i+1):""}findCatalogCardBySupport(t,i){return typeof t>"u"?null:this.findCardBySupport(t.node.getCards(),i)}findCardBySupport(t,i){let s=null,n="";return i.startsWith(`${this.constants.supports.KEYWORD_TRANSLATION}:`)&&(n=this.getLanguageCodeFromSupport(i),i=this.constants.supports.KEYWORD_TRANSLATION),t.forEach(r=>{if(r.support===i){if(i===this.constants.supports.KEYWORD_TRANSLATION&&this.createTranslationContent(r,n)===null)return;s=r;return}},this),s}createGlossaryContent(t){return this.getGlossaryCardContent(t)}createTranslationContent(t,i){let s=this.getTranslationCardContent(t,i);return s!==null?s:this.getTranslationCardContent(t,i,!0)}getGlossaryCardContent(t){let i=null;return t.getChildren().forEach(s=>{switch(s.$options.name){case"QtiHtmlContent":i=this.createContent("qti-html-content",s);return;case"QtiFileRef":i=this.createContent("qti-file-ref",s);return;case"QtiCardEntry":i=this.getGlossaryCardContent(s);return;default:return}},this),i}getTranslationCardContent(t,i,s=!1,n=0){if(n>1||n==0&&t.getLanguage().length>0&&t.getLanguage()!==i)return null;let r=null;return t.getChildren().forEach(a=>{switch(a.$options.name){case"QtiHtmlContent":r=this.createContent("qti-html-content",a);return;case"QtiFileRef":r=this.createContent("qti-file-ref",a);return;case"QtiCardEntry":if(s&&a.isDefault()){r=this.getTranslationCardContent(a,i,s,n+1);return}if(a.getLanguage()===i){r=this.getTranslationCardContent(a,i,s,n+1);return}return;default:return}},this),r}createContent(t,i){return{properties:{name:t},content:i.getContent()}}}const yT={name:"EventListener",emits:["templateProcessingReady","itemBodyReady"],setup(e,t){return()=>{var i,s;return((s=(i=t.slots).default)==null?void 0:s.call(i))??null}}},wT=new F,bT={name:"QtiAssessmentItem",components:{EventListener:yT},emits:["itemReady","itemCompleted","itemSuspendAttemptReady","itemEndAttemptReady","itemScoreAttemptReady","itemCatalogEvent","itemNewTemplate","itemNewTemplateCompleted"],props:{identifier:{type:String,required:!0},title:{type:String,required:!1},adaptive:{type:String,required:!1},timeDependent:{type:String,required:!1},"xml:lang":{type:String,required:!1}},data(){return{isAdaptive:!1,isTimeDependent:!1,lang:null,locale:null,catalogFactory:null,getResponsesCallback:null}},methods:{getEndAttempt(e){this.endAttempt(void 0,(function(){this.notifyAttemptResults("itemEndAttemptReady",e)}).bind(this))},getSuspendAttempt(e){M.updateItemDuration(),this.getResponses((function(){this.evaluateAttemptValidity(M.getItemContextSessionControl().getValidateResponses()),this.notifyAttemptResults("itemSuspendAttemptReady",e)}).bind(this))},getScoreAttempt(e){this.processResponses(!0),this.notifyAttemptResults("itemScoreAttemptReady",e)},notifyAttemptResults(e,t){const i=new Ec(this.identifier,M);this.$parent.$emit(e,{state:i.getSerializedState(),target:typeof t<"u"?t:null})},notifyEndAttemptInteractionResults(){const t=new Ec(this.identifier,M).getSerializedState();M.getItemContextSessionControl().getValidateResponses()&&t.validationMessages.length>0&&M.getInteractions().forEach(i=>{i.interactionType==="EndAttemptInteraction"&&i.interactionSubType==="endattempt-controller-bar"&&i.enable()}),this.$parent.$emit("itemEndAttemptReady",{state:t,target:null})},handleTemplateProcessingReady(e){console.log("[QtiAssessmentItem][TemplateProcessingReady]"),M.defineTemplateProcessing({node:e.templateProcessing}),M.hasItemContextState()||this.executeTemplateProcessing()},handleItemBodyReady(e){console.log("[QtiAssessmentItem][ItemBodyReady][Adaptive="+this.isAdaptive+"]",e),M.defineItemBody({node:e.itemBody}),this.initializeResponseDeclarations(M.hasItemContextState()),this.initializeOutcomeDeclarations(M.hasItemContextState()),this.isAdaptive&&this.evaluateFeedbacks(),(M.getItemLifecycleStatus()==="closed"||M.getItemLifecycleStatus()==="review"||M.getItemLifecycleStatus()==="solution")&&(M.resetItemTimer(),this.disableInteractions())},getItemBody(){return M.getItemBody()},getTemplateProcessing(){let e=M.getProcessing("template");return typeof e>"u"?null:e.node},getResponseProcessing(){let e=M.getProcessing("response");return typeof e>"u"?null:e.node},newTemplate(){console.log("[QtiAssessmentItem][NewTemplate][Started]"),this.$parent.$emit("itemNewTemplate"),this.resetResponseDeclarations(),this.resetInteractions(),this.resetTemplateDeclarations(),this.executeTemplateProcessing(),this.evaluatePrintedVariables(),this.evaluateTemplateMathVariables(),this.evaluateTemplates(),this.resetOutcomeDeclarations(),this.evaluateFeedbacks(),M.restartItemTimer(),console.log("[QtiAssessmentItem][NewTemplate][Completed]"),this.$parent.$emit("itemNewTemplateCompleted")},evaluateTemplateMathVariables(){if(M.getTemplateMathParameterVariables().length===0)return;const t=this.getItemBody();t!==null&&t.updateTemplateMathVariables(),M.getFeedbacks().forEach(i=>{i.feedbackType==="Modal"&&i.node.updateTemplateMathVariables()})},executeTemplateProcessing(){let e=this.getTemplateProcessing();e!==null&&e.evaluate()},initializeOutcomeDeclarations(e){e?M.restoreOutcomeVariables():this.resetOutcomeDeclarations()},resetOutcomeDeclarations(){M.getOutcomeDeclarations().forEach(e=>{this.resetOutcomeDeclaration(e)},this)},resetOutcomeDeclaration(e){if(e.node!==void 0){e.node.reset();return}M.setOutcomeVariableValue({identifier:e.identifier,value:e.defaultValue})},initializeResponseDeclarations(e){e?M.restoreResponseVariables():this.resetResponseDeclarations()},resetResponseDeclarations(){M.getResponseDeclarations().forEach(e=>{e.resetValue&&e.resetValue()})},resetTemplateDeclarations(){M.getTemplateDeclarations().forEach(e=>{e.node.reset()})},resetInteractions(){M.getInteractions().forEach(e=>{console.log("[ResetInteractions]["+e.identifier+"]",e),e.resetValue&&e.resetValue(),e.node.enable&&e.node.enable()}),M.resetInteractionStateIsValidResponse()},disableInteractions(){M.getInteractions().forEach(e=>{e.node.disable&&e.node.disable()})},showSolutionInteractions(){M.getItemContextSessionControl().getShowSolution()&&M.getItemLifecycleState()==="solution"&&M.getInteractions().forEach(e=>{e.node.showSolution&&e.node.showSolution(M.getResponseVariableCorrectResponse(e.identifier))})},evaluateFeedbacks(){console.log("[EvaluateFeedback][Started]"),M.getFeedbacks().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateFeedback][Completed]")},evaluatePrintedVariables(){console.log("[EvaluatePrintedVariables][Started]"),M.getPrintedVariables().forEach(e=>{e.node.evaluate()}),console.log("[EvaluatePrintedVariables][Completed]")},evaluateTemplates(){console.log("[EvaluateTemplates][Started]"),M.getTemplates().forEach(e=>{e.node.evaluate()}),console.log("[EvaluateTemplates][Completed]")},endAttempt(e,t){console.log("[EndAttempt][Start][Identifier]",this.identifier),M.updateItemDuration(),this.getResponses((function(){if(!this.evaluateAttemptValidity(M.getItemContextSessionControl().getValidateResponses())){console.log("[EndAttempt][InvalidResponses][Identifier]",this.identifier),t&&t();return}this.processResponses(),this.isAdaptive&&this.evaluateItemCompleted(),this.updateItemBodyUI(e),console.log("[EndAttempt][Complete][Identifier]",this.identifier),t&&t()}).bind(this))},updateItemBodyUI(e){typeof e>"u"||e.interactionSubType!=="endattempt-controller-bar"&&M.getInteractions().forEach(t=>{if(t.interactionType==="EndAttemptInteraction"){if(t.interactionSubType==="endattempt-controller-bar"){t.disable();return}if(this.isAdaptive){if(this.isAdaptiveItemCompleted()){t.disable();return}t.enable()}}})},getResponses(e){console.log("[GetResponses][Start]"),M.getAsyncStateMap().clear(),this.getResponsesCallback=e;let t=M.getResponseDeclarations();for(let i=0;i<t.length;i++){const s=t[i],n=M.getInteraction(s.identifier);if(typeof n>"u"){s.identifier!=="numAttempts"&&s.identifier!=="duration"&&M.resetResponseVariableValue({identifier:s.identifier,value:s.defaultValue,state:null});continue}if(n.interactionType!=="PortableCustom"){console.log("[GetResponses]["+s.identifier+"]:",n.node.getResponse()),M.setResponseVariableValue({identifier:s.identifier,value:n.node.getResponse(),state:n.node.getState()});continue}n.node.pciIsReady()?M.getAsyncStateMap().set(n.identifier,{identifier:n.identifier,node:n.node}):M.setResponseVariableValue({identifier:s.identifier,value:n.node.getResponse(),state:n.node.getState()})}this.initiateAsyncGetResponsesRequests()},initiateAsyncGetResponsesRequests(){if(M.getAsyncStateMap().size===0)return this.triggerGetResponsesComplete();for(const[e,t]of M.getAsyncStateMap().entries())console.log("[GetResponses]["+e+"][PCI Initiate]"),t.node.getStateRequest()},triggerGetResponsesComplete(){console.log("[GetResponses][Complete]"),typeof this.getResponsesCallback=="function"&&this.getResponsesCallback()},evaluateItemCompleted(){this.isAdaptiveItemCompleted()&&(M.resetItemTimer(),this.$parent.$emit("itemCompleted"))},isAdaptiveItemCompleted(){return M.getOutcomeDeclaration("completionStatus").value==="completed"},processResponses(e=!1){console.log("[ProcessResponses][Started]"),e||M.incrementNumAttempts(),console.log("[ProcessResponses][IsAdaptive]",this.isAdaptive),this.isAdaptive||this.resetOutcomeDeclarations();let t=this.getResponseProcessing();t!==null&&t.evaluate(),e||(this.printOutcomeDeclarations(),this.evaluatePrintedVariables(),M.getItemContextSessionControl().getShowFeedback()&&this.evaluateFeedbacks()),console.log("[ProcessResponses][Completed]")},evaluateAttemptValidity(e){return e?(M.resetItemContextValidationMessages(),this.evaluateInteractionResponseValidity(M.getInteractions())):!0},evaluateInteractionResponseValidity(e){let t=!0;return e.forEach(i=>{i.isValidResponse||(M.addItemContextValidationMessage({identifier:i.identifier,message:i.invalidResponseMessage}),t=!1)}),t},bindCatalog(){this.catalogFactory!==null&&this.catalogFactory.bindAll()},setLang(e,t){t!==null&&e.setAttribute("lang",t)},coerceItemAttributes(){this.isTimeDependent=typeof this.timeDependent>"u"?!1:this.timeDependent==="true",this.isAdaptive=typeof this.adaptive>"u"?!1:this.adaptive==="true",this.lang=wT.parseXmlLangAttribute(this.$props["xml:lang"]),this.locale=this.lang===null?"en":this.lang},printOutcomeDeclarations(){M.getOutcomeDeclarations().forEach(e=>{(this.isAdaptive||e.identifier!=="completionStatus")&&console.log("[ProcessResponses][Outcomes]["+e.identifier+"][Value]",e.value)})}},errorCaptured(e,t){return console.log("["+e.name+"]["+t.$options.name+"] "+e.message),!1},created(){this.coerceItemAttributes()},mounted(){this.setLang(this.$refs.item,this.lang),this.catalogFactory=new gT(this,M),this.bindCatalog(),this.$parent.$emit("itemReady",{item:this})},beforeUnmount(){this.catalogFactory!==null&&this.catalogFactory.resetAll()}},vT={ref:"item",class:"qti-assessment-item"};function ET(e,t,i,s,n,r){const a=l.resolveComponent("event-listener");return l.openBlock(),l.createElementBlock("div",vT,[l.createVNode(a,{onTemplateProcessingReady:r.handleTemplateProcessingReady,onItemBodyReady:r.handleItemBodyReady},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(e.$slots,"default")])]),_:3},8,["onTemplateProcessingReady","onItemBodyReady"])],512)}const CT=D(bT,[["render",ET]]),ko=new F,TT=new ie,ST={name:"QtiContextDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,defaultValue:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return this.declarationContext},initializeValue(){if(this.getIdentifier()==="QTI_CONTEXT"){this.initializeQtiContext();return}if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(TT.nullValue())},initializeQtiContext(){const e=new Map;e.set("candidateIdentifier",new Ge("candidateIdentifier","string",null)),e.set("testIdentifier",new Ge("testIdentifier","string",null)),e.set("environmentIdentifier",new Ge("environmentIdentifier","string",null)),this.defaultValue!==null&&this.defaultValue.forEach((t,i)=>{e.set(i,new Ge(i,t.getBaseType(),t.getValue()))}),this.setValue(e)},reset(){this.initializeValue()},computeDeclarationContext(){var e,t,i;this.declarationContext=((i=(t=(e=this.$parent)==null?void 0:e.$parent)==null?void 0:t.$options)==null?void 0:i.name)==="QtiAssessmentTest"?"TEST":"ITEM"},getStore(){return this.declarationContext==="TEST"?tt:M},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(ko.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}throw new c('Element must be one of qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})}},created:function(){try{this.computeDeclarationContext(),ko.validateCardinality(this.cardinality),ko.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),ko.validateIdentifierAttribute(this.identifier),this.validateChildren(),this.getStore().defineContextDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,resetValue:this.reset,defaultValue:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.initializeValue();const e={identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),resetValue:this.reset,defaultValue:this.defaultValue};this.declarationContext==="TEST"?tt.defineContextDeclaration(e):M.defineContextDeclaration(e),console.log("["+this.$options.name+"]["+this.identifier+"]["+this.declarationContext+"][DefaultValue]",this.defaultValue)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},xT=["identifier"];function IT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-context-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,xT)}const _T=D(ST,[["render",IT]]),qo=new F,VT=new ie,AT={name:"QtiResponseDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0}},data(){return{value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},getState(){return this.state},setState(e){this.state=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getCorrectResponse(){return this.correctResponse},getMapping(){return this.mapping},getAreaMapping(){return this.areaMapping},getDeclarationContext(){return"ITEM"},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(VT.nullValue())},validateChildren(){let e=!1,t=!1,i=!1,s=!1;this.$slots.default&&this.$slots.default().forEach(n=>{if(qo.isValidSlot(n)){if(n.type.name==="QtiCorrectResponse"){if(!e)return e=!0;throw new c("Maximum of 1 qti-correct-response element permitted")}if(n.type.name==="QtiDefaultValue"){if(!t)return t=!0;throw new c("Maximum of 1 qti-default-value element permitted")}if(n.type.name==="QtiMapping"){if(!i)return i=!0;throw new c("Maximum of 1 qti-mapping element permitted")}if(n.type.name==="QtiAreaMapping"){if(this.getCardinality()!=="record"&&this.getBaseType()!=="point")throw new c(`Invalid qti-area-mapping definition. Variable base-type is "${this.getBaseType()}", not "point"`);if(!s)return s=!0;throw new c("Maximum of 1 qti-area-mapping element permitted")}throw new c('Element must be one of qti-correct-response, qti-default-value, qti-mapping, qti-area-mapping: "'+n.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiCorrectResponse")return this.correctResponse=t.component.proxy.getValue();if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();if(t.type.name==="QtiMapping")return this.mapping=t.component.proxy;if(t.type.name==="QtiAreaMapping")return this.areaMapping=t.component.proxy;throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(console.log("[ResponseDeclaration]["+e+"][priorState]",t),t===null)return null;if(!("value"in t))throw new B('Variable Restore State Invalid. "value" property not found.');if(!("state"in t))throw new B('Variable Restore State Invalid. "state" property not found.');return this.setValue(t.value),this.setState(t.state),t}},created(){try{qo.validateCardinality(this.cardinality),qo.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),qo.validateIdentifierAttribute(this.identifier),this.validateChildren(),M.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,state:null,defaultValue:null,correctResponse:null,mapping:null,areaMapping:null})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),M.defineResponseDeclaration({identifier:this.getIdentifier(),baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),state:this.getState(),defaultValue:this.getDefaultValue(),correctResponse:this.getCorrectResponse(),mapping:this.getMapping(),areaMapping:this.getAreaMapping()}),console.log("["+this.$options.name+"]["+this.identifier+"][CorrectResponse]",this.correctResponse,"[Mapping]",this.mapping)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},$T=["identifier"];function LT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-response-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,$T)}const MT=D(AT,[["render",LT]]),Gs=new F,fp=new ie,RT={name:"QtiOutcomeDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},view:{type:String,required:!1,default:null},interpretation:{type:String,required:!1,default:null},longInterpretation:{type:String,required:!1,default:null},normalMaximum:{type:String,required:!1},normalMinimum:{type:String,required:!1},masteryValue:{type:String,required:!1},externalScored:{type:String,required:!1,default:null},variableIdentifierRef:{type:String,required:!1,default:null}},data(){return{value:null,defaultValue:null,lookupTable:null,isQtiValid:!0,normalMaximumValue:null,normalMinimumValue:null,masteryValueValue:null,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getNormalMaximumValue(){return this.normalMaximumValue},getNormalMinimumValue(){return this.normalMinimumValue},getMasteryValueValue(){return this.masteryValueValue},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return this.declarationContext},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}if(this.getCardinality()==="single"&&fp.isBaseTypeNumeric(this.getBaseType())){this.setValue(new j(0).toNumber());return}this.setValue(fp.nullValue())},reset(){this.initializeValue(),this.getStore().setOutcomeVariableValue({identifier:this.identifier,value:this.getValue()})},computeDeclarationContext(){var e,t,i;this.declarationContext=((i=(t=(e=this.$parent)==null?void 0:e.$parent)==null?void 0:t.$options)==null?void 0:i.name)==="QtiAssessmentTest"?"TEST":"ITEM"},getStore(){return this.declarationContext==="TEST"?tt:M},validateChildren(){let e=!1,t=!1,i=!1;this.$slots.default&&this.$slots.default().forEach(s=>{if(Gs.isValidSlot(s)){if(s.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}if(s.type.name==="QtiMatchTable"){if(i)throw new c("Maximum of 1 lookupTable permitted");if(!t)return t=!0;throw new c("Maximum of 1 qti-match-table element permitted")}if(s.type.name==="QtiInterpolationTable"){if(t)throw new c("Maximum of 1 lookupTable permitted");if(!i)return i=!0;throw new c("Maximum of 1 qti-interpolation-table element permitted")}throw new c('Element must be one of qti-default-value, qti-match-table, qti-interpolation-table: "'+s.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.component!==null){if(t.type.name==="QtiDefaultValue")return this.defaultValue=t.component.proxy.getValue();if(t.type.name==="QtiMatchTable"||t.type.name==="QtiInterpolationTable")return this.lookupTable=t.component.proxy;throw new c("["+this.$options.name+'][Unhandled Child Node]: "'+t.type.name+'"')}})}},created(){try{if(this.computeDeclarationContext(),Gs.validateCardinality(this.cardinality),Gs.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Gs.validateIdentifierAttribute(this.identifier),this.validateChildren(),this.normalMaximumValue=Gs.validateFloatAttribute("normal-maximum",this.normalMaximum,!1,null),this.normalMaximumValue!==null&&this.normalMaximumValue<=0)throw new c('Outcome declaration "'+this.identifier+'" has invalid normal-maximum attribute value. Must be a positive value.');if(this.normalMinimumValue=Gs.validateFloatAttribute("normal-minimum",this.normalMinimum,!1,null),this.masteryValueValue=Gs.validateFloatAttribute("mastery-value",this.masteryValue,!1,null),this.identifier==="SCORE"||this.identifier==="MAXSCORE"){if(typeof this.baseType>"u"||this.baseType!=="float")throw new c('Outcome declaration "'+this.identifier+'" has invalid base-type. Must be base-type="float".');if(typeof this.cardinality>"u"||this.cardinality!=="single")throw new c('Outcome declaration "'+this.identifier+'" has invalid cardinality. Must be cardinality="single".')}this.getStore().defineOutcomeDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:null,defaultValue:null,node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.initializeValue();const e={identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),view:this.view,interpretation:this.interpretation,longInterpretation:this.longInterpretation,normalMaximum:this.getNormalMaximumValue(),normalMinimum:this.getNormalMinimumValue(),masteryValue:this.getMasteryValueValue(),externalScored:this.externalScored,variableIdentifierRef:this.variableIdentifierRef,value:this.getValue(),defaultValue:this.defaultValue,lookupTable:this.lookupTable,lookupTableType:this.lookupTableType,node:this};this.declarationContext==="TEST"?tt.defineOutcomeDeclaration(e):M.defineOutcomeDeclaration(e),console.log("["+this.$options.name+"]["+this.identifier+"]["+this.declarationContext+"][DefaultValue]",this.defaultValue,"[lookupTable]",this.lookupTable)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},NT=["identifier"];function kT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-outcome-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,NT)}const qT=D(RT,[["render",kT]]),Oo=new F,OT=new ie,PT={name:"QtiTemplateDeclaration",props:{identifier:{type:String,required:!0},baseType:{type:String,required:!1},cardinality:{type:String,required:!0},paramVariable:{type:String,required:!1,default:"false"},mathVariable:{type:String,required:!1,default:"false"}},data(){return{value:null,defaultValue:null,isQtiValid:!0,declarationContext:"ITEM"}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.baseType},getCardinality(){return this.cardinality},getDefaultValue(){return this.defaultValue},getDeclarationContext(){return"ITEM"},initializeValue(){if(this.defaultValue!==null){this.setValue(this.defaultValue);return}this.setValue(OT.nullValue())},reset(){this.initializeValue(),M.setTemplateVariableValue({identifier:this.identifier,value:this.getValue()})},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default().forEach(t=>{if(Oo.isValidSlot(t)){if(t.type.name==="QtiDefaultValue"){if(!e)return e=!0;throw new c("Maximum of 1 qti-default-value element permitted")}throw new c('Element must be qti-default-value: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{if(t.type.name==="QtiDefaultValue"&&t.component!==null)return this.defaultValue=t.component.proxy.getValue();throw new c("["+t.type.name+'][Unhandled Child Node]: "'+t.type.name+'"')})},readChildren:function(){this.$children.forEach(e=>{switch(e.$el.className){case"qti-default-value":this.defaultValue=e.getValue();break;default:throw new c("["+this.$options.name+'][Unhandled Child Node]: "'+e.$el.className+'"')}})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Variable Restore State Invalid. "value" property not found.');return this.setValue(t.value),t}},created:function(){try{Oo.validateCardinality(this.cardinality),Oo.validateBaseTypeAndCardinality(this.baseType,this.cardinality==="record"),Oo.validateIdentifierAttribute(this.identifier),this.validateChildren(),M.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:null,defaultValue:null,paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this})}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){if(this.isQtiValid)try{this.processChildren(),this.getPriorState(this.identifier)===null&&this.initializeValue(),M.defineTemplateDeclaration({identifier:this.identifier,baseType:this.getBaseType(),cardinality:this.getCardinality(),value:this.getValue(),defaultValue:this.getDefaultValue(),paramVariable:this.paramVariable==="true",mathVariable:this.mathVariable==="true",node:this}),console.log("["+this.$options.name+"]["+this.identifier+"][Value]",this.getValue())}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},BT=["identifier"];function DT(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-template-declaration",identifier:i.identifier},[l.renderSlot(e.$slots,"default")],8,BT)}const QT=D(PT,[["render",DT]]);function pp(e,t){return function(){return e.apply(t,arguments)}}const{toString:HT}=Object.prototype,{getPrototypeOf:Hc}=Object,Po=(e=>t=>{const i=HT.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),hi=e=>(e=e.toLowerCase(),t=>Po(t)===e),Bo=e=>t=>typeof t===e,{isArray:Ln}=Array,Pr=Bo("undefined");function UT(e){return e!==null&&!Pr(e)&&e.constructor!==null&&!Pr(e.constructor)&&Bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mp=hi("ArrayBuffer");function FT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mp(e.buffer),t}const GT=Bo("string"),Bt=Bo("function"),gp=Bo("number"),Do=e=>e!==null&&typeof e=="object",jT=e=>e===!0||e===!1,Qo=e=>{if(Po(e)!=="object")return!1;const t=Hc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},WT=hi("Date"),zT=hi("File"),KT=hi("Blob"),YT=hi("FileList"),XT=e=>Do(e)&&Bt(e.pipe),ZT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Bt(e.append)&&((t=Po(e))==="formdata"||t==="object"&&Bt(e.toString)&&e.toString()==="[object FormData]"))},JT=hi("URLSearchParams"),[e0,t0,i0,s0]=["ReadableStream","Request","Response","Headers"].map(hi),n0=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Br(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let s,n;if(typeof e!="object"&&(e=[e]),Ln(e))for(s=0,n=e.length;s<n;s++)t.call(null,e[s],s,e);else{const r=i?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,e[o],o,e)}}function yp(e,t){t=t.toLowerCase();const i=Object.keys(e);let s=i.length,n;for(;s-- >0;)if(n=i[s],t===n.toLowerCase())return n;return null}const js=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wp=e=>!Pr(e)&&e!==js;function Uc(){const{caseless:e}=wp(this)&&this||{},t={},i=(s,n)=>{const r=e&&yp(t,n)||n;Qo(t[r])&&Qo(s)?t[r]=Uc(t[r],s):Qo(s)?t[r]=Uc({},s):Ln(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Br(arguments[s],i);return t}const r0=(e,t,i,{allOwnKeys:s}={})=>(Br(t,(n,r)=>{i&&Bt(n)?e[r]=pp(n,i):e[r]=n},{allOwnKeys:s}),e),a0=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),o0=(e,t,i,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},l0=(e,t,i,s)=>{let n,r,a;const o={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),r=n.length;r-- >0;)a=n[r],(!s||s(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=i!==!1&&Hc(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},c0=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const s=e.indexOf(t,i);return s!==-1&&s===i},u0=e=>{if(!e)return null;if(Ln(e))return e;let t=e.length;if(!gp(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},h0=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Hc(Uint8Array)),d0=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},f0=(e,t)=>{let i;const s=[];for(;(i=e.exec(t))!==null;)s.push(i);return s},p0=hi("HTMLFormElement"),m0=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,s,n){return s.toUpperCase()+n}),bp=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),g0=hi("RegExp"),vp=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),s={};Br(i,(n,r)=>{let a;(a=t(n,r,e))!==!1&&(s[r]=a||n)}),Object.defineProperties(e,s)},y0=e=>{vp(e,(t,i)=>{if(Bt(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=e[i];if(Bt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},w0=(e,t)=>{const i={},s=n=>{n.forEach(r=>{i[r]=!0})};return Ln(e)?s(e):s(String(e).split(t)),i},b0=()=>{},v0=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function E0(e){return!!(e&&Bt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const C0=e=>{const t=new Array(10),i=(s,n)=>{if(Do(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=Ln(s)?[]:{};return Br(s,(a,o)=>{const u=i(a,n+1);!Pr(u)&&(r[o]=u)}),t[n]=void 0,r}}return s};return i(e,0)},T0=hi("AsyncFunction"),S0=e=>e&&(Do(e)||Bt(e))&&Bt(e.then)&&Bt(e.catch),Ep=((e,t)=>e?setImmediate:t?((i,s)=>(js.addEventListener("message",({source:n,data:r})=>{n===js&&r===i&&s.length&&s.shift()()},!1),n=>{s.push(n),js.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Bt(js.postMessage)),x0=typeof queueMicrotask<"u"?queueMicrotask.bind(js):typeof process<"u"&&process.nextTick||Ep,G={isArray:Ln,isArrayBuffer:mp,isBuffer:UT,isFormData:ZT,isArrayBufferView:FT,isString:GT,isNumber:gp,isBoolean:jT,isObject:Do,isPlainObject:Qo,isReadableStream:e0,isRequest:t0,isResponse:i0,isHeaders:s0,isUndefined:Pr,isDate:WT,isFile:zT,isBlob:KT,isRegExp:g0,isFunction:Bt,isStream:XT,isURLSearchParams:JT,isTypedArray:h0,isFileList:YT,forEach:Br,merge:Uc,extend:r0,trim:n0,stripBOM:a0,inherits:o0,toFlatObject:l0,kindOf:Po,kindOfTest:hi,endsWith:c0,toArray:u0,forEachEntry:d0,matchAll:f0,isHTMLForm:p0,hasOwnProperty:bp,hasOwnProp:bp,reduceDescriptors:vp,freezeMethods:y0,toObjectSet:w0,toCamelCase:m0,noop:b0,toFiniteNumber:v0,findKey:yp,global:js,isContextDefined:wp,isSpecCompliantForm:E0,toJSONObject:C0,isAsyncFn:T0,isThenable:S0,setImmediate:Ep,asap:x0};function Ie(e,t,i,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}G.inherits(Ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}});const Cp=Ie.prototype,Tp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Tp[e]={value:e}}),Object.defineProperties(Ie,Tp),Object.defineProperty(Cp,"isAxiosError",{value:!0}),Ie.from=(e,t,i,s,n,r)=>{const a=Object.create(Cp);return G.toFlatObject(e,a,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),Ie.call(a,e.message,t,i,s,n),a.cause=e,a.name=e.name,r&&Object.assign(a,r),a};const I0=null;function Fc(e){return G.isPlainObject(e)||G.isArray(e)}function Sp(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function xp(e,t,i){return e?e.concat(t).map(function(n,r){return n=Sp(n),!i&&r?"["+n+"]":n}).join(i?".":""):t}function _0(e){return G.isArray(e)&&!e.some(Fc)}const V0=G.toFlatObject(G,{},null,function(t){return/^is[A-Z]/.test(t)});function Ho(e,t,i){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=G.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function($,R){return!G.isUndefined(R[$])});const s=i.metaTokens,n=i.visitor||f,r=i.dots,a=i.indexes,u=(i.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(n))throw new TypeError("visitor must be a function");function d(E){if(E===null)return"";if(G.isDate(E))return E.toISOString();if(!u&&G.isBlob(E))throw new Ie("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(E)||G.isTypedArray(E)?u&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function f(E,$,R){let O=E;if(E&&!R&&typeof E=="object"){if(G.endsWith($,"{}"))$=s?$:$.slice(0,-2),E=JSON.stringify(E);else if(G.isArray(E)&&_0(E)||(G.isFileList(E)||G.endsWith($,"[]"))&&(O=G.toArray(E)))return $=Sp($),O.forEach(function(z,V){!(G.isUndefined(z)||z===null)&&t.append(a===!0?xp([$],V,r):a===null?$:$+"[]",d(z))}),!1}return Fc(E)?!0:(t.append(xp(R,$,r),d(E)),!1)}const y=[],m=Object.assign(V0,{defaultVisitor:f,convertValue:d,isVisitable:Fc});function b(E,$){if(!G.isUndefined(E)){if(y.indexOf(E)!==-1)throw Error("Circular reference detected in "+$.join("."));y.push(E),G.forEach(E,function(O,N){(!(G.isUndefined(O)||O===null)&&n.call(t,O,G.isString(N)?N.trim():N,$,m))===!0&&b(O,$?$.concat(N):[N])}),y.pop()}}if(!G.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ip(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Gc(e,t){this._pairs=[],e&&Ho(e,this,t)}const _p=Gc.prototype;_p.append=function(t,i){this._pairs.push([t,i])},_p.toString=function(t){const i=t?function(s){return t.call(this,s,Ip)}:Ip;return this._pairs.map(function(n){return i(n[0])+"="+i(n[1])},"").join("&")};function A0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vp(e,t,i){if(!t)return e;const s=i&&i.encode||A0;G.isFunction(i)&&(i={serialize:i});const n=i&&i.serialize;let r;if(n?r=n(t,i):r=G.isURLSearchParams(t)?t.toString():new Gc(t,i).toString(s),r){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class Ap{constructor(){this.handlers=[]}use(t,i,s){return this.handlers.push({fulfilled:t,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,function(s){s!==null&&t(s)})}}const $p={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Gc,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},jc=typeof window<"u"&&typeof document<"u",Wc=typeof navigator=="object"&&navigator||void 0,L0=jc&&(!Wc||["ReactNative","NativeScript","NS"].indexOf(Wc.product)<0),M0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",R0=jc&&window.location.href||"http://localhost",ut={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jc,hasStandardBrowserEnv:L0,hasStandardBrowserWebWorkerEnv:M0,navigator:Wc,origin:R0},Symbol.toStringTag,{value:"Module"})),...$0};function N0(e,t){return Ho(e,new ut.classes.URLSearchParams,Object.assign({visitor:function(i,s,n,r){return ut.isNode&&G.isBuffer(i)?(this.append(s,i.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function k0(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function q0(e){const t={},i=Object.keys(e);let s;const n=i.length;let r;for(s=0;s<n;s++)r=i[s],t[r]=e[r];return t}function Lp(e){function t(i,s,n,r){let a=i[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),u=r>=i.length;return a=!a&&G.isArray(n)?n.length:a,u?(G.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!G.isObject(n[a]))&&(n[a]=[]),t(i,s,n[a],r)&&G.isArray(n[a])&&(n[a]=q0(n[a])),!o)}if(G.isFormData(e)&&G.isFunction(e.entries)){const i={};return G.forEachEntry(e,(s,n)=>{t(k0(s),n,i,0)}),i}return null}function O0(e,t,i){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(e)}const Dr={transitional:$p,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const s=i.getContentType()||"",n=s.indexOf("application/json")>-1,r=G.isObject(t);if(r&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return n?JSON.stringify(Lp(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t)||G.isReadableStream(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return N0(t,this.formSerializer).toString();if((o=G.isFileList(t))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ho(o?{"files[]":t}:t,u&&new u,this.formSerializer)}}return r||n?(i.setContentType("application/json",!1),O0(t)):t}],transformResponse:[function(t){const i=this.transitional||Dr.transitional,s=i&&i.forcedJSONParsing,n=this.responseType==="json";if(G.isResponse(t)||G.isReadableStream(t))return t;if(t&&G.isString(t)&&(s&&!this.responseType||n)){const a=!(i&&i.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?Ie.from(o,Ie.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ut.classes.FormData,Blob:ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{Dr.headers[e]={}});const P0=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),B0=e=>{const t={};let i,s,n;return e&&e.split(`
|
83
83
|
`).forEach(function(a){n=a.indexOf(":"),i=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!i||t[i]&&P0[i])&&(i==="set-cookie"?t[i]?t[i].push(s):t[i]=[s]:t[i]=t[i]?t[i]+", "+s:s)}),t},Mp=Symbol("internals");function Qr(e){return e&&String(e).trim().toLowerCase()}function Uo(e){return e===!1||e==null?e:G.isArray(e)?e.map(Uo):String(e)}function D0(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(e);)t[s[1]]=s[2];return t}const Q0=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function zc(e,t,i,s,n){if(G.isFunction(s))return s.call(this,t,i);if(n&&(t=i),!!G.isString(t)){if(G.isString(s))return t.indexOf(s)!==-1;if(G.isRegExp(s))return s.test(t)}}function H0(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,s)=>i.toUpperCase()+s)}function U0(e,t){const i=G.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+i,{value:function(n,r,a){return this[s].call(this,t,n,r,a)},configurable:!0})})}class xt{constructor(t){t&&this.set(t)}set(t,i,s){const n=this;function r(o,u,d){const f=Qr(u);if(!f)throw new Error("header name must be a non-empty string");const y=G.findKey(n,f);(!y||n[y]===void 0||d===!0||d===void 0&&n[y]!==!1)&&(n[y||u]=Uo(o))}const a=(o,u)=>G.forEach(o,(d,f)=>r(d,f,u));if(G.isPlainObject(t)||t instanceof this.constructor)a(t,i);else if(G.isString(t)&&(t=t.trim())&&!Q0(t))a(B0(t),i);else if(G.isHeaders(t))for(const[o,u]of t.entries())r(u,o,s);else t!=null&&r(i,t,s);return this}get(t,i){if(t=Qr(t),t){const s=G.findKey(this,t);if(s){const n=this[s];if(!i)return n;if(i===!0)return D0(n);if(G.isFunction(i))return i.call(this,n,s);if(G.isRegExp(i))return i.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=Qr(t),t){const s=G.findKey(this,t);return!!(s&&this[s]!==void 0&&(!i||zc(this,this[s],s,i)))}return!1}delete(t,i){const s=this;let n=!1;function r(a){if(a=Qr(a),a){const o=G.findKey(s,a);o&&(!i||zc(s,s[o],o,i))&&(delete s[o],n=!0)}}return G.isArray(t)?t.forEach(r):r(t),n}clear(t){const i=Object.keys(this);let s=i.length,n=!1;for(;s--;){const r=i[s];(!t||zc(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const i=this,s={};return G.forEach(this,(n,r)=>{const a=G.findKey(s,r);if(a){i[a]=Uo(n),delete i[r];return}const o=t?H0(r):String(r).trim();o!==r&&delete i[r],i[o]=Uo(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return G.forEach(this,(s,n)=>{s!=null&&s!==!1&&(i[n]=t&&G.isArray(s)?s.join(", "):s)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
|
84
84
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const s=new this(t);return i.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[Mp]=this[Mp]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Qr(a);s[o]||(U0(n,a),s[o]=!0)}return G.isArray(t)?t.forEach(r):r(t),this}}xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(xt.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[i]=s}}}),G.freezeMethods(xt);function Kc(e,t){const i=this||Dr,s=t||i,n=xt.from(s.headers);let r=s.data;return G.forEach(e,function(o){r=o.call(i,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function Rp(e){return!!(e&&e.__CANCEL__)}function Mn(e,t,i){Ie.call(this,e??"canceled",Ie.ERR_CANCELED,t,i),this.name="CanceledError"}G.inherits(Mn,Ie,{__CANCEL__:!0});function Np(e,t,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?e(i):t(new Ie("Request failed with status code "+i.status,[Ie.ERR_BAD_REQUEST,Ie.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function F0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function G0(e,t){e=e||10;const i=new Array(e),s=new Array(e);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=s[r];a||(a=d),i[n]=u,s[n]=d;let y=r,m=0;for(;y!==n;)m+=i[y++],y=y%e;if(n=(n+1)%e,n===r&&(r=(r+1)%e),d-a<t)return;const b=f&&d-f;return b?Math.round(m*1e3/b):void 0}}function j0(e,t){let i=0,s=1e3/t,n,r;const a=(d,f=Date.now())=>{i=f,n=null,r&&(clearTimeout(r),r=null),e.apply(null,d)};return[(...d)=>{const f=Date.now(),y=f-i;y>=s?a(d,f):(n=d,r||(r=setTimeout(()=>{r=null,a(n)},s-y)))},()=>n&&a(n)]}const Fo=(e,t,i=3)=>{let s=0;const n=G0(50,250);return j0(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,u=a-s,d=n(u),f=a<=o;s=a;const y={loaded:a,total:o,progress:o?a/o:void 0,bytes:u,rate:d||void 0,estimated:d&&o&&f?(o-a)/d:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(y)},i)},kp=(e,t)=>{const i=e!=null;return[s=>t[0]({lengthComputable:i,total:e,loaded:s}),t[1]]},qp=e=>(...t)=>G.asap(()=>e(...t)),W0=ut.hasStandardBrowserEnv?((e,t)=>i=>(i=new URL(i,ut.origin),e.protocol===i.protocol&&e.host===i.host&&(t||e.port===i.port)))(new URL(ut.origin),ut.navigator&&/(msie|trident)/i.test(ut.navigator.userAgent)):()=>!0,z0=ut.hasStandardBrowserEnv?{write(e,t,i,s,n,r){const a=[e+"="+encodeURIComponent(t)];G.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),G.isString(s)&&a.push("path="+s),G.isString(n)&&a.push("domain="+n),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function K0(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Y0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Op(e,t,i){let s=!K0(t);return e&&(s||i==!1)?Y0(e,t):t}const Pp=e=>e instanceof xt?{...e}:e;function Ws(e,t){t=t||{};const i={};function s(d,f,y,m){return G.isPlainObject(d)&&G.isPlainObject(f)?G.merge.call({caseless:m},d,f):G.isPlainObject(f)?G.merge({},f):G.isArray(f)?f.slice():f}function n(d,f,y,m){if(G.isUndefined(f)){if(!G.isUndefined(d))return s(void 0,d,y,m)}else return s(d,f,y,m)}function r(d,f){if(!G.isUndefined(f))return s(void 0,f)}function a(d,f){if(G.isUndefined(f)){if(!G.isUndefined(d))return s(void 0,d)}else return s(void 0,f)}function o(d,f,y){if(y in t)return s(d,f);if(y in e)return s(void 0,d)}const u={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(d,f,y)=>n(Pp(d),Pp(f),y,!0)};return G.forEach(Object.keys(Object.assign({},e,t)),function(f){const y=u[f]||n,m=y(e[f],t[f],f);G.isUndefined(m)&&y!==o||(i[f]=m)}),i}const Bp=e=>{const t=Ws({},e);let{data:i,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=xt.from(a),t.url=Vp(Op(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let u;if(G.isFormData(i)){if(ut.hasStandardBrowserEnv||ut.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[d,...f]=u?u.split(";").map(y=>y.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...f].join("; "))}}if(ut.hasStandardBrowserEnv&&(s&&G.isFunction(s)&&(s=s(t)),s||s!==!1&&W0(t.url))){const d=n&&r&&z0.read(r);d&&a.set(n,d)}return t},X0=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,s){const n=Bp(e);let r=n.data;const a=xt.from(n.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:d}=n,f,y,m,b,E;function $(){b&&b(),E&&E(),n.cancelToken&&n.cancelToken.unsubscribe(f),n.signal&&n.signal.removeEventListener("abort",f)}let R=new XMLHttpRequest;R.open(n.method.toUpperCase(),n.url,!0),R.timeout=n.timeout;function O(){if(!R)return;const z=xt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),Z={data:!o||o==="text"||o==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:z,config:e,request:R};Np(function(re){i(re),$()},function(re){s(re),$()},Z),R=null}"onloadend"in R?R.onloadend=O:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout(O)},R.onabort=function(){R&&(s(new Ie("Request aborted",Ie.ECONNABORTED,e,R)),R=null)},R.onerror=function(){s(new Ie("Network Error",Ie.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let V=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const Z=n.transitional||$p;n.timeoutErrorMessage&&(V=n.timeoutErrorMessage),s(new Ie(V,Z.clarifyTimeoutError?Ie.ETIMEDOUT:Ie.ECONNABORTED,e,R)),R=null},r===void 0&&a.setContentType(null),"setRequestHeader"in R&&G.forEach(a.toJSON(),function(V,Z){R.setRequestHeader(Z,V)}),G.isUndefined(n.withCredentials)||(R.withCredentials=!!n.withCredentials),o&&o!=="json"&&(R.responseType=n.responseType),d&&([m,E]=Fo(d,!0),R.addEventListener("progress",m)),u&&R.upload&&([y,b]=Fo(u),R.upload.addEventListener("progress",y),R.upload.addEventListener("loadend",b)),(n.cancelToken||n.signal)&&(f=z=>{R&&(s(!z||z.type?new Mn(null,e,R):z),R.abort(),R=null)},n.cancelToken&&n.cancelToken.subscribe(f),n.signal&&(n.signal.aborted?f():n.signal.addEventListener("abort",f)));const N=F0(n.url);if(N&&ut.protocols.indexOf(N)===-1){s(new Ie("Unsupported protocol "+N+":",Ie.ERR_BAD_REQUEST,e));return}R.send(r||null)})},Z0=(e,t)=>{const{length:i}=e=e?e.filter(Boolean):[];if(t||i){let s=new AbortController,n;const r=function(d){if(!n){n=!0,o();const f=d instanceof Error?d:this.reason;s.abort(f instanceof Ie?f:new Mn(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,r(new Ie(`timeout ${t} of ms exceeded`,Ie.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(r):d.removeEventListener("abort",r)}),e=null)};e.forEach(d=>d.addEventListener("abort",r));const{signal:u}=s;return u.unsubscribe=()=>G.asap(o),u}},J0=function*(e,t){let i=e.byteLength;if(i<t){yield e;return}let s=0,n;for(;s<i;)n=s+t,yield e.slice(s,n),s=n},eS=async function*(e,t){for await(const i of tS(e))yield*J0(i,t)},tS=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:i,value:s}=await t.read();if(i)break;yield s}}finally{await t.cancel()}},Dp=(e,t,i,s)=>{const n=eS(e,t);let r=0,a,o=u=>{a||(a=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:d,value:f}=await n.next();if(d){o(),u.close();return}let y=f.byteLength;if(i){let m=r+=y;i(m)}u.enqueue(new Uint8Array(f))}catch(d){throw o(d),d}},cancel(u){return o(u),n.return()}},{highWaterMark:2})},Go=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Qp=Go&&typeof ReadableStream=="function",iS=Go&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Hp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sS=Qp&&Hp(()=>{let e=!1;const t=new Request(ut.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Up=64*1024,Yc=Qp&&Hp(()=>G.isReadableStream(new Response("").body)),jo={stream:Yc&&(e=>e.body)};Go&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!jo[t]&&(jo[t]=G.isFunction(e[t])?i=>i[t]():(i,s)=>{throw new Ie(`Response type '${t}' is not supported`,Ie.ERR_NOT_SUPPORT,s)})})})(new Response);const nS=async e=>{if(e==null)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e))return(await new Request(ut.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(G.isArrayBufferView(e)||G.isArrayBuffer(e))return e.byteLength;if(G.isURLSearchParams(e)&&(e=e+""),G.isString(e))return(await iS(e)).byteLength},rS=async(e,t)=>{const i=G.toFiniteNumber(e.getContentLength());return i??nS(t)},Xc={http:I0,xhr:X0,fetch:Go&&(async e=>{let{url:t,method:i,data:s,signal:n,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:u,responseType:d,headers:f,withCredentials:y="same-origin",fetchOptions:m}=Bp(e);d=d?(d+"").toLowerCase():"text";let b=Z0([n,r&&r.toAbortSignal()],a),E;const $=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let R;try{if(u&&sS&&i!=="get"&&i!=="head"&&(R=await rS(f,s))!==0){let Z=new Request(t,{method:"POST",body:s,duplex:"half"}),K;if(G.isFormData(s)&&(K=Z.headers.get("content-type"))&&f.setContentType(K),Z.body){const[re,w]=kp(R,Fo(qp(u)));s=Dp(Z.body,Up,re,w)}}G.isString(y)||(y=y?"include":"omit");const O="credentials"in Request.prototype;E=new Request(t,{...m,signal:b,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:s,duplex:"half",credentials:O?y:void 0});let N=await fetch(E);const z=Yc&&(d==="stream"||d==="response");if(Yc&&(o||z&&$)){const Z={};["status","statusText","headers"].forEach(C=>{Z[C]=N[C]});const K=G.toFiniteNumber(N.headers.get("content-length")),[re,w]=o&&kp(K,Fo(qp(o),!0))||[];N=new Response(Dp(N.body,Up,re,()=>{w&&w(),$&&$()}),Z)}d=d||"text";let V=await jo[G.findKey(jo,d)||"text"](N,e);return!z&&$&&$(),await new Promise((Z,K)=>{Np(Z,K,{data:V,headers:xt.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:E})})}catch(O){throw $&&$(),O&&O.name==="TypeError"&&/fetch/i.test(O.message)?Object.assign(new Ie("Network Error",Ie.ERR_NETWORK,e,E),{cause:O.cause||O}):Ie.from(O,O&&O.code,e,E)}})};G.forEach(Xc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Fp=e=>`- ${e}`,aS=e=>G.isFunction(e)||e===null||e===!1,Gp={getAdapter:e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let i,s;const n={};for(let r=0;r<t;r++){i=e[r];let a;if(s=i,!aS(i)&&(s=Xc[(a=String(i)).toLowerCase()],s===void 0))throw new Ie(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,u])=>`adapter ${o} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
85
85
|
`+r.map(Fp).join(`
|
86
86
|
`):" "+Fp(r[0]):"as no adapter specified";throw new Ie("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Xc};function Zc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Mn(null,e)}function jp(e){return Zc(e),e.headers=xt.from(e.headers),e.data=Kc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gp.getAdapter(e.adapter||Dr.adapter)(e).then(function(s){return Zc(e),s.data=Kc.call(e,e.transformResponse,s),s.headers=xt.from(s.headers),s},function(s){return Rp(s)||(Zc(e),s&&s.response&&(s.response.data=Kc.call(e,e.transformResponse,s.response),s.response.headers=xt.from(s.response.headers))),Promise.reject(s)})}const Wp="1.8.4",Wo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wo[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const zp={};Wo.transitional=function(t,i,s){function n(r,a){return"[Axios v"+Wp+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new Ie(n(a," has been removed"+(i?" in "+i:"")),Ie.ERR_DEPRECATED);return i&&!zp[a]&&(zp[a]=!0,console.warn(n(a," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(r,a,o):!0}},Wo.spelling=function(t){return(i,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function oS(e,t,i){if(typeof e!="object")throw new Ie("options must be an object",Ie.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=e[r],u=o===void 0||a(o,r,e);if(u!==!0)throw new Ie("option "+r+" must be "+u,Ie.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Ie("Unknown option "+r,Ie.ERR_BAD_OPTION)}}const zo={assertOptions:oS,validators:Wo},Li=zo.validators;class zs{constructor(t){this.defaults=t,this.interceptors={request:new Ap,response:new Ap}}async request(t,i){try{return await this._request(t,i)}catch(s){if(s instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
87
|
-
`+r):s.stack=r}catch{}}throw s}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=Ws(this.defaults,i);const{transitional:s,paramsSerializer:n,headers:r}=i;s!==void 0&&zo.assertOptions(s,{silentJSONParsing:Li.transitional(Li.boolean),forcedJSONParsing:Li.transitional(Li.boolean),clarifyTimeoutError:Li.transitional(Li.boolean)},!1),n!=null&&(G.isFunction(n)?i.paramsSerializer={serialize:n}:zo.assertOptions(n,{encode:Li.function,serialize:Li.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),zo.assertOptions(i,{baseUrl:Li.spelling("baseURL"),withXsrfToken:Li.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let a=r&&G.merge(r.common,r[i.method]);r&&G.forEach(["delete","get","head","post","put","patch","common"],E=>{delete r[E]}),i.headers=xt.concat(a,r);const o=[];let u=!0;this.interceptors.request.forEach(function($){typeof $.runWhen=="function"&&$.runWhen(i)===!1||(u=u&&$.synchronous,o.unshift($.fulfilled,$.rejected))});const d=[];this.interceptors.response.forEach(function($){d.push($.fulfilled,$.rejected)});let f,y=0,m;if(!u){const E=[jp.bind(this),void 0];for(E.unshift.apply(E,o),E.push.apply(E,d),m=E.length,f=Promise.resolve(i);y<m;)f=f.then(E[y++],E[y++]);return f}m=o.length;let b=i;for(y=0;y<m;){const E=o[y++],$=o[y++];try{b=E(b)}catch(R){$.call(this,R);break}}try{f=jp.call(this,b)}catch(E){return Promise.reject(E)}for(y=0,m=d.length;y<m;)f=f.then(d[y++],d[y++]);return f}getUri(t){t=Ws(this.defaults,t);const i=Op(t.baseURL,t.url,t.allowAbsoluteUrls);return Vp(i,t.params,t.paramsSerializer)}}G.forEach(["delete","get","head","options"],function(t){zs.prototype[t]=function(i,s){return this.request(Ws(s||{},{method:t,url:i,data:(s||{}).data}))}}),G.forEach(["post","put","patch"],function(t){function i(s){return function(r,a,o){return this.request(Ws(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}zs.prototype[t]=i(),zs.prototype[t+"Form"]=i(!0)});class Jc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(r){i=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Mn(r,a,o),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const t=new AbortController,i=s=>{t.abort(s)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let t;return{token:new Jc(function(n){t=n}),cancel:t}}}function lS(e){return function(i){return e.apply(null,i)}}function cS(e){return G.isObject(e)&&e.isAxiosError===!0}const eu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(eu).forEach(([e,t])=>{eu[t]=e});function Kp(e){const t=new zs(e),i=pp(zs.prototype.request,t);return G.extend(i,zs.prototype,t,{allOwnKeys:!0}),G.extend(i,t,null,{allOwnKeys:!0}),i.create=function(n){return Kp(Ws(e,n))},i}const Ye=Kp(Dr);Ye.Axios=zs,Ye.CanceledError=Mn,Ye.CancelToken=Jc,Ye.isCancel=Rp,Ye.VERSION=Wp,Ye.toFormData=Ho,Ye.AxiosError=Ie,Ye.Cancel=Ye.CanceledError,Ye.all=function(t){return Promise.all(t)},Ye.spread=lS,Ye.isAxiosError=cS,Ye.mergeConfig=Ws,Ye.AxiosHeaders=xt,Ye.formToJSON=e=>Lp(G.isHTMLForm(e)?new FormData(e):e),Ye.getAdapter=Gp.getAdapter,Ye.HttpStatusCode=eu,Ye.default=Ye;const uS={name:"QtiStylesheet",props:{href:{type:String,required:!0},type:{type:String,required:!0}},data(){return{rawCss:"",css:"",isQtiValid:!0}},methods:{getHref(){return this.href},getType(){return this.type},getRawCss(){return this.rawCss},getCss(){Ye.get(this.href).then(e=>{this.rawCss=e.data,this.css=`<style>${this.rawCss}</style>`}).catch(e=>{console.log("["+this.$options.name+"][CSS Fetch Error: "+e+"]")})},validateChildren(){}},created(){this.getCss()},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"][Href: "+this.href+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},hS=["innerHTML"];function dS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-stylesheet",innerHTML:n.css},null,8,hS)}const fS=D(uS,[["render",dS]]),pS={name:"QtiCompanionMaterialsInfo",data(){return{isQtiValid:!0}},methods:{validateChildren(){}},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},mS={class:"qti-companion-materials-info"};function gS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",mS)}const yS=D(pS,[["render",gS]]),Hr=new F,wS={name:"QtiMapping",props:{lowerBound:{type:String,required:!1},upperBound:{type:String,required:!1},defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueLowerBound:null,valueUpperBound:null,valueDefaultValue:new j(0).toNumber(),isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},getLowerBound(){return this.valueLowerBound},setLowerBound(e){this.valueLowerBound=e},getUpperBound(){return this.valueUpperBound},setUpperBound(e){this.valueUpperBound=e},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},computeFloatValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},applyConstraints(e){return e===null||!j.isBigNumber(e)?null:(this.getLowerBound()!==null&&e.comparedTo(this.getLowerBound())<0&&(e=new j(this.getLowerBound())),this.getUpperBound()!==null&&e.comparedTo(this.getUpperBound())>0&&(e=new j(this.getUpperBound())),e.toNumber())},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-map-entry node");if(this.$slots.default().forEach(t=>{if(Hr.isValidSlot(t))if(Hr.kebabCase(t.type.name)==="qti-map-entry")e+=1;else throw new c('Node is not a qti-map-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-map-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;e===null&&(e=[]),e.push(s.getValue())}),e}},created(){try{typeof this.lowerBound<"u"&&this.setLowerBound(this.computeFloatValue(Hr.FloatValue(this.lowerBound))),typeof this.upperBound<"u"&&this.setUpperBound(this.computeFloatValue(Hr.FloatValue(this.upperBound))),typeof this.defaultValue<"u"&&this.setDefaultValue(this.computeFloatValue(Hr.FloatValue(this.defaultValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMapping][lowerBound][upperBound][defaultValue][Value]",this.getLowerBound(),this.getUpperBound(),this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},bS={class:"qti-mapping"};function vS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",bS,[l.renderSlot(e.$slots,"default")])}const ES=D(wS,[["render",vS]]),tu=new F,CS={name:"QtiMapEntry",props:{mapKey:{type:String,required:!0},mappedValue:{type:String,required:!0},caseSensitive:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMappedValue:null,valueCaseSensitive:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setMappedValue(e){this.valueMappedValue=e},getMappedValue(){return this.valueMappedValue},setCaseSensitive(e){this.valueCaseSensitive=e},getCaseSensitive(){return this.valueCaseSensitive},computeMappedValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(tu.isValidSlot(e))throw new c('Invalid Child Node: "'+e.type.name+'"')})}},created(){try{this.setCaseSensitive(tu.validateCaseSensitive(this.caseSensitive,!1)),this.setMappedValue(this.computeMappedValue(tu.FloatValue(this.mappedValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){let e=this.$el.querySelector(".amp-mapentry__container");this.isQtiValid&&(this.setValue({mapKey:this.mapKey,mappedValue:this.getMappedValue(),caseSensitive:this.getCaseSensitive()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},TS={class:"qti-map-entry"},SS={class:"amp-mapentry__container"};function xS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",TS,[l.createElementVNode("div",SS,[l.renderSlot(e.$slots,"default")])])}const IS=D(CS,[["render",xS]]),Ur=new F,_S={name:"QtiAreaMapping",props:{lowerBound:{type:String,required:!1},upperBound:{type:String,required:!1},defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueLowerBound:null,valueUpperBound:null,valueDefaultValue:new j(0).toNumber(),isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},getLowerBound(){return this.valueLowerBound},setLowerBound(e){this.valueLowerBound=e},getUpperBound(){return this.valueUpperBound},setUpperBound(e){this.valueUpperBound=e},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},computeFloatValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},applyConstraints(e){return e===null||!j.isBigNumber(e)?null:(this.getLowerBound()!==null&&e.comparedTo(this.getLowerBound())<0&&(e=new j(this.getLowerBound())),this.getUpperBound()!==null&&e.comparedTo(this.getUpperBound())>0&&(e=new j(this.getUpperBound())),e.toNumber())},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-area-map-entry node");if(this.$slots.default().forEach(t=>{if(Ur.isValidSlot(t))if(Ur.kebabCase(t.type.name)==="qti-area-map-entry")e+=1;else throw new c('Node is not a qti-area-map-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-area-map-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;e===null&&(e=[]),e.push(s.getValue())}),e}},created(){try{typeof this.lowerBound<"u"&&this.setLowerBound(this.computeFloatValue(Ur.FloatValue(this.lowerBound))),typeof this.upperBound<"u"&&this.setUpperBound(this.computeFloatValue(Ur.FloatValue(this.upperBound))),typeof this.defaultValue<"u"&&this.setDefaultValue(this.computeFloatValue(Ur.FloatValue(this.defaultValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiAreaMapping][lowerBound][upperBound][defaultValue][Value]",this.getLowerBound(),this.getUpperBound(),this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},VS={class:"qti-area-mapping"};function AS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",VS,[l.renderSlot(e.$slots,"default")])}const $S=D(_S,[["render",AS]]),iu=new F,LS={name:"QtiAreaMapEntry",props:{shape:{type:String,required:!0},coords:{type:String,required:!0},mappedValue:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMappedValue:null,coordsData:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setMappedValue(e){this.valueMappedValue=e},getMappedValue(){return this.valueMappedValue},computeMappedValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},getShape(){return this.shape},getCoordsData(){return this.coordsData},setCoordsData(e){this.coordsData=e},validateCoordsAttribute(e){let t=e.split(",");switch(this.shape){case"circle":if(t.length!=3)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 3, but found: ${t.length}`);break;case"rect":case"ellipse":if(t.length!=4)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 4, but found: ${t.length}`);break;case"poly":this.validatePolyCoords(t);break;case"default":if(t.length!=0)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 0, but found: ${t.length}`);break}return this.validatePositiveCoords(t),t},validatePolyCoords(e){let i=!1;e.length>1&&e[0]==e[e.length-2]&&e[1]==e[e.length-1]&&(i=!0);let s=6;if(i&&(s+=2),e.length<s)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected at least: ${s}, but found: ${e.length}`);if(e.length>=s&&e.length%2!=0)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected even number of coordinates, but found: ${e.length}`)},validatePositiveCoords(e){for(let t=0;t<e.length;t++)if(e[t]<0)throw new c(`Coordinate (${e[t]}) at (${t+1}) cannot be negative.`)},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(iu.isValidSlot(e))throw new c('Invalid Child Node: "'+e.type.name+'"')})}},created(){try{iu.validateShapeAttribute(this.shape),this.setCoordsData(this.validateCoordsAttribute(this.coords)),this.setMappedValue(this.computeMappedValue(iu.FloatValue(this.mappedValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){let e=this.$el.querySelector(".amp-areamapentry__container");this.isQtiValid&&(this.setValue({mapShape:this.getShape(),mapCoords:this.getCoordsData(),mappedValue:this.getMappedValue()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},MS={class:"qti-area-map-entry"},RS={class:"amp-areamapentry__container"};function NS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",MS,[l.createElementVNode("div",RS,[l.renderSlot(e.$slots,"default")])])}const kS=D(LS,[["render",NS]]),su=new F,qS={name:"QtiInterpolationTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"interpolation",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-interpolation-table-entry node");if(this.$slots.default().forEach(t=>{if(su.isValidSlot(t))if(su.kebabCase(t.type.name)==="qti-interpolation-table-entry")e+=1;else throw new c('Node is not a qti-interpolation-table-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-interpolation-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(su.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiInterpolationTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},OS={class:"qti-interpolation-table"};function PS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",OS,[l.renderSlot(e.$slots,"default")])}const BS=D(qS,[["render",PS]]),Ko=new F,DS={name:"QtiInterpolationTableEntry",props:{sourceValue:{type:String,required:!0},includeBoundary:{type:String,required:!1},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,valueIncludeBoundary:!0,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},setIncludeBoundary(e){this.valueIncludeBoundary=e},getIncludeBoundary(){return this.valueIncludeBoundary},computeSourceValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},isValidSlot(e){if(typeof e.componentOptions<"u")return!0;if(typeof e.text<"u"&&e.text.trim().length>0)throw new c('Invalid Child Node: "'+e.text.trim()+'"');return!1},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(Ko.isValidSlot(e))throw new c('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setIncludeBoundary(Ko.validateIncludeBoundary(this.includeBoundary,"include-boundary")),this.setSourceValue(this.computeSourceValue(Ko.FloatValue(this.sourceValue))),this.setTargetValue(Ko.validateValueFromBaseType(e,this.targetValue))}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message);if(e.name==="QtiParseException")throw new se(e.message)}},mounted(){let e=this.$el.querySelector(".amp-interpolationentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue(),includeBoundary:this.getIncludeBoundary()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},QS={class:"qti-interpolation-table-entry"},HS={class:"amp-interpolationentry__container"};function US(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",QS,[l.createElementVNode("div",HS,[l.renderSlot(e.$slots,"default")])])}const FS=D(DS,[["render",US]]),nu=new F,GS={name:"QtiMatchTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"match",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-match-table-entry node");if(this.$slots.default().forEach(t=>{if(nu.isValidSlot(t))if(nu.kebabCase(t.type.name)==="qti-match-table-entry")e+=1;else throw new c('Node is not a qti-match-table-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-match-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(nu.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMatchTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},jS={class:"qti-match-table"};function WS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",jS,[l.renderSlot(e.$slots,"default")])}const zS=D(GS,[["render",WS]]),ru=new F,KS={name:"QtiMatchTableEntry",props:{sourceValue:{type:String,required:!0},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},computeSourceValue(e){let t=null;try{if(t=new j(e),!t.isInteger())throw new se('Invalid qti-match-table-entry source-value integer "'+t+'"')}catch(i){throw new se(i.message)}return t.toNumber()},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(ru.isValidSlot(e))throw new c('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setSourceValue(this.computeSourceValue(ru.IntegerValue(this.sourceValue))),this.setTargetValue(ru.validateValueFromBaseType(e,this.targetValue)),this.validateChildren()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message);if(e.name==="QtiParseException")throw new se(e.message)}},mounted(){let e=this.$el.querySelector(".amp-matchtableentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},YS={class:"qti-match-table-entry"},XS={class:"amp-matchtableentry__container"};function ZS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",YS,[l.createElementVNode("div",XS,[l.renderSlot(e.$slots,"default")])])}const JS=D(KS,[["render",ZS]]),ex={name:"QtiDefaultValue",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),s.isRecordFieldValue()&&e.set(s.getFieldIdentifier(),s);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(s.getValue());break;case"single":e=e===null?s.getValue():e;break;default:console.log("[DefaultValue][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[DefaultValue][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},tx={ref:"root",class:"qti-default-value"};function ix(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tx,[l.renderSlot(e.$slots,"default")],512)}const sx=D(ex,[["render",ix]]),nx={name:"QtiCorrectResponse",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),s.isRecordFieldValue()&&e.set(s.getFieldIdentifier(),s);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(s.getValue());break;case"single":e=e===null?s.getValue():e;break;default:console.log("[CorrectResponse][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[CorrectResponse][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},rx={class:"qti-correct-response"};function ax(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",rx,[l.renderSlot(e.$slots,"default")])}const ox=D(nx,[["render",ax]]);class Yp{constructor(){}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new se('Invalid integer "'+t+'". ');return i}catch(i){throw new se('Invalid integer "'+t+'". '+i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new se('Invalid float "'+t+'". ');return i}catch(i){throw new se('Invalid float "'+t+'". '+i.message)}}BooleanValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid boolean "'+t+'". Length is not valid.');if(t.toLowerCase()==="true"||t==="1")return!0;if(t.toLowerCase()==="false"||t==="0")return!1;throw new se('Invalid boolean "'+t+'".')}StringValue(t){if(t==null||t.length==0)throw new se('Invalid string "'+t+'". Length is not valid.');return t}IdentifierValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new se('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new se('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.");return t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}}const au=new F,Rn=new Yp,lx={name:"QtiValue",props:{baseType:{type:String,required:!1},fieldIdentifier:{type:String,required:!1}},data(){return{singleValue:null,valueBaseType:null,valueCardinality:"single",valueFieldIdentifier:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){if(this.isNull())return null;switch(this.valueBaseType){case"integer":case"float":return this.singleValue.toNumber();case"boolean":return this.singleValue;case"string":case"identifier":case"directedPair":case"pair":case"point":return this.singleValue;default:return console.log("[QtiValue][GetValue Exception]","Unhandled BaseType:"+this.valueBaseType),null}},isNull(){return this.singleValue===null},getBaseType(){return this.valueBaseType},getCardinality(){return"single"},getFieldIdentifier(){return this.valueFieldIdentifier},isRecordFieldValue(){return this.valueFieldIdentifier!==null&&this.valueBaseType!==null},readChildren(e){this.valueBaseType!=null&&(this.singleValue=this.parseSingleValue(this.valueBaseType,e.textContent))},parseSingleValue(e,t){let i=null;try{switch(e){case"integer":i=new j(Rn.IntegerValue(t));break;case"float":i=new j(Rn.FloatValue(t));break;case"boolean":i=Rn.BooleanValue(t);break;case"string":i=Rn.StringValue(t);break;case"identifier":i=Rn.IdentifierValue(t);break;case"directedPair":case"pair":case"point":i=Rn.StringValue(t);break;default:throw new se('[QtiValue][Unhandled BaseType]: "'+e+'"')}}catch(s){throw new se(s.message)}return i},_getVariableBaseType(e){return typeof e<"u"?e.baseType:null},_getVariableCardinality(e){return typeof e<"u"?e.cardinality:null},_validateAttributes(e,t){if(t==="record"){if(typeof this.baseType>"u")throw new c('base-type is a required attribute for "record" cardinality');if(au.validateBaseType(this.baseType),this.valueBaseType=this.baseType,typeof this.fieldIdentifier>"u")throw new c('field-identifier is a required attribute for "record" cardinality');au.validateIdentifierAttribute(this.fieldIdentifier),this.valueFieldIdentifier=this.fieldIdentifier}else{if(typeof this.baseType<"u")throw new c("base-type only permitted for record cardinality.");if(typeof this.fieldIdentifier<"u")throw new c("field-identifier only permitted for record cardinality.");this.valueBaseType=e}},getStore(){return this.$parent.$parent.getDeclarationContext()==="TEST"?tt:M}},created:function(){try{let e=au.validateVariableIdentifierAttribute(this.getStore(),this.$parent.$parent.$props.identifier);if(typeof e>"u")throw new c('Variable declaration not found: "'+this.$parent.$parent.$props.identifier+'"');this.variableCardinality=this._getVariableCardinality(e),this.variableBaseType=this._getVariableBaseType(e),this._validateAttributes(this.variableBaseType,this.variableCardinality)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){let e=this.$el.querySelector(".amp-value__container");if(this.isQtiValid){try{this.readChildren(e)}catch(t){throw this.isQtiValid=!1,t.name==="QtiValidationException"?new c(t.message):t.name==="QtiParseException"?new se(t.message):new Error(t.message)}console.log("["+this.$options.name+"][Value:"+this.getValue()+"][BaseType:"+this.getBaseType()+"][FieldIdentifier:"+this.getFieldIdentifier()+"]")}e.remove()}},cx=["variable-basetype","variable-cardinality"],ux={class:"amp-value__container"};function hx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-value","variable-basetype":n.variableBaseType,"variable-cardinality":n.variableCardinality},[l.createElementVNode("div",ux,[l.renderSlot(e.$slots,"default")])],8,cx)}const dx=D(lx,[["render",hx]]),fx=new F,px={name:"QtiItemBody",emits:["itemBodyReady"],data(){return{mathElementMap:new Map}},methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[s,n]of this.mathElementMap){const r=new RegExp('id="('+s+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(n,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return M.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=fx.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(s){const n=new RegExp("<[mc]i[^>]*>("+s.identifier+")<\\/[mc]i>","g"),r=e.match(n);r&&(i=i.replace(n,r[0].replace(s.identifier,s.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})}},mounted(){this.initializeTemplateMathVariables(),this.$parent.$emit("itemBodyReady",{itemBody:this})}},mx={ref:"root",class:"qti-item-body"};function gx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",mx,[l.renderSlot(e.$slots,"default")],512)}const yx=D(px,[["render",gx]]),wx={name:"ModalDialog",data(){return{visible:!0}},methods:{hide(){this.$refs.mymodal.classList.remove("fade","show"),document.querySelector("body").classList.remove("modal-open")},show(){this.$refs.mymodal.classList.add("fade","show"),document.querySelector("body").classList.add("modal-open")}}},bx={key:0,ref:"mymodal",class:"qti3-player-modal"},vx={class:"qti3-player-modal-dialog qti3-player-modal-md qti3-player-modal-dialog-centered"},Ex={class:"qti3-player-modal-content"},Cx={class:"qti3-player-modal-header"},Tx={class:"qti3-player-modal-body"},Sx={class:"qti3-player-modal-footer"};function xx(e,t,i,s,n,r){return l.openBlock(),l.createBlock(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",bx,[l.createElementVNode("div",vx,[t[2]||(t[2]=l.createElementVNode("span",{tabindex:"0"},null,-1)),l.createElementVNode("div",Ex,[l.createElementVNode("header",Cx,[l.renderSlot(e.$slots,"header",{},void 0,!0),l.createElementVNode("button",{type:"button",class:"qti3-player-close","aria-label":"Close",onClick:t[0]||(t[0]=a=>r.hide())},"×")]),l.createElementVNode("div",Tx,[l.renderSlot(e.$slots,"body",{},void 0,!0)]),l.createElementVNode("footer",Sx,[l.renderSlot(e.$slots,"footer",{},void 0,!0)])]),t[3]||(t[3]=l.createElementVNode("span",{tabindex:"0"},null,-1))]),l.createElementVNode("div",{class:"qti3-player-modal-backdrop",onClick:t[1]||(t[1]=a=>r.hide())})],512)):l.createCommentVNode("",!0)]),_:3})}const Ix=D(wx,[["render",xx],["__scopeId","data-v-2611a8eb"]]),Fr=new F,_x={name:"QtiModalFeedback",components:{ModalDialog:Ix},props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0},title:{type:String,required:!1}},computed:{modalTitle(){return typeof this.title>"u"?void 0:this.title}},data(){return{outcomeDeclaration:null,mathElementMap:new Map,isQtiValid:!0}},inheritAttrs:!0,methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[s,n]of this.mathElementMap){const r=new RegExp('id="('+s+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(n,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return M.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=Fr.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(s){const n=new RegExp("<[mc]i[^>]*>("+s.identifier+")<\\/[mc]i>","g"),r=e.match(n);r&&(i=i.replace(n,r[0].replace(s.identifier,s.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})},display(e){e?this.$refs.modal.show():this.$refs.modal.hide()},evaluate(){if(this.outcomeDeclaration=Fr.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Fr.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Fr.validateIdentifierAttribute(this.identifier),this.show=Fr.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.initializeTemplateMathVariables(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Modal",node:this}),console.log("[ModalFeedback]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},Vx={ref:"root",class:"qti-modal-feedback"};function Ax(e,t,i,s,n,r){const a=l.resolveComponent("ModalDialog");return l.openBlock(),l.createElementBlock("div",Vx,[l.createVNode(a,{ref:"modal"},{header:l.withCtx(()=>[l.createElementVNode("h5",null,l.toDisplayString(r.modalTitle),1)]),body:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),footer:l.withCtx(()=>[l.createElementVNode("button",{class:"qti-modal-feedback-ok",onClick:t[0]||(t[0]=o=>e.$refs.modal.hide())},"OK")]),_:3},512)],512)}const $x=D(_x,[["render",Ax]]),Lx={name:"QtiContentBody",data(){return{isQtiValid:!0}},mounted(){}},Mx={ref:"root",class:"qti-content-body"};function Rx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Mx,[l.renderSlot(e.$slots,"default")],512)}const Nx=D(Lx,[["render",Rx]]),Yo=new F,kx={name:"QtiTemplateInline",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=Yo.validateTemplateIdentifierAttribute(M,this.templateIdentifier),console.log("[QtiTemplateInline]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.hideTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=Yo.validateTemplateIdentifierAttribute(M,this.templateIdentifier);if(e.baseType!=="identifier")throw new c('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Yo.validateIdentifierAttribute(this.identifier),this.show=Yo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},qx={ref:"root",class:"qti-template-inline hidden"};function Ox(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",qx,[l.renderSlot(e.$slots,"default")],512)}const Px=D(kx,[["render",Ox]]),Xo=new F,Bx={name:"QtiTemplateBlock",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=Xo.validateTemplateIdentifierAttribute(M,this.templateIdentifier),console.log("[QtiTemplateBlock]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=Xo.validateTemplateIdentifierAttribute(M,this.templateIdentifier);if(e.baseType!=="identifier")throw new c('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Xo.validateIdentifierAttribute(this.identifier),this.show=Xo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},Dx={ref:"root",class:"qti-template-block hidden"};function Qx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Dx,[l.renderSlot(e.$slots,"default")],512)}const Hx=D(Bx,[["render",Qx]]),Zo=new F,Ux={name:"QtiFeedbackInline",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=Zo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Zo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Zo.validateIdentifierAttribute(this.identifier),this.show=Zo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Inline",show:this.show,node:this}),console.log("[FeedbackInline]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},Fx={ref:"root",class:"qti-feedback-inline hidden"};function Gx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Fx,[l.renderSlot(e.$slots,"default")],512)}const jx=D(Ux,[["render",Gx]]),Jo=new F,Wx={name:"QtiFeedbackBlock",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=Jo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),console.log("[FeedbackBlock]["+this.identifier+"][evaluate]",this.outcomeIdentifier,this.outcomeDeclaration.value),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Jo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Jo.validateIdentifierAttribute(this.identifier),this.show=Jo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Block",show:this.show,node:this}),console.log("[FeedbackBlock]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},zx={ref:"root",class:"qti-feedback-block hidden"};function Kx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",zx,[l.renderSlot(e.$slots,"default")],512)}const Yx=D(Wx,[["render",Kx]]),Xx=new F,Zx=new ie,Jx={name:"QtiRubricBlock",props:{view:{type:String,required:!0},use:{type:String,required:!1}},data(){return{rubricBlockContext:null,isQtiValid:!0}},computed:{isScoringRubricBlock(){const e=this.view.split(" ");for(let t=0;t<e.length;t++)if(e[t]==="scorer")return!0;return!1}},methods:{getView(){return this.view},getUse(){return this.use},getInnerHtml(){return this.$refs.root.innerHTML},getStore(){return this.rubricBlockContext==="TEST"?tt:M},validateChildren(){},evaluate(){if(!this.isScoringRubricBlock){this.$refs.root.classList.remove("hidden");return}this.$refs.root.innerHTML=""}},created(){try{this.rubricBlockContext=Zx.computeNodeContext(this),Xx.validateRubricBlockViewAttribute(this.view),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.isScoringRubricBlock&&this.getStore().defineScoringRubricBlock({view:this.view,html:this.$refs.root.innerHTML,node:this}),this.evaluate(),console.log("["+this.$options.name+"]["+this.rubricBlockContext+"][View: "+this.view+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},e1={ref:"root",class:"qti-rubric-block hidden"};function t1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",e1,[l.renderSlot(e.$slots,"default")],512)}const i1=D(Jx,[["render",t1]]);var bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ou={},Gr={},lu={},jr={},Zp;function s1(){if(Zp)return jr;Zp=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.boolean=void 0;const e=function(t){switch(Object.prototype.toString.call(t)){case"[object String]":return["true","t","yes","y","on","1"].includes(t.trim().toLowerCase());case"[object Number]":return t.valueOf()===1;case"[object Boolean]":return t.valueOf();default:return!1}};return jr.boolean=e,jr}var Wr={},Jp;function n1(){if(Jp)return Wr;Jp=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.isBooleanable=void 0;const e=function(t){switch(Object.prototype.toString.call(t)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(t.trim().toLowerCase());case"[object Number]":return[0,1].includes(t.valueOf());case"[object Boolean]":return!0;default:return!1}};return Wr.isBooleanable=e,Wr}var em;function r1(){return em||(em=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=s1();Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const i=n1();Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return i.isBooleanable}})}(lu)),lu}var zr={},tm;function a1(){if(tm)return zr;tm=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.tokenize=void 0;const e=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,t=i=>{let s;const n=[];let r=0,a=0,o=null;for(;(s=e.exec(i))!==null;){s.index>a&&(o={literal:i.slice(a,s.index),type:"literal"},n.push(o));const u=s[0];a=s.index+u.length,u==="\\%"||u==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):s.groups&&(o={conversion:s.groups.conversion,flag:s.groups.flag||null,placeholder:u,position:s.groups.position?Number.parseInt(s.groups.position,10)-1:r++,precision:s.groups.precision?Number.parseInt(s.groups.precision.slice(1),10):null,type:"placeholder",width:s.groups.width?Number.parseInt(s.groups.width,10):null},n.push(o))}return a<=i.length-1&&(o&&o.type==="literal"?o.literal+=i.slice(a):n.push({literal:i.slice(a),type:"literal"})),n};return zr.tokenize=t,zr}var im;function o1(){if(im)return Gr;im=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.createPrintf=void 0;const e=r1(),t=a1(),i=(n,r)=>r.placeholder,s=n=>{var r;const a=(d,f,y)=>y==="-"?d.padEnd(f," "):y==="-+"?((Number(d)>=0?"+":"")+d).padEnd(f," "):y==="+"?((Number(d)>=0?"+":"")+d).padStart(f," "):y==="0"?d.padStart(f,"0"):d.padStart(f," "),o=(r=n==null?void 0:n.formatUnboundExpression)!==null&&r!==void 0?r:i,u={};return(d,...f)=>{let y=u[d];y||(y=u[d]=t.tokenize(d));let m="";for(const b of y)if(b.type==="literal")m+=b.literal;else{let E=f[b.position];if(E===void 0)m+=o(d,b,f);else if(b.conversion==="b")m+=e.boolean(E)?"true":"false";else if(b.conversion==="B")m+=e.boolean(E)?"TRUE":"FALSE";else if(b.conversion==="c")m+=E;else if(b.conversion==="C")m+=String(E).toUpperCase();else if(b.conversion==="i"||b.conversion==="d")E=String(Math.trunc(E)),b.width!==null&&(E=a(E,b.width,b.flag)),m+=E;else if(b.conversion==="e")m+=Number(E).toExponential();else if(b.conversion==="E")m+=Number(E).toExponential().toUpperCase();else if(b.conversion==="f")b.precision!==null&&(E=Number(E).toFixed(b.precision)),b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else if(b.conversion==="o")m+=(Number.parseInt(String(E),10)>>>0).toString(8);else if(b.conversion==="s")b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else if(b.conversion==="S")b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=String(E).toUpperCase();else if(b.conversion==="u")m+=Number.parseInt(String(E),10)>>>0;else if(b.conversion==="x")E=(Number.parseInt(String(E),10)>>>0).toString(16),b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else throw new Error("Unknown format specifier.")}return m}};return Gr.createPrintf=s,Gr}var sm;function l1(){return sm||(sm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=o1();Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()}(ou)),ou}var c1=l1();const nm=new F,u1={name:"QtiPrintedVariable",props:{id:{type:String,required:!1},language:{type:String,required:!1},label:{type:String,required:!1},baseuri:{type:String,required:!1},identifier:{type:String,required:!0},format:{type:String,required:!1},base:{type:String,required:!1},index:{type:String,required:!1},powerForm:{type:String,required:!1},field:{type:String,required:!1},delimiter:{type:String,required:!1},mappingIndicator:{type:String,required:!1}},data(){return{value:this.identifier,declaration:null,isQtiValid:!0}},methods:{printedValue(e){return typeof this.format>"u"?e:c1.printf(this.format,e)},evaluate(){try{this.declaration=nm.validatePrintedVariableIdentifierAttribute(M,this.identifier),this.value=this.printedValue(this.declaration.value),console.log("[QtiPrintedVariable]["+this.identifier+"][Value]",this.value)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{nm.validatePrintedVariableIdentifierAttribute(M,this.identifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.definePrintedVariable({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}};function h1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-printed-variable"},l.toDisplayString(n.value),513)}const d1=D(u1,[["render",h1]]);class f1{constructor(){this.constants={LABELS_UPPER_ALPHA:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],LABELS_LOWER_ALPHA:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],LABELS_DECIMAL:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"],LABELS_CJK_IDEOGRAPHIC:["一","二","三","四","五","六","七","八","九","十"],LABELS_SUFFIX_PERIOD:".",LABELS_SUFFIX_PARENTHESIS:")",LABELS_SUFFIX_NONE:"",LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"、",QTI_LABELS_NONE:"qti-labels-none",QTI_LABELS_DECIMAL:"qti-labels-decimal",QTI_LABELS_LOWER_ALPHA:"qti-labels-lower-alpha",QTI_LABELS_UPPER_ALPHA:"qti-labels-upper-alpha",QTI_LABELS_CJK_IDEOGRAPHIC:"qti-labels-cjk-ideographic",QTI_LABELS_SUFFIX_NONE:"qti-labels-suffix-none",QTI_LABELS_SUFFIX_PERIOD:"qti-labels-suffix-period",QTI_LABELS_SUFFIX_PARENTHESIS:"qti-labels-suffix-parenthesis",QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"qti-labels-cjk-ideographic-comma",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_INPUT_CONTROL_HIDDEN:"qti-input-control-hidden",SBAC_PRESENTATION:"sbac",LRN_PRESENTATION:"lrn",QTI_CHOICES_STACKING_1:"qti-choices-stacking-1",QTI_CHOICES_STACKING_2:"qti-choices-stacking-2",QTI_CHOICES_STACKING_3:"qti-choices-stacking-3",QTI_CHOICES_STACKING_4:"qti-choices-stacking-4",QTI_CHOICES_STACKING_5:"qti-choices-stacking-5",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message"},this.parentClassList=null,this.choiceGroupNode=null,this.choices=null,this.presentation_HideLabels=!1,this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA,this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD,this.presentation_Sbac=!1,this.presentation_Lrn=!1,this.presentation_IsInputControlHidden=!1,this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage="",this.presentation_Label_Style="",this.presentation_Stacking_Class=""}initialize(t){this.choiceGroupNode=t,this.parentClassList=t.choiceInteractionClassAttribute,this.choices=t.choices,this.processRootClassAttribute(this.parentClassList),this.processStackingClass(),this.processLabelsAndInputControls()}processRootClassAttribute(t){const i=t.values();for(let s of i)switch(s){case this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!0;break;case this.constants.QTI_CHOICES_STACKING_1:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_1;break;case this.constants.QTI_CHOICES_STACKING_2:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2;break;case this.constants.QTI_CHOICES_STACKING_3:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3;break;case this.constants.QTI_CHOICES_STACKING_4:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4;break;case this.constants.QTI_CHOICES_STACKING_5:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5;break;case this.constants.QTI_LABELS_NONE:this.presentation_HideLabels=!0;break;case this.constants.QTI_LABELS_UPPER_ALPHA:this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA;break;case this.constants.QTI_LABELS_LOWER_ALPHA:this.presentation_Labels=this.constants.LABELS_LOWER_ALPHA;break;case this.constants.QTI_LABELS_DECIMAL:this.presentation_Labels=this.constants.LABELS_DECIMAL;break;case this.constants.QTI_LABELS_CJK_IDEOGRAPHIC:this.presentation_Labels=this.constants.LABELS_CJK_IDEOGRAPHIC;break;case this.constants.QTI_LABELS_SUFFIX_NONE:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_NONE;break;case this.constants.QTI_LABELS_SUFFIX_PERIOD:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD;break;case this.constants.QTI_LABELS_SUFFIX_PARENTHESIS:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PARENTHESIS;break;case this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:this.presentation_LabelsSuffix=this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA;break;case this.constants.QTI_INPUT_CONTROL_HIDDEN:this.presentation_IsInputControlHidden=!0;break;case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.LRN_PRESENTATION:this.presentation_Lrn=!0;break}}processStackingClass(){if(this.presentation_Stacking_Class!==""&&!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal)this.choices.length>1?this.presentation_IsOrientationHorizontal=!0:this.presentation_IsOrientationVertical=!0;else if(this.presentation_Stacking_Class===""&&this.presentation_IsOrientationHorizontal){const t=this.choices.length;t>=5?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5:t==4?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4:t==3?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3:t==2&&(this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2),t==1&&(this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1)}!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal&&(this.presentation_IsOrientationVertical=!0),this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_IsOrientationVertical?this.constants.QTI_ORIENTATION_VERTICAL:this.constants.QTI_ORIENTATION_HORIZONTAL),this.presentation_Stacking_Class!==""&&this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_Stacking_Class)}processLabelsAndInputControls(){for(let t=0;t<this.choices.length;t++)this.presentation_HideLabels?this.choices[t].hideLabel():this.presentation_Sbac?this.choices[t].setLabelSbac(this.presentation_Labels[t]):this.choices[t].setLabel(this.presentation_Labels[t]+this.presentation_LabelsSuffix),this.presentation_Lrn&&this.choices[t].setChoiceLrn(),this.presentation_IsInputControlHidden&&this.choices[t].hideControl()}}const p1=new F,m1=new ie,g1={props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxChoices:{required:!1,type:String,default:"1"}},data(){return{choices:[],firstChoice:null,lastChoice:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,choiceInteractionClassAttribute:null,presentationFactory:null,isQtiValid:!0,priorState:null}},methods:{getPriorState(){return this.priorState},setPriorState(e){this.priorState=e},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default()[0].children.forEach(t=>{if(p1.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e)throw new c("Invalid element order. qti-prompt must come before qti-simple-choices");if(!this.hasPrompt)return this.hasPrompt=!0;throw new c("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e=!0;if(t.type.name!=="QtiSimpleChoice")throw new c('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children.forEach(t=>{t.component!==null&&t.type.name==="QtiSimpleChoice"&&this.choices.push(t.component.proxy)},this)},processGroupUI(){this.isShuffle&&this.processShuffle(),this.presentationFactory.initialize(this),this.setActiveDescendant(""),this.isRadio&&this.processFirstAndLastChoices()},resetGroupUI(){this.setPriorState(null),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})},processShuffle(){let e=this.createShuffleContainer(this.choices,this.getPriorState()),t=null;if(this.hasPrompt){const i=this.$refs.choicegroup.querySelector(".qti-prompt");i!==null&&(t=i.cloneNode(!0))}this.choices.splice(0,this.choices.length),this.$refs.choicegroup.innerHTML="",t!==null&&this.$refs.choicegroup.appendChild(t),e.forEach(i=>{this.$refs.choicegroup.appendChild(i.node.$el),this.choices.push(i.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),m1.shuffleArrayFixed(i),i):(t.state.order.forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Choice Interaction State Invalid. Choice identifier "'+e+'" not found.')},processFirstAndLastChoices(){this.choices.length!==0&&(this.firstChoice=this.choices[0],this.lastChoice=this.choices[this.choices.length-1])},setActiveDescendant(e){this.$refs.choicegroup.setAttribute("aria-activedescendant",e)},initializeChoiceGroup(){switch(this.cardinality){case"single":this.role="radiogroup",this.isRadio=!0;break;case"multiple":this.role="group",this.isRadio=!1;break;default:this.role="radiogroup",this.isRadio=!0;break}this.isShuffle=this.shuffle==="true",this.presentationFactory=new f1}},created(){try{if(typeof this.cardinality>"u")throw new c("Undefined qti-choice-interaction cardinality");this.initializeChoiceGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiChoiceInteraction][ValidationError]",e.name,e.message),new c(e.message)}},mounted(){if(this.isQtiValid)try{this.choiceInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.setPriorState(this.$parent.priorState),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiChoiceInteraction][ValidationException]",e.message),new c(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiChoiceInteraction][EvaluationException]",e.message),new B(e.message)}}},y1=["role"];function w1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("ul",{ref:"choicegroup",role:n.role,class:"qti-choice-list"},[l.renderSlot(e.$slots,"default")],8,y1)}const rm=D(g1,[["render",w1]]),am=new F,b1={name:"QtiChoiceInteraction",components:[rm],props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,choices:[],firstChoice:null,lastChoice:null,currentChoice:null,isRadio:!0,isShuffle:!1,hasPrompts:!1,isDisabled:!1,isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.toggleDisableChoices(!0)},enable(){this.toggleDisableChoices(!1)},toggleDisableChoices(e){this.isDisabled=e,this.choices.forEach(t=>{t.setIsDisabled(e)})},getInvalidResponseMessage(){return this.minSelectionsMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.choices.forEach(e=>{e.setChecked(!1),this.isRadio&&e.setTabIndex("-1")}),this.currentChoice=null,this.priorState=null,this.$refs.choicegroup.resetGroupUI()},restoreValue(e){e!==null&&(this.isRadio?this.handleSetChecked({identifier:e,checked:"true"},!0):e.forEach(t=>{this.handleSetChecked({identifier:t,checked:"true"},!0)},this),this.updateValidity(this.computeIsValid()))},getCardinality(){let e=M.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality!=="multiple"?"single":"multiple":"single",this.cardinality},getPrompts(e){let t=[];return e.default&&e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleSetChecked(e,t=!1){this.choices.forEach(i=>{this.isRadio&&(i.setChecked(!1),i.setTabIndex("-1")),i.identifier===e.identifier&&(this.currentChoice=i)}),e.checked==="true"?this.checkMaxChoicesLimit()?this.currentChoice.setChecked(!1):this.currentChoice.setChecked(!0):this.currentChoice.setChecked(!1),t||(this.setResponse(this.computeResponse()),this.currentChoice.setFocus(),this.evaluateValidity()),this.currentChoice.setTabIndex("0")},handleSetFocusPreviousChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findPreviousIdentifier(e))},handleSetFocusNextChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findNextIdentifier(e))},handleSetActiveDescendant(e){this.$refs.choicegroup.setActiveDescendant(e)},setFocusChoice(e){for(let t=0;t<this.choices.length;t++)this.choices[t].identifier===e&&(this.currentChoice=this.choices[t]);this.currentChoice.setTabIndex("0"),this.currentChoice.setFocus()},removeChoiceFromTabOrder(e){for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e){this.choices[t].setTabIndex(-1);break}},findPreviousIdentifier(e){if(e===this.firstChoice.identifier)return this.lastChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t-1].identifier;return null},findNextIdentifier(e){if(e===this.lastChoice.identifier)return this.firstChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t+1].identifier;return null},handleChoiceGroupReady(e){this.choices=e.choices,this.firstChoice=e.firstChoice,this.lastChoice=e.lastChoice,this.isRadio&&this.firstChoice.setTabIndex("0"),this.priorState!==null&&this.restoreValue(this.priorState.value),this.setResponse(this.computeResponse()),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},computeResponse(){let e=this.isRadio?null:[];return this.choices.forEach(t=>{t.isChecked()&&(this.isRadio?e=t.identifier:e.push(t.identifier))}),this.isRadio?e:e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return this.minChoices*1===0?!0:this.response===null?!1:this.cardinality==="single"||this.cardinality==="multiple"&&this.response.length>=this.minChoices*1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),M.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},checkMaxChoicesLimit(){if(this.isRadio||this.maxChoices==0)return!1;const e=this.getResponse();return e!==null&&e.length==this.maxChoices?(M.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage),!0):!1},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You are permitted a maximum of "+this.maxChoices+" choice"+(this.maxChoices>1?"s":"")+" for this question.<br/><br/>Please unselect one of your choices before making another choice."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minSelectionsMessage=this.minChoices==0?"":"You must make at least "+this.minChoices+" choice"+(this.minChoices>1?"s":"")+" for this question."},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new B('Choice Interaction State Invalid. "order" property not found.');return t},showSolution(e){if(e!==null){if(this.isRadio){this.choices.forEach(t=>{this.setChoiceSolution(t,e)},this);return}this.choices.forEach(t=>{const i=this.findIdentifierInCorrectResponse(t.identifier,e);this.setChoiceSolution(t,i)},this)}},setChoiceSolution(e,t){e.isChecked()?e.identifier===t?e.setCorrectSolution():e.setIncorrectSolution():e.identifier===t?e.setExpectedSolution():e.setIgnoreSolution()},findIdentifierInCorrectResponse(e,t){for(let i=0;i<t.length;i++)if(e===t[i])return e;return null}},created(){try{this.responseDeclaration=am.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.priorState=this.getPriorState(this.responseIdentifier),am.validateMaxMinChoices(this.maxChoices,this.minChoices),this.cardinality=this.getCardinality(),this.isRadio=this.cardinality!=="multiple",this.isShuffle=this.shuffle==="true",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"Choice",node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},v1={ref:"root",class:"qti-choice-interaction"},E1={ref:"prompt",class:"qti-prompt-wrapper"};function C1(e,t,i,s,n,r){const a=l.resolveComponent("ChoiceGroup");return l.openBlock(),l.createElementBlock("div",v1,[l.createElementVNode("div",E1,null,512),l.createVNode(a,l.mergeProps({ref:"choicegroup",cardinality:n.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxChoices:i.maxChoices,minChoices:i.minChoices,onChoiceGroupReady:r.handleChoiceGroupReady,onSetChecked:r.handleSetChecked,onSetFocusNextChoice:r.handleSetFocusNextChoice,onSetFocusPreviousChoice:r.handleSetFocusPreviousChoice,onSetActiveDescendant:r.handleSetActiveDescendant},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxChoices","minChoices","onChoiceGroupReady","onSetChecked","onSetFocusNextChoice","onSetFocusPreviousChoice","onSetActiveDescendant"])],512)}const T1=D(b1,[["render",C1]]);class S1{constructor(t){return this.constants={QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_WRITING_ORIENTATION_VERTICAL_RL:"qti-writing-orientation-vertical-rl"},this.classList=t,this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_ORIENTATION_VERTICAL:case this.constants.QTI_WRITING_ORIENTATION_VERTICAL_RL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_VERTICAL;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL;break}}getOrientationClass(){return this.presentation_OrientationClass}isOrientationVertical(){return this.presentation_OrientationClass==this.constants.QTI_ORIENTATION_VERTICAL}setVerticalOrientation(t){this.isOrientationVertical()&&t.classList.add(this.constants.QTI_ORIENTATION_VERTICAL)}}const cu=new F,x1=new ie,I1={name:"QtiInlineChoiceInteraction",props:{responseIdentifier:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},required:{required:!1,type:String,default:"false"},dataPrompt:{required:!1,type:String,default:"Choose..."},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},dataMinSelectionsMessage:{required:!1,type:String}},computed:{labelId(){return"inlinechoice_label_"+this.responseIdentifier},buttonId(){return"inlinechoice_button_"+this.responseIdentifier},buttonAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier+" inlinechoice_button_"+this.responseIdentifier},listboxId(){return"inlinechoice_listbox_"+this.responseIdentifier},listboxAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",choices:[],allOptionElements:null,activeDescendant:null,keysSoFar:"",searchIndex:null,isShuffle:null,isRequired:!1,isDisabled:!1,isQtiValid:!0,presentationFactory:null,isOrientationVertical:!1,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.toggleDisable(!0)},enable(){this.toggleDisable(!1)},toggleDisable(e){this.isDisabled=e,e?(this.getResponse()===null&&(this.$refs.label.innerHTML=""),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.button.classList.add("qti-hidden"),this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.button.classList.remove("qti-hidden"))},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.$refs.listbox.querySelectorAll('[role="option"]').forEach(t=>{this.defocusOption(t)},this),this.processGroupUI()},restoreValue(e){if(e===null)return;const t=this.findChoiceByIdentifier(e,this.choices);this.focusOption(t.$el,!0),this.setResponse(this.computeResponse(e)),this.updateValidity(this.computeIsValid())},getCardinality(){let e=M.getResponseDeclaration(this.responseIdentifier);if(typeof e>"u"&&(this.cardinality="single"),e.cardinality!=="single")throw new c('Invalid qti-inline-choice-interaction Response Variable cardinality: "'+this.cardinality+'"');return this.cardinality="single",this.cardinality},computeResponse(e){return e===null||e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return!this.isRequired&&this.minChoices*1===0?!0:this.response!==null},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),M.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}!this.isRequired&&this.minChoices*1===0||(this.minSelectionsMessage="You must make at least 1 choice for this question.")},handleButtonClick(){this.isDisabled||this.showListbox()},handleButtonKeyup(e){switch(e.code){case"ArrowUp":case"ArrowDown":if(e.preventDefault(),this.isDisabled)return;this.showListbox();break}},handleChoiceMousedown(e){e.preventDefault();let t=e.target;t.getAttribute("role")==="option"&&(this.focusOption(t),this.hideListbox(),this.$refs.button.focus())},handleBlur(){this.hideListbox()},handleFocusChange(e){this.$refs.prompt.innerHTML=e.innerHTML,this.$refs.label.innerHTML=e.innerHTML},showListbox(){this.$refs.listbox.classList.remove("inline-choice-select-listbox-hidden"),this.$refs.button.setAttribute("aria-expanded","true"),this.$refs.listbox.focus()},hideListbox(){this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden"),this.$refs.button.removeAttribute("aria-expanded")},setupFocus(){this.activeDescendant||this.focusFirstOption()},focusFirstOption(){let e=this.$refs.listbox.querySelector('[role="option"]');e&&this.focusOption(e)},focusLastOption(){let e=this.$refs.listbox.querySelectorAll('[role="option"]');e.length&&this.focusOption(e[e.length-1])},focusOption(e,t=!1){if(t||this.defocusOption(document.getElementById(this.activeDescendant)),e.setAttribute("aria-selected","true"),e.classList.add("focused"),this.setActiveDescendant(e.id),!t&&(this.setResponse(this.computeResponse(e.getAttribute("data-identifier"))),this.evaluateValidity(),this.$refs.listbox.scrollHeight>this.$refs.listbox.clientHeight)){const i=this.$refs.listbox.clientHeight+this.$refs.listbox.scrollTop,s=e.offsetTop+e.offsetHeight;s>i?this.$refs.listbox.scrollTop=s-this.$refs.listbox.clientHeight:e.offsetTop<this.$refs.listbox.scrollTop&&(this.$refs.listbox.scrollTop=e.offsetTop)}this.handleFocusChange(e)},defocusOption(e){e&&(e.removeAttribute("aria-selected"),e.classList.remove("focused"))},checkKeyPress(e){if(e.code=="Enter"||e.code=="Escape"){e.preventDefault(),this.hideListbox(),this.$refs.button.focus();return}let t=document.getElementById(this.activeDescendant);if(t)switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),e.code=="ArrowUp"?t=t.previousElementSibling:t=t.nextElementSibling,t&&this.focusOption(t);break;case"Home":e.preventDefault(),this.focusFirstOption();break;case"End":e.preventDefault(),this.focusLastOption();break}},findOptionToFocus(e){let t=this.$refs.listbox.querySelectorAll('[role="option"]');if(!this.keysSoFar)for(let s=0;s<t.length;s++)t[s].getAttribute("id")==this.activeDescendant&&(this.searchIndex=s);this.keysSoFar+=e,this.clearKeysSoFarAfterDelay();let i=this.findMatchInRange(t,this.searchIndex+1,t.length);return i||(i=this.findMatchInRange(t,0,this.searchIndex)),i},clearKeysSoFarAfterDelay(){this.keyClear&&(clearTimeout(this.keyClear),this.keyClear=null);let e=this;this.keyClear=setTimeout((function(){e.keysSoFar="",e.keyClear=null}).bind(this),500)},findMatchInRange(e,t,i){for(let s=t;s<i;s++){let n=e[s].innerText;if(n&&n.toUpperCase().indexOf(this.keysSoFar)===0)return e[s]}return null},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(cu.isValidSlot(e)){if(e.type.name==="QtiInlineChoice")return;throw new c('Node is not a qti-inline-choice: "'+e.type.name+'"')}})},processChildren(){const e=this.$.subTree.children[0].children[2].children[0];this.choices.push(e.component.proxy),this.$.subTree.children[0].children[2].children[1].children.forEach(i=>{i.component!==null&&this.choices.push(i.component.proxy)})},processGroupUI(){this.isOrientationVertical&&this.presentationFactory.setVerticalOrientation(this.$refs.root),this.isShuffle&&this.processShuffle(),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid()),this.setActiveDescendant("")},processShuffle(){let e=this.createShuffleContainer(this.choices,this.priorState);this.choices.splice(0,this.choices.length),this.$refs.listbox.innerHTML="",e.forEach(t=>{this.$refs.listbox.appendChild(t.node.$el),this.choices.push(t.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),x1.shuffleArrayFixed(i),i):(t.state.order.forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Inline Choice Interaction State Invalid. Inline Choice identifier "'+e+'" not found.')},setActiveDescendant(e){this.activeDescendant=e,this.$refs.listbox.setAttribute("aria-activedescendant",e)},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new B('Choice Interaction State Invalid. "order" property not found.');return t},addChoiceMousedownListeners(){this.allOptionElements=this.$refs.listbox.querySelectorAll('[role="option"]'),this.allOptionElements.forEach(e=>{e.addEventListener("mousedown",this.handleChoiceMousedown)})},removeChoiceMousedownListeners(){this.allOptionsElements!==null&&this.allOptionElements.forEach(e=>{e.removeEventListener("mousedown",this.handleChoiceMousedown)})}},created(){try{if(this.responseDeclaration=cu.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.presentationFactory=new S1(this.$.vnode.props.class),this.isOrientationVertical=this.presentationFactory.isOrientationVertical(),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),cu.validateMaxMinChoices(this.maxChoices,this.minChoices),this.minChoices>1)throw new c('Invalid qti-inline-choice-interaction min-choices attribute: "'+this.minChoices+'"');this.cardinality=this.getCardinality(),this.isShuffle=this.shuffle==="true",this.isRequired=this.required==="true",this.computeMinSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(),this.priorState!==null&&this.restoreValue(this.priorState.value),this.addChoiceMousedownListeners(),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"InlineChoice",node:this,resetValue:this.resetValue,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:null}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}},beforeUnmount(){this.removeChoiceMousedownListeners()}},_1={ref:"root",class:"qti-inline-choice-interaction"},V1={class:"inline-choice-wrapper"},A1=["aria-labelledby","id"],$1=["aria-labelledby"];function L1(e,t,i,s,n,r){const a=l.resolveComponent("qti-inline-choice");return l.openBlock(),l.createElementBlock("div",_1,[l.createElementVNode("div",V1,[l.createElementVNode("div",{ref:"label",class:"inline-choice-select-label qti-hidden"},l.toDisplayString(i.dataPrompt),513),l.createElementVNode("button",{ref:"button","aria-haspopup":"listbox","aria-labelledby":r.buttonAriaLabelledbyId,id:r.buttonId,class:"inline-choice-select",onClick:t[0]||(t[0]=(...o)=>r.handleButtonClick&&r.handleButtonClick(...o)),onKeyup:t[1]||(t[1]=(...o)=>r.handleButtonKeyup&&r.handleButtonKeyup(...o))},[l.createElementVNode("div",{ref:"prompt",class:"inline-choice-select-prompt"},l.toDisplayString(i.dataPrompt),513)],40,A1),l.createElementVNode("ul",{ref:"listbox",tabindex:"-1",role:"listbox","aria-labelledby":r.labelId,class:"inline-choice-select-listbox inline-choice-select-listbox-hidden",onBlur:t[2]||(t[2]=(...o)=>r.handleBlur&&r.handleBlur(...o)),onFocus:t[3]||(t[3]=(...o)=>r.setupFocus&&r.setupFocus(...o)),onKeydown:t[4]||(t[4]=(...o)=>r.checkKeyPress&&r.checkKeyPress(...o))},[l.createVNode(a,{identifier:"",fixed:"true"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.dataPrompt),1)]),_:1}),l.renderSlot(e.$slots,"default")],40,$1)])],512)}const M1=D(I1,[["render",L1]]),R1={name:"EndAttemptGeneric",props:{title:{required:!0,type:String}},data(){return{step:1,isBtnDisabled:!1}},methods:{getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleEndAttempt(){this.$parent.$emit("endAttempt",{response:!0})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.root.setAttribute("disabled",""):this.$refs.root.removeAttribute("disabled"),this.setIsBtnDisabled(e)}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}};function N1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("button",{ref:"root",class:"qti-end-attempt-interaction",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleEndAttempt&&r.handleEndAttempt(...a),["prevent"])),type:"button"},l.toDisplayString(i.title),513)}const k1=D(R1,[["render",N1]]),q1={name:"EndAttemptControllerBar",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{step:1,isBtnDisabled:!1,response:!1}},computed:{progressMaximumSteps(){return typeof this.dataSteps>"u"?1:this.dataSteps*1},progressActiveWidth(){let e=this.progressMaximumSteps;return e=this.step>e?this.step:e,Math.floor(100*(this.step/e))},progressMessage(){return this.step===this.progressMaximumSteps?"All Parts Showing":"Step "+this.step+" of "+this.progressMaximumSteps},hasTemplates(){return typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1},controllerType(){return typeof this.dataControllerType<"u"?this.dataControllerType:"generic"},progressClass(){return{"endattempt-progress-panel":!0,"progress-hidden":typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1}}},methods:{getStep(){return this.step},setStep(e){this.step=e<this.progressMaximumSteps?e:this.progressMaximumSteps},incrementStep(){this.setStep(this.getStep()+1)},getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleControllerNewTemplate(){this.resetControllerState(),M.NotifyNewTemplate({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:this.progressMaximumSteps})},handleControllerEndAttempt(){this.updateControllerState(),this.$parent.$emit("endAttempt",{response:this.response})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.endattempt.setAttribute("disabled",""):this.$refs.endattempt.removeAttribute("disabled"),this.setIsBtnDisabled(e)},resetControllerState(){this.setStep(1),this.enable(),this.$parent.$emit("notifyUpdateState",{})},updateControllerState(){switch(this.dataControllerType){case"showexample":case"solve":this.incrementStep(),this.getStep()<this.progressMaximumSteps?(this.response=!1,this.enable()):(this.response=!0,this.disable());break;case"generic":default:this.getStep()<this.progressMaximumSteps?(this.response=!1,this.incrementStep(),this.enable()):(this.response=!0,this.disable())}}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}},O1={class:"endattempt-controller"},P1={class:"endattempt-controller-progress"},B1={id:"msgNotes"},D1={class:"progress"},Q1=["aria-valuenow"],H1={class:"endattempt-controller-buttons"};function U1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",O1,[l.createElementVNode("div",P1,[l.createElementVNode("div",{class:l.normalizeClass(r.progressClass)},[l.createElementVNode("div",B1,l.toDisplayString(r.progressMessage),1),l.createElementVNode("div",D1,[l.createElementVNode("div",{class:"progress-bar",style:l.normalizeStyle({width:r.progressActiveWidth+"%"}),role:"progressbar","aria-valuenow":r.progressActiveWidth,"aria-valuemin":"0","aria-valuemax":"progressMaximumSteps"},null,12,Q1)])],2)]),t[2]||(t[2]=l.createElementVNode("div",{class:"endattempt-controller-filler"},null,-1)),l.createElementVNode("div",H1,[r.hasTemplates?(l.openBlock(),l.createElementBlock("button",{key:0,id:"btnNewTemplate",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleControllerNewTemplate&&r.handleControllerNewTemplate(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-secondary"},"New Question")):l.createCommentVNode("",!0),l.createElementVNode("button",{ref:"endattempt",id:"btnEndAttempt",onClick:t[1]||(t[1]=l.withModifiers((...a)=>r.handleControllerEndAttempt&&r.handleControllerEndAttempt(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-primary"},l.toDisplayString(i.title),513)])])}const F1=D(q1,[["render",U1]]),el={DEFAULT:"",ENDATTEMPT_CONTROLLER_BAR:"endattempt-controller-bar"};function G1(e,t){switch(e){case el.ENDATTEMPT_CONTROLLER_BAR:return{template:'<end-attempt-controller-bar response-identifier="'+t.responseIdentifier+'" title="'+t.title+'" data-steps="'+t.dataSteps+'" data-hastemplates="'+t.dataHastemplates+'" data-controller-type="'+t.dataControllerType+'" data-hideprogress="'+t.dataHideprogress+'" />',components:{EndAttemptControllerBar:F1}};default:return{template:'<end-attempt-default response-identifier="'+t.responseIdentifier+'" title="'+t.title+'"/>',components:{EndAttemptDefault:k1}}}}function j1(e){if(typeof e>"u"||e===null||e.length==0)return el.DEFAULT;const t=e.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case el.ENDATTEMPT_CONTROLLER_BAR:return t[i]}return el.DEFAULT}const W1=new F,z1={name:"QtiEndAttemptInteraction",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{response:!1,state:null,cardinality:"single",responseDeclaration:null,interactionSubType:"",isBtnDisabled:!1,isValidResponse:!0,invalidResponseMessage:"",isQtiValid:!0,node:null,priorState:null}},computed:{interactionTemplate(){return G1(this.interactionSubType,this.createComponentProperties())}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},updateState(){this.setState(this.computeState())},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.invalidResponseMessage},getCardinality(){return this.cardinality},getStep(){return this.interactionSubType==="endattempt-controller-bar"?this.node.getStep():1},setStep(e){this.interactionSubType==="endattempt-controller-bar"&&this.node.setStep(e)},initializeValue(){this.enableButton(),this.setStep(1),this.updateState(),this.setResponse(!1),this.setIsValid(!0)},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.initializeValue()},restoreValue(e){e.state.isBtnDisabled?this.disableButton():this.enableButton(),this.setStep(e.state.step),this.setState(this.computeState()),this.setResponse(this.computeResponse(e.value)),this.setIsValid(!0)},computeResponse(e){return e===null?!1:e},computeState(){return{step:this.getStep(),isBtnDisabled:this.getIsBtnDisabled(),interactionSubType:this.getInteractionSubType()}},disable(){this.disableButton(),this.updateState()},enable(){this.enableButton(),this.setResponse(!1),this.updateState()},getIsBtnDisabled(){return this.node.getIsBtnDisabled()},setIsBtnDisabled(e){this.node.setIsBtnDisabled(e)},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},handleEndAttempt(e){this.setResponse(e.response),this.updateState(),this.notifyEndAttempt()},handleUpdateState(){this.updateState()},enableButton(){this.node.enable()},disableButton(){this.node.disable()},detectInteractionSubType(e){return j1(e)},createComponentProperties(){const e={responseIdentifier:this.responseIdentifier,title:this.title};return e.dataSteps=typeof this.dataSteps<"u"?this.dataSteps:"1",e.dataHastemplates=typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1,e.dataHideprogress=typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1,e.dataControllerType=typeof this.dataControllerType<"u"?this.dataControllerType:"generic",e},handleEndAttemptReady(e){this.node=e.node},notifyEndAttempt(){M.NotifyEndAttempt({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:typeof this.dataSteps<"u"?this.dataSteps*1:1,interactionSubType:this.getInteractionSubType()})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('End Attempt Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('End Attempt Interaction State Invalid. "state" property not found.');if(!("step"in t.state))throw new B('End Attempt Interaction State Invalid. "step" property not found.');if(!("isBtnDisabled"in t.state))throw new B('End Attempt Interaction State Invalid. "isBtnDisabled" property not found.');return t}},created(){try{this.responseDeclaration=W1.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$attrs.class)),this.priorState=this.getPriorState(this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.priorState===null?this.initializeValue():this.restoreValue(this.priorState),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"EndAttemptInteraction",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,disable:this.disable,enable:this.enable,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage()}),console.log("["+this.$options.name+":"+this.interactionSubType+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},K1={ref:"root"};function Y1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",K1,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.interactionTemplate),l.mergeProps({ref:"endattempt",onEndAttempt:r.handleEndAttempt,onUpdateState:r.handleUpdateState,onEndAttemptReady:r.handleEndAttemptReady},e.$attrs),null,16,["onEndAttempt","onUpdateState","onEndAttemptReady"]))],512)}const X1=D(z1,[["render",Y1]]);class Z1{constructor(t,i){return this.constants={QTI_COUNTER_NONE:"none",QTI_COUNTER_UP:"qti-counter-up",QTI_COUNTER_DOWN:"qti-counter-down",QTI_HEIGHT_LINES_3:"qti-height-lines-3",QTI_HEIGHT_LINES_6:"qti-height-lines-6",QTI_HEIGHT_LINES_15:"qti-height-lines-15",SBAC_HEIGHT_LINES_95:"sbac-height-lines-95",SBAC_PRESENTATION:"sbac"},this.classList=t,this.expectedLength=i,this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3,this.presentation_CounterStyle=this.constants.QTI_COUNTER_NONE,this.presentation_Sbac=!1,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.SBAC_HEIGHT_LINES_95:this.presentation_HeightClass=this.constants.SBAC_HEIGHT_LINES_95;break;case this.constants.QTI_COUNTER_UP:this.presentation_CounterStyle="up",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_COUNTER_DOWN:this.presentation_CounterStyle="down",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_HEIGHT_LINES_3:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3;break;case this.constants.QTI_HEIGHT_LINES_6:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_6;break;case this.constants.QTI_HEIGHT_LINES_15:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_15;break}}processExpectedLength(){return typeof this.expectedLength>"u"||this.expectedLength===null||this.expectedLength.length==0||this.expectedLength==="0"?400:this.expectedLength*1}getCounterStyle(){return this.presentation_CounterStyle}getHeightClass(){return this.presentation_HeightClass}getExpectedLength(){return this.expectedLength}getIsSbac(){return this.presentation_Sbac}}var It="top",Yt="bottom",Xt="right",_t="left",uu="auto",Kr=[It,Yt,Xt,_t],Nn="start",Yr="end",J1="clippingParents",om="viewport",Xr="popper",eI="reference",lm=Kr.reduce(function(e,t){return e.concat([t+"-"+Nn,t+"-"+Yr])},[]),cm=[].concat(Kr,[uu]).reduce(function(e,t){return e.concat([t,t+"-"+Nn,t+"-"+Yr])},[]),tI="beforeRead",iI="read",sI="afterRead",nI="beforeMain",rI="main",aI="afterMain",oI="beforeWrite",lI="write",cI="afterWrite",uI=[tI,iI,sI,nI,rI,aI,oI,lI,cI];function Mi(e){return e?(e.nodeName||"").toLowerCase():null}function Dt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ks(e){var t=Dt(e).Element;return e instanceof t||e instanceof Element}function Zt(e){var t=Dt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hu(e){if(typeof ShadowRoot>"u")return!1;var t=Dt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hI(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var s=t.styles[i]||{},n=t.attributes[i]||{},r=t.elements[i];!Zt(r)||!Mi(r)||(Object.assign(r.style,s),Object.keys(n).forEach(function(a){var o=n[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function dI(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(s){var n=t.elements[s],r=t.attributes[s]||{},a=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:i[s]),o=a.reduce(function(u,d){return u[d]="",u},{});!Zt(n)||!Mi(n)||(Object.assign(n.style,o),Object.keys(r).forEach(function(u){n.removeAttribute(u)}))})}}const um={name:"applyStyles",enabled:!0,phase:"write",fn:hI,effect:dI,requires:["computeStyles"]};function Ri(e){return e.split("-")[0]}var Ys=Math.max,tl=Math.min,kn=Math.round;function du(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hm(){return!/^((?!chrome|android).)*safari/i.test(du())}function qn(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var s=e.getBoundingClientRect(),n=1,r=1;t&&Zt(e)&&(n=e.offsetWidth>0&&kn(s.width)/e.offsetWidth||1,r=e.offsetHeight>0&&kn(s.height)/e.offsetHeight||1);var a=Ks(e)?Dt(e):window,o=a.visualViewport,u=!hm()&&i,d=(s.left+(u&&o?o.offsetLeft:0))/n,f=(s.top+(u&&o?o.offsetTop:0))/r,y=s.width/n,m=s.height/r;return{width:y,height:m,top:f,right:d+y,bottom:f+m,left:d,x:d,y:f}}function fu(e){var t=qn(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function dm(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&hu(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Ji(e){return Dt(e).getComputedStyle(e)}function fI(e){return["table","td","th"].indexOf(Mi(e))>=0}function vs(e){return((Ks(e)?e.ownerDocument:e.document)||window.document).documentElement}function il(e){return Mi(e)==="html"?e:e.assignedSlot||e.parentNode||(hu(e)?e.host:null)||vs(e)}function fm(e){return!Zt(e)||Ji(e).position==="fixed"?null:e.offsetParent}function pI(e){var t=/firefox/i.test(du()),i=/Trident/i.test(du());if(i&&Zt(e)){var s=Ji(e);if(s.position==="fixed")return null}var n=il(e);for(hu(n)&&(n=n.host);Zt(n)&&["html","body"].indexOf(Mi(n))<0;){var r=Ji(n);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return n;n=n.parentNode}return null}function Zr(e){for(var t=Dt(e),i=fm(e);i&&fI(i)&&Ji(i).position==="static";)i=fm(i);return i&&(Mi(i)==="html"||Mi(i)==="body"&&Ji(i).position==="static")?t:i||pI(e)||t}function pu(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jr(e,t,i){return Ys(e,tl(t,i))}function mI(e,t,i){var s=Jr(e,t,i);return s>i?i:s}function pm(){return{top:0,right:0,bottom:0,left:0}}function mm(e){return Object.assign({},pm(),e)}function gm(e,t){return t.reduce(function(i,s){return i[s]=e,i},{})}var gI=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,mm(typeof t!="number"?t:gm(t,Kr))};function yI(e){var t,i=e.state,s=e.name,n=e.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,o=Ri(i.placement),u=pu(o),d=[_t,Xt].indexOf(o)>=0,f=d?"height":"width";if(!(!r||!a)){var y=gI(n.padding,i),m=fu(r),b=u==="y"?It:_t,E=u==="y"?Yt:Xt,$=i.rects.reference[f]+i.rects.reference[u]-a[u]-i.rects.popper[f],R=a[u]-i.rects.reference[u],O=Zr(r),N=O?u==="y"?O.clientHeight||0:O.clientWidth||0:0,z=$/2-R/2,V=y[b],Z=N-m[f]-y[E],K=N/2-m[f]/2+z,re=Jr(V,K,Z),w=u;i.modifiersData[s]=(t={},t[w]=re,t.centerOffset=re-K,t)}}function wI(e){var t=e.state,i=e.options,s=i.element,n=s===void 0?"[data-popper-arrow]":s;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||dm(t.elements.popper,n)&&(t.elements.arrow=n))}const bI={name:"arrow",enabled:!0,phase:"main",fn:yI,effect:wI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function On(e){return e.split("-")[1]}var vI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function EI(e,t){var i=e.x,s=e.y,n=t.devicePixelRatio||1;return{x:kn(i*n)/n||0,y:kn(s*n)/n||0}}function ym(e){var t,i=e.popper,s=e.popperRect,n=e.placement,r=e.variation,a=e.offsets,o=e.position,u=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,y=e.isFixed,m=a.x,b=m===void 0?0:m,E=a.y,$=E===void 0?0:E,R=typeof f=="function"?f({x:b,y:$}):{x:b,y:$};b=R.x,$=R.y;var O=a.hasOwnProperty("x"),N=a.hasOwnProperty("y"),z=_t,V=It,Z=window;if(d){var K=Zr(i),re="clientHeight",w="clientWidth";if(K===Dt(i)&&(K=vs(i),Ji(K).position!=="static"&&o==="absolute"&&(re="scrollHeight",w="scrollWidth")),K=K,n===It||(n===_t||n===Xt)&&r===Yr){V=Yt;var C=y&&K===Z&&Z.visualViewport?Z.visualViewport.height:K[re];$-=C-s.height,$*=u?1:-1}if(n===_t||(n===It||n===Yt)&&r===Yr){z=Xt;var I=y&&K===Z&&Z.visualViewport?Z.visualViewport.width:K[w];b-=I-s.width,b*=u?1:-1}}var p=Object.assign({position:o},d&&vI),T=f===!0?EI({x:b,y:$},Dt(i)):{x:b,y:$};if(b=T.x,$=T.y,u){var g;return Object.assign({},p,(g={},g[V]=N?"0":"",g[z]=O?"0":"",g.transform=(Z.devicePixelRatio||1)<=1?"translate("+b+"px, "+$+"px)":"translate3d("+b+"px, "+$+"px, 0)",g))}return Object.assign({},p,(t={},t[V]=N?$+"px":"",t[z]=O?b+"px":"",t.transform="",t))}function CI(e){var t=e.state,i=e.options,s=i.gpuAcceleration,n=s===void 0?!0:s,r=i.adaptive,a=r===void 0?!0:r,o=i.roundOffsets,u=o===void 0?!0:o,d={placement:Ri(t.placement),variation:On(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ym(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ym(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const TI={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CI,data:{}};var sl={passive:!0};function SI(e){var t=e.state,i=e.instance,s=e.options,n=s.scroll,r=n===void 0?!0:n,a=s.resize,o=a===void 0?!0:a,u=Dt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(f){f.addEventListener("scroll",i.update,sl)}),o&&u.addEventListener("resize",i.update,sl),function(){r&&d.forEach(function(f){f.removeEventListener("scroll",i.update,sl)}),o&&u.removeEventListener("resize",i.update,sl)}}const xI={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:SI,data:{}};var II={left:"right",right:"left",bottom:"top",top:"bottom"};function nl(e){return e.replace(/left|right|bottom|top/g,function(t){return II[t]})}var _I={start:"end",end:"start"};function wm(e){return e.replace(/start|end/g,function(t){return _I[t]})}function mu(e){var t=Dt(e),i=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:i,scrollTop:s}}function gu(e){return qn(vs(e)).left+mu(e).scrollLeft}function VI(e,t){var i=Dt(e),s=vs(e),n=i.visualViewport,r=s.clientWidth,a=s.clientHeight,o=0,u=0;if(n){r=n.width,a=n.height;var d=hm();(d||!d&&t==="fixed")&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:a,x:o+gu(e),y:u}}function AI(e){var t,i=vs(e),s=mu(e),n=(t=e.ownerDocument)==null?void 0:t.body,r=Ys(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Ys(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-s.scrollLeft+gu(e),u=-s.scrollTop;return Ji(n||i).direction==="rtl"&&(o+=Ys(i.clientWidth,n?n.clientWidth:0)-r),{width:r,height:a,x:o,y:u}}function yu(e){var t=Ji(e),i=t.overflow,s=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function bm(e){return["html","body","#document"].indexOf(Mi(e))>=0?e.ownerDocument.body:Zt(e)&&yu(e)?e:bm(il(e))}function ea(e,t){var i;t===void 0&&(t=[]);var s=bm(e),n=s===((i=e.ownerDocument)==null?void 0:i.body),r=Dt(s),a=n?[r].concat(r.visualViewport||[],yu(s)?s:[]):s,o=t.concat(a);return n?o:o.concat(ea(il(a)))}function wu(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $I(e,t){var i=qn(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function vm(e,t,i){return t===om?wu(VI(e,i)):Ks(t)?$I(t,i):wu(AI(vs(e)))}function LI(e){var t=ea(il(e)),i=["absolute","fixed"].indexOf(Ji(e).position)>=0,s=i&&Zt(e)?Zr(e):e;return Ks(s)?t.filter(function(n){return Ks(n)&&dm(n,s)&&Mi(n)!=="body"}):[]}function MI(e,t,i,s){var n=t==="clippingParents"?LI(e):[].concat(t),r=[].concat(n,[i]),a=r[0],o=r.reduce(function(u,d){var f=vm(e,d,s);return u.top=Ys(f.top,u.top),u.right=tl(f.right,u.right),u.bottom=tl(f.bottom,u.bottom),u.left=Ys(f.left,u.left),u},vm(e,a,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Em(e){var t=e.reference,i=e.element,s=e.placement,n=s?Ri(s):null,r=s?On(s):null,a=t.x+t.width/2-i.width/2,o=t.y+t.height/2-i.height/2,u;switch(n){case It:u={x:a,y:t.y-i.height};break;case Yt:u={x:a,y:t.y+t.height};break;case Xt:u={x:t.x+t.width,y:o};break;case _t:u={x:t.x-i.width,y:o};break;default:u={x:t.x,y:t.y}}var d=n?pu(n):null;if(d!=null){var f=d==="y"?"height":"width";switch(r){case Nn:u[d]=u[d]-(t[f]/2-i[f]/2);break;case Yr:u[d]=u[d]+(t[f]/2-i[f]/2);break}}return u}function ta(e,t){t===void 0&&(t={});var i=t,s=i.placement,n=s===void 0?e.placement:s,r=i.strategy,a=r===void 0?e.strategy:r,o=i.boundary,u=o===void 0?J1:o,d=i.rootBoundary,f=d===void 0?om:d,y=i.elementContext,m=y===void 0?Xr:y,b=i.altBoundary,E=b===void 0?!1:b,$=i.padding,R=$===void 0?0:$,O=mm(typeof R!="number"?R:gm(R,Kr)),N=m===Xr?eI:Xr,z=e.rects.popper,V=e.elements[E?N:m],Z=MI(Ks(V)?V:V.contextElement||vs(e.elements.popper),u,f,a),K=qn(e.elements.reference),re=Em({reference:K,element:z,strategy:"absolute",placement:n}),w=wu(Object.assign({},z,re)),C=m===Xr?w:K,I={top:Z.top-C.top+O.top,bottom:C.bottom-Z.bottom+O.bottom,left:Z.left-C.left+O.left,right:C.right-Z.right+O.right},p=e.modifiersData.offset;if(m===Xr&&p){var T=p[n];Object.keys(I).forEach(function(g){var L=[Xt,Yt].indexOf(g)>=0?1:-1,x=[It,Yt].indexOf(g)>=0?"y":"x";I[g]+=T[x]*L})}return I}function RI(e,t){t===void 0&&(t={});var i=t,s=i.placement,n=i.boundary,r=i.rootBoundary,a=i.padding,o=i.flipVariations,u=i.allowedAutoPlacements,d=u===void 0?cm:u,f=On(s),y=f?o?lm:lm.filter(function(E){return On(E)===f}):Kr,m=y.filter(function(E){return d.indexOf(E)>=0});m.length===0&&(m=y);var b=m.reduce(function(E,$){return E[$]=ta(e,{placement:$,boundary:n,rootBoundary:r,padding:a})[Ri($)],E},{});return Object.keys(b).sort(function(E,$){return b[E]-b[$]})}function NI(e){if(Ri(e)===uu)return[];var t=nl(e);return[wm(e),t,wm(t)]}function kI(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,o=a===void 0?!0:a,u=i.fallbackPlacements,d=i.padding,f=i.boundary,y=i.rootBoundary,m=i.altBoundary,b=i.flipVariations,E=b===void 0?!0:b,$=i.allowedAutoPlacements,R=t.options.placement,O=Ri(R),N=O===R,z=u||(N||!E?[nl(R)]:NI(R)),V=[R].concat(z).reduce(function(oe,P){return oe.concat(Ri(P)===uu?RI(t,{placement:P,boundary:f,rootBoundary:y,padding:d,flipVariations:E,allowedAutoPlacements:$}):P)},[]),Z=t.rects.reference,K=t.rects.popper,re=new Map,w=!0,C=V[0],I=0;I<V.length;I++){var p=V[I],T=Ri(p),g=On(p)===Nn,L=[It,Yt].indexOf(T)>=0,x=L?"width":"height",S=ta(t,{placement:p,boundary:f,rootBoundary:y,altBoundary:m,padding:d}),_=L?g?Xt:_t:g?Yt:It;Z[x]>K[x]&&(_=nl(_));var A=nl(_),q=[];if(r&&q.push(S[T]<=0),o&&q.push(S[_]<=0,S[A]<=0),q.every(function(oe){return oe})){C=p,w=!1;break}re.set(p,q)}if(w)for(var H=E?3:1,J=function(P){var Q=V.find(function(we){var fe=re.get(we);if(fe)return fe.slice(0,P).every(function(_e){return _e})});if(Q)return C=Q,"break"},ee=H;ee>0;ee--){var ae=J(ee);if(ae==="break")break}t.placement!==C&&(t.modifiersData[s]._skip=!0,t.placement=C,t.reset=!0)}}const qI={name:"flip",enabled:!0,phase:"main",fn:kI,requiresIfExists:["offset"],data:{_skip:!1}};function Cm(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Tm(e){return[It,Xt,Yt,_t].some(function(t){return e[t]>=0})}function OI(e){var t=e.state,i=e.name,s=t.rects.reference,n=t.rects.popper,r=t.modifiersData.preventOverflow,a=ta(t,{elementContext:"reference"}),o=ta(t,{altBoundary:!0}),u=Cm(a,s),d=Cm(o,n,r),f=Tm(u),y=Tm(d);t.modifiersData[i]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:y},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":y})}const PI={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:OI};function BI(e,t,i){var s=Ri(e),n=[_t,It].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,a=r[0],o=r[1];return a=a||0,o=(o||0)*n,[_t,Xt].indexOf(s)>=0?{x:o,y:a}:{x:a,y:o}}function DI(e){var t=e.state,i=e.options,s=e.name,n=i.offset,r=n===void 0?[0,0]:n,a=cm.reduce(function(f,y){return f[y]=BI(y,t.rects,r),f},{}),o=a[t.placement],u=o.x,d=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=a}const QI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:DI};function HI(e){var t=e.state,i=e.name;t.modifiersData[i]=Em({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const UI={name:"popperOffsets",enabled:!0,phase:"read",fn:HI,data:{}};function FI(e){return e==="x"?"y":"x"}function GI(e){var t=e.state,i=e.options,s=e.name,n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,o=a===void 0?!1:a,u=i.boundary,d=i.rootBoundary,f=i.altBoundary,y=i.padding,m=i.tether,b=m===void 0?!0:m,E=i.tetherOffset,$=E===void 0?0:E,R=ta(t,{boundary:u,rootBoundary:d,padding:y,altBoundary:f}),O=Ri(t.placement),N=On(t.placement),z=!N,V=pu(O),Z=FI(V),K=t.modifiersData.popperOffsets,re=t.rects.reference,w=t.rects.popper,C=typeof $=="function"?$(Object.assign({},t.rects,{placement:t.placement})):$,I=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),p=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(K){if(r){var g,L=V==="y"?It:_t,x=V==="y"?Yt:Xt,S=V==="y"?"height":"width",_=K[V],A=_+R[L],q=_-R[x],H=b?-w[S]/2:0,J=N===Nn?re[S]:w[S],ee=N===Nn?-w[S]:-re[S],ae=t.elements.arrow,oe=b&&ae?fu(ae):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pm(),Q=P[L],we=P[x],fe=Jr(0,re[S],oe[S]),_e=z?re[S]/2-H-fe-Q-I.mainAxis:J-fe-Q-I.mainAxis,Ce=z?-re[S]/2+H+fe+we+I.mainAxis:ee+fe+we+I.mainAxis,be=t.elements.arrow&&Zr(t.elements.arrow),$e=be?V==="y"?be.clientTop||0:be.clientLeft||0:0,ve=(g=p==null?void 0:p[V])!=null?g:0,Ve=_+_e-ve-$e,Te=_+Ce-ve,Ti=Jr(b?tl(A,Ve):A,_,b?Ys(q,Te):q);K[V]=Ti,T[V]=Ti-_}if(o){var Fi,Ms=V==="x"?It:_t,Rs=V==="x"?Yt:Xt,pt=K[Z],Lt=Z==="y"?"height":"width",Gi=pt+R[Ms],ri=pt-R[Rs],mt=[It,_t].indexOf(O)!==-1,Si=(Fi=p==null?void 0:p[Z])!=null?Fi:0,Ns=mt?Gi:pt-re[Lt]-w[Lt]-Si+I.altAxis,ai=mt?pt+re[Lt]+w[Lt]-Si-I.altAxis:ri,xi=b&&mt?mI(Ns,pt,ai):Jr(b?Ns:Gi,pt,b?ai:ri);K[Z]=xi,T[Z]=xi-pt}t.modifiersData[s]=T}}const jI={name:"preventOverflow",enabled:!0,phase:"main",fn:GI,requiresIfExists:["offset"]};function WI(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function zI(e){return e===Dt(e)||!Zt(e)?mu(e):WI(e)}function KI(e){var t=e.getBoundingClientRect(),i=kn(t.width)/e.offsetWidth||1,s=kn(t.height)/e.offsetHeight||1;return i!==1||s!==1}function YI(e,t,i){i===void 0&&(i=!1);var s=Zt(t),n=Zt(t)&&KI(t),r=vs(t),a=qn(e,n,i),o={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!i)&&((Mi(t)!=="body"||yu(r))&&(o=zI(t)),Zt(t)?(u=qn(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):r&&(u.x=gu(r))),{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function XI(e){var t=new Map,i=new Set,s=[];e.forEach(function(r){t.set(r.name,r)});function n(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!i.has(o)){var u=t.get(o);u&&n(u)}}),s.push(r)}return e.forEach(function(r){i.has(r.name)||n(r)}),s}function ZI(e){var t=XI(e);return uI.reduce(function(i,s){return i.concat(t.filter(function(n){return n.phase===s}))},[])}function JI(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function e_(e){var t=e.reduce(function(i,s){var n=i[s.name];return i[s.name]=n?Object.assign({},n,s,{options:Object.assign({},n.options,s.options),data:Object.assign({},n.data,s.data)}):s,i},{});return Object.keys(t).map(function(i){return t[i]})}var Sm={placement:"bottom",modifiers:[],strategy:"absolute"};function xm(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function t_(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,s=i===void 0?[]:i,n=t.defaultOptions,r=n===void 0?Sm:n;return function(o,u,d){d===void 0&&(d=r);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Sm,r),modifiersData:{},elements:{reference:o,popper:u},attributes:{},styles:{}},y=[],m=!1,b={state:f,setOptions:function(O){var N=typeof O=="function"?O(f.options):O;$(),f.options=Object.assign({},r,f.options,N),f.scrollParents={reference:Ks(o)?ea(o):o.contextElement?ea(o.contextElement):[],popper:ea(u)};var z=ZI(e_([].concat(s,f.options.modifiers)));return f.orderedModifiers=z.filter(function(V){return V.enabled}),E(),b.update()},forceUpdate:function(){if(!m){var O=f.elements,N=O.reference,z=O.popper;if(xm(N,z)){f.rects={reference:YI(N,Zr(z),f.options.strategy==="fixed"),popper:fu(z)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(I){return f.modifiersData[I.name]=Object.assign({},I.data)});for(var V=0;V<f.orderedModifiers.length;V++){if(f.reset===!0){f.reset=!1,V=-1;continue}var Z=f.orderedModifiers[V],K=Z.fn,re=Z.options,w=re===void 0?{}:re,C=Z.name;typeof K=="function"&&(f=K({state:f,options:w,name:C,instance:b})||f)}}}},update:JI(function(){return new Promise(function(R){b.forceUpdate(),R(f)})}),destroy:function(){$(),m=!0}};if(!xm(o,u))return b;b.setOptions(d).then(function(R){!m&&d.onFirstUpdate&&d.onFirstUpdate(R)});function E(){f.orderedModifiers.forEach(function(R){var O=R.name,N=R.options,z=N===void 0?{}:N,V=R.effect;if(typeof V=="function"){var Z=V({state:f,name:O,instance:b,options:z}),K=function(){};y.push(Z||K)}})}function $(){y.forEach(function(R){return R()}),y=[]}return b}}var i_=[xI,UI,TI,um,QI,qI,jI,bI,PI],s_=t_({defaultModifiers:i_}),n_="tippy-box",Im="tippy-content",r_="tippy-backdrop",_m="tippy-arrow",Vm="tippy-svg-arrow",Xs={passive:!0,capture:!0},Am=function(){return document.body};function a_(e,t){return{}.hasOwnProperty.call(e,t)}function bu(e,t,i){if(Array.isArray(e)){var s=e[t];return s??(Array.isArray(i)?i[t]:i)}return e}function vu(e,t){var i={}.toString.call(e);return i.indexOf("[object")===0&&i.indexOf(t+"]")>-1}function $m(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Lm(e,t){if(t===0)return e;var i;return function(s){clearTimeout(i),i=setTimeout(function(){e(s)},t)}}function o_(e,t){var i=Object.assign({},e);return t.forEach(function(s){delete i[s]}),i}function l_(e){return e.split(/\s+/).filter(Boolean)}function Pn(e){return[].concat(e)}function Mm(e,t){e.indexOf(t)===-1&&e.push(t)}function c_(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function u_(e){return e.split("-")[0]}function rl(e){return[].slice.call(e)}function Rm(e){return Object.keys(e).reduce(function(t,i){return e[i]!==void 0&&(t[i]=e[i]),t},{})}function ia(){return document.createElement("div")}function sa(e){return["Element","Fragment"].some(function(t){return vu(e,t)})}function h_(e){return vu(e,"NodeList")}function d_(e){return vu(e,"MouseEvent")}function f_(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function p_(e){return sa(e)?[e]:h_(e)?rl(e):Array.isArray(e)?e:rl(document.querySelectorAll(e))}function Eu(e,t){e.forEach(function(i){i&&(i.style.transitionDuration=t+"ms")})}function Nm(e,t){e.forEach(function(i){i&&i.setAttribute("data-state",t)})}function m_(e){var t,i=Pn(e),s=i[0];return s!=null&&(t=s.ownerDocument)!=null&&t.body?s.ownerDocument:document}function g_(e,t){var i=t.clientX,s=t.clientY;return e.every(function(n){var r=n.popperRect,a=n.popperState,o=n.props,u=o.interactiveBorder,d=u_(a.placement),f=a.modifiersData.offset;if(!f)return!0;var y=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,b=d==="right"?f.left.x:0,E=d==="left"?f.right.x:0,$=r.top-s+y>u,R=s-r.bottom-m>u,O=r.left-i+b>u,N=i-r.right-E>u;return $||R||O||N})}function Cu(e,t,i){var s=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){e[s](n,i)})}function km(e,t){for(var i=t;i;){var s;if(e.contains(i))return!0;i=i.getRootNode==null||(s=i.getRootNode())==null?void 0:s.host}return!1}var Ni={isTouch:!1},qm=0;function y_(){Ni.isTouch||(Ni.isTouch=!0,window.performance&&document.addEventListener("mousemove",Om))}function Om(){var e=performance.now();e-qm<20&&(Ni.isTouch=!1,document.removeEventListener("mousemove",Om)),qm=e}function w_(){var e=document.activeElement;if(f_(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function b_(){document.addEventListener("touchstart",y_,Xs),window.addEventListener("blur",w_)}var v_=typeof window<"u"&&typeof document<"u",E_=v_?!!window.msCrypto:!1;function Bn(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Pm(e){var t=/[ \t]{2,}/g,i=/^[ \t]*/gm;return e.replace(t," ").replace(i,"").trim()}function C_(e){return Pm(`
|
87
|
+
`+r):s.stack=r}catch{}}throw s}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=Ws(this.defaults,i);const{transitional:s,paramsSerializer:n,headers:r}=i;s!==void 0&&zo.assertOptions(s,{silentJSONParsing:Li.transitional(Li.boolean),forcedJSONParsing:Li.transitional(Li.boolean),clarifyTimeoutError:Li.transitional(Li.boolean)},!1),n!=null&&(G.isFunction(n)?i.paramsSerializer={serialize:n}:zo.assertOptions(n,{encode:Li.function,serialize:Li.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),zo.assertOptions(i,{baseUrl:Li.spelling("baseURL"),withXsrfToken:Li.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let a=r&&G.merge(r.common,r[i.method]);r&&G.forEach(["delete","get","head","post","put","patch","common"],E=>{delete r[E]}),i.headers=xt.concat(a,r);const o=[];let u=!0;this.interceptors.request.forEach(function($){typeof $.runWhen=="function"&&$.runWhen(i)===!1||(u=u&&$.synchronous,o.unshift($.fulfilled,$.rejected))});const d=[];this.interceptors.response.forEach(function($){d.push($.fulfilled,$.rejected)});let f,y=0,m;if(!u){const E=[jp.bind(this),void 0];for(E.unshift.apply(E,o),E.push.apply(E,d),m=E.length,f=Promise.resolve(i);y<m;)f=f.then(E[y++],E[y++]);return f}m=o.length;let b=i;for(y=0;y<m;){const E=o[y++],$=o[y++];try{b=E(b)}catch(R){$.call(this,R);break}}try{f=jp.call(this,b)}catch(E){return Promise.reject(E)}for(y=0,m=d.length;y<m;)f=f.then(d[y++],d[y++]);return f}getUri(t){t=Ws(this.defaults,t);const i=Op(t.baseURL,t.url,t.allowAbsoluteUrls);return Vp(i,t.params,t.paramsSerializer)}}G.forEach(["delete","get","head","options"],function(t){zs.prototype[t]=function(i,s){return this.request(Ws(s||{},{method:t,url:i,data:(s||{}).data}))}}),G.forEach(["post","put","patch"],function(t){function i(s){return function(r,a,o){return this.request(Ws(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}zs.prototype[t]=i(),zs.prototype[t+"Form"]=i(!0)});class Jc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(r){i=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Mn(r,a,o),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const t=new AbortController,i=s=>{t.abort(s)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let t;return{token:new Jc(function(n){t=n}),cancel:t}}}function lS(e){return function(i){return e.apply(null,i)}}function cS(e){return G.isObject(e)&&e.isAxiosError===!0}const eu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(eu).forEach(([e,t])=>{eu[t]=e});function Kp(e){const t=new zs(e),i=pp(zs.prototype.request,t);return G.extend(i,zs.prototype,t,{allOwnKeys:!0}),G.extend(i,t,null,{allOwnKeys:!0}),i.create=function(n){return Kp(Ws(e,n))},i}const Xe=Kp(Dr);Xe.Axios=zs,Xe.CanceledError=Mn,Xe.CancelToken=Jc,Xe.isCancel=Rp,Xe.VERSION=Wp,Xe.toFormData=Ho,Xe.AxiosError=Ie,Xe.Cancel=Xe.CanceledError,Xe.all=function(t){return Promise.all(t)},Xe.spread=lS,Xe.isAxiosError=cS,Xe.mergeConfig=Ws,Xe.AxiosHeaders=xt,Xe.formToJSON=e=>Lp(G.isHTMLForm(e)?new FormData(e):e),Xe.getAdapter=Gp.getAdapter,Xe.HttpStatusCode=eu,Xe.default=Xe;const uS={name:"QtiStylesheet",props:{href:{type:String,required:!0},type:{type:String,required:!0}},data(){return{rawCss:"",css:"",isQtiValid:!0}},methods:{getHref(){return this.href},getType(){return this.type},getRawCss(){return this.rawCss},getCss(){Xe.get(this.href).then(e=>{this.rawCss=e.data,this.css=`<style>${this.rawCss}</style>`}).catch(e=>{console.log("["+this.$options.name+"][CSS Fetch Error: "+e+"]")})},validateChildren(){}},created(){this.getCss()},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"][Href: "+this.href+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},hS=["innerHTML"];function dS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-stylesheet",innerHTML:n.css},null,8,hS)}const fS=D(uS,[["render",dS]]),pS={name:"QtiCompanionMaterialsInfo",data(){return{isQtiValid:!0}},methods:{validateChildren(){}},mounted(){if(this.isQtiValid)try{this.validateChildren(),console.log("["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},mS={class:"qti-companion-materials-info"};function gS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",mS)}const yS=D(pS,[["render",gS]]),Hr=new F,wS={name:"QtiMapping",props:{lowerBound:{type:String,required:!1},upperBound:{type:String,required:!1},defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueLowerBound:null,valueUpperBound:null,valueDefaultValue:new j(0).toNumber(),isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},getLowerBound(){return this.valueLowerBound},setLowerBound(e){this.valueLowerBound=e},getUpperBound(){return this.valueUpperBound},setUpperBound(e){this.valueUpperBound=e},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},computeFloatValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},applyConstraints(e){return e===null||!j.isBigNumber(e)?null:(this.getLowerBound()!==null&&e.comparedTo(this.getLowerBound())<0&&(e=new j(this.getLowerBound())),this.getUpperBound()!==null&&e.comparedTo(this.getUpperBound())>0&&(e=new j(this.getUpperBound())),e.toNumber())},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-map-entry node");if(this.$slots.default().forEach(t=>{if(Hr.isValidSlot(t))if(Hr.kebabCase(t.type.name)==="qti-map-entry")e+=1;else throw new c('Node is not a qti-map-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-map-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;e===null&&(e=[]),e.push(s.getValue())}),e}},created(){try{typeof this.lowerBound<"u"&&this.setLowerBound(this.computeFloatValue(Hr.FloatValue(this.lowerBound))),typeof this.upperBound<"u"&&this.setUpperBound(this.computeFloatValue(Hr.FloatValue(this.upperBound))),typeof this.defaultValue<"u"&&this.setDefaultValue(this.computeFloatValue(Hr.FloatValue(this.defaultValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMapping][lowerBound][upperBound][defaultValue][Value]",this.getLowerBound(),this.getUpperBound(),this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},bS={class:"qti-mapping"};function vS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",bS,[l.renderSlot(e.$slots,"default")])}const ES=D(wS,[["render",vS]]),tu=new F,CS={name:"QtiMapEntry",props:{mapKey:{type:String,required:!0},mappedValue:{type:String,required:!0},caseSensitive:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMappedValue:null,valueCaseSensitive:!1,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setMappedValue(e){this.valueMappedValue=e},getMappedValue(){return this.valueMappedValue},setCaseSensitive(e){this.valueCaseSensitive=e},getCaseSensitive(){return this.valueCaseSensitive},computeMappedValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(tu.isValidSlot(e))throw new c('Invalid Child Node: "'+e.type.name+'"')})}},created(){try{this.setCaseSensitive(tu.validateCaseSensitive(this.caseSensitive,!1)),this.setMappedValue(this.computeMappedValue(tu.FloatValue(this.mappedValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){let e=this.$el.querySelector(".amp-mapentry__container");this.isQtiValid&&(this.setValue({mapKey:this.mapKey,mappedValue:this.getMappedValue(),caseSensitive:this.getCaseSensitive()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},TS={class:"qti-map-entry"},SS={class:"amp-mapentry__container"};function xS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",TS,[l.createElementVNode("div",SS,[l.renderSlot(e.$slots,"default")])])}const IS=D(CS,[["render",xS]]),Ur=new F,_S={name:"QtiAreaMapping",props:{lowerBound:{type:String,required:!1},upperBound:{type:String,required:!1},defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueLowerBound:null,valueUpperBound:null,valueDefaultValue:new j(0).toNumber(),isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},getLowerBound(){return this.valueLowerBound},setLowerBound(e){this.valueLowerBound=e},getUpperBound(){return this.valueUpperBound},setUpperBound(e){this.valueUpperBound=e},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},computeFloatValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},applyConstraints(e){return e===null||!j.isBigNumber(e)?null:(this.getLowerBound()!==null&&e.comparedTo(this.getLowerBound())<0&&(e=new j(this.getLowerBound())),this.getUpperBound()!==null&&e.comparedTo(this.getUpperBound())>0&&(e=new j(this.getUpperBound())),e.toNumber())},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-area-map-entry node");if(this.$slots.default().forEach(t=>{if(Ur.isValidSlot(t))if(Ur.kebabCase(t.type.name)==="qti-area-map-entry")e+=1;else throw new c('Node is not a qti-area-map-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-area-map-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;e===null&&(e=[]),e.push(s.getValue())}),e}},created(){try{typeof this.lowerBound<"u"&&this.setLowerBound(this.computeFloatValue(Ur.FloatValue(this.lowerBound))),typeof this.upperBound<"u"&&this.setUpperBound(this.computeFloatValue(Ur.FloatValue(this.upperBound))),typeof this.defaultValue<"u"&&this.setDefaultValue(this.computeFloatValue(Ur.FloatValue(this.defaultValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiAreaMapping][lowerBound][upperBound][defaultValue][Value]",this.getLowerBound(),this.getUpperBound(),this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},VS={class:"qti-area-mapping"};function AS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",VS,[l.renderSlot(e.$slots,"default")])}const $S=D(_S,[["render",AS]]),iu=new F,LS={name:"QtiAreaMapEntry",props:{shape:{type:String,required:!0},coords:{type:String,required:!0},mappedValue:{type:String,required:!0}},data(){return{value:null,valueBaseType:"float",valueCardinality:"single",valueMappedValue:null,coordsData:[],isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setMappedValue(e){this.valueMappedValue=e},getMappedValue(){return this.valueMappedValue},computeMappedValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},getShape(){return this.shape},getCoordsData(){return this.coordsData},setCoordsData(e){this.coordsData=e},validateCoordsAttribute(e){let t=e.split(",");switch(this.shape){case"circle":if(t.length!=3)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 3, but found: ${t.length}`);break;case"rect":case"ellipse":if(t.length!=4)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 4, but found: ${t.length}`);break;case"poly":this.validatePolyCoords(t);break;case"default":if(t.length!=0)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected 0, but found: ${t.length}`);break}return this.validatePositiveCoords(t),t},validatePolyCoords(e){let i=!1;e.length>1&&e[0]==e[e.length-2]&&e[1]==e[e.length-1]&&(i=!0);let s=6;if(i&&(s+=2),e.length<s)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected at least: ${s}, but found: ${e.length}`);if(e.length>=s&&e.length%2!=0)throw new c(`Invalid number of coordinates for ${this.shape} shape. Expected even number of coordinates, but found: ${e.length}`)},validatePositiveCoords(e){for(let t=0;t<e.length;t++)if(e[t]<0)throw new c(`Coordinate (${e[t]}) at (${t+1}) cannot be negative.`)},validateChildren:function(){this.$slots.default&&this.$slots.default().forEach(e=>{if(iu.isValidSlot(e))throw new c('Invalid Child Node: "'+e.type.name+'"')})}},created(){try{iu.validateShapeAttribute(this.shape),this.setCoordsData(this.validateCoordsAttribute(this.coords)),this.setMappedValue(this.computeMappedValue(iu.FloatValue(this.mappedValue))),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){let e=this.$el.querySelector(".amp-areamapentry__container");this.isQtiValid&&(this.setValue({mapShape:this.getShape(),mapCoords:this.getCoordsData(),mappedValue:this.getMappedValue()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},MS={class:"qti-area-map-entry"},RS={class:"amp-areamapentry__container"};function NS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",MS,[l.createElementVNode("div",RS,[l.renderSlot(e.$slots,"default")])])}const kS=D(LS,[["render",NS]]),su=new F,qS={name:"QtiInterpolationTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"interpolation",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-interpolation-table-entry node");if(this.$slots.default().forEach(t=>{if(su.isValidSlot(t))if(su.kebabCase(t.type.name)==="qti-interpolation-table-entry")e+=1;else throw new c('Node is not a qti-interpolation-table-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-interpolation-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(su.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiInterpolationTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},OS={class:"qti-interpolation-table"};function PS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",OS,[l.renderSlot(e.$slots,"default")])}const BS=D(qS,[["render",PS]]),Ko=new F,DS={name:"QtiInterpolationTableEntry",props:{sourceValue:{type:String,required:!0},includeBoundary:{type:String,required:!1},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,valueIncludeBoundary:!0,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},setIncludeBoundary(e){this.valueIncludeBoundary=e},getIncludeBoundary(){return this.valueIncludeBoundary},computeSourceValue(e){let t=null;try{t=new j(e)}catch(i){throw new se(i.message)}return t.toNumber()},isValidSlot(e){if(typeof e.componentOptions<"u")return!0;if(typeof e.text<"u"&&e.text.trim().length>0)throw new c('Invalid Child Node: "'+e.text.trim()+'"');return!1},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(Ko.isValidSlot(e))throw new c('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setIncludeBoundary(Ko.validateIncludeBoundary(this.includeBoundary,"include-boundary")),this.setSourceValue(this.computeSourceValue(Ko.FloatValue(this.sourceValue))),this.setTargetValue(Ko.validateValueFromBaseType(e,this.targetValue))}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message);if(e.name==="QtiParseException")throw new se(e.message)}},mounted(){let e=this.$el.querySelector(".amp-interpolationentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue(),includeBoundary:this.getIncludeBoundary()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},QS={class:"qti-interpolation-table-entry"},HS={class:"amp-interpolationentry__container"};function US(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",QS,[l.createElementVNode("div",HS,[l.renderSlot(e.$slots,"default")])])}const FS=D(DS,[["render",US]]),nu=new F,GS={name:"QtiMatchTable",props:{defaultValue:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:"single",valueDefaultValue:null,tableType:"match",isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},getTableType(){return this.tableType},getDefaultValue(){return this.valueDefaultValue},setDefaultValue(e){this.valueDefaultValue=e},validateChildren:function(){let e=0;if(!this.$slots.default)throw new c("Must have at least one qti-match-table-entry node");if(this.$slots.default().forEach(t=>{if(nu.isValidSlot(t))if(nu.kebabCase(t.type.name)==="qti-match-table-entry")e+=1;else throw new c('Node is not a qti-match-table-entry: "'+t.tpe.name+'"')}),e===0)throw new c("Must have at least one qti-match-table-entry node")},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{e===null&&(e=[]),e.push(i.getValue())}),e}},created(){try{let e=this.$parent.getBaseType();this.setBaseType(e),typeof this.defaultValue>"u"?this.setDefaultValue(null):this.setDefaultValue(nu.validateValueFromBaseType(e,this.defaultValue)),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[QtiMatchTable][DefaultValue][Value]",this.getDefaultValue(),this.getValue())}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},jS={class:"qti-match-table"};function WS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",jS,[l.renderSlot(e.$slots,"default")])}const zS=D(GS,[["render",WS]]),ru=new F,KS={name:"QtiMatchTableEntry",props:{sourceValue:{type:String,required:!0},targetValue:{type:String,required:!0}},data(){return{value:null,valueSourceValue:null,valueTargetValue:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},setSourceValue(e){this.valueSourceValue=e},getSourceValue(){return this.valueSourceValue},setTargetValue(e){this.valueTargetValue=e},getTargetValue(){return this.valueTargetValue},computeSourceValue(e){let t=null;try{if(t=new j(e),!t.isInteger())throw new se('Invalid qti-match-table-entry source-value integer "'+t+'"')}catch(i){throw new se(i.message)}return t.toNumber()},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(ru.isValidSlot(e))throw new c('Invalid Child Node: "'+e.tpe.name+'"')})}},created(){try{let e=this.$parent.$parent.getBaseType();this.setSourceValue(this.computeSourceValue(ru.IntegerValue(this.sourceValue))),this.setTargetValue(ru.validateValueFromBaseType(e,this.targetValue)),this.validateChildren()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message);if(e.name==="QtiParseException")throw new se(e.message)}},mounted(){let e=this.$el.querySelector(".amp-matchtableentry__container");this.isQtiValid&&(this.setValue({sourceValue:this.getSourceValue(),targetValue:this.getTargetValue()}),console.log("["+this.$options.name+"][Value]",this.getValue())),e.remove()}},YS={class:"qti-match-table-entry"},XS={class:"amp-matchtableentry__container"};function ZS(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",YS,[l.createElementVNode("div",XS,[l.renderSlot(e.$slots,"default")])])}const JS=D(KS,[["render",ZS]]),ex={name:"QtiDefaultValue",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),s.isRecordFieldValue()&&e.set(s.getFieldIdentifier(),s);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(s.getValue());break;case"single":e=e===null?s.getValue():e;break;default:console.log("[DefaultValue][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[DefaultValue][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},tx={ref:"root",class:"qti-default-value"};function ix(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tx,[l.renderSlot(e.$slots,"default")],512)}const sx=D(ex,[["render",ix]]),nx={name:"QtiCorrectResponse",props:{interpretation:{type:String,required:!1}},data(){return{value:null,valueBaseType:null,valueCardinality:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){return this.value},setValue(e){this.value=e},isNull(){return this.value===null},getBaseType(){return this.valueBaseType},getCardinality(){return this.valueCardinality},processChildren(){let e=null;return this.$.subTree.children[0].children.forEach(i=>{if(i.component===null)return;const s=i.component.proxy;switch(this.variableCardinality){case"record":e===null&&(e=new Map),s.isRecordFieldValue()&&e.set(s.getFieldIdentifier(),s);break;case"multiple":case"ordered":e===null&&(e=[]),e.push(s.getValue());break;case"single":e=e===null?s.getValue():e;break;default:console.log("[CorrectResponse][Cardinality]: processChildren cardinality unhandled = "+this.variableCardinality)}}),e},getVariableBaseType(){return this.$parent.$props.baseType},getVariableCardinality(){return this.$parent.$props.cardinality},evaluate(){return this.getValue()}},created(){try{this.valueBaseType=this.variableBaseType=this.getVariableBaseType(),this.valueCardinality=this.variableCardinality=this.getVariableCardinality()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.setValue(this.processChildren()),console.log("[CorrectResponse][Value:",this.getValue(),"][BaseType:"+this.getBaseType()+"][Cardinality:"+this.getCardinality()+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},rx={class:"qti-correct-response"};function ax(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",rx,[l.renderSlot(e.$slots,"default")])}const ox=D(nx,[["render",ax]]);class Yp{constructor(){}IntegerValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid integer "'+t+'". Length is not valid.');try{let i=parseInt(t,10);if(Number.isNaN(i))throw new se('Invalid integer "'+t+'". ');return i}catch(i){throw new se('Invalid integer "'+t+'". '+i.message)}}FloatValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid float "'+t+'". Length is not valid.');try{let i=parseFloat(t);if(Number.isNaN(i))throw new se('Invalid float "'+t+'". ');return i}catch(i){throw new se('Invalid float "'+t+'". '+i.message)}}BooleanValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid boolean "'+t+'". Length is not valid.');if(t.toLowerCase()==="true"||t==="1")return!0;if(t.toLowerCase()==="false"||t==="0")return!1;throw new se('Invalid boolean "'+t+'".')}StringValue(t){if(t==null||t.length==0)throw new se('Invalid string "'+t+'". Length is not valid.');return t}IdentifierValue(t){if(t!=null&&(t=t.trim()),t==null||t.length==0)throw new se('Invalid identifier "'+t+'". Length is not valid.');if(!this.isCharacterALetter(t.charAt(0))&&!this.isCharacterADigit(t.charAt(0))&&t.charAt(0)!=="_")throw new se('Invalid identifier "'+t+'". First character "'+t.charAt(0)+'" is not valid.');for(let i=1;i<t.length;i++)if(!this.isCharacterALetterOrDigit(t.charAt(i))&&t.charAt(i)!=="_"&&t.charAt(i)!=="-"&&t.charAt(i)!==".")throw new se('Invalid identifier "'+t+'". Character "'+t.charAt(i)+'" at position '+(i+1)+" is not valid.");return t}isCharacterALetter(t){return/[a-zA-Z]/.test(t)}isCharacterADigit(t){return/\d/.test(t)}isCharacterALetterOrDigit(t){return this.isCharacterALetter(t)||this.isCharacterADigit(t)}}const au=new F,Rn=new Yp,lx={name:"QtiValue",props:{baseType:{type:String,required:!1},fieldIdentifier:{type:String,required:!1}},data(){return{singleValue:null,valueBaseType:null,valueCardinality:"single",valueFieldIdentifier:null,variableBaseType:null,variableCardinality:null,isQtiValid:!0}},methods:{getValue(){if(this.isNull())return null;switch(this.valueBaseType){case"integer":case"float":return this.singleValue.toNumber();case"boolean":return this.singleValue;case"string":case"identifier":case"directedPair":case"pair":case"point":return this.singleValue;default:return console.log("[QtiValue][GetValue Exception]","Unhandled BaseType:"+this.valueBaseType),null}},isNull(){return this.singleValue===null},getBaseType(){return this.valueBaseType},getCardinality(){return"single"},getFieldIdentifier(){return this.valueFieldIdentifier},isRecordFieldValue(){return this.valueFieldIdentifier!==null&&this.valueBaseType!==null},readChildren(e){this.valueBaseType!=null&&(this.singleValue=this.parseSingleValue(this.valueBaseType,e.textContent))},parseSingleValue(e,t){let i=null;try{switch(e){case"integer":i=new j(Rn.IntegerValue(t));break;case"float":i=new j(Rn.FloatValue(t));break;case"boolean":i=Rn.BooleanValue(t);break;case"string":i=Rn.StringValue(t);break;case"identifier":i=Rn.IdentifierValue(t);break;case"directedPair":case"pair":case"point":i=Rn.StringValue(t);break;default:throw new se('[QtiValue][Unhandled BaseType]: "'+e+'"')}}catch(s){throw new se(s.message)}return i},_getVariableBaseType(e){return typeof e<"u"?e.baseType:null},_getVariableCardinality(e){return typeof e<"u"?e.cardinality:null},_validateAttributes(e,t){if(t==="record"){if(typeof this.baseType>"u")throw new c('base-type is a required attribute for "record" cardinality');if(au.validateBaseType(this.baseType),this.valueBaseType=this.baseType,typeof this.fieldIdentifier>"u")throw new c('field-identifier is a required attribute for "record" cardinality');au.validateIdentifierAttribute(this.fieldIdentifier),this.valueFieldIdentifier=this.fieldIdentifier}else{if(typeof this.baseType<"u")throw new c("base-type only permitted for record cardinality.");if(typeof this.fieldIdentifier<"u")throw new c("field-identifier only permitted for record cardinality.");this.valueBaseType=e}},getStore(){return this.$parent.$parent.getDeclarationContext()==="TEST"?tt:M}},created:function(){try{let e=au.validateVariableIdentifierAttribute(this.getStore(),this.$parent.$parent.$props.identifier);if(typeof e>"u")throw new c('Variable declaration not found: "'+this.$parent.$parent.$props.identifier+'"');this.variableCardinality=this._getVariableCardinality(e),this.variableBaseType=this._getVariableBaseType(e),this._validateAttributes(this.variableBaseType,this.variableCardinality)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted:function(){let e=this.$el.querySelector(".amp-value__container");if(this.isQtiValid){try{this.readChildren(e)}catch(t){throw this.isQtiValid=!1,t.name==="QtiValidationException"?new c(t.message):t.name==="QtiParseException"?new se(t.message):new Error(t.message)}console.log("["+this.$options.name+"][Value:"+this.getValue()+"][BaseType:"+this.getBaseType()+"][FieldIdentifier:"+this.getFieldIdentifier()+"]")}e.remove()}},cx=["variable-basetype","variable-cardinality"],ux={class:"amp-value__container"};function hx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{class:"qti-value","variable-basetype":n.variableBaseType,"variable-cardinality":n.variableCardinality},[l.createElementVNode("div",ux,[l.renderSlot(e.$slots,"default")])],8,cx)}const dx=D(lx,[["render",hx]]),fx=new F,px={name:"QtiItemBody",emits:["itemBodyReady"],data(){return{mathElementMap:new Map}},methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[s,n]of this.mathElementMap){const r=new RegExp('id="('+s+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(n,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return M.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=fx.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(s){const n=new RegExp("<[mc]i[^>]*>("+s.identifier+")<\\/[mc]i>","g"),r=e.match(n);r&&(i=i.replace(n,r[0].replace(s.identifier,s.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})}},mounted(){this.initializeTemplateMathVariables(),this.$parent.$emit("itemBodyReady",{itemBody:this})}},mx={ref:"root",class:"qti-item-body"};function gx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",mx,[l.renderSlot(e.$slots,"default")],512)}const yx=D(px,[["render",gx]]),wx={name:"ModalDialog",data(){return{visible:!0}},methods:{hide(){this.$refs.mymodal.classList.remove("fade","show"),document.querySelector("body").classList.remove("modal-open")},show(){this.$refs.mymodal.classList.add("fade","show"),document.querySelector("body").classList.add("modal-open")}}},bx={key:0,ref:"mymodal",class:"qti3-player-modal"},vx={class:"qti3-player-modal-dialog qti3-player-modal-md qti3-player-modal-dialog-centered"},Ex={class:"qti3-player-modal-content"},Cx={class:"qti3-player-modal-header"},Tx={class:"qti3-player-modal-body"},Sx={class:"qti3-player-modal-footer"};function xx(e,t,i,s,n,r){return l.openBlock(),l.createBlock(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",bx,[l.createElementVNode("div",vx,[t[2]||(t[2]=l.createElementVNode("span",{tabindex:"0"},null,-1)),l.createElementVNode("div",Ex,[l.createElementVNode("header",Cx,[l.renderSlot(e.$slots,"header",{},void 0,!0),l.createElementVNode("button",{type:"button",class:"qti3-player-close","aria-label":"Close",onClick:t[0]||(t[0]=a=>r.hide())},"×")]),l.createElementVNode("div",Tx,[l.renderSlot(e.$slots,"body",{},void 0,!0)]),l.createElementVNode("footer",Sx,[l.renderSlot(e.$slots,"footer",{},void 0,!0)])]),t[3]||(t[3]=l.createElementVNode("span",{tabindex:"0"},null,-1))]),l.createElementVNode("div",{class:"qti3-player-modal-backdrop",onClick:t[1]||(t[1]=a=>r.hide())})],512)):l.createCommentVNode("",!0)]),_:3})}const Ix=D(wx,[["render",xx],["__scopeId","data-v-2611a8eb"]]),Fr=new F,_x={name:"QtiModalFeedback",components:{ModalDialog:Ix},props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0},title:{type:String,required:!1}},computed:{modalTitle(){return typeof this.title>"u"?void 0:this.title}},data(){return{outcomeDeclaration:null,mathElementMap:new Map,isQtiValid:!0}},inheritAttrs:!0,methods:{initializeTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathElements().forEach(function(i){this.archiveMathElement(i),i.innerHTML=this.applyTemplateValuesToMathml(i.innerHTML,e)},this)},updateTemplateMathVariables(){const e=this.getTemplateMathVariables();if(e.length===0)return;this.getMathScriptElements().forEach(function(i){for(let[s,n]of this.mathElementMap){const r=new RegExp('id="('+s+')"',"g");if(i.innerHTML.match(r)){i.innerHTML=this.applyTemplateValuesToMathml(n,e);break}}},this),this.reprocessMML()},getTemplateMathVariables(){return M.getTemplateMathParameterVariables()},getMathElements(){return this.$el.querySelectorAll("math")},getMathScriptElements(){return this.$el.querySelectorAll('script[type="math/mml"]')},archiveMathElement(e){e.hasAttribute("id")||(e.id=Fr.randomString(5,"a")),this.mathElementMap.set(e.id,e.outerHTML)},applyTemplateValuesToMathml(e,t){let i=e;return t.forEach(function(s){const n=new RegExp("<[mc]i[^>]*>("+s.identifier+")<\\/[mc]i>","g"),r=e.match(n);r&&(i=i.replace(n,r[0].replace(s.identifier,s.value)))}),i},reprocessMML(){this.$nextTick(()=>{window.MathJax&&window.MathJax.Hub.Queue(["Reprocess",window.MathJax.Hub,this.$refs.root])})},display(e){e?this.$refs.modal.show():this.$refs.modal.hide()},evaluate(){if(this.outcomeDeclaration=Fr.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Fr.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Fr.validateIdentifierAttribute(this.identifier),this.show=Fr.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.initializeTemplateMathVariables(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Modal",node:this}),console.log("[ModalFeedback]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},Vx={ref:"root",class:"qti-modal-feedback"};function Ax(e,t,i,s,n,r){const a=l.resolveComponent("ModalDialog");return l.openBlock(),l.createElementBlock("div",Vx,[l.createVNode(a,{ref:"modal"},{header:l.withCtx(()=>[l.createElementVNode("h5",null,l.toDisplayString(r.modalTitle),1)]),body:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),footer:l.withCtx(()=>[l.createElementVNode("button",{class:"qti-modal-feedback-ok",onClick:t[0]||(t[0]=o=>e.$refs.modal.hide())},"OK")]),_:3},512)],512)}const $x=D(_x,[["render",Ax]]),Lx={name:"QtiContentBody",data(){return{isQtiValid:!0}},mounted(){}},Mx={ref:"root",class:"qti-content-body"};function Rx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Mx,[l.renderSlot(e.$slots,"default")],512)}const Nx=D(Lx,[["render",Rx]]),Yo=new F,kx={name:"QtiTemplateInline",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=Yo.validateTemplateIdentifierAttribute(M,this.templateIdentifier),console.log("[QtiTemplateInline]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.hideTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=Yo.validateTemplateIdentifierAttribute(M,this.templateIdentifier);if(e.baseType!=="identifier")throw new c('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Yo.validateIdentifierAttribute(this.identifier),this.show=Yo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},qx={ref:"root",class:"qti-template-inline hidden"};function Ox(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",qx,[l.renderSlot(e.$slots,"default")],512)}const Px=D(kx,[["render",Ox]]),Xo=new F,Bx={name:"QtiTemplateBlock",props:{identifier:{type:String,required:!0},templateIdentifier:{type:String,required:!0},showHide:{type:String,required:!1,default:"show"}},data(){return{value:null,templateDeclaration:null,show:!0,isQtiValid:!0}},methods:{evaluate(){try{if(this.hideTemplate(),this.templateDeclaration=Xo.validateTemplateIdentifierAttribute(M,this.templateIdentifier),console.log("[QtiTemplateBlock]["+this.templateIdentifier+"][Show]",this.show),this.templateDeclaration.cardinality==="single"){if(this.templateDeclaration.value===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}if(this.templateDeclaration.cardinality==="multiple"){for(let e=0;e<this.templateDeclaration.value.length;e++)if(this.templateDeclaration.value[e]===this.identifier){this.show?this.showTemplate():this.hideTemplate();return}this.show||this.showTemplate();return}}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}},hideTemplate(){this.$refs.root.classList.add("hidden")},showTemplate(){this.$refs.root.classList.remove("hidden")}},created(){try{let e=Xo.validateTemplateIdentifierAttribute(M,this.templateIdentifier);if(e.baseType!=="identifier")throw new c('Invalid template variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid template variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Xo.validateIdentifierAttribute(this.identifier),this.show=Xo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.defineTemplate({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},Dx={ref:"root",class:"qti-template-block hidden"};function Qx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Dx,[l.renderSlot(e.$slots,"default")],512)}const Hx=D(Bx,[["render",Qx]]),Zo=new F,Ux={name:"QtiFeedbackInline",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=Zo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Zo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Zo.validateIdentifierAttribute(this.identifier),this.show=Zo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Inline",show:this.show,node:this}),console.log("[FeedbackInline]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},Fx={ref:"root",class:"qti-feedback-inline hidden"};function Gx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",Fx,[l.renderSlot(e.$slots,"default")],512)}const jx=D(Ux,[["render",Gx]]),Jo=new F,Wx={name:"QtiFeedbackBlock",props:{identifier:{type:String,required:!0},outcomeIdentifier:{type:String,required:!0},showHide:{type:String,required:!0}},data(){return{show:null,outcomeDeclaration:null,isQtiValid:!0}},methods:{defaultShowHide(){this.show?this.$refs.root.classList.add("hidden"):this.$refs.root.classList.remove("hidden")},display(e){e?this.$refs.root.classList.remove("hidden"):this.$refs.root.classList.add("hidden")},isOutcomeValueNull(e){return e===null},evaluate(){if(this.defaultShowHide(),this.outcomeDeclaration=Jo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier),console.log("[FeedbackBlock]["+this.identifier+"][evaluate]",this.outcomeIdentifier,this.outcomeDeclaration.value),this.outcomeDeclaration.cardinality==="single"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;if(this.outcomeDeclaration.value===this.identifier){this.display(this.show);return}this.show||this.display(!0);return}if(this.outcomeDeclaration.cardinality==="multiple"){if(this.isOutcomeValueNull(this.outcomeDeclaration.value))return;for(let e=0;e<this.outcomeDeclaration.value.length;e++)if(this.outcomeDeclaration.value[e]===this.identifier){this.display(this.show);return}this.show||this.display(!0)}}},created(){try{let e=Jo.validateOutcomeIdentifierAttribute(M,this.outcomeIdentifier);if(e.baseType!=="identifier")throw new c('Invalid outcome variable base-type: "'+e.baseType+'". Must be "identifier".');if(e.cardinality!=="single"&&e.cardinality!=="multiple")throw new c('Invalid outcome variable cardinality: "'+e.cardinality+'". Must be "single" or "multiple".');Jo.validateIdentifierAttribute(this.identifier),this.show=Jo.validateShowHideAttribute(this.showHide)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.defaultShowHide(),M.defineFeedback({outcomeIdentifier:this.outcomeIdentifier,identifier:this.identifier,feedbackType:"Block",show:this.show,node:this}),console.log("[FeedbackBlock]",this)}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},zx={ref:"root",class:"qti-feedback-block hidden"};function Kx(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",zx,[l.renderSlot(e.$slots,"default")],512)}const Yx=D(Wx,[["render",Kx]]),Xx=new F,Zx=new ie,Jx={name:"QtiRubricBlock",props:{view:{type:String,required:!0},use:{type:String,required:!1}},data(){return{rubricBlockContext:null,isQtiValid:!0}},computed:{isScoringRubricBlock(){const e=this.view.split(" ");for(let t=0;t<e.length;t++)if(e[t]==="scorer")return!0;return!1}},methods:{getView(){return this.view},getUse(){return this.use},getInnerHtml(){return this.$refs.root.innerHTML},getStore(){return this.rubricBlockContext==="TEST"?tt:M},validateChildren(){},evaluate(){if(!this.isScoringRubricBlock){this.$refs.root.classList.remove("hidden");return}this.$refs.root.innerHTML=""}},created(){try{this.rubricBlockContext=Zx.computeNodeContext(this),Xx.validateRubricBlockViewAttribute(this.view),this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.isScoringRubricBlock&&this.getStore().defineScoringRubricBlock({view:this.view,html:this.$refs.root.innerHTML,node:this}),this.evaluate(),console.log("["+this.$options.name+"]["+this.rubricBlockContext+"][View: "+this.view+"]")}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},e1={ref:"root",class:"qti-rubric-block hidden"};function t1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",e1,[l.renderSlot(e.$slots,"default")],512)}const i1=D(Jx,[["render",t1]]);var bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ou={},Gr={},lu={},jr={},Zp;function s1(){if(Zp)return jr;Zp=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.boolean=void 0;const e=function(t){switch(Object.prototype.toString.call(t)){case"[object String]":return["true","t","yes","y","on","1"].includes(t.trim().toLowerCase());case"[object Number]":return t.valueOf()===1;case"[object Boolean]":return t.valueOf();default:return!1}};return jr.boolean=e,jr}var Wr={},Jp;function n1(){if(Jp)return Wr;Jp=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.isBooleanable=void 0;const e=function(t){switch(Object.prototype.toString.call(t)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(t.trim().toLowerCase());case"[object Number]":return[0,1].includes(t.valueOf());case"[object Boolean]":return!0;default:return!1}};return Wr.isBooleanable=e,Wr}var em;function r1(){return em||(em=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=s1();Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const i=n1();Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return i.isBooleanable}})}(lu)),lu}var zr={},tm;function a1(){if(tm)return zr;tm=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.tokenize=void 0;const e=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,t=i=>{let s;const n=[];let r=0,a=0,o=null;for(;(s=e.exec(i))!==null;){s.index>a&&(o={literal:i.slice(a,s.index),type:"literal"},n.push(o));const u=s[0];a=s.index+u.length,u==="\\%"||u==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):s.groups&&(o={conversion:s.groups.conversion,flag:s.groups.flag||null,placeholder:u,position:s.groups.position?Number.parseInt(s.groups.position,10)-1:r++,precision:s.groups.precision?Number.parseInt(s.groups.precision.slice(1),10):null,type:"placeholder",width:s.groups.width?Number.parseInt(s.groups.width,10):null},n.push(o))}return a<=i.length-1&&(o&&o.type==="literal"?o.literal+=i.slice(a):n.push({literal:i.slice(a),type:"literal"})),n};return zr.tokenize=t,zr}var im;function o1(){if(im)return Gr;im=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.createPrintf=void 0;const e=r1(),t=a1(),i=(n,r)=>r.placeholder,s=n=>{var r;const a=(d,f,y)=>y==="-"?d.padEnd(f," "):y==="-+"?((Number(d)>=0?"+":"")+d).padEnd(f," "):y==="+"?((Number(d)>=0?"+":"")+d).padStart(f," "):y==="0"?d.padStart(f,"0"):d.padStart(f," "),o=(r=n==null?void 0:n.formatUnboundExpression)!==null&&r!==void 0?r:i,u={};return(d,...f)=>{let y=u[d];y||(y=u[d]=t.tokenize(d));let m="";for(const b of y)if(b.type==="literal")m+=b.literal;else{let E=f[b.position];if(E===void 0)m+=o(d,b,f);else if(b.conversion==="b")m+=e.boolean(E)?"true":"false";else if(b.conversion==="B")m+=e.boolean(E)?"TRUE":"FALSE";else if(b.conversion==="c")m+=E;else if(b.conversion==="C")m+=String(E).toUpperCase();else if(b.conversion==="i"||b.conversion==="d")E=String(Math.trunc(E)),b.width!==null&&(E=a(E,b.width,b.flag)),m+=E;else if(b.conversion==="e")m+=Number(E).toExponential();else if(b.conversion==="E")m+=Number(E).toExponential().toUpperCase();else if(b.conversion==="f")b.precision!==null&&(E=Number(E).toFixed(b.precision)),b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else if(b.conversion==="o")m+=(Number.parseInt(String(E),10)>>>0).toString(8);else if(b.conversion==="s")b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else if(b.conversion==="S")b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=String(E).toUpperCase();else if(b.conversion==="u")m+=Number.parseInt(String(E),10)>>>0;else if(b.conversion==="x")E=(Number.parseInt(String(E),10)>>>0).toString(16),b.width!==null&&(E=a(String(E),b.width,b.flag)),m+=E;else throw new Error("Unknown format specifier.")}return m}};return Gr.createPrintf=s,Gr}var sm;function l1(){return sm||(sm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=o1();Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()}(ou)),ou}var c1=l1();const nm=new F,u1={name:"QtiPrintedVariable",props:{id:{type:String,required:!1},language:{type:String,required:!1},label:{type:String,required:!1},baseuri:{type:String,required:!1},identifier:{type:String,required:!0},format:{type:String,required:!1},base:{type:String,required:!1},index:{type:String,required:!1},powerForm:{type:String,required:!1},field:{type:String,required:!1},delimiter:{type:String,required:!1},mappingIndicator:{type:String,required:!1}},data(){return{value:this.identifier,declaration:null,isQtiValid:!0}},methods:{printedValue(e){return typeof this.format>"u"?e:c1.printf(this.format,e)},evaluate(){try{this.declaration=nm.validatePrintedVariableIdentifierAttribute(M,this.identifier),this.value=this.printedValue(this.declaration.value),console.log("[QtiPrintedVariable]["+this.identifier+"][Value]",this.value)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{nm.validatePrintedVariableIdentifierAttribute(M,this.identifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{M.definePrintedVariable({node:this}),this.evaluate()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}};function h1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",{ref:"root",class:"qti-printed-variable"},l.toDisplayString(n.value),513)}const d1=D(u1,[["render",h1]]);class f1{constructor(){this.constants={LABELS_UPPER_ALPHA:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],LABELS_LOWER_ALPHA:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],LABELS_DECIMAL:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"],LABELS_CJK_IDEOGRAPHIC:["一","二","三","四","五","六","七","八","九","十"],LABELS_SUFFIX_PERIOD:".",LABELS_SUFFIX_PARENTHESIS:")",LABELS_SUFFIX_NONE:"",LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"、",QTI_LABELS_NONE:"qti-labels-none",QTI_LABELS_DECIMAL:"qti-labels-decimal",QTI_LABELS_LOWER_ALPHA:"qti-labels-lower-alpha",QTI_LABELS_UPPER_ALPHA:"qti-labels-upper-alpha",QTI_LABELS_CJK_IDEOGRAPHIC:"qti-labels-cjk-ideographic",QTI_LABELS_SUFFIX_NONE:"qti-labels-suffix-none",QTI_LABELS_SUFFIX_PERIOD:"qti-labels-suffix-period",QTI_LABELS_SUFFIX_PARENTHESIS:"qti-labels-suffix-parenthesis",QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:"qti-labels-cjk-ideographic-comma",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_INPUT_CONTROL_HIDDEN:"qti-input-control-hidden",SBAC_PRESENTATION:"sbac",LRN_PRESENTATION:"lrn",QTI_CHOICES_STACKING_1:"qti-choices-stacking-1",QTI_CHOICES_STACKING_2:"qti-choices-stacking-2",QTI_CHOICES_STACKING_3:"qti-choices-stacking-3",QTI_CHOICES_STACKING_4:"qti-choices-stacking-4",QTI_CHOICES_STACKING_5:"qti-choices-stacking-5",DATA_MAX_SELECTIONS_MESSAGE:"data-max-selections-message",DATA_MIN_SELECTIONS_MESSAGE:"data-min-selections-message"},this.parentClassList=null,this.choiceGroupNode=null,this.choices=null,this.presentation_HideLabels=!1,this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA,this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD,this.presentation_Sbac=!1,this.presentation_Lrn=!1,this.presentation_IsInputControlHidden=!1,this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!1,this.presentation_MaxSelectionsMessage="",this.presentation_MinSelectionsMessage="",this.presentation_Label_Style="",this.presentation_Stacking_Class=""}initialize(t){this.choiceGroupNode=t,this.parentClassList=t.choiceInteractionClassAttribute,this.choices=t.choices,this.processRootClassAttribute(this.parentClassList),this.processStackingClass(),this.processLabelsAndInputControls()}processRootClassAttribute(t){const i=t.values();for(let s of i)switch(s){case this.constants.QTI_ORIENTATION_VERTICAL:this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_IsOrientationVertical=!1,this.presentation_IsOrientationHorizontal=!0;break;case this.constants.QTI_CHOICES_STACKING_1:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_1;break;case this.constants.QTI_CHOICES_STACKING_2:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2;break;case this.constants.QTI_CHOICES_STACKING_3:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3;break;case this.constants.QTI_CHOICES_STACKING_4:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4;break;case this.constants.QTI_CHOICES_STACKING_5:this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5;break;case this.constants.QTI_LABELS_NONE:this.presentation_HideLabels=!0;break;case this.constants.QTI_LABELS_UPPER_ALPHA:this.presentation_Labels=this.constants.LABELS_UPPER_ALPHA;break;case this.constants.QTI_LABELS_LOWER_ALPHA:this.presentation_Labels=this.constants.LABELS_LOWER_ALPHA;break;case this.constants.QTI_LABELS_DECIMAL:this.presentation_Labels=this.constants.LABELS_DECIMAL;break;case this.constants.QTI_LABELS_CJK_IDEOGRAPHIC:this.presentation_Labels=this.constants.LABELS_CJK_IDEOGRAPHIC;break;case this.constants.QTI_LABELS_SUFFIX_NONE:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_NONE;break;case this.constants.QTI_LABELS_SUFFIX_PERIOD:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PERIOD;break;case this.constants.QTI_LABELS_SUFFIX_PARENTHESIS:this.presentation_LabelsSuffix=this.constants.LABELS_SUFFIX_PARENTHESIS;break;case this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA:this.presentation_LabelsSuffix=this.constants.QTI_LABELS_SUFFIX_CJK_IDEOGRAPHIC_COMMA;break;case this.constants.QTI_INPUT_CONTROL_HIDDEN:this.presentation_IsInputControlHidden=!0;break;case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.LRN_PRESENTATION:this.presentation_Lrn=!0;break}}processStackingClass(){if(this.presentation_Stacking_Class!==""&&!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal)this.choices.length>1?this.presentation_IsOrientationHorizontal=!0:this.presentation_IsOrientationVertical=!0;else if(this.presentation_Stacking_Class===""&&this.presentation_IsOrientationHorizontal){const t=this.choices.length;t>=5?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_5:t==4?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_4:t==3?this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_3:t==2&&(this.presentation_Stacking_Class=this.constants.QTI_CHOICES_STACKING_2),t==1&&(this.presentation_IsOrientationVertical=!0,this.presentation_IsOrientationHorizontal=!1)}!this.presentation_IsOrientationVertical&&!this.presentation_IsOrientationHorizontal&&(this.presentation_IsOrientationVertical=!0),this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_IsOrientationVertical?this.constants.QTI_ORIENTATION_VERTICAL:this.constants.QTI_ORIENTATION_HORIZONTAL),this.presentation_Stacking_Class!==""&&this.choiceGroupNode.$refs.choicegroup.classList.add(this.presentation_Stacking_Class)}processLabelsAndInputControls(){for(let t=0;t<this.choices.length;t++)this.presentation_HideLabels?this.choices[t].hideLabel():this.presentation_Sbac?this.choices[t].setLabelSbac(this.presentation_Labels[t]):this.choices[t].setLabel(this.presentation_Labels[t]+this.presentation_LabelsSuffix),this.presentation_Lrn&&this.choices[t].setChoiceLrn(),this.presentation_IsInputControlHidden&&this.choices[t].hideControl()}}const p1=new F,m1=new ie,g1={props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},maxChoices:{required:!1,type:String,default:"1"}},data(){return{choices:[],firstChoice:null,lastChoice:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,choiceInteractionClassAttribute:null,presentationFactory:null,isQtiValid:!0,priorState:null}},methods:{getPriorState(){return this.priorState},setPriorState(e){this.priorState=e},validateChildren(){let e=!1;this.$slots.default&&this.$slots.default()[0].children.forEach(t=>{if(p1.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e)throw new c("Invalid element order. qti-prompt must come before qti-simple-choices");if(!this.hasPrompt)return this.hasPrompt=!0;throw new c("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e=!0;if(t.type.name!=="QtiSimpleChoice")throw new c('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children.forEach(t=>{t.component!==null&&t.type.name==="QtiSimpleChoice"&&this.choices.push(t.component.proxy)},this)},processGroupUI(){this.isShuffle&&this.processShuffle(),this.presentationFactory.initialize(this),this.setActiveDescendant(""),this.isRadio&&this.processFirstAndLastChoices()},resetGroupUI(){this.setPriorState(null),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})},processShuffle(){let e=this.createShuffleContainer(this.choices,this.getPriorState()),t=null;if(this.hasPrompt){const i=this.$refs.choicegroup.querySelector(".qti-prompt");i!==null&&(t=i.cloneNode(!0))}this.choices.splice(0,this.choices.length),this.$refs.choicegroup.innerHTML="",t!==null&&this.$refs.choicegroup.appendChild(t),e.forEach(i=>{this.$refs.choicegroup.appendChild(i.node.$el),this.choices.push(i.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),m1.shuffleArrayFixed(i),i):(t.state.order.forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Choice Interaction State Invalid. Choice identifier "'+e+'" not found.')},processFirstAndLastChoices(){this.choices.length!==0&&(this.firstChoice=this.choices[0],this.lastChoice=this.choices[this.choices.length-1])},setActiveDescendant(e){this.$refs.choicegroup.setAttribute("aria-activedescendant",e)},initializeChoiceGroup(){switch(this.cardinality){case"single":this.role="radiogroup",this.isRadio=!0;break;case"multiple":this.role="group",this.isRadio=!1;break;default:this.role="radiogroup",this.isRadio=!0;break}this.isShuffle=this.shuffle==="true",this.presentationFactory=new f1}},created(){try{if(typeof this.cardinality>"u")throw new c("Undefined qti-choice-interaction cardinality");this.initializeChoiceGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiChoiceInteraction][ValidationError]",e.name,e.message),new c(e.message)}},mounted(){if(this.isQtiValid)try{this.choiceInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.setPriorState(this.$parent.priorState),this.processGroupUI(),this.$emit("choiceGroupReady",{choices:this.choices,firstChoice:this.firstChoice,lastChoice:this.lastChoice})}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiChoiceInteraction][ValidationException]",e.message),new c(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiChoiceInteraction][EvaluationException]",e.message),new B(e.message)}}},y1=["role"];function w1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("ul",{ref:"choicegroup",role:n.role,class:"qti-choice-list"},[l.renderSlot(e.$slots,"default")],8,y1)}const rm=D(g1,[["render",w1]]),am=new F,b1={name:"QtiChoiceInteraction",components:[rm],props:{responseIdentifier:{required:!0,type:String},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String},dataMaxSelectionsMessage:{required:!1,type:String},dataMinSelectionsMessage:{required:!1,type:String}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",maxSelectionsMessage:"",responseDeclaration:null,choices:[],firstChoice:null,lastChoice:null,currentChoice:null,isRadio:!0,isShuffle:!1,hasPrompts:!1,isDisabled:!1,isQtiValid:!0,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},disable(){this.toggleDisableChoices(!0)},enable(){this.toggleDisableChoices(!1)},toggleDisableChoices(e){this.isDisabled=e,this.choices.forEach(t=>{t.setIsDisabled(e)})},getInvalidResponseMessage(){return this.minSelectionsMessage},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.choices.forEach(e=>{e.setChecked(!1),this.isRadio&&e.setTabIndex("-1")}),this.currentChoice=null,this.priorState=null,this.$refs.choicegroup.resetGroupUI()},restoreValue(e){e!==null&&(this.isRadio?this.handleSetChecked({identifier:e,checked:"true"},!0):e.forEach(t=>{this.handleSetChecked({identifier:t,checked:"true"},!0)},this),this.updateValidity(this.computeIsValid()))},getCardinality(){let e=M.getResponseDeclaration(this.responseIdentifier);return this.cardinality=typeof e<"u"?e.cardinality!=="multiple"?"single":"multiple":"single",this.cardinality},getPrompts(e){let t=[];return e.default&&e.default().forEach(i=>{typeof i.type<"u"&&i.type.name==="QtiPrompt"&&t.push(i)}),t},movePrompt(){if(!this.hasPrompts)return;const e=this.$refs.root.querySelector(".qti-prompt");e!==null&&this.$refs.prompt.appendChild(e)},handleSetChecked(e,t=!1){this.choices.forEach(i=>{this.isRadio&&(i.setChecked(!1),i.setTabIndex("-1")),i.identifier===e.identifier&&(this.currentChoice=i)}),e.checked==="true"?this.checkMaxChoicesLimit()?this.currentChoice.setChecked(!1):this.currentChoice.setChecked(!0):this.currentChoice.setChecked(!1),t||(this.setResponse(this.computeResponse()),this.currentChoice.setFocus(),this.evaluateValidity()),this.currentChoice.setTabIndex("0")},handleSetFocusPreviousChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findPreviousIdentifier(e))},handleSetFocusNextChoice(e){this.isRadio&&this.removeChoiceFromTabOrder(e),this.setFocusChoice(this.findNextIdentifier(e))},handleSetActiveDescendant(e){this.$refs.choicegroup.setActiveDescendant(e)},setFocusChoice(e){for(let t=0;t<this.choices.length;t++)this.choices[t].identifier===e&&(this.currentChoice=this.choices[t]);this.currentChoice.setTabIndex("0"),this.currentChoice.setFocus()},removeChoiceFromTabOrder(e){for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e){this.choices[t].setTabIndex(-1);break}},findPreviousIdentifier(e){if(e===this.firstChoice.identifier)return this.lastChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t-1].identifier;return null},findNextIdentifier(e){if(e===this.lastChoice.identifier)return this.firstChoice.identifier;for(let t=0;t<this.choices.length;t++)if(this.choices[t].identifier===e)return this.choices[t+1].identifier;return null},handleChoiceGroupReady(e){this.choices=e.choices,this.firstChoice=e.firstChoice,this.lastChoice=e.lastChoice,this.isRadio&&this.firstChoice.setTabIndex("0"),this.priorState!==null&&this.restoreValue(this.priorState.value),this.setResponse(this.computeResponse()),this.setState(this.computeState()),this.setIsValid(this.computeIsValid())},computeResponse(){let e=this.isRadio?null:[];return this.choices.forEach(t=>{t.isChecked()&&(this.isRadio?e=t.identifier:e.push(t.identifier))}),this.isRadio?e:e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return this.minChoices*1===0?!0:this.response===null?!1:this.cardinality==="single"||this.cardinality==="multiple"&&this.response.length>=this.minChoices*1},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),M.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},checkMaxChoicesLimit(){if(this.isRadio||this.maxChoices==0)return!1;const e=this.getResponse();return e!==null&&e.length==this.maxChoices?(M.NotifyInteractionSelectionsLimit(this.maxSelectionsMessage),!0):!1},computeMaxSelectionsMessage(){if(typeof this.dataMaxSelectionsMessage<"u"){this.maxSelectionsMessage=this.dataMaxSelectionsMessage;return}this.maxSelectionsMessage=this.maxChoices==0?"":"You are permitted a maximum of "+this.maxChoices+" choice"+(this.maxChoices>1?"s":"")+" for this question.<br/><br/>Please unselect one of your choices before making another choice."},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}this.minSelectionsMessage=this.minChoices==0?"":"You must make at least "+this.minChoices+" choice"+(this.minChoices>1?"s":"")+" for this question."},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new B('Choice Interaction State Invalid. "order" property not found.');return t},showSolution(e){if(e!==null){if(this.isRadio){this.choices.forEach(t=>{this.setChoiceSolution(t,e)},this);return}this.choices.forEach(t=>{const i=this.findIdentifierInCorrectResponse(t.identifier,e);this.setChoiceSolution(t,i)},this)}},setChoiceSolution(e,t){e.isChecked()?e.identifier===t?e.setCorrectSolution():e.setIncorrectSolution():e.identifier===t?e.setExpectedSolution():e.setIgnoreSolution()},findIdentifierInCorrectResponse(e,t){for(let i=0;i<t.length;i++)if(e===t[i])return e;return null}},created(){try{this.responseDeclaration=am.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.priorState=this.getPriorState(this.responseIdentifier),am.validateMaxMinChoices(this.maxChoices,this.minChoices),this.cardinality=this.getCardinality(),this.isRadio=this.cardinality!=="multiple",this.isShuffle=this.shuffle==="true",this.hasPrompts=this.getPrompts(this.$slots).length>0,this.computeMinSelectionsMessage(),this.computeMaxSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.movePrompt(),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"Choice",node:this,resetValue:this.resetValue,isValidResponse:this.getIsValid(),invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:this.maxSelectionsMessage}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},v1={ref:"root",class:"qti-choice-interaction"},E1={ref:"prompt",class:"qti-prompt-wrapper"};function C1(e,t,i,s,n,r){const a=l.resolveComponent("ChoiceGroup");return l.openBlock(),l.createElementBlock("div",v1,[l.createElementVNode("div",E1,null,512),l.createVNode(a,l.mergeProps({ref:"choicegroup",cardinality:n.cardinality,shuffle:i.shuffle,responseIdentifier:i.responseIdentifier,maxChoices:i.maxChoices,minChoices:i.minChoices,onChoiceGroupReady:r.handleChoiceGroupReady,onSetChecked:r.handleSetChecked,onSetFocusNextChoice:r.handleSetFocusNextChoice,onSetFocusPreviousChoice:r.handleSetFocusPreviousChoice,onSetActiveDescendant:r.handleSetActiveDescendant},e.$attrs),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["cardinality","shuffle","responseIdentifier","maxChoices","minChoices","onChoiceGroupReady","onSetChecked","onSetFocusNextChoice","onSetFocusPreviousChoice","onSetActiveDescendant"])],512)}const T1=D(b1,[["render",C1]]);class S1{constructor(t){return this.constants={QTI_ORIENTATION_HORIZONTAL:"qti-orientation-horizontal",QTI_ORIENTATION_VERTICAL:"qti-orientation-vertical",QTI_WRITING_ORIENTATION_VERTICAL_RL:"qti-writing-orientation-vertical-rl"},this.classList=t,this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.QTI_ORIENTATION_VERTICAL:case this.constants.QTI_WRITING_ORIENTATION_VERTICAL_RL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_VERTICAL;break;case this.constants.QTI_ORIENTATION_HORIZONTAL:this.presentation_OrientationClass=this.constants.QTI_ORIENTATION_HORIZONTAL;break}}getOrientationClass(){return this.presentation_OrientationClass}isOrientationVertical(){return this.presentation_OrientationClass==this.constants.QTI_ORIENTATION_VERTICAL}setVerticalOrientation(t){this.isOrientationVertical()&&t.classList.add(this.constants.QTI_ORIENTATION_VERTICAL)}}const cu=new F,x1=new ie,I1={name:"QtiInlineChoiceInteraction",props:{responseIdentifier:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},required:{required:!1,type:String,default:"false"},dataPrompt:{required:!1,type:String,default:"Choose..."},minChoices:{required:!1,type:String,default:"0"},maxChoices:{required:!1,type:String,default:"1"},dataMinSelectionsMessage:{required:!1,type:String}},computed:{labelId(){return"inlinechoice_label_"+this.responseIdentifier},buttonId(){return"inlinechoice_button_"+this.responseIdentifier},buttonAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier+" inlinechoice_button_"+this.responseIdentifier},listboxId(){return"inlinechoice_listbox_"+this.responseIdentifier},listboxAriaLabelledbyId(){return"inlinechoice_label_"+this.responseIdentifier}},data(){return{response:null,state:null,isValidResponse:!1,cardinality:"single",minSelectionsMessage:"",choices:[],allOptionElements:null,activeDescendant:null,keysSoFar:"",searchIndex:null,isShuffle:null,isRequired:!1,isDisabled:!1,isQtiValid:!0,presentationFactory:null,isOrientationVertical:!1,priorState:null}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.minSelectionsMessage},disable(){this.toggleDisable(!0)},enable(){this.toggleDisable(!1)},toggleDisable(e){this.isDisabled=e,e?(this.getResponse()===null&&(this.$refs.label.innerHTML=""),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.button.classList.add("qti-hidden"),this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.button.classList.remove("qti-hidden"))},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.$refs.listbox.querySelectorAll('[role="option"]').forEach(t=>{this.defocusOption(t)},this),this.processGroupUI()},restoreValue(e){if(e===null)return;const t=this.findChoiceByIdentifier(e,this.choices);this.focusOption(t.$el,!0),this.setResponse(this.computeResponse(e)),this.updateValidity(this.computeIsValid())},getCardinality(){let e=M.getResponseDeclaration(this.responseIdentifier);if(typeof e>"u"&&(this.cardinality="single"),e.cardinality!=="single")throw new c('Invalid qti-inline-choice-interaction Response Variable cardinality: "'+this.cardinality+'"');return this.cardinality="single",this.cardinality},computeResponse(e){return e===null||e.length===0?null:e},computeState(){const e={};let t=[];return this.choices.forEach(i=>{t.push(i.identifier)}),e.order=t,e},computeIsValid(){return!this.isRequired&&this.minChoices*1===0?!0:this.response!==null},evaluateValidity(){const e=this.getIsValid(),t=this.computeIsValid();e!==t&&this.updateValidity(t)},updateValidity(e){this.setIsValid(e),M.setInteractionIsValidResponse({identifier:this.responseIdentifier,isValidResponse:e})},computeMinSelectionsMessage(){if(typeof this.dataMinSelectionsMessage<"u"){this.minSelectionsMessage=this.dataMinSelectionsMessage;return}!this.isRequired&&this.minChoices*1===0||(this.minSelectionsMessage="You must make at least 1 choice for this question.")},handleButtonClick(){this.isDisabled||this.showListbox()},handleButtonKeyup(e){switch(e.code){case"ArrowUp":case"ArrowDown":if(e.preventDefault(),this.isDisabled)return;this.showListbox();break}},handleChoiceMousedown(e){e.preventDefault();let t=e.target;t.getAttribute("role")==="option"&&(this.focusOption(t),this.hideListbox(),this.$refs.button.focus())},handleBlur(){this.hideListbox()},handleFocusChange(e){this.$refs.prompt.innerHTML=e.innerHTML,this.$refs.label.innerHTML=e.innerHTML},showListbox(){this.$refs.listbox.classList.remove("inline-choice-select-listbox-hidden"),this.$refs.button.setAttribute("aria-expanded","true"),this.$refs.listbox.focus()},hideListbox(){this.$refs.listbox.classList.add("inline-choice-select-listbox-hidden"),this.$refs.button.removeAttribute("aria-expanded")},setupFocus(){this.activeDescendant||this.focusFirstOption()},focusFirstOption(){let e=this.$refs.listbox.querySelector('[role="option"]');e&&this.focusOption(e)},focusLastOption(){let e=this.$refs.listbox.querySelectorAll('[role="option"]');e.length&&this.focusOption(e[e.length-1])},focusOption(e,t=!1){if(t||this.defocusOption(document.getElementById(this.activeDescendant)),e.setAttribute("aria-selected","true"),e.classList.add("focused"),this.setActiveDescendant(e.id),!t&&(this.setResponse(this.computeResponse(e.getAttribute("data-identifier"))),this.evaluateValidity(),this.$refs.listbox.scrollHeight>this.$refs.listbox.clientHeight)){const i=this.$refs.listbox.clientHeight+this.$refs.listbox.scrollTop,s=e.offsetTop+e.offsetHeight;s>i?this.$refs.listbox.scrollTop=s-this.$refs.listbox.clientHeight:e.offsetTop<this.$refs.listbox.scrollTop&&(this.$refs.listbox.scrollTop=e.offsetTop)}this.handleFocusChange(e)},defocusOption(e){e&&(e.removeAttribute("aria-selected"),e.classList.remove("focused"))},checkKeyPress(e){if(e.code=="Enter"||e.code=="Escape"){e.preventDefault(),this.hideListbox(),this.$refs.button.focus();return}let t=document.getElementById(this.activeDescendant);if(t)switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault(),e.code=="ArrowUp"?t=t.previousElementSibling:t=t.nextElementSibling,t&&this.focusOption(t);break;case"Home":e.preventDefault(),this.focusFirstOption();break;case"End":e.preventDefault(),this.focusLastOption();break}},findOptionToFocus(e){let t=this.$refs.listbox.querySelectorAll('[role="option"]');if(!this.keysSoFar)for(let s=0;s<t.length;s++)t[s].getAttribute("id")==this.activeDescendant&&(this.searchIndex=s);this.keysSoFar+=e,this.clearKeysSoFarAfterDelay();let i=this.findMatchInRange(t,this.searchIndex+1,t.length);return i||(i=this.findMatchInRange(t,0,this.searchIndex)),i},clearKeysSoFarAfterDelay(){this.keyClear&&(clearTimeout(this.keyClear),this.keyClear=null);let e=this;this.keyClear=setTimeout((function(){e.keysSoFar="",e.keyClear=null}).bind(this),500)},findMatchInRange(e,t,i){for(let s=t;s<i;s++){let n=e[s].innerText;if(n&&n.toUpperCase().indexOf(this.keysSoFar)===0)return e[s]}return null},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(cu.isValidSlot(e)){if(e.type.name==="QtiInlineChoice")return;throw new c('Node is not a qti-inline-choice: "'+e.type.name+'"')}})},processChildren(){const e=this.$.subTree.children[0].children[2].children[0];this.choices.push(e.component.proxy),this.$.subTree.children[0].children[2].children[1].children.forEach(i=>{i.component!==null&&this.choices.push(i.component.proxy)})},processGroupUI(){this.isOrientationVertical&&this.presentationFactory.setVerticalOrientation(this.$refs.root),this.isShuffle&&this.processShuffle(),this.setResponse(null),this.setState(this.computeState()),this.setIsValid(this.computeIsValid()),this.setActiveDescendant("")},processShuffle(){let e=this.createShuffleContainer(this.choices,this.priorState);this.choices.splice(0,this.choices.length),this.$refs.listbox.innerHTML="",e.forEach(t=>{this.$refs.listbox.appendChild(t.node.$el),this.choices.push(t.node)},this)},createShuffleContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),x1.shuffleArrayFixed(i),i):(t.state.order.forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Inline Choice Interaction State Invalid. Inline Choice identifier "'+e+'" not found.')},setActiveDescendant(e){this.activeDescendant=e,this.$refs.listbox.setAttribute("aria-activedescendant",e)},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('Choice Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('Choice Interaction State Invalid. "state" property not found.');if(!("order"in t.state))throw new B('Choice Interaction State Invalid. "order" property not found.');return t},addChoiceMousedownListeners(){this.allOptionElements=this.$refs.listbox.querySelectorAll('[role="option"]'),this.allOptionElements.forEach(e=>{e.addEventListener("mousedown",this.handleChoiceMousedown)})},removeChoiceMousedownListeners(){this.allOptionsElements!==null&&this.allOptionElements.forEach(e=>{e.removeEventListener("mousedown",this.handleChoiceMousedown)})}},created(){try{if(this.responseDeclaration=cu.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.presentationFactory=new S1(this.$.vnode.props.class),this.isOrientationVertical=this.presentationFactory.isOrientationVertical(),this.validateChildren(),this.priorState=this.getPriorState(this.responseIdentifier),cu.validateMaxMinChoices(this.maxChoices,this.minChoices),this.minChoices>1)throw new c('Invalid qti-inline-choice-interaction min-choices attribute: "'+this.minChoices+'"');this.cardinality=this.getCardinality(),this.isShuffle=this.shuffle==="true",this.isRequired=this.required==="true",this.computeMinSelectionsMessage()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),this.processGroupUI(),this.priorState!==null&&this.restoreValue(this.priorState.value),this.addChoiceMousedownListeners(),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"InlineChoice",node:this,resetValue:this.resetValue,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage(),maxSelectionsMessage:null}),console.log("["+this.$options.name+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}},beforeUnmount(){this.removeChoiceMousedownListeners()}},_1={ref:"root",class:"qti-inline-choice-interaction"},V1={class:"inline-choice-wrapper"},A1=["aria-labelledby","id"],$1=["aria-labelledby"];function L1(e,t,i,s,n,r){const a=l.resolveComponent("qti-inline-choice");return l.openBlock(),l.createElementBlock("div",_1,[l.createElementVNode("div",V1,[l.createElementVNode("div",{ref:"label",class:"inline-choice-select-label qti-hidden"},l.toDisplayString(i.dataPrompt),513),l.createElementVNode("button",{ref:"button","aria-haspopup":"listbox","aria-labelledby":r.buttonAriaLabelledbyId,id:r.buttonId,class:"inline-choice-select",onClick:t[0]||(t[0]=(...o)=>r.handleButtonClick&&r.handleButtonClick(...o)),onKeyup:t[1]||(t[1]=(...o)=>r.handleButtonKeyup&&r.handleButtonKeyup(...o))},[l.createElementVNode("div",{ref:"prompt",class:"inline-choice-select-prompt"},l.toDisplayString(i.dataPrompt),513)],40,A1),l.createElementVNode("ul",{ref:"listbox",tabindex:"-1",role:"listbox","aria-labelledby":r.labelId,class:"inline-choice-select-listbox inline-choice-select-listbox-hidden",onBlur:t[2]||(t[2]=(...o)=>r.handleBlur&&r.handleBlur(...o)),onFocus:t[3]||(t[3]=(...o)=>r.setupFocus&&r.setupFocus(...o)),onKeydown:t[4]||(t[4]=(...o)=>r.checkKeyPress&&r.checkKeyPress(...o))},[l.createVNode(a,{identifier:"",fixed:"true"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.dataPrompt),1)]),_:1}),l.renderSlot(e.$slots,"default")],40,$1)])],512)}const M1=D(I1,[["render",L1]]),R1={name:"EndAttemptGeneric",props:{title:{required:!0,type:String}},data(){return{step:1,isBtnDisabled:!1}},methods:{getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleEndAttempt(){this.$parent.$emit("endAttempt",{response:!0})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.root.setAttribute("disabled",""):this.$refs.root.removeAttribute("disabled"),this.setIsBtnDisabled(e)}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}};function N1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("button",{ref:"root",class:"qti-end-attempt-interaction",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleEndAttempt&&r.handleEndAttempt(...a),["prevent"])),type:"button"},l.toDisplayString(i.title),513)}const k1=D(R1,[["render",N1]]),q1={name:"EndAttemptControllerBar",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{step:1,isBtnDisabled:!1,response:!1}},computed:{progressMaximumSteps(){return typeof this.dataSteps>"u"?1:this.dataSteps*1},progressActiveWidth(){let e=this.progressMaximumSteps;return e=this.step>e?this.step:e,Math.floor(100*(this.step/e))},progressMessage(){return this.step===this.progressMaximumSteps?"All Parts Showing":"Step "+this.step+" of "+this.progressMaximumSteps},hasTemplates(){return typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1},controllerType(){return typeof this.dataControllerType<"u"?this.dataControllerType:"generic"},progressClass(){return{"endattempt-progress-panel":!0,"progress-hidden":typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1}}},methods:{getStep(){return this.step},setStep(e){this.step=e<this.progressMaximumSteps?e:this.progressMaximumSteps},incrementStep(){this.setStep(this.getStep()+1)},getIsBtnDisabled(){return this.isBtnDisabled},setIsBtnDisabled(e){this.isBtnDisabled=e},handleControllerNewTemplate(){this.resetControllerState(),M.NotifyNewTemplate({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:this.progressMaximumSteps})},handleControllerEndAttempt(){this.updateControllerState(),this.$parent.$emit("endAttempt",{response:this.response})},enable(){this.toggleButtonDisabled(!1)},disable(){this.toggleButtonDisabled(!0)},toggleButtonDisabled(e){e?this.$refs.endattempt.setAttribute("disabled",""):this.$refs.endattempt.removeAttribute("disabled"),this.setIsBtnDisabled(e)},resetControllerState(){this.setStep(1),this.enable(),this.$parent.$emit("notifyUpdateState",{})},updateControllerState(){switch(this.dataControllerType){case"showexample":case"solve":this.incrementStep(),this.getStep()<this.progressMaximumSteps?(this.response=!1,this.enable()):(this.response=!0,this.disable());break;case"generic":default:this.getStep()<this.progressMaximumSteps?(this.response=!1,this.incrementStep(),this.enable()):(this.response=!0,this.disable())}}},created(){},mounted(){this.$parent.$emit("endAttemptReady",{node:this})}},O1={class:"endattempt-controller"},P1={class:"endattempt-controller-progress"},B1={id:"msgNotes"},D1={class:"progress"},Q1=["aria-valuenow"],H1={class:"endattempt-controller-buttons"};function U1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",O1,[l.createElementVNode("div",P1,[l.createElementVNode("div",{class:l.normalizeClass(r.progressClass)},[l.createElementVNode("div",B1,l.toDisplayString(r.progressMessage),1),l.createElementVNode("div",D1,[l.createElementVNode("div",{class:"progress-bar",style:l.normalizeStyle({width:r.progressActiveWidth+"%"}),role:"progressbar","aria-valuenow":r.progressActiveWidth,"aria-valuemin":"0","aria-valuemax":"progressMaximumSteps"},null,12,Q1)])],2)]),t[2]||(t[2]=l.createElementVNode("div",{class:"endattempt-controller-filler"},null,-1)),l.createElementVNode("div",H1,[r.hasTemplates?(l.openBlock(),l.createElementBlock("button",{key:0,id:"btnNewTemplate",onClick:t[0]||(t[0]=l.withModifiers((...a)=>r.handleControllerNewTemplate&&r.handleControllerNewTemplate(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-secondary"},"New Question")):l.createCommentVNode("",!0),l.createElementVNode("button",{ref:"endattempt",id:"btnEndAttempt",onClick:t[1]||(t[1]=l.withModifiers((...a)=>r.handleControllerEndAttempt&&r.handleControllerEndAttempt(...a),["prevent"])),type:"button",class:"endattempt-btn endattempt-btn-primary"},l.toDisplayString(i.title),513)])])}const F1=D(q1,[["render",U1]]),el={DEFAULT:"",ENDATTEMPT_CONTROLLER_BAR:"endattempt-controller-bar"};function G1(e,t){switch(e){case el.ENDATTEMPT_CONTROLLER_BAR:return{template:'<end-attempt-controller-bar response-identifier="'+t.responseIdentifier+'" title="'+t.title+'" data-steps="'+t.dataSteps+'" data-hastemplates="'+t.dataHastemplates+'" data-controller-type="'+t.dataControllerType+'" data-hideprogress="'+t.dataHideprogress+'" />',components:{EndAttemptControllerBar:F1}};default:return{template:'<end-attempt-default response-identifier="'+t.responseIdentifier+'" title="'+t.title+'"/>',components:{EndAttemptDefault:k1}}}}function j1(e){if(typeof e>"u"||e===null||e.length==0)return el.DEFAULT;const t=e.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case el.ENDATTEMPT_CONTROLLER_BAR:return t[i]}return el.DEFAULT}const W1=new F,z1={name:"QtiEndAttemptInteraction",props:{responseIdentifier:{required:!0,type:String},title:{required:!0,type:String},dataSteps:{required:!1,type:String},dataHastemplates:{required:!1,type:String},dataControllerType:{required:!1,type:String},dataHideprogress:{required:!1,type:String}},data(){return{response:!1,state:null,cardinality:"single",responseDeclaration:null,interactionSubType:"",isBtnDisabled:!1,isValidResponse:!0,invalidResponseMessage:"",isQtiValid:!0,node:null,priorState:null}},computed:{interactionTemplate(){return G1(this.interactionSubType,this.createComponentProperties())}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},getState(){return this.state},setState(e){this.state=e},updateState(){this.setState(this.computeState())},getIsValid(){return this.isValidResponse},setIsValid(e){this.isValidResponse=e},getInvalidResponseMessage(){return this.invalidResponseMessage},getCardinality(){return this.cardinality},getStep(){return this.interactionSubType==="endattempt-controller-bar"?this.node.getStep():1},setStep(e){this.interactionSubType==="endattempt-controller-bar"&&this.node.setStep(e)},initializeValue(){this.enableButton(),this.setStep(1),this.updateState(),this.setResponse(!1),this.setIsValid(!0)},resetValue(){console.log("[ResetValue][identifier]",this.responseIdentifier),this.initializeValue()},restoreValue(e){e.state.isBtnDisabled?this.disableButton():this.enableButton(),this.setStep(e.state.step),this.setState(this.computeState()),this.setResponse(this.computeResponse(e.value)),this.setIsValid(!0)},computeResponse(e){return e===null?!1:e},computeState(){return{step:this.getStep(),isBtnDisabled:this.getIsBtnDisabled(),interactionSubType:this.getInteractionSubType()}},disable(){this.disableButton(),this.updateState()},enable(){this.enableButton(),this.setResponse(!1),this.updateState()},getIsBtnDisabled(){return this.node.getIsBtnDisabled()},setIsBtnDisabled(e){this.node.setIsBtnDisabled(e)},setInteractionSubType(e){this.interactionSubType=e},getInteractionSubType(){return this.interactionSubType},handleEndAttempt(e){this.setResponse(e.response),this.updateState(),this.notifyEndAttempt()},handleUpdateState(){this.updateState()},enableButton(){this.node.enable()},disableButton(){this.node.disable()},detectInteractionSubType(e){return j1(e)},createComponentProperties(){const e={responseIdentifier:this.responseIdentifier,title:this.title};return e.dataSteps=typeof this.dataSteps<"u"?this.dataSteps:"1",e.dataHastemplates=typeof this.dataHastemplates<"u"?this.dataHastemplates==="true":!1,e.dataHideprogress=typeof this.dataHideprogress<"u"?this.dataHideprogress==="true":!1,e.dataControllerType=typeof this.dataControllerType<"u"?this.dataControllerType:"generic",e},handleEndAttemptReady(e){this.node=e.node},notifyEndAttempt(){M.NotifyEndAttempt({identifier:this.responseIdentifier,step:this.getStep(),maximumSteps:typeof this.dataSteps<"u"?this.dataSteps*1:1,interactionSubType:this.getInteractionSubType()})},getPriorState(e){const t=M.getItemContextStateVariable(e);if(t===null)return null;if(!("value"in t))throw new B('End Attempt Interaction State Invalid. "value" property not found.');if(!("state"in t))throw new B('End Attempt Interaction State Invalid. "state" property not found.');if(!("step"in t.state))throw new B('End Attempt Interaction State Invalid. "step" property not found.');if(!("isBtnDisabled"in t.state))throw new B('End Attempt Interaction State Invalid. "isBtnDisabled" property not found.');return t}},created(){try{this.responseDeclaration=W1.validateResponseIdentifierAttribute(M,this.responseIdentifier),this.setInteractionSubType(this.detectInteractionSubType(this.$attrs.class)),this.priorState=this.getPriorState(this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiParseException"?new se(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.priorState===null?this.initializeValue():this.restoreValue(this.priorState),M.defineInteraction({identifier:this.responseIdentifier,interactionType:"EndAttemptInteraction",interactionSubType:this.interactionSubType,node:this,resetValue:this.resetValue,disable:this.disable,enable:this.enable,isValidResponse:this.isValidResponse,invalidResponseMessage:this.getInvalidResponseMessage()}),console.log("["+this.$options.name+":"+this.interactionSubType+"][Identifier]",this.responseIdentifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},K1={ref:"root"};function Y1(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",K1,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.interactionTemplate),l.mergeProps({ref:"endattempt",onEndAttempt:r.handleEndAttempt,onUpdateState:r.handleUpdateState,onEndAttemptReady:r.handleEndAttemptReady},e.$attrs),null,16,["onEndAttempt","onUpdateState","onEndAttemptReady"]))],512)}const X1=D(z1,[["render",Y1]]);class Z1{constructor(t,i){return this.constants={QTI_COUNTER_NONE:"none",QTI_COUNTER_UP:"qti-counter-up",QTI_COUNTER_DOWN:"qti-counter-down",QTI_HEIGHT_LINES_3:"qti-height-lines-3",QTI_HEIGHT_LINES_6:"qti-height-lines-6",QTI_HEIGHT_LINES_15:"qti-height-lines-15",SBAC_HEIGHT_LINES_95:"sbac-height-lines-95",SBAC_PRESENTATION:"sbac"},this.classList=t,this.expectedLength=i,this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3,this.presentation_CounterStyle=this.constants.QTI_COUNTER_NONE,this.presentation_Sbac=!1,this.processClassAttribute(),this}processClassAttribute(){if(typeof this.classList>"u"||this.classList===null||this.classList.length==0)return;const t=this.classList.split(" ");for(let i=0;i<t.length;i++)switch(t[i]){case this.constants.SBAC_PRESENTATION:this.presentation_Sbac=!0;break;case this.constants.SBAC_HEIGHT_LINES_95:this.presentation_HeightClass=this.constants.SBAC_HEIGHT_LINES_95;break;case this.constants.QTI_COUNTER_UP:this.presentation_CounterStyle="up",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_COUNTER_DOWN:this.presentation_CounterStyle="down",this.expectedLength=this.processExpectedLength();break;case this.constants.QTI_HEIGHT_LINES_3:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_3;break;case this.constants.QTI_HEIGHT_LINES_6:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_6;break;case this.constants.QTI_HEIGHT_LINES_15:this.presentation_HeightClass=this.constants.QTI_HEIGHT_LINES_15;break}}processExpectedLength(){return typeof this.expectedLength>"u"||this.expectedLength===null||this.expectedLength.length==0||this.expectedLength==="0"?400:this.expectedLength*1}getCounterStyle(){return this.presentation_CounterStyle}getHeightClass(){return this.presentation_HeightClass}getExpectedLength(){return this.expectedLength}getIsSbac(){return this.presentation_Sbac}}var It="top",Yt="bottom",Xt="right",_t="left",uu="auto",Kr=[It,Yt,Xt,_t],Nn="start",Yr="end",J1="clippingParents",om="viewport",Xr="popper",eI="reference",lm=Kr.reduce(function(e,t){return e.concat([t+"-"+Nn,t+"-"+Yr])},[]),cm=[].concat(Kr,[uu]).reduce(function(e,t){return e.concat([t,t+"-"+Nn,t+"-"+Yr])},[]),tI="beforeRead",iI="read",sI="afterRead",nI="beforeMain",rI="main",aI="afterMain",oI="beforeWrite",lI="write",cI="afterWrite",uI=[tI,iI,sI,nI,rI,aI,oI,lI,cI];function Mi(e){return e?(e.nodeName||"").toLowerCase():null}function Dt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ks(e){var t=Dt(e).Element;return e instanceof t||e instanceof Element}function Zt(e){var t=Dt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hu(e){if(typeof ShadowRoot>"u")return!1;var t=Dt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hI(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var s=t.styles[i]||{},n=t.attributes[i]||{},r=t.elements[i];!Zt(r)||!Mi(r)||(Object.assign(r.style,s),Object.keys(n).forEach(function(a){var o=n[a];o===!1?r.removeAttribute(a):r.setAttribute(a,o===!0?"":o)}))})}function dI(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(s){var n=t.elements[s],r=t.attributes[s]||{},a=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:i[s]),o=a.reduce(function(u,d){return u[d]="",u},{});!Zt(n)||!Mi(n)||(Object.assign(n.style,o),Object.keys(r).forEach(function(u){n.removeAttribute(u)}))})}}const um={name:"applyStyles",enabled:!0,phase:"write",fn:hI,effect:dI,requires:["computeStyles"]};function Ri(e){return e.split("-")[0]}var Ys=Math.max,tl=Math.min,kn=Math.round;function du(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hm(){return!/^((?!chrome|android).)*safari/i.test(du())}function qn(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var s=e.getBoundingClientRect(),n=1,r=1;t&&Zt(e)&&(n=e.offsetWidth>0&&kn(s.width)/e.offsetWidth||1,r=e.offsetHeight>0&&kn(s.height)/e.offsetHeight||1);var a=Ks(e)?Dt(e):window,o=a.visualViewport,u=!hm()&&i,d=(s.left+(u&&o?o.offsetLeft:0))/n,f=(s.top+(u&&o?o.offsetTop:0))/r,y=s.width/n,m=s.height/r;return{width:y,height:m,top:f,right:d+y,bottom:f+m,left:d,x:d,y:f}}function fu(e){var t=qn(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function dm(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&hu(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Ji(e){return Dt(e).getComputedStyle(e)}function fI(e){return["table","td","th"].indexOf(Mi(e))>=0}function vs(e){return((Ks(e)?e.ownerDocument:e.document)||window.document).documentElement}function il(e){return Mi(e)==="html"?e:e.assignedSlot||e.parentNode||(hu(e)?e.host:null)||vs(e)}function fm(e){return!Zt(e)||Ji(e).position==="fixed"?null:e.offsetParent}function pI(e){var t=/firefox/i.test(du()),i=/Trident/i.test(du());if(i&&Zt(e)){var s=Ji(e);if(s.position==="fixed")return null}var n=il(e);for(hu(n)&&(n=n.host);Zt(n)&&["html","body"].indexOf(Mi(n))<0;){var r=Ji(n);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return n;n=n.parentNode}return null}function Zr(e){for(var t=Dt(e),i=fm(e);i&&fI(i)&&Ji(i).position==="static";)i=fm(i);return i&&(Mi(i)==="html"||Mi(i)==="body"&&Ji(i).position==="static")?t:i||pI(e)||t}function pu(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jr(e,t,i){return Ys(e,tl(t,i))}function mI(e,t,i){var s=Jr(e,t,i);return s>i?i:s}function pm(){return{top:0,right:0,bottom:0,left:0}}function mm(e){return Object.assign({},pm(),e)}function gm(e,t){return t.reduce(function(i,s){return i[s]=e,i},{})}var gI=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,mm(typeof t!="number"?t:gm(t,Kr))};function yI(e){var t,i=e.state,s=e.name,n=e.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,o=Ri(i.placement),u=pu(o),d=[_t,Xt].indexOf(o)>=0,f=d?"height":"width";if(!(!r||!a)){var y=gI(n.padding,i),m=fu(r),b=u==="y"?It:_t,E=u==="y"?Yt:Xt,$=i.rects.reference[f]+i.rects.reference[u]-a[u]-i.rects.popper[f],R=a[u]-i.rects.reference[u],O=Zr(r),N=O?u==="y"?O.clientHeight||0:O.clientWidth||0:0,z=$/2-R/2,V=y[b],Z=N-m[f]-y[E],K=N/2-m[f]/2+z,re=Jr(V,K,Z),w=u;i.modifiersData[s]=(t={},t[w]=re,t.centerOffset=re-K,t)}}function wI(e){var t=e.state,i=e.options,s=i.element,n=s===void 0?"[data-popper-arrow]":s;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||dm(t.elements.popper,n)&&(t.elements.arrow=n))}const bI={name:"arrow",enabled:!0,phase:"main",fn:yI,effect:wI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function On(e){return e.split("-")[1]}var vI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function EI(e,t){var i=e.x,s=e.y,n=t.devicePixelRatio||1;return{x:kn(i*n)/n||0,y:kn(s*n)/n||0}}function ym(e){var t,i=e.popper,s=e.popperRect,n=e.placement,r=e.variation,a=e.offsets,o=e.position,u=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,y=e.isFixed,m=a.x,b=m===void 0?0:m,E=a.y,$=E===void 0?0:E,R=typeof f=="function"?f({x:b,y:$}):{x:b,y:$};b=R.x,$=R.y;var O=a.hasOwnProperty("x"),N=a.hasOwnProperty("y"),z=_t,V=It,Z=window;if(d){var K=Zr(i),re="clientHeight",w="clientWidth";if(K===Dt(i)&&(K=vs(i),Ji(K).position!=="static"&&o==="absolute"&&(re="scrollHeight",w="scrollWidth")),K=K,n===It||(n===_t||n===Xt)&&r===Yr){V=Yt;var C=y&&K===Z&&Z.visualViewport?Z.visualViewport.height:K[re];$-=C-s.height,$*=u?1:-1}if(n===_t||(n===It||n===Yt)&&r===Yr){z=Xt;var I=y&&K===Z&&Z.visualViewport?Z.visualViewport.width:K[w];b-=I-s.width,b*=u?1:-1}}var p=Object.assign({position:o},d&&vI),T=f===!0?EI({x:b,y:$},Dt(i)):{x:b,y:$};if(b=T.x,$=T.y,u){var g;return Object.assign({},p,(g={},g[V]=N?"0":"",g[z]=O?"0":"",g.transform=(Z.devicePixelRatio||1)<=1?"translate("+b+"px, "+$+"px)":"translate3d("+b+"px, "+$+"px, 0)",g))}return Object.assign({},p,(t={},t[V]=N?$+"px":"",t[z]=O?b+"px":"",t.transform="",t))}function CI(e){var t=e.state,i=e.options,s=i.gpuAcceleration,n=s===void 0?!0:s,r=i.adaptive,a=r===void 0?!0:r,o=i.roundOffsets,u=o===void 0?!0:o,d={placement:Ri(t.placement),variation:On(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ym(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ym(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const TI={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CI,data:{}};var sl={passive:!0};function SI(e){var t=e.state,i=e.instance,s=e.options,n=s.scroll,r=n===void 0?!0:n,a=s.resize,o=a===void 0?!0:a,u=Dt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(f){f.addEventListener("scroll",i.update,sl)}),o&&u.addEventListener("resize",i.update,sl),function(){r&&d.forEach(function(f){f.removeEventListener("scroll",i.update,sl)}),o&&u.removeEventListener("resize",i.update,sl)}}const xI={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:SI,data:{}};var II={left:"right",right:"left",bottom:"top",top:"bottom"};function nl(e){return e.replace(/left|right|bottom|top/g,function(t){return II[t]})}var _I={start:"end",end:"start"};function wm(e){return e.replace(/start|end/g,function(t){return _I[t]})}function mu(e){var t=Dt(e),i=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:i,scrollTop:s}}function gu(e){return qn(vs(e)).left+mu(e).scrollLeft}function VI(e,t){var i=Dt(e),s=vs(e),n=i.visualViewport,r=s.clientWidth,a=s.clientHeight,o=0,u=0;if(n){r=n.width,a=n.height;var d=hm();(d||!d&&t==="fixed")&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:a,x:o+gu(e),y:u}}function AI(e){var t,i=vs(e),s=mu(e),n=(t=e.ownerDocument)==null?void 0:t.body,r=Ys(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Ys(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-s.scrollLeft+gu(e),u=-s.scrollTop;return Ji(n||i).direction==="rtl"&&(o+=Ys(i.clientWidth,n?n.clientWidth:0)-r),{width:r,height:a,x:o,y:u}}function yu(e){var t=Ji(e),i=t.overflow,s=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function bm(e){return["html","body","#document"].indexOf(Mi(e))>=0?e.ownerDocument.body:Zt(e)&&yu(e)?e:bm(il(e))}function ea(e,t){var i;t===void 0&&(t=[]);var s=bm(e),n=s===((i=e.ownerDocument)==null?void 0:i.body),r=Dt(s),a=n?[r].concat(r.visualViewport||[],yu(s)?s:[]):s,o=t.concat(a);return n?o:o.concat(ea(il(a)))}function wu(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $I(e,t){var i=qn(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function vm(e,t,i){return t===om?wu(VI(e,i)):Ks(t)?$I(t,i):wu(AI(vs(e)))}function LI(e){var t=ea(il(e)),i=["absolute","fixed"].indexOf(Ji(e).position)>=0,s=i&&Zt(e)?Zr(e):e;return Ks(s)?t.filter(function(n){return Ks(n)&&dm(n,s)&&Mi(n)!=="body"}):[]}function MI(e,t,i,s){var n=t==="clippingParents"?LI(e):[].concat(t),r=[].concat(n,[i]),a=r[0],o=r.reduce(function(u,d){var f=vm(e,d,s);return u.top=Ys(f.top,u.top),u.right=tl(f.right,u.right),u.bottom=tl(f.bottom,u.bottom),u.left=Ys(f.left,u.left),u},vm(e,a,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Em(e){var t=e.reference,i=e.element,s=e.placement,n=s?Ri(s):null,r=s?On(s):null,a=t.x+t.width/2-i.width/2,o=t.y+t.height/2-i.height/2,u;switch(n){case It:u={x:a,y:t.y-i.height};break;case Yt:u={x:a,y:t.y+t.height};break;case Xt:u={x:t.x+t.width,y:o};break;case _t:u={x:t.x-i.width,y:o};break;default:u={x:t.x,y:t.y}}var d=n?pu(n):null;if(d!=null){var f=d==="y"?"height":"width";switch(r){case Nn:u[d]=u[d]-(t[f]/2-i[f]/2);break;case Yr:u[d]=u[d]+(t[f]/2-i[f]/2);break}}return u}function ta(e,t){t===void 0&&(t={});var i=t,s=i.placement,n=s===void 0?e.placement:s,r=i.strategy,a=r===void 0?e.strategy:r,o=i.boundary,u=o===void 0?J1:o,d=i.rootBoundary,f=d===void 0?om:d,y=i.elementContext,m=y===void 0?Xr:y,b=i.altBoundary,E=b===void 0?!1:b,$=i.padding,R=$===void 0?0:$,O=mm(typeof R!="number"?R:gm(R,Kr)),N=m===Xr?eI:Xr,z=e.rects.popper,V=e.elements[E?N:m],Z=MI(Ks(V)?V:V.contextElement||vs(e.elements.popper),u,f,a),K=qn(e.elements.reference),re=Em({reference:K,element:z,strategy:"absolute",placement:n}),w=wu(Object.assign({},z,re)),C=m===Xr?w:K,I={top:Z.top-C.top+O.top,bottom:C.bottom-Z.bottom+O.bottom,left:Z.left-C.left+O.left,right:C.right-Z.right+O.right},p=e.modifiersData.offset;if(m===Xr&&p){var T=p[n];Object.keys(I).forEach(function(g){var L=[Xt,Yt].indexOf(g)>=0?1:-1,x=[It,Yt].indexOf(g)>=0?"y":"x";I[g]+=T[x]*L})}return I}function RI(e,t){t===void 0&&(t={});var i=t,s=i.placement,n=i.boundary,r=i.rootBoundary,a=i.padding,o=i.flipVariations,u=i.allowedAutoPlacements,d=u===void 0?cm:u,f=On(s),y=f?o?lm:lm.filter(function(E){return On(E)===f}):Kr,m=y.filter(function(E){return d.indexOf(E)>=0});m.length===0&&(m=y);var b=m.reduce(function(E,$){return E[$]=ta(e,{placement:$,boundary:n,rootBoundary:r,padding:a})[Ri($)],E},{});return Object.keys(b).sort(function(E,$){return b[E]-b[$]})}function NI(e){if(Ri(e)===uu)return[];var t=nl(e);return[wm(e),t,wm(t)]}function kI(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,o=a===void 0?!0:a,u=i.fallbackPlacements,d=i.padding,f=i.boundary,y=i.rootBoundary,m=i.altBoundary,b=i.flipVariations,E=b===void 0?!0:b,$=i.allowedAutoPlacements,R=t.options.placement,O=Ri(R),N=O===R,z=u||(N||!E?[nl(R)]:NI(R)),V=[R].concat(z).reduce(function(oe,P){return oe.concat(Ri(P)===uu?RI(t,{placement:P,boundary:f,rootBoundary:y,padding:d,flipVariations:E,allowedAutoPlacements:$}):P)},[]),Z=t.rects.reference,K=t.rects.popper,re=new Map,w=!0,C=V[0],I=0;I<V.length;I++){var p=V[I],T=Ri(p),g=On(p)===Nn,L=[It,Yt].indexOf(T)>=0,x=L?"width":"height",S=ta(t,{placement:p,boundary:f,rootBoundary:y,altBoundary:m,padding:d}),_=L?g?Xt:_t:g?Yt:It;Z[x]>K[x]&&(_=nl(_));var A=nl(_),q=[];if(r&&q.push(S[T]<=0),o&&q.push(S[_]<=0,S[A]<=0),q.every(function(oe){return oe})){C=p,w=!1;break}re.set(p,q)}if(w)for(var H=E?3:1,J=function(P){var Q=V.find(function(we){var fe=re.get(we);if(fe)return fe.slice(0,P).every(function(_e){return _e})});if(Q)return C=Q,"break"},ee=H;ee>0;ee--){var ae=J(ee);if(ae==="break")break}t.placement!==C&&(t.modifiersData[s]._skip=!0,t.placement=C,t.reset=!0)}}const qI={name:"flip",enabled:!0,phase:"main",fn:kI,requiresIfExists:["offset"],data:{_skip:!1}};function Cm(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Tm(e){return[It,Xt,Yt,_t].some(function(t){return e[t]>=0})}function OI(e){var t=e.state,i=e.name,s=t.rects.reference,n=t.rects.popper,r=t.modifiersData.preventOverflow,a=ta(t,{elementContext:"reference"}),o=ta(t,{altBoundary:!0}),u=Cm(a,s),d=Cm(o,n,r),f=Tm(u),y=Tm(d);t.modifiersData[i]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:y},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":y})}const PI={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:OI};function BI(e,t,i){var s=Ri(e),n=[_t,It].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,a=r[0],o=r[1];return a=a||0,o=(o||0)*n,[_t,Xt].indexOf(s)>=0?{x:o,y:a}:{x:a,y:o}}function DI(e){var t=e.state,i=e.options,s=e.name,n=i.offset,r=n===void 0?[0,0]:n,a=cm.reduce(function(f,y){return f[y]=BI(y,t.rects,r),f},{}),o=a[t.placement],u=o.x,d=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=a}const QI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:DI};function HI(e){var t=e.state,i=e.name;t.modifiersData[i]=Em({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const UI={name:"popperOffsets",enabled:!0,phase:"read",fn:HI,data:{}};function FI(e){return e==="x"?"y":"x"}function GI(e){var t=e.state,i=e.options,s=e.name,n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,o=a===void 0?!1:a,u=i.boundary,d=i.rootBoundary,f=i.altBoundary,y=i.padding,m=i.tether,b=m===void 0?!0:m,E=i.tetherOffset,$=E===void 0?0:E,R=ta(t,{boundary:u,rootBoundary:d,padding:y,altBoundary:f}),O=Ri(t.placement),N=On(t.placement),z=!N,V=pu(O),Z=FI(V),K=t.modifiersData.popperOffsets,re=t.rects.reference,w=t.rects.popper,C=typeof $=="function"?$(Object.assign({},t.rects,{placement:t.placement})):$,I=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),p=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(K){if(r){var g,L=V==="y"?It:_t,x=V==="y"?Yt:Xt,S=V==="y"?"height":"width",_=K[V],A=_+R[L],q=_-R[x],H=b?-w[S]/2:0,J=N===Nn?re[S]:w[S],ee=N===Nn?-w[S]:-re[S],ae=t.elements.arrow,oe=b&&ae?fu(ae):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pm(),Q=P[L],we=P[x],fe=Jr(0,re[S],oe[S]),_e=z?re[S]/2-H-fe-Q-I.mainAxis:J-fe-Q-I.mainAxis,Ce=z?-re[S]/2+H+fe+we+I.mainAxis:ee+fe+we+I.mainAxis,be=t.elements.arrow&&Zr(t.elements.arrow),$e=be?V==="y"?be.clientTop||0:be.clientLeft||0:0,ve=(g=p==null?void 0:p[V])!=null?g:0,Ve=_+_e-ve-$e,Te=_+Ce-ve,Ti=Jr(b?tl(A,Ve):A,_,b?Ys(q,Te):q);K[V]=Ti,T[V]=Ti-_}if(o){var Fi,Ms=V==="x"?It:_t,Rs=V==="x"?Yt:Xt,pt=K[Z],Lt=Z==="y"?"height":"width",Gi=pt+R[Ms],ri=pt-R[Rs],mt=[It,_t].indexOf(O)!==-1,Si=(Fi=p==null?void 0:p[Z])!=null?Fi:0,Ns=mt?Gi:pt-re[Lt]-w[Lt]-Si+I.altAxis,ai=mt?pt+re[Lt]+w[Lt]-Si-I.altAxis:ri,xi=b&&mt?mI(Ns,pt,ai):Jr(b?Ns:Gi,pt,b?ai:ri);K[Z]=xi,T[Z]=xi-pt}t.modifiersData[s]=T}}const jI={name:"preventOverflow",enabled:!0,phase:"main",fn:GI,requiresIfExists:["offset"]};function WI(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function zI(e){return e===Dt(e)||!Zt(e)?mu(e):WI(e)}function KI(e){var t=e.getBoundingClientRect(),i=kn(t.width)/e.offsetWidth||1,s=kn(t.height)/e.offsetHeight||1;return i!==1||s!==1}function YI(e,t,i){i===void 0&&(i=!1);var s=Zt(t),n=Zt(t)&&KI(t),r=vs(t),a=qn(e,n,i),o={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!i)&&((Mi(t)!=="body"||yu(r))&&(o=zI(t)),Zt(t)?(u=qn(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):r&&(u.x=gu(r))),{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function XI(e){var t=new Map,i=new Set,s=[];e.forEach(function(r){t.set(r.name,r)});function n(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(o){if(!i.has(o)){var u=t.get(o);u&&n(u)}}),s.push(r)}return e.forEach(function(r){i.has(r.name)||n(r)}),s}function ZI(e){var t=XI(e);return uI.reduce(function(i,s){return i.concat(t.filter(function(n){return n.phase===s}))},[])}function JI(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function e_(e){var t=e.reduce(function(i,s){var n=i[s.name];return i[s.name]=n?Object.assign({},n,s,{options:Object.assign({},n.options,s.options),data:Object.assign({},n.data,s.data)}):s,i},{});return Object.keys(t).map(function(i){return t[i]})}var Sm={placement:"bottom",modifiers:[],strategy:"absolute"};function xm(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function t_(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,s=i===void 0?[]:i,n=t.defaultOptions,r=n===void 0?Sm:n;return function(o,u,d){d===void 0&&(d=r);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Sm,r),modifiersData:{},elements:{reference:o,popper:u},attributes:{},styles:{}},y=[],m=!1,b={state:f,setOptions:function(O){var N=typeof O=="function"?O(f.options):O;$(),f.options=Object.assign({},r,f.options,N),f.scrollParents={reference:Ks(o)?ea(o):o.contextElement?ea(o.contextElement):[],popper:ea(u)};var z=ZI(e_([].concat(s,f.options.modifiers)));return f.orderedModifiers=z.filter(function(V){return V.enabled}),E(),b.update()},forceUpdate:function(){if(!m){var O=f.elements,N=O.reference,z=O.popper;if(xm(N,z)){f.rects={reference:YI(N,Zr(z),f.options.strategy==="fixed"),popper:fu(z)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(I){return f.modifiersData[I.name]=Object.assign({},I.data)});for(var V=0;V<f.orderedModifiers.length;V++){if(f.reset===!0){f.reset=!1,V=-1;continue}var Z=f.orderedModifiers[V],K=Z.fn,re=Z.options,w=re===void 0?{}:re,C=Z.name;typeof K=="function"&&(f=K({state:f,options:w,name:C,instance:b})||f)}}}},update:JI(function(){return new Promise(function(R){b.forceUpdate(),R(f)})}),destroy:function(){$(),m=!0}};if(!xm(o,u))return b;b.setOptions(d).then(function(R){!m&&d.onFirstUpdate&&d.onFirstUpdate(R)});function E(){f.orderedModifiers.forEach(function(R){var O=R.name,N=R.options,z=N===void 0?{}:N,V=R.effect;if(typeof V=="function"){var Z=V({state:f,name:O,instance:b,options:z}),K=function(){};y.push(Z||K)}})}function $(){y.forEach(function(R){return R()}),y=[]}return b}}var i_=[xI,UI,TI,um,QI,qI,jI,bI,PI],s_=t_({defaultModifiers:i_}),n_="tippy-box",Im="tippy-content",r_="tippy-backdrop",_m="tippy-arrow",Vm="tippy-svg-arrow",Xs={passive:!0,capture:!0},Am=function(){return document.body};function a_(e,t){return{}.hasOwnProperty.call(e,t)}function bu(e,t,i){if(Array.isArray(e)){var s=e[t];return s??(Array.isArray(i)?i[t]:i)}return e}function vu(e,t){var i={}.toString.call(e);return i.indexOf("[object")===0&&i.indexOf(t+"]")>-1}function $m(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Lm(e,t){if(t===0)return e;var i;return function(s){clearTimeout(i),i=setTimeout(function(){e(s)},t)}}function o_(e,t){var i=Object.assign({},e);return t.forEach(function(s){delete i[s]}),i}function l_(e){return e.split(/\s+/).filter(Boolean)}function Pn(e){return[].concat(e)}function Mm(e,t){e.indexOf(t)===-1&&e.push(t)}function c_(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function u_(e){return e.split("-")[0]}function rl(e){return[].slice.call(e)}function Rm(e){return Object.keys(e).reduce(function(t,i){return e[i]!==void 0&&(t[i]=e[i]),t},{})}function ia(){return document.createElement("div")}function sa(e){return["Element","Fragment"].some(function(t){return vu(e,t)})}function h_(e){return vu(e,"NodeList")}function d_(e){return vu(e,"MouseEvent")}function f_(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function p_(e){return sa(e)?[e]:h_(e)?rl(e):Array.isArray(e)?e:rl(document.querySelectorAll(e))}function Eu(e,t){e.forEach(function(i){i&&(i.style.transitionDuration=t+"ms")})}function Nm(e,t){e.forEach(function(i){i&&i.setAttribute("data-state",t)})}function m_(e){var t,i=Pn(e),s=i[0];return s!=null&&(t=s.ownerDocument)!=null&&t.body?s.ownerDocument:document}function g_(e,t){var i=t.clientX,s=t.clientY;return e.every(function(n){var r=n.popperRect,a=n.popperState,o=n.props,u=o.interactiveBorder,d=u_(a.placement),f=a.modifiersData.offset;if(!f)return!0;var y=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,b=d==="right"?f.left.x:0,E=d==="left"?f.right.x:0,$=r.top-s+y>u,R=s-r.bottom-m>u,O=r.left-i+b>u,N=i-r.right-E>u;return $||R||O||N})}function Cu(e,t,i){var s=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){e[s](n,i)})}function km(e,t){for(var i=t;i;){var s;if(e.contains(i))return!0;i=i.getRootNode==null||(s=i.getRootNode())==null?void 0:s.host}return!1}var Ni={isTouch:!1},qm=0;function y_(){Ni.isTouch||(Ni.isTouch=!0,window.performance&&document.addEventListener("mousemove",Om))}function Om(){var e=performance.now();e-qm<20&&(Ni.isTouch=!1,document.removeEventListener("mousemove",Om)),qm=e}function w_(){var e=document.activeElement;if(f_(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function b_(){document.addEventListener("touchstart",y_,Xs),window.addEventListener("blur",w_)}var v_=typeof window<"u"&&typeof document<"u",E_=v_?!!window.msCrypto:!1;function Bn(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Pm(e){var t=/[ \t]{2,}/g,i=/^[ \t]*/gm;return e.replace(t," ").replace(i,"").trim()}function C_(e){return Pm(`
|
88
88
|
%ctippy.js
|
89
89
|
|
90
90
|
%c`+Pm(e)+`
|
@@ -104,7 +104,7 @@ https://sweetalert2.github.io/#ajax-request`),pC(e),typeof e.title=="string"&&(e
|
|
104
104
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
105
105
|
|
106
106
|
`,`1) content: element.innerHTML
|
107
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var o=n.reduce(function(u,d){var f=d&&L_(d,s);return f&&u.push(f),u},[]);return sa(e)?o[0]:o}ra.defaultProps=Qt,ra.setDefaultProps=__,ra.currentInput=Ni,Object.assign({},um,{effect:function(t){var i=t.state,s={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,s.popper),i.styles=s,i.elements.arrow&&Object.assign(i.elements.arrow.style,s.arrow)}}),ra.setDefaultProps({render:jm});const M_={name:"Tooltip",props:{target:{required:!0,type:Function},message:{required:!1,type:String,default:""},colorStyle:{required:!1,type:String,default:""},placement:{required:!1,type:String,default:"top"}},computed:{tooltipStyle(){return this.colorStyle+" __tooltipMessage"}},data(){return{targetElement:null,tippy:null,zIndex:101}},methods:{hide(){this.tippy.hide()},show(){this.tippy.show()}},mounted(){this.targetElement=this.target(),this.tippy=ra(this.targetElement,{content:this.$refs.template.innerHTML,allowHTML:!0,trigger:"manual",theme:this.colorStyle,placement:this.placement,zIndex:101})},beforeDestroy(){this.tippy!==null&&this.tippy.destroy()}},R_={ref:"template",style:{display:"none"}};function N_(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",R_,[l.createElementVNode("span",{class:l.normalizeClass(r.tooltipStyle)},l.toDisplayString(i.message),3)],512)}const aa=D(M_,[["render",N_]]),k_=new F,q_={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br />")},handleInput(e){e.preventDefault();let t=!0;this.showCounter&&!this.applyLimitCheck(this.$refs.textarea.value)||(this.appliedRegex!==null?t=this.applyPatternMask(this.$refs.textarea.value):this.setResponse(this.$refs.textarea.value),t&&(this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})))},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)}},created(){this.appliedRegex=k_.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},O_={ref:"root"},P_={ref:"label",class:"ext-text-plain-default-label qti-hidden"},B_=["placeholder","disabled"],D_={key:0,"aria-hidden":"true",class:"ext-text-plain-counter"},Q_={key:0};function H_(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",O_,[l.createElementVNode("div",P_,null,512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-default"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=o=>n.response=o),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:"false",maxlength:"maxLength",onInput:t[1]||(t[1]=(...o)=>r.handleInput&&r.handleInput(...o))}),null,16,B_),[[l.vModelText,n.response]]),r.showCounter?(l.openBlock(),l.createElementBlock("div",D_,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Q_," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const U_=D(q_,[["render",H_]]),F_=new F,Wm=new ie,G_={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"},dataSpellcheck:{required:!1,type:String},dataToolbarButtons:{required:!1,type:String}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},computeSpellcheck(){return typeof this.dataSpellcheck<"u"?this.dataSpellcheck:!1},showCopy(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("copy"):!1},showCut(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("cut"):!1},showPaste(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("paste"):!1},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,selectedText:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(Wm.computeWordCount(this.response))},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e},handleInput(e){e.preventDefault();const t=this.$refs.textarea.value;this.isPassedConstraints(t)&&(this.setResponse(t),this.priorResponse=t,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()}))},isPassedConstraints(e){return!(this.showCounter&&!this.applyLimitCheck(e))},applyLimitCheck(e){return Wm.computeWordCount(e)>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?!0:(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},handleCopy(){this.selectedText=this.getSelectedText()},handleCut(){this.selectedText=this.getSelectedText(),this.insertText("")},handlePaste(){this.insertText(this.selectedText)},getSelectedText(){const e=this.$refs.textarea;if(typeof e.selectionStart=="number"){const t=e.value.slice(e.selectionStart,e.selectionEnd);return e.focus(),e.setSelectionRange(e.selectionStart,e.selectionEnd),t}return""},insertText(e){this.insertTextAtCursor(e),this.setResponse(this.$refs.textarea.value),this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})},insertTextAtCursor(e){const t=this.$refs.textarea;if(t.selectionStart||t.selectionStart===0){const s=t.selectionStart,n=t.selectionEnd,r=t.scrollTop,a=t.value.substring(0,s)+e+t.value.substring(n,t.value.length);if(!this.isPassedConstraints(a))return;t.value=a,t.focus(),t.selectionStart=s+e.length,t.selectionEnd=s+e.length,t.scrollTop=r;return}const i=t.value+e;this.isPassedConstraints(i)&&(t.value=i,t.focus())}},created(){this.appliedRegex=F_.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},j_={ref:"root"},W_={ref:"toolbar",class:"ext-text-toolbar"},z_={key:0,"aria-hidden":"true",class:"toolbar-right"},K_={class:"ext-text-toolbar-counter"},Y_={key:0},X_={class:"toolbar-left"},Z_=["placeholder","disabled","spellcheck"];function J_(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",j_,[l.createElementVNode("div",W_,[r.showCounter?(l.openBlock(),l.createElementBlock("div",z_,[l.createElementVNode("span",K_,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Y_," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0),t[5]||(t[5]=l.createTextVNode(" Word(s) "))])])):l.createCommentVNode("",!0),l.createElementVNode("span",X_,[r.showCopy?(l.openBlock(),l.createElementBlock("button",{key:0,onClick:t[0]||(t[0]=l.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"])),type:"button",class:"btn-copy",unselectable:"on"},"Copy")):l.createCommentVNode("",!0),r.showCut?(l.openBlock(),l.createElementBlock("button",{key:1,onClick:t[1]||(t[1]=l.withModifiers((...o)=>r.handleCut&&r.handleCut(...o),["prevent"])),type:"button",class:"btn-cut",unselectable:"on"},"Cut")):l.createCommentVNode("",!0),r.showPaste?(l.openBlock(),l.createElementBlock("button",{key:2,onClick:t[2]||(t[2]=l.withModifiers((...o)=>r.handlePaste&&r.handlePaste(...o),["prevent"])),type:"button",class:"btn-paste",unselectable:"on"},"Paste")):l.createCommentVNode("",!0)])],512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-lrn"},e.$attrs,{"onUpdate:modelValue":t[3]||(t[3]=o=>n.response=o),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:r.computeSpellcheck,maxlength:"maxLength",onInput:t[4]||(t[4]=(...o)=>r.handleInput&&r.handleInput(...o))}),null,16,Z_),[[l.vModelText,n.response]]),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:0,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const eV=D(G_,[["render",J_]]),tV=new F,iV={name:"ExtendedTextPlainVerticalRl",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:"foo"},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},tooltipPlacement(){return"right"},disabled(){return this.isDisabled}},data(){return{response:"",state:null,priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,caretIndex:0,maxlengthMessage:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e,t=!1){e===null&&(e=""),this.response=e,t&&this.updateContent(this.response),this.updateCounter(this.response.length)},updateResponse(e){this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},computeState(e){return{html:e}},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br>")},getContent(){return this.getTextContent(this.$refs.textarea.childNodes)},updateContent(e){this.$refs.textarea.innerHTML=e},getTextContent(e){let t,i="",s=0,n=e.nodeType;if(!n)for(;t=e[s++];)i+=this.getTextContent(t);return n===1||n===11?e.textContent:n===9?e.documentElement.textContent:n===3||n===4?e.nodeValue:i},getCaretIndex(){return this.caretIndex},setCaretIndex(e){this.caretIndex=e},handleInput(e){e.preventDefault();let t=!0;this.setCaretIndex(this.getCaretPos(this.$refs.textarea)-1);let i=this.getContent();this.showCounter&&!this.applyLimitCheck(i)||this.appliedRegex!==null&&(t=this.applyPatternMask(i),!t)||((i.length==0||i.length==1&&i.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),i=""),this.setResponse(i),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=i,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handlePaste(e){e.preventDefault();let t=!0,i=e.clipboardData.getData("text/plain");const s=document.getSelection().getRangeAt(0);s.deleteContents();const n=document.createTextNode(i);s.insertNode(n),s.selectNodeContents(n),s.collapse(!1);const r=window.getSelection();r.removeAllRanges(),r.addRange(s);let a=this.getContent();this.showCounter&&!this.applyLimitCheck(a)||this.appliedRegex!==null&&(t=this.applyPatternMask(a),!t)||((a.length==0||a.length==1&&a.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),a=""),this.setResponse(a),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=a,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handleDrop(e){e.preventDefault()},handleKeydown(e){switch(this.setCaretIndex(this.getCaretPos(this.$refs.textarea)),e.code){case"KeyI":case"KeyB":case"KeyU":e.ctrlKey&&e.preventDefault();return}},getRange(){const e=document.getSelection();return e.rangeCount===0?null:e.getRangeAt(0)},getCaretPos(e){let t=0;if(typeof window.getSelection<"u"&&window.getSelection().rangeCount!==0){const n=window.getSelection().getRangeAt(0),r=n.cloneRange();r.selectNodeContents(e),r.setEnd(n.endContainer,n.endOffset),t=r.toString().length}return t},setCaretPos(e,t){e.focus(),e.childNodes.length===1&&document.getSelection().collapse(e.childNodes[0],t)},getLength(){return this.response.length},empty(){this.$refs.textarea.textContent=""},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}}},created(){this.appliedRegex=tV.validatePattern("pattern-mask",this.patternMask),this.setState(this.computeState(""))},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},sV={ref:"root"},nV={ref:"label",class:"ext-text-default-vert-rl-label qti-hidden"},rV=["maxlength","data-placeholder"],aV={key:0,"aria-hidden":"true",class:"ext-text-default-vert-rl-counter"},oV={key:0};function lV(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",sV,[l.createElementVNode("div",nV,null,512),l.createElementVNode("div",l.mergeProps({ref:"textarea",class:"ext-text-default-vert-rl"},e.$attrs,{tabindex:"0",contenteditable:"true",autocapitalize:"false",spellcheck:"false",maxlength:r.maxLength,"data-placeholder":i.placeholder,onInput:t[0]||(t[0]=(...o)=>r.handleInput&&r.handleInput(...o)),onKeydown:t[1]||(t[1]=(...o)=>r.handleKeydown&&r.handleKeydown(...o)),onPaste:t[2]||(t[2]=(...o)=>r.handlePaste&&r.handlePaste(...o)),onDrop:t[3]||(t[3]=(...o)=>r.handleDrop&&r.handleDrop(...o))}),null,16,rV),r.showCounter?(l.openBlock(),l.createElementBlock("div",aV,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",oV," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle,placement:r.tooltipPlacement},null,8,["target","message","color-style","placement"])):l.createCommentVNode("",!0)],512)}const cV=D(iV,[["render",lV]]);var zm=typeof global=="object"&&global&&global.Object===Object&&global,uV=typeof self=="object"&&self&&self.Object===Object&&self,ki=zm||uV||Function("return this")(),Es=ki.Symbol,Km=Object.prototype,hV=Km.hasOwnProperty,dV=Km.toString,oa=Es?Es.toStringTag:void 0;function fV(e){var t=hV.call(e,oa),i=e[oa];try{e[oa]=void 0;var s=!0}catch{}var n=dV.call(e);return s&&(t?e[oa]=i:delete e[oa]),n}var pV=Object.prototype,mV=pV.toString;function gV(e){return mV.call(e)}var yV="[object Null]",wV="[object Undefined]",Ym=Es?Es.toStringTag:void 0;function Dn(e){return e==null?e===void 0?wV:yV:Ym&&Ym in Object(e)?fV(e):gV(e)}function ts(e){return e!=null&&typeof e=="object"}var Zs=Array.isArray;function Cs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Xm(e){return e}var bV="[object AsyncFunction]",vV="[object Function]",EV="[object GeneratorFunction]",CV="[object Proxy]";function _u(e){if(!Cs(e))return!1;var t=Dn(e);return t==vV||t==EV||t==bV||t==CV}var Vu=ki["__core-js_shared__"],Zm=function(){var e=/[^.]+$/.exec(Vu&&Vu.keys&&Vu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function TV(e){return!!Zm&&Zm in e}var SV=Function.prototype,xV=SV.toString;function Js(e){if(e!=null){try{return xV.call(e)}catch{}try{return e+""}catch{}}return""}var IV=/[\\^$.*+?()[\]{}|]/g,_V=/^\[object .+?Constructor\]$/,VV=Function.prototype,AV=Object.prototype,$V=VV.toString,LV=AV.hasOwnProperty,MV=RegExp("^"+$V.call(LV).replace(IV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RV(e){if(!Cs(e)||TV(e))return!1;var t=_u(e)?MV:_V;return t.test(Js(e))}function NV(e,t){return e==null?void 0:e[t]}function en(e,t){var i=NV(e,t);return RV(i)?i:void 0}var Au=en(ki,"WeakMap"),Jm=Object.create,kV=function(){function e(){}return function(t){if(!Cs(t))return{};if(Jm)return Jm(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function qV(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function eg(e,t){var i=-1,s=e.length;for(t||(t=Array(s));++i<s;)t[i]=e[i];return t}var OV=800,PV=16,BV=Date.now;function DV(e){var t=0,i=0;return function(){var s=BV(),n=PV-(s-i);if(i=s,n>0){if(++t>=OV)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function QV(e){return function(){return e}}var ol=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),HV=ol?function(e,t){return ol(e,"toString",{configurable:!0,enumerable:!1,value:QV(t),writable:!0})}:Xm,UV=DV(HV);function FV(e,t){for(var i=-1,s=e==null?0:e.length;++i<s&&t(e[i],i,e)!==!1;);return e}var GV=9007199254740991,jV=/^(?:0|[1-9]\d*)$/;function tg(e,t){var i=typeof e;return t=t??GV,!!t&&(i=="number"||i!="symbol"&&jV.test(e))&&e>-1&&e%1==0&&e<t}function $u(e,t,i){t=="__proto__"&&ol?ol(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function la(e,t){return e===t||e!==e&&t!==t}var WV=Object.prototype,zV=WV.hasOwnProperty;function ig(e,t,i){var s=e[t];(!(zV.call(e,t)&&la(s,i))||i===void 0&&!(t in e))&&$u(e,t,i)}function ca(e,t,i,s){var n=!i;i||(i={});for(var r=-1,a=t.length;++r<a;){var o=t[r],u=void 0;u===void 0&&(u=e[o]),n?$u(i,o,u):ig(i,o,u)}return i}var sg=Math.max;function KV(e,t,i){return t=sg(t===void 0?e.length-1:t,0),function(){for(var s=arguments,n=-1,r=sg(s.length-t,0),a=Array(r);++n<r;)a[n]=s[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=s[n];return o[t]=i(a),qV(e,this,o)}}function YV(e,t){return UV(KV(e,t,Xm),e+"")}var XV=9007199254740991;function ng(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XV}function ll(e){return e!=null&&ng(e.length)&&!_u(e)}function ZV(e,t,i){if(!Cs(i))return!1;var s=typeof t;return(s=="number"?ll(i)&&tg(t,i.length):s=="string"&&t in i)?la(i[t],e):!1}function JV(e){return YV(function(t,i){var s=-1,n=i.length,r=n>1?i[n-1]:void 0,a=n>2?i[2]:void 0;for(r=e.length>3&&typeof r=="function"?(n--,r):void 0,a&&ZV(i[0],i[1],a)&&(r=n<3?void 0:r,n=1),t=Object(t);++s<n;){var o=i[s];o&&e(t,o,s,r)}return t})}var eA=Object.prototype;function Lu(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||eA;return e===i}function tA(e,t){for(var i=-1,s=Array(e);++i<e;)s[i]=t(i);return s}var iA="[object Arguments]";function rg(e){return ts(e)&&Dn(e)==iA}var ag=Object.prototype,sA=ag.hasOwnProperty,nA=ag.propertyIsEnumerable,Mu=rg(function(){return arguments}())?rg:function(e){return ts(e)&&sA.call(e,"callee")&&!nA.call(e,"callee")};function rA(){return!1}var og=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lg=og&&typeof module=="object"&&module&&!module.nodeType&&module,aA=lg&&lg.exports===og,cg=aA?ki.Buffer:void 0,oA=cg?cg.isBuffer:void 0,ua=oA||rA,lA="[object Arguments]",cA="[object Array]",uA="[object Boolean]",hA="[object Date]",dA="[object Error]",fA="[object Function]",pA="[object Map]",mA="[object Number]",gA="[object Object]",yA="[object RegExp]",wA="[object Set]",bA="[object String]",vA="[object WeakMap]",EA="[object ArrayBuffer]",CA="[object DataView]",TA="[object Float32Array]",SA="[object Float64Array]",xA="[object Int8Array]",IA="[object Int16Array]",_A="[object Int32Array]",VA="[object Uint8Array]",AA="[object Uint8ClampedArray]",$A="[object Uint16Array]",LA="[object Uint32Array]",Ue={};Ue[TA]=Ue[SA]=Ue[xA]=Ue[IA]=Ue[_A]=Ue[VA]=Ue[AA]=Ue[$A]=Ue[LA]=!0,Ue[lA]=Ue[cA]=Ue[EA]=Ue[uA]=Ue[CA]=Ue[hA]=Ue[dA]=Ue[fA]=Ue[pA]=Ue[mA]=Ue[gA]=Ue[yA]=Ue[wA]=Ue[bA]=Ue[vA]=!1;function MA(e){return ts(e)&&ng(e.length)&&!!Ue[Dn(e)]}function Ru(e){return function(t){return e(t)}}var ug=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ha=ug&&typeof module=="object"&&module&&!module.nodeType&&module,RA=ha&&ha.exports===ug,Nu=RA&&zm.process,Qn=function(){try{var e=ha&&ha.require&&ha.require("util").types;return e||Nu&&Nu.binding&&Nu.binding("util")}catch{}}(),hg=Qn&&Qn.isTypedArray,ku=hg?Ru(hg):MA,NA=Object.prototype,kA=NA.hasOwnProperty;function dg(e,t){var i=Zs(e),s=!i&&Mu(e),n=!i&&!s&&ua(e),r=!i&&!s&&!n&&ku(e),a=i||s||n||r,o=a?tA(e.length,String):[],u=o.length;for(var d in e)(t||kA.call(e,d))&&!(a&&(d=="length"||n&&(d=="offset"||d=="parent")||r&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||tg(d,u)))&&o.push(d);return o}function fg(e,t){return function(i){return e(t(i))}}var qA=fg(Object.keys,Object),OA=Object.prototype,PA=OA.hasOwnProperty;function BA(e){if(!Lu(e))return qA(e);var t=[];for(var i in Object(e))PA.call(e,i)&&i!="constructor"&&t.push(i);return t}function qu(e){return ll(e)?dg(e):BA(e)}function DA(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}var QA=Object.prototype,HA=QA.hasOwnProperty;function UA(e){if(!Cs(e))return DA(e);var t=Lu(e),i=[];for(var s in e)s=="constructor"&&(t||!HA.call(e,s))||i.push(s);return i}function da(e){return ll(e)?dg(e,!0):UA(e)}var fa=en(Object,"create");function FA(){this.__data__=fa?fa(null):{},this.size=0}function GA(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var jA="__lodash_hash_undefined__",WA=Object.prototype,zA=WA.hasOwnProperty;function KA(e){var t=this.__data__;if(fa){var i=t[e];return i===jA?void 0:i}return zA.call(t,e)?t[e]:void 0}var YA=Object.prototype,XA=YA.hasOwnProperty;function ZA(e){var t=this.__data__;return fa?t[e]!==void 0:XA.call(t,e)}var JA="__lodash_hash_undefined__";function e$(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=fa&&t===void 0?JA:t,this}function tn(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}tn.prototype.clear=FA,tn.prototype.delete=GA,tn.prototype.get=KA,tn.prototype.has=ZA,tn.prototype.set=e$;function t$(){this.__data__=[],this.size=0}function cl(e,t){for(var i=e.length;i--;)if(la(e[i][0],t))return i;return-1}var i$=Array.prototype,s$=i$.splice;function n$(e){var t=this.__data__,i=cl(t,e);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():s$.call(t,i,1),--this.size,!0}function r$(e){var t=this.__data__,i=cl(t,e);return i<0?void 0:t[i][1]}function a$(e){return cl(this.__data__,e)>-1}function o$(e,t){var i=this.__data__,s=cl(i,e);return s<0?(++this.size,i.push([e,t])):i[s][1]=t,this}function is(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}is.prototype.clear=t$,is.prototype.delete=n$,is.prototype.get=r$,is.prototype.has=a$,is.prototype.set=o$;var pa=en(ki,"Map");function l$(){this.size=0,this.__data__={hash:new tn,map:new(pa||is),string:new tn}}function c$(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ul(e,t){var i=e.__data__;return c$(t)?i[typeof t=="string"?"string":"hash"]:i.map}function u$(e){var t=ul(this,e).delete(e);return this.size-=t?1:0,t}function h$(e){return ul(this,e).get(e)}function d$(e){return ul(this,e).has(e)}function f$(e,t){var i=ul(this,e),s=i.size;return i.set(e,t),this.size+=i.size==s?0:1,this}function sn(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}sn.prototype.clear=l$,sn.prototype.delete=u$,sn.prototype.get=h$,sn.prototype.has=d$,sn.prototype.set=f$;function pg(e,t){for(var i=-1,s=t.length,n=e.length;++i<s;)e[n+i]=t[i];return e}var Ou=fg(Object.getPrototypeOf,Object),p$="[object Object]",m$=Function.prototype,g$=Object.prototype,mg=m$.toString,y$=g$.hasOwnProperty,w$=mg.call(Object);function b$(e){if(!ts(e)||Dn(e)!=p$)return!1;var t=Ou(e);if(t===null)return!0;var i=y$.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&mg.call(i)==w$}function v$(){this.__data__=new is,this.size=0}function E$(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function C$(e){return this.__data__.get(e)}function T$(e){return this.__data__.has(e)}var S$=200;function x$(e,t){var i=this.__data__;if(i instanceof is){var s=i.__data__;if(!pa||s.length<S$-1)return s.push([e,t]),this.size=++i.size,this;i=this.__data__=new sn(s)}return i.set(e,t),this.size=i.size,this}function qi(e){var t=this.__data__=new is(e);this.size=t.size}qi.prototype.clear=v$,qi.prototype.delete=E$,qi.prototype.get=C$,qi.prototype.has=T$,qi.prototype.set=x$;function I$(e,t){return e&&ca(t,qu(t),e)}function _$(e,t){return e&&ca(t,da(t),e)}var gg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yg=gg&&typeof module=="object"&&module&&!module.nodeType&&module,V$=yg&&yg.exports===gg,wg=V$?ki.Buffer:void 0,bg=wg?wg.allocUnsafe:void 0;function vg(e,t){if(t)return e.slice();var i=e.length,s=bg?bg(i):new e.constructor(i);return e.copy(s),s}function A$(e,t){for(var i=-1,s=e==null?0:e.length,n=0,r=[];++i<s;){var a=e[i];t(a,i,e)&&(r[n++]=a)}return r}function Eg(){return[]}var $$=Object.prototype,L$=$$.propertyIsEnumerable,Cg=Object.getOwnPropertySymbols,Pu=Cg?function(e){return e==null?[]:(e=Object(e),A$(Cg(e),function(t){return L$.call(e,t)}))}:Eg;function M$(e,t){return ca(e,Pu(e),t)}var R$=Object.getOwnPropertySymbols,Tg=R$?function(e){for(var t=[];e;)pg(t,Pu(e)),e=Ou(e);return t}:Eg;function N$(e,t){return ca(e,Tg(e),t)}function Sg(e,t,i){var s=t(e);return Zs(e)?s:pg(s,i(e))}function Bu(e){return Sg(e,qu,Pu)}function k$(e){return Sg(e,da,Tg)}var Du=en(ki,"DataView"),Qu=en(ki,"Promise"),Hu=en(ki,"Set"),xg="[object Map]",q$="[object Object]",Ig="[object Promise]",_g="[object Set]",Vg="[object WeakMap]",Ag="[object DataView]",O$=Js(Du),P$=Js(pa),B$=Js(Qu),D$=Js(Hu),Q$=Js(Au),di=Dn;(Du&&di(new Du(new ArrayBuffer(1)))!=Ag||pa&&di(new pa)!=xg||Qu&&di(Qu.resolve())!=Ig||Hu&&di(new Hu)!=_g||Au&&di(new Au)!=Vg)&&(di=function(e){var t=Dn(e),i=t==q$?e.constructor:void 0,s=i?Js(i):"";if(s)switch(s){case O$:return Ag;case P$:return xg;case B$:return Ig;case D$:return _g;case Q$:return Vg}return t});var H$=Object.prototype,U$=H$.hasOwnProperty;function F$(e){var t=e.length,i=new e.constructor(t);return t&&typeof e[0]=="string"&&U$.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var hl=ki.Uint8Array;function Uu(e){var t=new e.constructor(e.byteLength);return new hl(t).set(new hl(e)),t}function G$(e,t){var i=t?Uu(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var j$=/\w*$/;function W$(e){var t=new e.constructor(e.source,j$.exec(e));return t.lastIndex=e.lastIndex,t}var $g=Es?Es.prototype:void 0,Lg=$g?$g.valueOf:void 0;function z$(e){return Lg?Object(Lg.call(e)):{}}function Mg(e,t){var i=t?Uu(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var K$="[object Boolean]",Y$="[object Date]",X$="[object Map]",Z$="[object Number]",J$="[object RegExp]",eL="[object Set]",tL="[object String]",iL="[object Symbol]",sL="[object ArrayBuffer]",nL="[object DataView]",rL="[object Float32Array]",aL="[object Float64Array]",oL="[object Int8Array]",lL="[object Int16Array]",cL="[object Int32Array]",uL="[object Uint8Array]",hL="[object Uint8ClampedArray]",dL="[object Uint16Array]",fL="[object Uint32Array]";function pL(e,t,i){var s=e.constructor;switch(t){case sL:return Uu(e);case K$:case Y$:return new s(+e);case nL:return G$(e,i);case rL:case aL:case oL:case lL:case cL:case uL:case hL:case dL:case fL:return Mg(e,i);case X$:return new s;case Z$:case tL:return new s(e);case J$:return W$(e);case eL:return new s;case iL:return z$(e)}}function Rg(e){return typeof e.constructor=="function"&&!Lu(e)?kV(Ou(e)):{}}var mL="[object Map]";function gL(e){return ts(e)&&di(e)==mL}var Ng=Qn&&Qn.isMap,yL=Ng?Ru(Ng):gL,wL="[object Set]";function bL(e){return ts(e)&&di(e)==wL}var kg=Qn&&Qn.isSet,vL=kg?Ru(kg):bL,EL=1,CL=2,TL=4,qg="[object Arguments]",SL="[object Array]",xL="[object Boolean]",IL="[object Date]",_L="[object Error]",Og="[object Function]",VL="[object GeneratorFunction]",AL="[object Map]",$L="[object Number]",Pg="[object Object]",LL="[object RegExp]",ML="[object Set]",RL="[object String]",NL="[object Symbol]",kL="[object WeakMap]",qL="[object ArrayBuffer]",OL="[object DataView]",PL="[object Float32Array]",BL="[object Float64Array]",DL="[object Int8Array]",QL="[object Int16Array]",HL="[object Int32Array]",UL="[object Uint8Array]",FL="[object Uint8ClampedArray]",GL="[object Uint16Array]",jL="[object Uint32Array]",He={};He[qg]=He[SL]=He[qL]=He[OL]=He[xL]=He[IL]=He[PL]=He[BL]=He[DL]=He[QL]=He[HL]=He[AL]=He[$L]=He[Pg]=He[LL]=He[ML]=He[RL]=He[NL]=He[UL]=He[FL]=He[GL]=He[jL]=!0,He[_L]=He[Og]=He[kL]=!1;function dl(e,t,i,s,n,r){var a,o=t&EL,u=t&CL,d=t&TL;if(a!==void 0)return a;if(!Cs(e))return e;var f=Zs(e);if(f){if(a=F$(e),!o)return eg(e,a)}else{var y=di(e),m=y==Og||y==VL;if(ua(e))return vg(e,o);if(y==Pg||y==qg||m&&!n){if(a=u||m?{}:Rg(e),!o)return u?N$(e,_$(a,e)):M$(e,I$(a,e))}else{if(!He[y])return n?e:{};a=pL(e,y,o)}}r||(r=new qi);var b=r.get(e);if(b)return b;r.set(e,a),vL(e)?e.forEach(function(R){a.add(dl(R,t,i,R,e,r))}):yL(e)&&e.forEach(function(R,O){a.set(O,dl(R,t,i,O,e,r))});var E=d?u?k$:Bu:u?da:qu,$=f?void 0:E(e);return FV($||e,function(R,O){$&&(O=R,R=e[O]),ig(a,O,dl(R,t,i,O,e,r))}),a}var WL=1,zL=4;function Hn(e){return dl(e,WL|zL)}var KL="__lodash_hash_undefined__";function YL(e){return this.__data__.set(e,KL),this}function XL(e){return this.__data__.has(e)}function fl(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new sn;++t<i;)this.add(e[t])}fl.prototype.add=fl.prototype.push=YL,fl.prototype.has=XL;function ZL(e,t){for(var i=-1,s=e==null?0:e.length;++i<s;)if(t(e[i],i,e))return!0;return!1}function JL(e,t){return e.has(t)}var eM=1,tM=2;function Bg(e,t,i,s,n,r){var a=i&eM,o=e.length,u=t.length;if(o!=u&&!(a&&u>o))return!1;var d=r.get(e),f=r.get(t);if(d&&f)return d==t&&f==e;var y=-1,m=!0,b=i&tM?new fl:void 0;for(r.set(e,t),r.set(t,e);++y<o;){var E=e[y],$=t[y];if(s)var R=a?s($,E,y,t,e,r):s(E,$,y,e,t,r);if(R!==void 0){if(R)continue;m=!1;break}if(b){if(!ZL(t,function(O,N){if(!JL(b,N)&&(E===O||n(E,O,i,s,r)))return b.push(N)})){m=!1;break}}else if(!(E===$||n(E,$,i,s,r))){m=!1;break}}return r.delete(e),r.delete(t),m}function iM(e){var t=-1,i=Array(e.size);return e.forEach(function(s,n){i[++t]=[n,s]}),i}function sM(e){var t=-1,i=Array(e.size);return e.forEach(function(s){i[++t]=s}),i}var nM=1,rM=2,aM="[object Boolean]",oM="[object Date]",lM="[object Error]",cM="[object Map]",uM="[object Number]",hM="[object RegExp]",dM="[object Set]",fM="[object String]",pM="[object Symbol]",mM="[object ArrayBuffer]",gM="[object DataView]",Dg=Es?Es.prototype:void 0,Fu=Dg?Dg.valueOf:void 0;function yM(e,t,i,s,n,r,a){switch(i){case gM:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case mM:return!(e.byteLength!=t.byteLength||!r(new hl(e),new hl(t)));case aM:case oM:case uM:return la(+e,+t);case lM:return e.name==t.name&&e.message==t.message;case hM:case fM:return e==t+"";case cM:var o=iM;case dM:var u=s&nM;if(o||(o=sM),e.size!=t.size&&!u)return!1;var d=a.get(e);if(d)return d==t;s|=rM,a.set(e,t);var f=Bg(o(e),o(t),s,n,r,a);return a.delete(e),f;case pM:if(Fu)return Fu.call(e)==Fu.call(t)}return!1}var wM=1,bM=Object.prototype,vM=bM.hasOwnProperty;function EM(e,t,i,s,n,r){var a=i&wM,o=Bu(e),u=o.length,d=Bu(t),f=d.length;if(u!=f&&!a)return!1;for(var y=u;y--;){var m=o[y];if(!(a?m in t:vM.call(t,m)))return!1}var b=r.get(e),E=r.get(t);if(b&&E)return b==t&&E==e;var $=!0;r.set(e,t),r.set(t,e);for(var R=a;++y<u;){m=o[y];var O=e[m],N=t[m];if(s)var z=a?s(N,O,m,t,e,r):s(O,N,m,e,t,r);if(!(z===void 0?O===N||n(O,N,i,s,r):z)){$=!1;break}R||(R=m=="constructor")}if($&&!R){var V=e.constructor,Z=t.constructor;V!=Z&&"constructor"in e&&"constructor"in t&&!(typeof V=="function"&&V instanceof V&&typeof Z=="function"&&Z instanceof Z)&&($=!1)}return r.delete(e),r.delete(t),$}var CM=1,Qg="[object Arguments]",Hg="[object Array]",pl="[object Object]",TM=Object.prototype,Ug=TM.hasOwnProperty;function SM(e,t,i,s,n,r){var a=Zs(e),o=Zs(t),u=a?Hg:di(e),d=o?Hg:di(t);u=u==Qg?pl:u,d=d==Qg?pl:d;var f=u==pl,y=d==pl,m=u==d;if(m&&ua(e)){if(!ua(t))return!1;a=!0,f=!1}if(m&&!f)return r||(r=new qi),a||ku(e)?Bg(e,t,i,s,n,r):yM(e,t,u,i,s,n,r);if(!(i&CM)){var b=f&&Ug.call(e,"__wrapped__"),E=y&&Ug.call(t,"__wrapped__");if(b||E){var $=b?e.value():e,R=E?t.value():t;return r||(r=new qi),n($,R,i,s,r)}}return m?(r||(r=new qi),EM(e,t,i,s,n,r)):!1}function Fg(e,t,i,s,n){return e===t?!0:e==null||t==null||!ts(e)&&!ts(t)?e!==e&&t!==t:SM(e,t,i,s,Fg,n)}function xM(e){return function(t,i,s){for(var n=-1,r=Object(t),a=s(t),o=a.length;o--;){var u=a[++n];if(i(r[u],u,r)===!1)break}return t}}var IM=xM();function Gu(e,t,i){(i!==void 0&&!la(e[t],i)||i===void 0&&!(t in e))&&$u(e,t,i)}function _M(e){return ts(e)&&ll(e)}function ju(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function VM(e){return ca(e,da(e))}function AM(e,t,i,s,n,r,a){var o=ju(e,i),u=ju(t,i),d=a.get(u);if(d){Gu(e,i,d);return}var f=r?r(o,u,i+"",e,t,a):void 0,y=f===void 0;if(y){var m=Zs(u),b=!m&&ua(u),E=!m&&!b&&ku(u);f=u,m||b||E?Zs(o)?f=o:_M(o)?f=eg(o):b?(y=!1,f=vg(u,!0)):E?(y=!1,f=Mg(u,!0)):f=[]:b$(u)||Mu(u)?(f=o,Mu(o)?f=VM(o):(!Cs(o)||_u(o))&&(f=Rg(u))):y=!1}y&&(a.set(u,f),n(f,u,s,r,a),a.delete(u)),Gu(e,i,f)}function Gg(e,t,i,s,n){e!==t&&IM(t,function(r,a){if(n||(n=new qi),Cs(r))AM(e,t,a,i,Gg,s,n);else{var o=s?s(ju(e,a),r,a+"",e,t,n):void 0;o===void 0&&(o=r),Gu(e,a,o)}},da)}function Wu(e,t){return Fg(e,t)}var Ts=JV(function(e,t,i){Gg(e,t,i)}),he=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(he||{});class Oi{constructor(t,i,s={}){this.attrName=t,this.keyName=i;const n=he.TYPE&he.ATTRIBUTE;this.scope=s.scope!=null?s.scope&he.LEVEL|n:he.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}static keys(t){return Array.from(t.attributes).map(i=>i.name)}add(t,i){return this.canAdd(t,i)?(t.setAttribute(this.keyName,i),!0):!1}canAdd(t,i){return this.whitelist==null?!0:typeof i=="string"?this.whitelist.indexOf(i.replace(/["']/g,""))>-1:this.whitelist.indexOf(i)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const i=t.getAttribute(this.keyName);return this.canAdd(t,i)&&i?i:""}}class Un extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const jg=class of{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,i=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(i){let s=null;try{s=t.parentNode}catch{return null}return this.find(s,i)}return null}create(t,i,s){const n=this.query(i);if(n==null)throw new Un(`Unable to create ${i} blot`);const r=n,a=i instanceof Node||i.nodeType===Node.TEXT_NODE?i:r.create(s),o=new r(t,a,s);return of.blots.set(o.domNode,o),o}find(t,i=!1){return of.find(t,i)}query(t,i=he.ANY){let s;return typeof t=="string"?s=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?s=this.types.text:typeof t=="number"?t&he.LEVEL&he.BLOCK?s=this.types.block:t&he.LEVEL&he.INLINE&&(s=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(n=>(s=this.classes[n],!!s)),s=s||this.tags[t.tagName]),s==null?null:"scope"in s&&i&he.LEVEL&s.scope&&i&he.TYPE&s.scope?s:null}register(...t){return t.map(i=>{const s="blotName"in i,n="attrName"in i;if(!s&&!n)throw new Un("Invalid definition");if(s&&i.blotName==="abstract")throw new Un("Cannot register abstract class");const r=s?i.blotName:n?i.attrName:void 0;return this.types[r]=i,n?typeof i.keyName=="string"&&(this.attributes[i.keyName]=i):s&&(i.className&&(this.classes[i.className]=i),i.tagName&&(Array.isArray(i.tagName)?i.tagName=i.tagName.map(a=>a.toUpperCase()):i.tagName=i.tagName.toUpperCase(),(Array.isArray(i.tagName)?i.tagName:[i.tagName]).forEach(a=>{(this.tags[a]==null||i.className==null)&&(this.tags[a]=i)}))),i})}};jg.blots=new WeakMap;let Fn=jg;function Wg(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(i=>i.indexOf(`${t}-`)===0)}class $M extends Oi{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(i=>i.split("-").slice(0,-1).join("-"))}add(t,i){return this.canAdd(t,i)?(this.remove(t),t.classList.add(`${this.keyName}-${i}`),!0):!1}remove(t){Wg(t,this.keyName).forEach(i=>{t.classList.remove(i)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const i=(Wg(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,i)?i:""}}const fi=$M;function zu(e){const t=e.split("-"),i=t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return t[0]+i}class LM extends Oi{static keys(t){return(t.getAttribute("style")||"").split(";").map(i=>i.split(":")[0].trim())}add(t,i){return this.canAdd(t,i)?(t.style[zu(this.keyName)]=i,!0):!1}remove(t){t.style[zu(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const i=t.style[zu(this.keyName)];return this.canAdd(t,i)?i:""}}const Ss=LM;class MM{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,i){i?t.add(this.domNode,i)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Fn.find(this.domNode);if(t==null)return;const i=Oi.keys(this.domNode),s=fi.keys(this.domNode),n=Ss.keys(this.domNode);i.concat(s).concat(n).forEach(r=>{const a=t.scroll.query(r,he.ATTRIBUTE);a instanceof Oi&&(this.attributes[a.attrName]=a)})}copy(t){Object.keys(this.attributes).forEach(i=>{const s=this.attributes[i].value(this.domNode);t.format(i,s)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(i=>{this.attributes[i].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,i)=>(t[i]=this.attributes[i].value(this.domNode),t),{})}}const ml=MM,zg=class{constructor(t,i){this.scroll=t,this.domNode=i,Fn.blots.set(i,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new Un("Blot definition missing tagName");let i,s;return Array.isArray(this.tagName)?(typeof t=="string"?(s=t.toUpperCase(),parseInt(s,10).toString()===s&&(s=parseInt(s,10))):typeof t=="number"&&(s=t),typeof s=="number"?i=document.createElement(this.tagName[s-1]):s&&this.tagName.indexOf(s)>-1?i=document.createElement(s):i=document.createElement(this.tagName[0])):i=document.createElement(this.tagName),this.className&&i.classList.add(this.className),i}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),Fn.blots.delete(this.domNode)}deleteAt(t,i){this.isolate(t,i).remove()}formatAt(t,i,s,n){const r=this.isolate(t,i);if(this.scroll.query(s,he.BLOT)!=null&&n)r.wrap(s,n);else if(this.scroll.query(s,he.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);r.wrap(a),a.format(s,n)}}insertAt(t,i,s){const n=s==null?this.scroll.create("text",i):this.scroll.create(i,s),r=this.split(t);this.parent.insertBefore(n,r||void 0)}isolate(t,i){const s=this.split(t);if(s==null)throw new Error("Attempt to isolate at end");return s.split(i),s}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;return this.parent!=null&&(this.parent.insertBefore(s,this.next||void 0),this.remove()),s}split(t,i){return t===0?this:this.next}update(t,i){}wrap(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;if(this.parent!=null&&this.parent.insertBefore(s,this.next||void 0),typeof s.appendChild!="function")throw new Un(`Cannot wrap ${t}`);return s.appendChild(this),s}};zg.blotName="abstract";let Kg=zg;const Yg=class extends Kg{static value(t){return!0}index(t,i){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(i,1):-1}position(t,i){let s=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(s+=1),[this.parent.domNode,s]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Yg.scope=he.INLINE_BLOT;const ht=Yg;class RM{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const i=t.slice(1);this.append(...i)}}at(t){const i=this.iterator();let s=i();for(;s&&t>0;)t-=1,s=i();return s}contains(t){const i=this.iterator();let s=i();for(;s;){if(s===t)return!0;s=i()}return!1}indexOf(t){const i=this.iterator();let s=i(),n=0;for(;s;){if(s===t)return n;n+=1,s=i()}return-1}insertBefore(t,i){t!=null&&(this.remove(t),t.next=i,i!=null?(t.prev=i.prev,i.prev!=null&&(i.prev.next=t),i.prev=t,i===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let i=0,s=this.head;for(;s!=null;){if(s===t)return i;i+=s.length(),s=s.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const i=t;return t!=null&&(t=t.next),i}}find(t,i=!1){const s=this.iterator();let n=s();for(;n;){const r=n.length();if(t<r||i&&t===r&&(n.next==null||n.next.length()!==0))return[n,t];t-=r,n=s()}return[null,0]}forEach(t){const i=this.iterator();let s=i();for(;s;)t(s),s=i()}forEachAt(t,i,s){if(i<=0)return;const[n,r]=this.find(t);let a=t-r;const o=this.iterator(n);let u=o();for(;u&&a<t+i;){const d=u.length();t>a?s(u,t-a,Math.min(i,a+d-t)):s(u,0,Math.min(d,t+i-a)),a+=d,u=o()}}map(t){return this.reduce((i,s)=>(i.push(t(s)),i),[])}reduce(t,i){const s=this.iterator();let n=s();for(;n;)i=t(i,n),n=s();return i}}function Xg(e,t){const i=t.find(e);if(i)return i;try{return t.create(e)}catch{const s=t.create(he.INLINE);return Array.from(e.childNodes).forEach(n=>{s.domNode.appendChild(n)}),e.parentNode&&e.parentNode.replaceChild(s.domNode,e),s.attach(),s}}const Zg=class qs extends Kg{constructor(t,i){super(t,i),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,qs.uiClass&&this.uiNode.classList.add(qs.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new RM,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const i=Xg(t,this.scroll);this.insertBefore(i,this.children.head||void 0)}catch(i){if(i instanceof Un)return;throw i}})}deleteAt(t,i){if(t===0&&i===this.length())return this.remove();this.children.forEachAt(t,i,(s,n,r)=>{s.deleteAt(n,r)})}descendant(t,i=0){const[s,n]=this.children.find(i);return t.blotName==null&&t(s)||t.blotName!=null&&s instanceof t?[s,n]:s instanceof qs?s.descendant(t,n):[null,-1]}descendants(t,i=0,s=Number.MAX_VALUE){let n=[],r=s;return this.children.forEachAt(i,s,(a,o,u)=>{(t.blotName==null&&t(a)||t.blotName!=null&&a instanceof t)&&n.push(a),a instanceof qs&&(n=n.concat(a.descendants(t,o,r))),r-=u}),n}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(i=>{t||this.statics.allowedChildren.some(s=>i instanceof s)||(i.statics.scope===he.BLOCK_BLOT?(i.next!=null&&this.splitAfter(i),i.prev!=null&&this.splitAfter(i.prev),i.parent.unwrap(),t=!0):i instanceof qs?i.unwrap():i.remove())})}formatAt(t,i,s,n){this.children.forEachAt(t,i,(r,a,o)=>{r.formatAt(a,o,s,n)})}insertAt(t,i,s){const[n,r]=this.children.find(t);if(n)n.insertAt(r,i,s);else{const a=s==null?this.scroll.create("text",i):this.scroll.create(i,s);this.appendChild(a)}}insertBefore(t,i){t.parent!=null&&t.parent.children.remove(t);let s=null;this.children.insertBefore(t,i||null),t.parent=this,i!=null&&(s=i.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==s)&&this.domNode.insertBefore(t.domNode,s),t.attach()}length(){return this.children.reduce((t,i)=>t+i.length(),0)}moveChildren(t,i){this.children.forEach(s=>{t.insertBefore(s,i)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i)}else this.remove()}path(t,i=!1){const[s,n]=this.children.find(t,i),r=[[this,t]];return s instanceof qs?r.concat(s.path(n,i)):(s!=null&&r.push([s,n]),r)}removeChild(t){this.children.remove(t)}replaceWith(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;return s instanceof qs&&this.moveChildren(s),super.replaceWith(s)}split(t,i=!1){if(!i){if(t===0)return this;if(t===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(t,this.length(),(n,r,a)=>{const o=n.split(r,i);o!=null&&s.appendChild(o)}),s}splitAfter(t){const i=this.clone();for(;t.next!=null;)i.appendChild(t.next);return this.parent&&this.parent.insertBefore(i,this.next||void 0),i}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,i){const s=[],n=[];t.forEach(r=>{r.target===this.domNode&&r.type==="childList"&&(s.push(...r.addedNodes),n.push(...r.removedNodes))}),n.forEach(r=>{if(r.parentNode!=null&&r.tagName!=="IFRAME"&&document.body.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(r);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),s.filter(r=>r.parentNode===this.domNode&&r!==this.uiNode).sort((r,a)=>r===a?0:r.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(r=>{let a=null;r.nextSibling!=null&&(a=this.scroll.find(r.nextSibling));const o=Xg(r,this.scroll);(o.next!==a||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,a||void 0))}),this.enforceAllowedChildren()}};Zg.uiClass="";const pi=Zg;function NM(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}const Gn=class Ar extends pi{static create(t){return super.create(t)}static formats(t,i){const s=i.query(Ar.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,i){super(t,i),this.attributes=new ml(this.domNode)}format(t,i){if(t===this.statics.blotName&&!i)this.children.forEach(s=>{s instanceof Ar||(s=s.wrap(Ar.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(t,he.INLINE);if(s==null)return;s instanceof Oi?this.attributes.attribute(s,i):i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i)}}formats(){const t=this.attributes.values(),i=this.statics.formats(this.domNode,this.scroll);return i!=null&&(t[this.statics.blotName]=i),t}formatAt(t,i,s,n){this.formats()[s]!=null||this.scroll.query(s,he.ATTRIBUTE)?this.isolate(t,i).format(s,n):super.formatAt(t,i,s,n)}optimize(t){super.optimize(t);const i=this.formats();if(Object.keys(i).length===0)return this.unwrap();const s=this.next;s instanceof Ar&&s.prev===this&&NM(i,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,i){const s=super.replaceWith(t,i);return this.attributes.copy(s),s}update(t,i){super.update(t,i),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}wrap(t,i){const s=super.wrap(t,i);return s instanceof Ar&&this.attributes.move(s),s}};Gn.allowedChildren=[Gn,ht],Gn.blotName="inline",Gn.scope=he.INLINE_BLOT,Gn.tagName="SPAN";const Ku=Gn,jn=class lf extends pi{static create(t){return super.create(t)}static formats(t,i){const s=i.query(lf.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,i){super(t,i),this.attributes=new ml(this.domNode)}format(t,i){const s=this.scroll.query(t,he.BLOCK);s!=null&&(s instanceof Oi?this.attributes.attribute(s,i):t===this.statics.blotName&&!i?this.replaceWith(lf.blotName):i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i))}formats(){const t=this.attributes.values(),i=this.statics.formats(this.domNode,this.scroll);return i!=null&&(t[this.statics.blotName]=i),t}formatAt(t,i,s,n){this.scroll.query(s,he.BLOCK)!=null?this.format(s,n):super.formatAt(t,i,s,n)}insertAt(t,i,s){if(s==null||this.scroll.query(i,he.INLINE)!=null)super.insertAt(t,i,s);else{const n=this.split(t);if(n!=null){const r=this.scroll.create(i,s);n.parent.insertBefore(r,n)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,i){const s=super.replaceWith(t,i);return this.attributes.copy(s),s}update(t,i){super.update(t,i),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}};jn.blotName="block",jn.scope=he.BLOCK_BLOT,jn.tagName="P",jn.allowedChildren=[Ku,jn,ht];const ma=jn,Yu=class extends pi{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,i){super.deleteAt(t,i),this.enforceAllowedChildren()}formatAt(t,i,s,n){super.formatAt(t,i,s,n),this.enforceAllowedChildren()}insertAt(t,i,s){super.insertAt(t,i,s),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Yu.blotName="container",Yu.scope=he.BLOCK_BLOT;const gl=Yu;class kM extends ht{static formats(t,i){}format(t,i){super.formatAt(0,this.length(),t,i)}formatAt(t,i,s,n){t===0&&i===this.length()?this.format(s,n):super.formatAt(t,i,s,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Ht=kM,qM={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},OM=100,Wn=class extends pi{constructor(t,i){super(null,i),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(s=>{this.update(s)}),this.observer.observe(this.domNode,qM),this.attach()}create(t,i){return this.registry.create(this,t,i)}find(t,i=!1){const s=this.registry.find(t,i);return s?s.scroll===this?s:i?this.find(s.scroll.domNode.parentNode,!0):null:null}query(t,i=he.ANY){return this.registry.query(t,i)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,i){this.update(),t===0&&i===this.length()?this.children.forEach(s=>{s.remove()}):super.deleteAt(t,i)}formatAt(t,i,s,n){this.update(),super.formatAt(t,i,s,n)}insertAt(t,i,s){this.update(),super.insertAt(t,i,s)}optimize(t=[],i={}){super.optimize(i);const s=i.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const r=(u,d=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(s.has(u.domNode)||s.set(u.domNode,[]),d&&r(u.parent))},a=u=>{s.has(u.domNode)&&(u instanceof pi&&u.children.forEach(a),s.delete(u.domNode),u.optimize(i))};let o=t;for(let u=0;o.length>0;u+=1){if(u>=OM)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const f=this.find(d.target,!0);f!=null&&(f.domNode===d.target&&(d.type==="childList"?(r(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(y=>{const m=this.find(y,!1);r(m,!1),m instanceof pi&&m.children.forEach(b=>{r(b,!1)})})):d.type==="attributes"&&r(f.prev)),r(f))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),n=o.slice();n.length>0;)t.push(n.pop())}}update(t,i={}){t=t||this.observer.takeRecords();const s=new WeakMap;t.map(n=>{const r=this.find(n.target,!0);return r==null?null:s.has(r.domNode)?(s.get(r.domNode).push(n),null):(s.set(r.domNode,[n]),r)}).forEach(n=>{n!=null&&n!==this&&s.has(n.domNode)&&n.update(s.get(n.domNode)||[],i)}),i.mutationsMap=s,s.has(this.domNode)&&super.update(s.get(this.domNode),i),this.optimize(t,i)}};Wn.blotName="scroll",Wn.defaultChild=ma,Wn.allowedChildren=[ma,gl],Wn.scope=he.BLOCK_BLOT,Wn.tagName="DIV";const Xu=Wn,Zu=class qb extends ht{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,i){super(t,i),this.text=this.statics.value(this.domNode)}deleteAt(t,i){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+i)}index(t,i){return this.domNode===t?i:-1}insertAt(t,i,s){s==null?(this.text=this.text.slice(0,t)+i+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,i,s)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof qb&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,i=!1){return[this.domNode,t]}split(t,i=!1){if(!i){if(t===0)return this;if(t===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(t,i){t.some(s=>s.type==="characterData"&&s.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Zu.blotName="text",Zu.scope=he.INLINE_BLOT;const yl=Zu,PM=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Oi,AttributorStore:ml,BlockBlot:ma,ClassAttributor:fi,ContainerBlot:gl,EmbedBlot:Ht,InlineBlot:Ku,LeafBlot:ht,ParentBlot:pi,Registry:Fn,Scope:he,ScrollBlot:Xu,StyleAttributor:Ss,TextBlot:yl},Symbol.toStringTag,{value:"Module"}));var wl={exports:{}},Ju,Jg;function BM(){if(Jg)return Ju;Jg=1;var e=-1,t=1,i=0;function s(p,T,g,L,x){if(p===T)return p?[[i,p]]:[];if(g!=null){var S=C(p,T,g);if(S)return S}var _=o(p,T),A=p.substring(0,_);p=p.substring(_),T=T.substring(_),_=d(p,T);var q=p.substring(p.length-_);p=p.substring(0,p.length-_),T=T.substring(0,T.length-_);var H=n(p,T);return A&&H.unshift([i,A]),q&&H.push([i,q]),N(H,x),L&&y(H),H}function n(p,T){var g;if(!p)return[[t,T]];if(!T)return[[e,p]];var L=p.length>T.length?p:T,x=p.length>T.length?T:p,S=L.indexOf(x);if(S!==-1)return g=[[t,L.substring(0,S)],[i,x],[t,L.substring(S+x.length)]],p.length>T.length&&(g[0][0]=g[2][0]=e),g;if(x.length===1)return[[e,p],[t,T]];var _=f(p,T);if(_){var A=_[0],q=_[1],H=_[2],J=_[3],ee=_[4],ae=s(A,H),oe=s(q,J);return ae.concat([[i,ee]],oe)}return r(p,T)}function r(p,T){for(var g=p.length,L=T.length,x=Math.ceil((g+L)/2),S=x,_=2*x,A=new Array(_),q=new Array(_),H=0;H<_;H++)A[H]=-1,q[H]=-1;A[S+1]=0,q[S+1]=0;for(var J=g-L,ee=J%2!==0,ae=0,oe=0,P=0,Q=0,we=0;we<x;we++){for(var fe=-we+ae;fe<=we-oe;fe+=2){var _e=S+fe,Ce;fe===-we||fe!==we&&A[_e-1]<A[_e+1]?Ce=A[_e+1]:Ce=A[_e-1]+1;for(var be=Ce-fe;Ce<g&&be<L&&p.charAt(Ce)===T.charAt(be);)Ce++,be++;if(A[_e]=Ce,Ce>g)oe+=2;else if(be>L)ae+=2;else if(ee){var $e=S+J-fe;if($e>=0&&$e<_&&q[$e]!==-1){var ve=g-q[$e];if(Ce>=ve)return a(p,T,Ce,be)}}}for(var Ve=-we+P;Ve<=we-Q;Ve+=2){var $e=S+Ve,ve;Ve===-we||Ve!==we&&q[$e-1]<q[$e+1]?ve=q[$e+1]:ve=q[$e-1]+1;for(var Te=ve-Ve;ve<g&&Te<L&&p.charAt(g-ve-1)===T.charAt(L-Te-1);)ve++,Te++;if(q[$e]=ve,ve>g)Q+=2;else if(Te>L)P+=2;else if(!ee){var _e=S+J-Ve;if(_e>=0&&_e<_&&A[_e]!==-1){var Ce=A[_e],be=S+Ce-_e;if(ve=g-ve,Ce>=ve)return a(p,T,Ce,be)}}}}return[[e,p],[t,T]]}function a(p,T,g,L){var x=p.substring(0,g),S=T.substring(0,L),_=p.substring(g),A=T.substring(L),q=s(x,S),H=s(_,A);return q.concat(H)}function o(p,T){if(!p||!T||p.charAt(0)!==T.charAt(0))return 0;for(var g=0,L=Math.min(p.length,T.length),x=L,S=0;g<x;)p.substring(S,x)==T.substring(S,x)?(g=x,S=g):L=x,x=Math.floor((L-g)/2+g);return z(p.charCodeAt(x-1))&&x--,x}function u(p,T){var g=p.length,L=T.length;if(g==0||L==0)return 0;g>L?p=p.substring(g-L):g<L&&(T=T.substring(0,g));var x=Math.min(g,L);if(p==T)return x;for(var S=0,_=1;;){var A=p.substring(x-_),q=T.indexOf(A);if(q==-1)return S;_+=q,(q==0||p.substring(x-_)==T.substring(0,_))&&(S=_,_++)}}function d(p,T){if(!p||!T||p.slice(-1)!==T.slice(-1))return 0;for(var g=0,L=Math.min(p.length,T.length),x=L,S=0;g<x;)p.substring(p.length-x,p.length-S)==T.substring(T.length-x,T.length-S)?(g=x,S=g):L=x,x=Math.floor((L-g)/2+g);return V(p.charCodeAt(p.length-x))&&x--,x}function f(p,T){var g=p.length>T.length?p:T,L=p.length>T.length?T:p;if(g.length<4||L.length*2<g.length)return null;function x(oe,P,Q){for(var we=oe.substring(Q,Q+Math.floor(oe.length/4)),fe=-1,_e="",Ce,be,$e,ve;(fe=P.indexOf(we,fe+1))!==-1;){var Ve=o(oe.substring(Q),P.substring(fe)),Te=d(oe.substring(0,Q),P.substring(0,fe));_e.length<Te+Ve&&(_e=P.substring(fe-Te,fe)+P.substring(fe,fe+Ve),Ce=oe.substring(0,Q-Te),be=oe.substring(Q+Ve),$e=P.substring(0,fe-Te),ve=P.substring(fe+Ve))}return _e.length*2>=oe.length?[Ce,be,$e,ve,_e]:null}var S=x(g,L,Math.ceil(g.length/4)),_=x(g,L,Math.ceil(g.length/2)),A;if(!S&&!_)return null;_?S?A=S[4].length>_[4].length?S:_:A=_:A=S;var q,H,J,ee;p.length>T.length?(q=A[0],H=A[1],J=A[2],ee=A[3]):(J=A[0],ee=A[1],q=A[2],H=A[3]);var ae=A[4];return[q,H,J,ee,ae]}function y(p){for(var T=!1,g=[],L=0,x=null,S=0,_=0,A=0,q=0,H=0;S<p.length;)p[S][0]==i?(g[L++]=S,_=q,A=H,q=0,H=0,x=p[S][1]):(p[S][0]==t?q+=p[S][1].length:H+=p[S][1].length,x&&x.length<=Math.max(_,A)&&x.length<=Math.max(q,H)&&(p.splice(g[L-1],0,[e,x]),p[g[L-1]+1][0]=t,L--,L--,S=L>0?g[L-1]:-1,_=0,A=0,q=0,H=0,x=null,T=!0)),S++;for(T&&N(p),O(p),S=1;S<p.length;){if(p[S-1][0]==e&&p[S][0]==t){var J=p[S-1][1],ee=p[S][1],ae=u(J,ee),oe=u(ee,J);ae>=oe?(ae>=J.length/2||ae>=ee.length/2)&&(p.splice(S,0,[i,ee.substring(0,ae)]),p[S-1][1]=J.substring(0,J.length-ae),p[S+1][1]=ee.substring(ae),S++):(oe>=J.length/2||oe>=ee.length/2)&&(p.splice(S,0,[i,J.substring(0,oe)]),p[S-1][0]=t,p[S-1][1]=ee.substring(0,ee.length-oe),p[S+1][0]=e,p[S+1][1]=J.substring(oe),S++),S++}S++}}var m=/[^a-zA-Z0-9]/,b=/\s/,E=/[\r\n]/,$=/\n\r?\n$/,R=/^\r?\n\r?\n/;function O(p){function T(oe,P){if(!oe||!P)return 6;var Q=oe.charAt(oe.length-1),we=P.charAt(0),fe=Q.match(m),_e=we.match(m),Ce=fe&&Q.match(b),be=_e&&we.match(b),$e=Ce&&Q.match(E),ve=be&&we.match(E),Ve=$e&&oe.match($),Te=ve&&P.match(R);return Ve||Te?5:$e||ve?4:fe&&!Ce&&be?3:Ce||be?2:fe||_e?1:0}for(var g=1;g<p.length-1;){if(p[g-1][0]==i&&p[g+1][0]==i){var L=p[g-1][1],x=p[g][1],S=p[g+1][1],_=d(L,x);if(_){var A=x.substring(x.length-_);L=L.substring(0,L.length-_),x=A+x.substring(0,x.length-_),S=A+S}for(var q=L,H=x,J=S,ee=T(L,x)+T(x,S);x.charAt(0)===S.charAt(0);){L+=x.charAt(0),x=x.substring(1)+S.charAt(0),S=S.substring(1);var ae=T(L,x)+T(x,S);ae>=ee&&(ee=ae,q=L,H=x,J=S)}p[g-1][1]!=q&&(q?p[g-1][1]=q:(p.splice(g-1,1),g--),p[g][1]=H,J?p[g+1][1]=J:(p.splice(g+1,1),g--))}g++}}function N(p,T){p.push([i,""]);for(var g=0,L=0,x=0,S="",_="",A;g<p.length;){if(g<p.length-1&&!p[g][1]){p.splice(g,1);continue}switch(p[g][0]){case t:x++,_+=p[g][1],g++;break;case e:L++,S+=p[g][1],g++;break;case i:var q=g-x-L-1;if(T){if(q>=0&&K(p[q][1])){var H=p[q][1].slice(-1);if(p[q][1]=p[q][1].slice(0,-1),S=H+S,_=H+_,!p[q][1]){p.splice(q,1),g--;var J=q-1;p[J]&&p[J][0]===t&&(x++,_=p[J][1]+_,J--),p[J]&&p[J][0]===e&&(L++,S=p[J][1]+S,J--),q=J}}if(Z(p[g][1])){var H=p[g][1].charAt(0);p[g][1]=p[g][1].slice(1),S+=H,_+=H}}if(g<p.length-1&&!p[g][1]){p.splice(g,1);break}if(S.length>0||_.length>0){S.length>0&&_.length>0&&(A=o(_,S),A!==0&&(q>=0?p[q][1]+=_.substring(0,A):(p.splice(0,0,[i,_.substring(0,A)]),g++),_=_.substring(A),S=S.substring(A)),A=d(_,S),A!==0&&(p[g][1]=_.substring(_.length-A)+p[g][1],_=_.substring(0,_.length-A),S=S.substring(0,S.length-A)));var ee=x+L;S.length===0&&_.length===0?(p.splice(g-ee,ee),g=g-ee):S.length===0?(p.splice(g-ee,ee,[t,_]),g=g-ee+1):_.length===0?(p.splice(g-ee,ee,[e,S]),g=g-ee+1):(p.splice(g-ee,ee,[e,S],[t,_]),g=g-ee+2)}g!==0&&p[g-1][0]===i?(p[g-1][1]+=p[g][1],p.splice(g,1)):g++,x=0,L=0,S="",_="";break}}p[p.length-1][1]===""&&p.pop();var ae=!1;for(g=1;g<p.length-1;)p[g-1][0]===i&&p[g+1][0]===i&&(p[g][1].substring(p[g][1].length-p[g-1][1].length)===p[g-1][1]?(p[g][1]=p[g-1][1]+p[g][1].substring(0,p[g][1].length-p[g-1][1].length),p[g+1][1]=p[g-1][1]+p[g+1][1],p.splice(g-1,1),ae=!0):p[g][1].substring(0,p[g+1][1].length)==p[g+1][1]&&(p[g-1][1]+=p[g+1][1],p[g][1]=p[g][1].substring(p[g+1][1].length)+p[g+1][1],p.splice(g+1,1),ae=!0)),g++;ae&&N(p,T)}function z(p){return p>=55296&&p<=56319}function V(p){return p>=56320&&p<=57343}function Z(p){return V(p.charCodeAt(0))}function K(p){return z(p.charCodeAt(p.length-1))}function re(p){for(var T=[],g=0;g<p.length;g++)p[g][1].length>0&&T.push(p[g]);return T}function w(p,T,g,L){return K(p)||Z(L)?null:re([[i,p],[e,T],[t,g],[i,L]])}function C(p,T,g){var L=typeof g=="number"?{index:g,length:0}:g.oldRange,x=typeof g=="number"?null:g.newRange,S=p.length,_=T.length;if(L.length===0&&(x===null||x.length===0)){var A=L.index,q=p.slice(0,A),H=p.slice(A),J=x?x.index:null;e:{var ee=A+_-S;if(J!==null&&J!==ee||ee<0||ee>_)break e;var ae=T.slice(0,ee),oe=T.slice(ee);if(oe!==H)break e;var P=Math.min(A,ee),Q=q.slice(0,P),we=ae.slice(0,P);if(Q!==we)break e;var fe=q.slice(P),_e=ae.slice(P);return w(Q,fe,_e,H)}e:{if(J!==null&&J!==A)break e;var Ce=A,ae=T.slice(0,Ce),oe=T.slice(Ce);if(ae!==q)break e;var be=Math.min(S-Ce,_-Ce),$e=H.slice(H.length-be),ve=oe.slice(oe.length-be);if($e!==ve)break e;var fe=H.slice(0,H.length-be),_e=oe.slice(0,oe.length-be);return w(q,fe,_e,$e)}}if(L.length>0&&x&&x.length===0)e:{var Q=p.slice(0,L.index),$e=p.slice(L.index+L.length),P=Q.length,be=$e.length;if(_<P+be)break e;var we=T.slice(0,P),ve=T.slice(_-be);if(Q!==we||$e!==ve)break e;var fe=p.slice(P,S-be),_e=T.slice(P,_-be);return w(Q,fe,_e,$e)}return null}function I(p,T,g,L){return s(p,T,g,L,!0)}return I.INSERT=t,I.DELETE=e,I.EQUAL=i,Ju=I,Ju}var ga={exports:{}};ga.exports;var ey;function ty(){return ey||(ey=1,function(e,t){var i=200,s="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",y="[object GeneratorFunction]",m="[object Map]",b="[object Number]",E="[object Object]",$="[object Promise]",R="[object RegExp]",O="[object Set]",N="[object String]",z="[object Symbol]",V="[object WeakMap]",Z="[object ArrayBuffer]",K="[object DataView]",re="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",I="[object Int16Array]",p="[object Int32Array]",T="[object Uint8Array]",g="[object Uint8ClampedArray]",L="[object Uint16Array]",x="[object Uint32Array]",S=/[\\^$.*+?()[\]{}|]/g,_=/\w*$/,A=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,H={};H[r]=H[a]=H[Z]=H[K]=H[o]=H[u]=H[re]=H[w]=H[C]=H[I]=H[p]=H[m]=H[b]=H[E]=H[R]=H[O]=H[N]=H[z]=H[T]=H[g]=H[L]=H[x]=!0,H[d]=H[f]=H[V]=!1;var J=typeof bs=="object"&&bs&&bs.Object===Object&&bs,ee=typeof self=="object"&&self&&self.Object===Object&&self,ae=J||ee||Function("return this")(),oe=t&&!t.nodeType&&t,P=oe&&!0&&e&&!e.nodeType&&e,Q=P&&P.exports===oe;function we(h,v){return h.set(v[0],v[1]),h}function fe(h,v){return h.add(v),h}function _e(h,v){for(var k=-1,Y=h?h.length:0;++k<Y&&v(h[k],k,h)!==!1;);return h}function Ce(h,v){for(var k=-1,Y=v.length,xe=h.length;++k<Y;)h[xe+k]=v[k];return h}function be(h,v,k,Y){for(var xe=-1,de=h?h.length:0;++xe<de;)k=v(k,h[xe],xe,h);return k}function $e(h,v){for(var k=-1,Y=Array(h);++k<h;)Y[k]=v(k);return Y}function ve(h,v){return h==null?void 0:h[v]}function Ve(h){var v=!1;if(h!=null&&typeof h.toString!="function")try{v=!!(h+"")}catch{}return v}function Te(h){var v=-1,k=Array(h.size);return h.forEach(function(Y,xe){k[++v]=[xe,Y]}),k}function Ti(h,v){return function(k){return h(v(k))}}function Fi(h){var v=-1,k=Array(h.size);return h.forEach(function(Y){k[++v]=Y}),k}var Ms=Array.prototype,Rs=Function.prototype,pt=Object.prototype,Lt=ae["__core-js_shared__"],Gi=function(){var h=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),ri=Rs.toString,mt=pt.hasOwnProperty,Si=pt.toString,Ns=RegExp("^"+ri.call(mt).replace(S,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ai=Q?ae.Buffer:void 0,xi=ae.Symbol,bn=ae.Uint8Array,Mt=Ti(Object.getPrototypeOf,Object),Cr=Object.create,Tr=pt.propertyIsEnumerable,po=Ms.splice,W=Object.getOwnPropertySymbols,le=ai?ai.isBuffer:void 0,pe=Ti(Object.keys,Object),Le=_i(ae,"DataView"),Ae=_i(ae,"Map"),De=_i(ae,"Promise"),it=_i(ae,"Set"),oi=_i(ae,"WeakMap"),ji=_i(Object,"create"),jt=vt(Le),Ii=vt(Ae),Wi=vt(De),li=vt(it),vn=vt(oi),ci=xi?xi.prototype:void 0,hs=ci?ci.valueOf:void 0;function ds(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Td(){this.__data__=ji?ji(null):{}}function Sd(h){return this.has(h)&&delete this.__data__[h]}function xd(h){var v=this.__data__;if(ji){var k=v[h];return k===s?void 0:k}return mt.call(v,h)?v[h]:void 0}function cc(h){var v=this.__data__;return ji?v[h]!==void 0:mt.call(v,h)}function mo(h,v){var k=this.__data__;return k[h]=ji&&v===void 0?s:v,this}ds.prototype.clear=Td,ds.prototype.delete=Sd,ds.prototype.get=xd,ds.prototype.has=cc,ds.prototype.set=mo;function ot(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Id(){this.__data__=[]}function _d(h){var v=this.__data__,k=xr(v,h);if(k<0)return!1;var Y=v.length-1;return k==Y?v.pop():po.call(v,k,1),!0}function Vd(h){var v=this.__data__,k=xr(v,h);return k<0?void 0:v[k][1]}function Ad(h){return xr(this.__data__,h)>-1}function $d(h,v){var k=this.__data__,Y=xr(k,h);return Y<0?k.push([h,v]):k[Y][1]=v,this}ot.prototype.clear=Id,ot.prototype.delete=_d,ot.prototype.get=Vd,ot.prototype.has=Ad,ot.prototype.set=$d;function gt(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Ld(){this.__data__={hash:new ds,map:new(Ae||ot),string:new ds}}function Md(h){return Cn(this,h).delete(h)}function Rd(h){return Cn(this,h).get(h)}function Nd(h){return Cn(this,h).has(h)}function kd(h,v){return Cn(this,h).set(h,v),this}gt.prototype.clear=Ld,gt.prototype.delete=Md,gt.prototype.get=Rd,gt.prototype.has=Nd,gt.prototype.set=kd;function Rt(h){this.__data__=new ot(h)}function qd(){this.__data__=new ot}function Od(h){return this.__data__.delete(h)}function Pd(h){return this.__data__.get(h)}function Bd(h){return this.__data__.has(h)}function Dd(h,v){var k=this.__data__;if(k instanceof ot){var Y=k.__data__;if(!Ae||Y.length<i-1)return Y.push([h,v]),this;k=this.__data__=new gt(Y)}return k.set(h,v),this}Rt.prototype.clear=qd,Rt.prototype.delete=Od,Rt.prototype.get=Pd,Rt.prototype.has=Bd,Rt.prototype.set=Dd;function Sr(h,v){var k=bo(h)||_r(h)?$e(h.length,String):[],Y=k.length,xe=!!Y;for(var de in h)mt.call(h,de)&&!(xe&&(de=="length"||ef(de,Y)))&&k.push(de);return k}function uc(h,v,k){var Y=h[v];(!(mt.call(h,v)&&mc(Y,k))||k===void 0&&!(v in h))&&(h[v]=k)}function xr(h,v){for(var k=h.length;k--;)if(mc(h[k][0],v))return k;return-1}function zi(h,v){return h&&wo(v,Eo(v),h)}function go(h,v,k,Y,xe,de,ke){var Re;if(Y&&(Re=de?Y(h,xe,de,ke):Y(h)),Re!==void 0)return Re;if(!Yi(h))return h;var Je=bo(h);if(Je){if(Re=Zd(h),!v)return Kd(h,Re)}else{var Pe=ps(h),yt=Pe==f||Pe==y;if(gc(h))return Ir(h,v);if(Pe==E||Pe==r||yt&&!de){if(Ve(h))return de?h:{};if(Re=Ki(yt?{}:h),!v)return Yd(h,zi(Re,h))}else{if(!H[Pe])return de?h:{};Re=Jd(h,Pe,go,v)}}ke||(ke=new Rt);var Nt=ke.get(h);if(Nt)return Nt;if(ke.set(h,Re),!Je)var st=k?Xd(h):Eo(h);return _e(st||h,function(wt,lt){st&&(lt=wt,wt=h[lt]),uc(Re,lt,go(wt,v,k,Y,lt,h,ke))}),Re}function Qd(h){return Yi(h)?Cr(h):{}}function Hd(h,v,k){var Y=v(h);return bo(h)?Y:Ce(Y,k(h))}function Ud(h){return Si.call(h)}function Fd(h){if(!Yi(h)||sf(h))return!1;var v=vo(h)||Ve(h)?Ns:A;return v.test(vt(h))}function Gd(h){if(!fc(h))return pe(h);var v=[];for(var k in Object(h))mt.call(h,k)&&k!="constructor"&&v.push(k);return v}function Ir(h,v){if(v)return h.slice();var k=new h.constructor(h.length);return h.copy(k),k}function yo(h){var v=new h.constructor(h.byteLength);return new bn(v).set(new bn(h)),v}function En(h,v){var k=v?yo(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.byteLength)}function hc(h,v,k){var Y=v?k(Te(h),!0):Te(h);return be(Y,we,new h.constructor)}function dc(h){var v=new h.constructor(h.source,_.exec(h));return v.lastIndex=h.lastIndex,v}function jd(h,v,k){var Y=v?k(Fi(h),!0):Fi(h);return be(Y,fe,new h.constructor)}function Wd(h){return hs?Object(hs.call(h)):{}}function zd(h,v){var k=v?yo(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.length)}function Kd(h,v){var k=-1,Y=h.length;for(v||(v=Array(Y));++k<Y;)v[k]=h[k];return v}function wo(h,v,k,Y){k||(k={});for(var xe=-1,de=v.length;++xe<de;){var ke=v[xe],Re=void 0;uc(k,ke,Re===void 0?h[ke]:Re)}return k}function Yd(h,v){return wo(h,fs(h),v)}function Xd(h){return Hd(h,Eo,fs)}function Cn(h,v){var k=h.__data__;return tf(v)?k[typeof v=="string"?"string":"hash"]:k.map}function _i(h,v){var k=ve(h,v);return Fd(k)?k:void 0}var fs=W?Ti(W,Object):rf,ps=Ud;(Le&&ps(new Le(new ArrayBuffer(1)))!=K||Ae&&ps(new Ae)!=m||De&&ps(De.resolve())!=$||it&&ps(new it)!=O||oi&&ps(new oi)!=V)&&(ps=function(h){var v=Si.call(h),k=v==E?h.constructor:void 0,Y=k?vt(k):void 0;if(Y)switch(Y){case jt:return K;case Ii:return m;case Wi:return $;case li:return O;case vn:return V}return v});function Zd(h){var v=h.length,k=h.constructor(v);return v&&typeof h[0]=="string"&&mt.call(h,"index")&&(k.index=h.index,k.input=h.input),k}function Ki(h){return typeof h.constructor=="function"&&!fc(h)?Qd(Mt(h)):{}}function Jd(h,v,k,Y){var xe=h.constructor;switch(v){case Z:return yo(h);case o:case u:return new xe(+h);case K:return En(h,Y);case re:case w:case C:case I:case p:case T:case g:case L:case x:return zd(h,Y);case m:return hc(h,Y,k);case b:case N:return new xe(h);case R:return dc(h);case O:return jd(h,Y,k);case z:return Wd(h)}}function ef(h,v){return v=v??n,!!v&&(typeof h=="number"||q.test(h))&&h>-1&&h%1==0&&h<v}function tf(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function sf(h){return!!Gi&&Gi in h}function fc(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||pt;return h===k}function vt(h){if(h!=null){try{return ri.call(h)}catch{}try{return h+""}catch{}}return""}function pc(h){return go(h,!0,!0)}function mc(h,v){return h===v||h!==h&&v!==v}function _r(h){return nf(h)&&mt.call(h,"callee")&&(!Tr.call(h,"callee")||Si.call(h)==r)}var bo=Array.isArray;function Vr(h){return h!=null&&yc(h.length)&&!vo(h)}function nf(h){return wc(h)&&Vr(h)}var gc=le||af;function vo(h){var v=Yi(h)?Si.call(h):"";return v==f||v==y}function yc(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=n}function Yi(h){var v=typeof h;return!!h&&(v=="object"||v=="function")}function wc(h){return!!h&&typeof h=="object"}function Eo(h){return Vr(h)?Sr(h):Gd(h)}function rf(){return[]}function af(){return!1}e.exports=pc}(ga,ga.exports)),ga.exports}var ya={exports:{}};ya.exports;var iy;function sy(){return iy||(iy=1,function(e,t){var i=200,s="__lodash_hash_undefined__",n=1,r=2,a=9007199254740991,o="[object Arguments]",u="[object Array]",d="[object AsyncFunction]",f="[object Boolean]",y="[object Date]",m="[object Error]",b="[object Function]",E="[object GeneratorFunction]",$="[object Map]",R="[object Number]",O="[object Null]",N="[object Object]",z="[object Promise]",V="[object Proxy]",Z="[object RegExp]",K="[object Set]",re="[object String]",w="[object Symbol]",C="[object Undefined]",I="[object WeakMap]",p="[object ArrayBuffer]",T="[object DataView]",g="[object Float32Array]",L="[object Float64Array]",x="[object Int8Array]",S="[object Int16Array]",_="[object Int32Array]",A="[object Uint8Array]",q="[object Uint8ClampedArray]",H="[object Uint16Array]",J="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,P={};P[g]=P[L]=P[x]=P[S]=P[_]=P[A]=P[q]=P[H]=P[J]=!0,P[o]=P[u]=P[p]=P[f]=P[T]=P[y]=P[m]=P[b]=P[$]=P[R]=P[N]=P[Z]=P[K]=P[re]=P[I]=!1;var Q=typeof bs=="object"&&bs&&bs.Object===Object&&bs,we=typeof self=="object"&&self&&self.Object===Object&&self,fe=Q||we||Function("return this")(),_e=t&&!t.nodeType&&t,Ce=_e&&!0&&e&&!e.nodeType&&e,be=Ce&&Ce.exports===_e,$e=be&&Q.process,ve=function(){try{return $e&&$e.binding&&$e.binding("util")}catch{}}(),Ve=ve&&ve.isTypedArray;function Te(h,v){for(var k=-1,Y=h==null?0:h.length,xe=0,de=[];++k<Y;){var ke=h[k];v(ke,k,h)&&(de[xe++]=ke)}return de}function Ti(h,v){for(var k=-1,Y=v.length,xe=h.length;++k<Y;)h[xe+k]=v[k];return h}function Fi(h,v){for(var k=-1,Y=h==null?0:h.length;++k<Y;)if(v(h[k],k,h))return!0;return!1}function Ms(h,v){for(var k=-1,Y=Array(h);++k<h;)Y[k]=v(k);return Y}function Rs(h){return function(v){return h(v)}}function pt(h,v){return h.has(v)}function Lt(h,v){return h==null?void 0:h[v]}function Gi(h){var v=-1,k=Array(h.size);return h.forEach(function(Y,xe){k[++v]=[xe,Y]}),k}function ri(h,v){return function(k){return h(v(k))}}function mt(h){var v=-1,k=Array(h.size);return h.forEach(function(Y){k[++v]=Y}),k}var Si=Array.prototype,Ns=Function.prototype,ai=Object.prototype,xi=fe["__core-js_shared__"],bn=Ns.toString,Mt=ai.hasOwnProperty,Cr=function(){var h=/[^.]+$/.exec(xi&&xi.keys&&xi.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Tr=ai.toString,po=RegExp("^"+bn.call(Mt).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=be?fe.Buffer:void 0,le=fe.Symbol,pe=fe.Uint8Array,Le=ai.propertyIsEnumerable,Ae=Si.splice,De=le?le.toStringTag:void 0,it=Object.getOwnPropertySymbols,oi=W?W.isBuffer:void 0,ji=ri(Object.keys,Object),jt=fs(fe,"DataView"),Ii=fs(fe,"Map"),Wi=fs(fe,"Promise"),li=fs(fe,"Set"),vn=fs(fe,"WeakMap"),ci=fs(Object,"create"),hs=vt(jt),ds=vt(Ii),Td=vt(Wi),Sd=vt(li),xd=vt(vn),cc=le?le.prototype:void 0,mo=cc?cc.valueOf:void 0;function ot(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Id(){this.__data__=ci?ci(null):{},this.size=0}function _d(h){var v=this.has(h)&&delete this.__data__[h];return this.size-=v?1:0,v}function Vd(h){var v=this.__data__;if(ci){var k=v[h];return k===s?void 0:k}return Mt.call(v,h)?v[h]:void 0}function Ad(h){var v=this.__data__;return ci?v[h]!==void 0:Mt.call(v,h)}function $d(h,v){var k=this.__data__;return this.size+=this.has(h)?0:1,k[h]=ci&&v===void 0?s:v,this}ot.prototype.clear=Id,ot.prototype.delete=_d,ot.prototype.get=Vd,ot.prototype.has=Ad,ot.prototype.set=$d;function gt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Ld(){this.__data__=[],this.size=0}function Md(h){var v=this.__data__,k=Ir(v,h);if(k<0)return!1;var Y=v.length-1;return k==Y?v.pop():Ae.call(v,k,1),--this.size,!0}function Rd(h){var v=this.__data__,k=Ir(v,h);return k<0?void 0:v[k][1]}function Nd(h){return Ir(this.__data__,h)>-1}function kd(h,v){var k=this.__data__,Y=Ir(k,h);return Y<0?(++this.size,k.push([h,v])):k[Y][1]=v,this}gt.prototype.clear=Ld,gt.prototype.delete=Md,gt.prototype.get=Rd,gt.prototype.has=Nd,gt.prototype.set=kd;function Rt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function qd(){this.size=0,this.__data__={hash:new ot,map:new(Ii||gt),string:new ot}}function Od(h){var v=_i(this,h).delete(h);return this.size-=v?1:0,v}function Pd(h){return _i(this,h).get(h)}function Bd(h){return _i(this,h).has(h)}function Dd(h,v){var k=_i(this,h),Y=k.size;return k.set(h,v),this.size+=k.size==Y?0:1,this}Rt.prototype.clear=qd,Rt.prototype.delete=Od,Rt.prototype.get=Pd,Rt.prototype.has=Bd,Rt.prototype.set=Dd;function Sr(h){var v=-1,k=h==null?0:h.length;for(this.__data__=new Rt;++v<k;)this.add(h[v])}function uc(h){return this.__data__.set(h,s),this}function xr(h){return this.__data__.has(h)}Sr.prototype.add=Sr.prototype.push=uc,Sr.prototype.has=xr;function zi(h){var v=this.__data__=new gt(h);this.size=v.size}function go(){this.__data__=new gt,this.size=0}function Qd(h){var v=this.__data__,k=v.delete(h);return this.size=v.size,k}function Hd(h){return this.__data__.get(h)}function Ud(h){return this.__data__.has(h)}function Fd(h,v){var k=this.__data__;if(k instanceof gt){var Y=k.__data__;if(!Ii||Y.length<i-1)return Y.push([h,v]),this.size=++k.size,this;k=this.__data__=new Rt(Y)}return k.set(h,v),this.size=k.size,this}zi.prototype.clear=go,zi.prototype.delete=Qd,zi.prototype.get=Hd,zi.prototype.has=Ud,zi.prototype.set=Fd;function Gd(h,v){var k=_r(h),Y=!k&&mc(h),xe=!k&&!Y&&Vr(h),de=!k&&!Y&&!xe&&wc(h),ke=k||Y||xe||de,Re=ke?Ms(h.length,String):[],Je=Re.length;for(var Pe in h)Mt.call(h,Pe)&&!(ke&&(Pe=="length"||xe&&(Pe=="offset"||Pe=="parent")||de&&(Pe=="buffer"||Pe=="byteLength"||Pe=="byteOffset")||Jd(Pe,Je)))&&Re.push(Pe);return Re}function Ir(h,v){for(var k=h.length;k--;)if(pc(h[k][0],v))return k;return-1}function yo(h,v,k){var Y=v(h);return _r(h)?Y:Ti(Y,k(h))}function En(h){return h==null?h===void 0?C:O:De&&De in Object(h)?ps(h):fc(h)}function hc(h){return Yi(h)&&En(h)==o}function dc(h,v,k,Y,xe){return h===v?!0:h==null||v==null||!Yi(h)&&!Yi(v)?h!==h&&v!==v:jd(h,v,k,Y,dc,xe)}function jd(h,v,k,Y,xe,de){var ke=_r(h),Re=_r(v),Je=ke?u:Ki(h),Pe=Re?u:Ki(v);Je=Je==o?N:Je,Pe=Pe==o?N:Pe;var yt=Je==N,Nt=Pe==N,st=Je==Pe;if(st&&Vr(h)){if(!Vr(v))return!1;ke=!0,yt=!1}if(st&&!yt)return de||(de=new zi),ke||wc(h)?wo(h,v,k,Y,xe,de):Yd(h,v,Je,k,Y,xe,de);if(!(k&n)){var wt=yt&&Mt.call(h,"__wrapped__"),lt=Nt&&Mt.call(v,"__wrapped__");if(wt||lt){var ks=wt?h.value():h,ms=lt?v.value():v;return de||(de=new zi),xe(ks,ms,k,Y,de)}}return st?(de||(de=new zi),Xd(h,v,k,Y,xe,de)):!1}function Wd(h){if(!yc(h)||tf(h))return!1;var v=gc(h)?po:ae;return v.test(vt(h))}function zd(h){return Yi(h)&&vo(h.length)&&!!P[En(h)]}function Kd(h){if(!sf(h))return ji(h);var v=[];for(var k in Object(h))Mt.call(h,k)&&k!="constructor"&&v.push(k);return v}function wo(h,v,k,Y,xe,de){var ke=k&n,Re=h.length,Je=v.length;if(Re!=Je&&!(ke&&Je>Re))return!1;var Pe=de.get(h);if(Pe&&de.get(v))return Pe==v;var yt=-1,Nt=!0,st=k&r?new Sr:void 0;for(de.set(h,v),de.set(v,h);++yt<Re;){var wt=h[yt],lt=v[yt];if(Y)var ks=ke?Y(lt,wt,yt,v,h,de):Y(wt,lt,yt,h,v,de);if(ks!==void 0){if(ks)continue;Nt=!1;break}if(st){if(!Fi(v,function(ms,Tn){if(!pt(st,Tn)&&(wt===ms||xe(wt,ms,k,Y,de)))return st.push(Tn)})){Nt=!1;break}}else if(!(wt===lt||xe(wt,lt,k,Y,de))){Nt=!1;break}}return de.delete(h),de.delete(v),Nt}function Yd(h,v,k,Y,xe,de,ke){switch(k){case T:if(h.byteLength!=v.byteLength||h.byteOffset!=v.byteOffset)return!1;h=h.buffer,v=v.buffer;case p:return!(h.byteLength!=v.byteLength||!de(new pe(h),new pe(v)));case f:case y:case R:return pc(+h,+v);case m:return h.name==v.name&&h.message==v.message;case Z:case re:return h==v+"";case $:var Re=Gi;case K:var Je=Y&n;if(Re||(Re=mt),h.size!=v.size&&!Je)return!1;var Pe=ke.get(h);if(Pe)return Pe==v;Y|=r,ke.set(h,v);var yt=wo(Re(h),Re(v),Y,xe,de,ke);return ke.delete(h),yt;case w:if(mo)return mo.call(h)==mo.call(v)}return!1}function Xd(h,v,k,Y,xe,de){var ke=k&n,Re=Cn(h),Je=Re.length,Pe=Cn(v),yt=Pe.length;if(Je!=yt&&!ke)return!1;for(var Nt=Je;Nt--;){var st=Re[Nt];if(!(ke?st in v:Mt.call(v,st)))return!1}var wt=de.get(h);if(wt&&de.get(v))return wt==v;var lt=!0;de.set(h,v),de.set(v,h);for(var ks=ke;++Nt<Je;){st=Re[Nt];var ms=h[st],Tn=v[st];if(Y)var kb=ke?Y(Tn,ms,st,v,h,de):Y(ms,Tn,st,h,v,de);if(!(kb===void 0?ms===Tn||xe(ms,Tn,k,Y,de):kb)){lt=!1;break}ks||(ks=st=="constructor")}if(lt&&!ks){var bc=h.constructor,vc=v.constructor;bc!=vc&&"constructor"in h&&"constructor"in v&&!(typeof bc=="function"&&bc instanceof bc&&typeof vc=="function"&&vc instanceof vc)&&(lt=!1)}return de.delete(h),de.delete(v),lt}function Cn(h){return yo(h,Eo,Zd)}function _i(h,v){var k=h.__data__;return ef(v)?k[typeof v=="string"?"string":"hash"]:k.map}function fs(h,v){var k=Lt(h,v);return Wd(k)?k:void 0}function ps(h){var v=Mt.call(h,De),k=h[De];try{h[De]=void 0;var Y=!0}catch{}var xe=Tr.call(h);return Y&&(v?h[De]=k:delete h[De]),xe}var Zd=it?function(h){return h==null?[]:(h=Object(h),Te(it(h),function(v){return Le.call(h,v)}))}:rf,Ki=En;(jt&&Ki(new jt(new ArrayBuffer(1)))!=T||Ii&&Ki(new Ii)!=$||Wi&&Ki(Wi.resolve())!=z||li&&Ki(new li)!=K||vn&&Ki(new vn)!=I)&&(Ki=function(h){var v=En(h),k=v==N?h.constructor:void 0,Y=k?vt(k):"";if(Y)switch(Y){case hs:return T;case ds:return $;case Td:return z;case Sd:return K;case xd:return I}return v});function Jd(h,v){return v=v??a,!!v&&(typeof h=="number"||oe.test(h))&&h>-1&&h%1==0&&h<v}function ef(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function tf(h){return!!Cr&&Cr in h}function sf(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||ai;return h===k}function fc(h){return Tr.call(h)}function vt(h){if(h!=null){try{return bn.call(h)}catch{}try{return h+""}catch{}}return""}function pc(h,v){return h===v||h!==h&&v!==v}var mc=hc(function(){return arguments}())?hc:function(h){return Yi(h)&&Mt.call(h,"callee")&&!Le.call(h,"callee")},_r=Array.isArray;function bo(h){return h!=null&&vo(h.length)&&!gc(h)}var Vr=oi||af;function nf(h,v){return dc(h,v)}function gc(h){if(!yc(h))return!1;var v=En(h);return v==b||v==E||v==d||v==V}function vo(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=a}function yc(h){var v=typeof h;return h!=null&&(v=="object"||v=="function")}function Yi(h){return h!=null&&typeof h=="object"}var wc=Ve?Rs(Ve):zd;function Eo(h){return bo(h)?Gd(h):Kd(h)}function rf(){return[]}function af(){return!1}e.exports=nf}(ya,ya.exports)),ya.exports}var bl={},ny;function DM(){if(ny)return bl;ny=1,Object.defineProperty(bl,"__esModule",{value:!0});const e=ty(),t=sy();var i;return function(s){function n(u={},d={},f=!1){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});let y=e(d);f||(y=Object.keys(y).reduce((m,b)=>(y[b]!=null&&(m[b]=y[b]),m),{}));for(const m in u)u[m]!==void 0&&d[m]===void 0&&(y[m]=u[m]);return Object.keys(y).length>0?y:void 0}s.compose=n;function r(u={},d={}){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});const f=Object.keys(u).concat(Object.keys(d)).reduce((y,m)=>(t(u[m],d[m])||(y[m]=d[m]===void 0?null:d[m]),y),{});return Object.keys(f).length>0?f:void 0}s.diff=r;function a(u={},d={}){u=u||{};const f=Object.keys(d).reduce((y,m)=>(d[m]!==u[m]&&u[m]!==void 0&&(y[m]=d[m]),y),{});return Object.keys(u).reduce((y,m)=>(u[m]!==d[m]&&d[m]===void 0&&(y[m]=null),y),f)}s.invert=a;function o(u,d,f=!1){if(typeof u!="object")return d;if(typeof d!="object")return;if(!f)return d;const y=Object.keys(d).reduce((m,b)=>(u[b]===void 0&&(m[b]=d[b]),m),{});return Object.keys(y).length>0?y:void 0}s.transform=o}(i||(i={})),bl.default=i,bl}var vl={},ry;function ay(){if(ry)return vl;ry=1,Object.defineProperty(vl,"__esModule",{value:!0});var e;return function(t){function i(s){return typeof s.delete=="number"?s.delete:typeof s.retain=="number"?s.retain:typeof s.retain=="object"&&s.retain!==null?1:typeof s.insert=="string"?s.insert.length:1}t.length=i}(e||(e={})),vl.default=e,vl}var El={},oy;function QM(){if(oy)return El;oy=1,Object.defineProperty(El,"__esModule",{value:!0});const e=ay();class t{constructor(s){this.ops=s,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(s){s||(s=1/0);const n=this.ops[this.index];if(n){const r=this.offset,a=e.default.length(n);if(s>=a-r?(s=a-r,this.index+=1,this.offset=0):this.offset+=s,typeof n.delete=="number")return{delete:s};{const o={};return n.attributes&&(o.attributes=n.attributes),typeof n.retain=="number"?o.retain=s:typeof n.retain=="object"&&n.retain!==null?o.retain=n.retain:typeof n.insert=="string"?o.insert=n.insert.substr(r,s):o.insert=n.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?e.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const s=this.ops[this.index];return s?typeof s.delete=="number"?"delete":typeof s.retain=="number"||typeof s.retain=="object"&&s.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const s=this.offset,n=this.index,r=this.next(),a=this.ops.slice(this.index);return this.offset=s,this.index=n,[r].concat(a)}}else return[]}}return El.default=t,El}var ly;function HM(){return ly||(ly=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const i=BM(),s=ty(),n=sy(),r=DM();t.AttributeMap=r.default;const a=ay();t.Op=a.default;const o=QM();t.OpIterator=o.default;const u="\0",d=(y,m)=>{if(typeof y!="object"||y===null)throw new Error(`cannot retain a ${typeof y}`);if(typeof m!="object"||m===null)throw new Error(`cannot retain a ${typeof m}`);const b=Object.keys(y)[0];if(!b||b!==Object.keys(m)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(m)[0]}`);return[b,y[b],m[b]]};class f{constructor(m){Array.isArray(m)?this.ops=m:m!=null&&Array.isArray(m.ops)?this.ops=m.ops:this.ops=[]}static registerEmbed(m,b){this.handlers[m]=b}static unregisterEmbed(m){delete this.handlers[m]}static getHandler(m){const b=this.handlers[m];if(!b)throw new Error(`no handlers for embed type "${m}"`);return b}insert(m,b){const E={};return typeof m=="string"&&m.length===0?this:(E.insert=m,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(E.attributes=b),this.push(E))}delete(m){return m<=0?this:this.push({delete:m})}retain(m,b){if(typeof m=="number"&&m<=0)return this;const E={retain:m};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(E.attributes=b),this.push(E)}push(m){let b=this.ops.length,E=this.ops[b-1];if(m=s(m),typeof E=="object"){if(typeof m.delete=="number"&&typeof E.delete=="number")return this.ops[b-1]={delete:E.delete+m.delete},this;if(typeof E.delete=="number"&&m.insert!=null&&(b-=1,E=this.ops[b-1],typeof E!="object"))return this.ops.unshift(m),this;if(n(m.attributes,E.attributes)){if(typeof m.insert=="string"&&typeof E.insert=="string")return this.ops[b-1]={insert:E.insert+m.insert},typeof m.attributes=="object"&&(this.ops[b-1].attributes=m.attributes),this;if(typeof m.retain=="number"&&typeof E.retain=="number")return this.ops[b-1]={retain:E.retain+m.retain},typeof m.attributes=="object"&&(this.ops[b-1].attributes=m.attributes),this}}return b===this.ops.length?this.ops.push(m):this.ops.splice(b,0,m),this}chop(){const m=this.ops[this.ops.length-1];return m&&typeof m.retain=="number"&&!m.attributes&&this.ops.pop(),this}filter(m){return this.ops.filter(m)}forEach(m){this.ops.forEach(m)}map(m){return this.ops.map(m)}partition(m){const b=[],E=[];return this.forEach($=>{(m($)?b:E).push($)}),[b,E]}reduce(m,b){return this.ops.reduce(m,b)}changeLength(){return this.reduce((m,b)=>b.insert?m+a.default.length(b):b.delete?m-b.delete:m,0)}length(){return this.reduce((m,b)=>m+a.default.length(b),0)}slice(m=0,b=1/0){const E=[],$=new o.default(this.ops);let R=0;for(;R<b&&$.hasNext();){let O;R<m?O=$.next(m-R):(O=$.next(b-R),E.push(O)),R+=a.default.length(O)}return new f(E)}compose(m){const b=new o.default(this.ops),E=new o.default(m.ops),$=[],R=E.peek();if(R!=null&&typeof R.retain=="number"&&R.attributes==null){let N=R.retain;for(;b.peekType()==="insert"&&b.peekLength()<=N;)N-=b.peekLength(),$.push(b.next());R.retain-N>0&&E.next(R.retain-N)}const O=new f($);for(;b.hasNext()||E.hasNext();)if(E.peekType()==="insert")O.push(E.next());else if(b.peekType()==="delete")O.push(b.next());else{const N=Math.min(b.peekLength(),E.peekLength()),z=b.next(N),V=E.next(N);if(V.retain){const Z={};if(typeof z.retain=="number")Z.retain=typeof V.retain=="number"?N:V.retain;else if(typeof V.retain=="number")z.retain==null?Z.insert=z.insert:Z.retain=z.retain;else{const re=z.retain==null?"insert":"retain",[w,C,I]=d(z[re],V.retain),p=f.getHandler(w);Z[re]={[w]:p.compose(C,I,re==="retain")}}const K=r.default.compose(z.attributes,V.attributes,typeof z.retain=="number");if(K&&(Z.attributes=K),O.push(Z),!E.hasNext()&&n(O.ops[O.ops.length-1],Z)){const re=new f(b.rest());return O.concat(re).chop()}}else typeof V.delete=="number"&&(typeof z.retain=="number"||typeof z.retain=="object"&&z.retain!==null)&&O.push(V)}return O.chop()}concat(m){const b=new f(this.ops.slice());return m.ops.length>0&&(b.push(m.ops[0]),b.ops=b.ops.concat(m.ops.slice(1))),b}diff(m,b){if(this.ops===m.ops)return new f;const E=[this,m].map(z=>z.map(V=>{if(V.insert!=null)return typeof V.insert=="string"?V.insert:u;const Z=z===m?"on":"with";throw new Error("diff() called "+Z+" non-document")}).join("")),$=new f,R=i(E[0],E[1],b,!0),O=new o.default(this.ops),N=new o.default(m.ops);return R.forEach(z=>{let V=z[1].length;for(;V>0;){let Z=0;switch(z[0]){case i.INSERT:Z=Math.min(N.peekLength(),V),$.push(N.next(Z));break;case i.DELETE:Z=Math.min(V,O.peekLength()),O.next(Z),$.delete(Z);break;case i.EQUAL:Z=Math.min(O.peekLength(),N.peekLength(),V);const K=O.next(Z),re=N.next(Z);n(K.insert,re.insert)?$.retain(Z,r.default.diff(K.attributes,re.attributes)):$.push(re).delete(Z);break}V-=Z}}),$.chop()}eachLine(m,b=`
|
107
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var o=n.reduce(function(u,d){var f=d&&L_(d,s);return f&&u.push(f),u},[]);return sa(e)?o[0]:o}ra.defaultProps=Qt,ra.setDefaultProps=__,ra.currentInput=Ni,Object.assign({},um,{effect:function(t){var i=t.state,s={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,s.popper),i.styles=s,i.elements.arrow&&Object.assign(i.elements.arrow.style,s.arrow)}}),ra.setDefaultProps({render:jm});const M_={name:"Tooltip",props:{target:{required:!0,type:Function},message:{required:!1,type:String,default:""},colorStyle:{required:!1,type:String,default:""},placement:{required:!1,type:String,default:"top"}},computed:{tooltipStyle(){return this.colorStyle+" __tooltipMessage"}},data(){return{targetElement:null,tippy:null,zIndex:101}},methods:{hide(){this.tippy.hide()},show(){this.tippy.show()}},mounted(){this.targetElement=this.target(),this.tippy=ra(this.targetElement,{content:this.$refs.template.innerHTML,allowHTML:!0,trigger:"manual",theme:this.colorStyle,placement:this.placement,zIndex:101})},beforeDestroy(){this.tippy!==null&&this.tippy.destroy()}},R_={ref:"template",style:{display:"none"}};function N_(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",R_,[l.createElementVNode("span",{class:l.normalizeClass(r.tooltipStyle)},l.toDisplayString(i.message),3)],512)}const aa=D(M_,[["render",N_]]),k_=new F,q_={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br />")},handleInput(e){e.preventDefault();let t=!0;this.showCounter&&!this.applyLimitCheck(this.$refs.textarea.value)||(this.appliedRegex!==null?t=this.applyPatternMask(this.$refs.textarea.value):this.setResponse(this.$refs.textarea.value),t&&(this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})))},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)}},created(){this.appliedRegex=k_.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},O_={ref:"root"},P_={ref:"label",class:"ext-text-plain-default-label qti-hidden"},B_=["placeholder","disabled"],D_={key:0,"aria-hidden":"true",class:"ext-text-plain-counter"},Q_={key:0};function H_(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",O_,[l.createElementVNode("div",P_,null,512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-default"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=o=>n.response=o),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:"false",maxlength:"maxLength",onInput:t[1]||(t[1]=(...o)=>r.handleInput&&r.handleInput(...o))}),null,16,B_),[[l.vModelText,n.response]]),r.showCounter?(l.openBlock(),l.createElementBlock("div",D_,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Q_," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const U_=D(q_,[["render",H_]]),F_=new F,Wm=new ie,G_={name:"ExtendedTextPlainDefault",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:""},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"},dataSpellcheck:{required:!1,type:String},dataToolbarButtons:{required:!1,type:String}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},computeSpellcheck(){return typeof this.dataSpellcheck<"u"?this.dataSpellcheck:!1},showCopy(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("copy"):!1},showCut(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("cut"):!1},showPaste(){return this.isDisabled?!1:typeof this.dataToolbarButtons<"u"?this.dataToolbarButtons.includes("paste"):!1},disabled(){return this.isDisabled}},data(){return{response:"",priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,selectedText:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e){if(e===null){this.response="",this.updateCounter(0);return}this.response=e,this.updateCounter(Wm.computeWordCount(this.response))},getState(){return this.state},setState(e){this.state=e},setIsDisabled(e){this.isDisabled=e},handleInput(e){e.preventDefault();const t=this.$refs.textarea.value;this.isPassedConstraints(t)&&(this.setResponse(t),this.priorResponse=t,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()}))},isPassedConstraints(e){return!(this.showCounter&&!this.applyLimitCheck(e))},applyLimitCheck(e){return Wm.computeWordCount(e)>this.computedExpectedLength?(this.setResponse(this.priorResponse),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?!0:(this.showPatternMaskMessage(),this.setResponse(this.priorResponse),!1)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}},getLength(){return this.response.length},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},handleCopy(){this.selectedText=this.getSelectedText()},handleCut(){this.selectedText=this.getSelectedText(),this.insertText("")},handlePaste(){this.insertText(this.selectedText)},getSelectedText(){const e=this.$refs.textarea;if(typeof e.selectionStart=="number"){const t=e.value.slice(e.selectionStart,e.selectionEnd);return e.focus(),e.setSelectionRange(e.selectionStart,e.selectionEnd),t}return""},insertText(e){this.insertTextAtCursor(e),this.setResponse(this.$refs.textarea.value),this.priorResponse=this.$refs.textarea.value,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse()})},insertTextAtCursor(e){const t=this.$refs.textarea;if(t.selectionStart||t.selectionStart===0){const s=t.selectionStart,n=t.selectionEnd,r=t.scrollTop,a=t.value.substring(0,s)+e+t.value.substring(n,t.value.length);if(!this.isPassedConstraints(a))return;t.value=a,t.focus(),t.selectionStart=s+e.length,t.selectionEnd=s+e.length,t.scrollTop=r;return}const i=t.value+e;this.isPassedConstraints(i)&&(t.value=i,t.focus())}},created(){this.appliedRegex=F_.validatePattern("pattern-mask",this.patternMask)},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},j_={ref:"root"},W_={ref:"toolbar",class:"ext-text-toolbar"},z_={key:0,"aria-hidden":"true",class:"toolbar-right"},K_={class:"ext-text-toolbar-counter"},Y_={key:0},X_={class:"toolbar-left"},Z_=["placeholder","disabled","spellcheck"];function J_(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",j_,[l.createElementVNode("div",W_,[r.showCounter?(l.openBlock(),l.createElementBlock("div",z_,[l.createElementVNode("span",K_,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",Y_," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0),t[5]||(t[5]=l.createTextVNode(" Word(s) "))])])):l.createCommentVNode("",!0),l.createElementVNode("span",X_,[r.showCopy?(l.openBlock(),l.createElementBlock("button",{key:0,onClick:t[0]||(t[0]=l.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"])),type:"button",class:"btn-copy",unselectable:"on"},"Copy")):l.createCommentVNode("",!0),r.showCut?(l.openBlock(),l.createElementBlock("button",{key:1,onClick:t[1]||(t[1]=l.withModifiers((...o)=>r.handleCut&&r.handleCut(...o),["prevent"])),type:"button",class:"btn-cut",unselectable:"on"},"Cut")):l.createCommentVNode("",!0),r.showPaste?(l.openBlock(),l.createElementBlock("button",{key:2,onClick:t[2]||(t[2]=l.withModifiers((...o)=>r.handlePaste&&r.handlePaste(...o),["prevent"])),type:"button",class:"btn-paste",unselectable:"on"},"Paste")):l.createCommentVNode("",!0)])],512),l.withDirectives(l.createElementVNode("textarea",l.mergeProps({ref:"textarea",class:"ext-text-plain-lrn"},e.$attrs,{"onUpdate:modelValue":t[3]||(t[3]=o=>n.response=o),placeholder:i.placeholder,disabled:r.disabled,autocapitalize:"none",spellcheck:r.computeSpellcheck,maxlength:"maxLength",onInput:t[4]||(t[4]=(...o)=>r.handleInput&&r.handleInput(...o))}),null,16,Z_),[[l.vModelText,n.response]]),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:0,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle},null,8,["target","message","color-style"])):l.createCommentVNode("",!0)],512)}const eV=D(G_,[["render",J_]]),tV=new F,iV={name:"ExtendedTextPlainVerticalRl",emits:["extendedTextReady","extendedTextUpdate"],components:{Tooltip:aa},props:{responseIdentifier:{required:!0,type:String},expectedLength:{required:!1,type:String},placeholder:{required:!1,type:String,default:"foo"},patternMask:{required:!1,type:String},patternMaskMessage:{required:!1,type:String,default:"Invalid Input"},counterStyle:{required:!1,type:String,default:"none"}},computed:{computedExpectedLength(){return typeof this.expectedLength<"u"?this.expectedLength*1:400},hasPatternMask(){return typeof this.patternMask<"u"},colorStyle(){return M.getItemContextPnp().getColorStyle()},maxLength(){return 1e4},showCounter(){return this.counterStyle==="up"||this.counterStyle==="down"},isCounterUp(){return this.counterStyle==="up"},tooltipPlacement(){return"right"},disabled(){return this.isDisabled}},data(){return{response:"",state:null,priorResponse:"",appliedRegex:null,displayMessage:!1,counter:0,caretIndex:0,maxlengthMessage:"",isDisabled:!1}},inheritAttrs:!1,methods:{getResponse(){return this.response},setResponse(e,t=!1){e===null&&(e=""),this.response=e,t&&this.updateContent(this.response),this.updateCounter(this.response.length)},updateResponse(e){this.response=e,this.updateCounter(this.response.length)},getState(){return this.state},setState(e){this.state=e},computeState(e){return{html:e}},setIsDisabled(e){this.isDisabled=e,e?(this.$refs.label.innerHTML=this.replaceNewLines(this.getResponse()),this.$refs.label.classList.remove("qti-hidden"),this.$refs.label.setAttribute("tabIndex",0),this.$refs.textarea.classList.add("qti-hidden")):(this.$refs.label.classList.add("qti-hidden"),this.$refs.label.setAttribute("tabIndex",-1),this.$refs.textarea.classList.remove("qti-hidden"))},replaceNewLines(e){return e===null?"":e.replace(/\r\n|\r|\n/g,"<br>")},getContent(){return this.getTextContent(this.$refs.textarea.childNodes)},updateContent(e){this.$refs.textarea.innerHTML=e},getTextContent(e){let t,i="",s=0,n=e.nodeType;if(!n)for(;t=e[s++];)i+=this.getTextContent(t);return n===1||n===11?e.textContent:n===9?e.documentElement.textContent:n===3||n===4?e.nodeValue:i},getCaretIndex(){return this.caretIndex},setCaretIndex(e){this.caretIndex=e},handleInput(e){e.preventDefault();let t=!0;this.setCaretIndex(this.getCaretPos(this.$refs.textarea)-1);let i=this.getContent();this.showCounter&&!this.applyLimitCheck(i)||this.appliedRegex!==null&&(t=this.applyPatternMask(i),!t)||((i.length==0||i.length==1&&i.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),i=""),this.setResponse(i),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=i,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handlePaste(e){e.preventDefault();let t=!0,i=e.clipboardData.getData("text/plain");const s=document.getSelection().getRangeAt(0);s.deleteContents();const n=document.createTextNode(i);s.insertNode(n),s.selectNodeContents(n),s.collapse(!1);const r=window.getSelection();r.removeAllRanges(),r.addRange(s);let a=this.getContent();this.showCounter&&!this.applyLimitCheck(a)||this.appliedRegex!==null&&(t=this.applyPatternMask(a),!t)||((a.length==0||a.length==1&&a.charCodeAt(0)==10)&&(this.empty(),this.updateCounter(0),a=""),this.setResponse(a),this.setState(this.computeState(this.replaceNewLines(this.$refs.textarea.innerHTML))),this.priorResponse=a,this.$parent.$emit("extendedTextUpdate",{response:this.getResponse(),state:this.getState()}))},handleDrop(e){e.preventDefault()},handleKeydown(e){switch(this.setCaretIndex(this.getCaretPos(this.$refs.textarea)),e.code){case"KeyI":case"KeyB":case"KeyU":e.ctrlKey&&e.preventDefault();return}},getRange(){const e=document.getSelection();return e.rangeCount===0?null:e.getRangeAt(0)},getCaretPos(e){let t=0;if(typeof window.getSelection<"u"&&window.getSelection().rangeCount!==0){const n=window.getSelection().getRangeAt(0),r=n.cloneRange();r.selectNodeContents(e),r.setEnd(n.endContainer,n.endOffset),t=r.toString().length}return t},setCaretPos(e,t){e.focus(),e.childNodes.length===1&&document.getSelection().collapse(e.childNodes[0],t)},getLength(){return this.response.length},empty(){this.$refs.textarea.textContent=""},applyLimitCheck(e){return e.length>this.computedExpectedLength?(this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1):!0},applyPatternMask(e){return this.appliedRegex.test(e)?(this.setResponse(e),this.priorResponse=e,!0):(this.showPatternMaskMessage(),this.setResponse(this.priorResponse,!0),this.setCaretPos(this.$refs.textarea,this.getCaretIndex()),!1)},showPatternMaskMessage(){this.$refs.tooltip.show(),this.hidePatternMaskMessage()},hidePatternMaskMessage(e=3e3){setTimeout(()=>{this.$refs.tooltip.hide()},e)},updateCounter(e){if(this.showCounter){if(this.isCounterUp){this.counter=e;return}this.counter=this.computedExpectedLength-e}}},created(){this.appliedRegex=tV.validatePattern("pattern-mask",this.patternMask),this.setState(this.computeState(""))},mounted(){this.$parent.$emit("extendedTextReady",{node:this})}},sV={ref:"root"},nV={ref:"label",class:"ext-text-default-vert-rl-label qti-hidden"},rV=["maxlength","data-placeholder"],aV={key:0,"aria-hidden":"true",class:"ext-text-default-vert-rl-counter"},oV={key:0};function lV(e,t,i,s,n,r){const a=l.resolveComponent("tooltip");return l.openBlock(),l.createElementBlock("div",sV,[l.createElementVNode("div",nV,null,512),l.createElementVNode("div",l.mergeProps({ref:"textarea",class:"ext-text-default-vert-rl"},e.$attrs,{tabindex:"0",contenteditable:"true",autocapitalize:"false",spellcheck:"false",maxlength:r.maxLength,"data-placeholder":i.placeholder,onInput:t[0]||(t[0]=(...o)=>r.handleInput&&r.handleInput(...o)),onKeydown:t[1]||(t[1]=(...o)=>r.handleKeydown&&r.handleKeydown(...o)),onPaste:t[2]||(t[2]=(...o)=>r.handlePaste&&r.handlePaste(...o)),onDrop:t[3]||(t[3]=(...o)=>r.handleDrop&&r.handleDrop(...o))}),null,16,rV),r.showCounter?(l.openBlock(),l.createElementBlock("div",aV,[l.createTextVNode(l.toDisplayString(n.counter),1),r.isCounterUp?(l.openBlock(),l.createElementBlock("span",oV," / "+l.toDisplayString(i.expectedLength),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),r.hasPatternMask?(l.openBlock(),l.createBlock(a,{key:1,ref:"tooltip",target:()=>e.$refs.textarea,message:i.patternMaskMessage,"color-style":r.colorStyle,placement:r.tooltipPlacement},null,8,["target","message","color-style","placement"])):l.createCommentVNode("",!0)],512)}const cV=D(iV,[["render",lV]]);var zm=typeof global=="object"&&global&&global.Object===Object&&global,uV=typeof self=="object"&&self&&self.Object===Object&&self,ki=zm||uV||Function("return this")(),Es=ki.Symbol,Km=Object.prototype,hV=Km.hasOwnProperty,dV=Km.toString,oa=Es?Es.toStringTag:void 0;function fV(e){var t=hV.call(e,oa),i=e[oa];try{e[oa]=void 0;var s=!0}catch{}var n=dV.call(e);return s&&(t?e[oa]=i:delete e[oa]),n}var pV=Object.prototype,mV=pV.toString;function gV(e){return mV.call(e)}var yV="[object Null]",wV="[object Undefined]",Ym=Es?Es.toStringTag:void 0;function Dn(e){return e==null?e===void 0?wV:yV:Ym&&Ym in Object(e)?fV(e):gV(e)}function ts(e){return e!=null&&typeof e=="object"}var Zs=Array.isArray;function Cs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Xm(e){return e}var bV="[object AsyncFunction]",vV="[object Function]",EV="[object GeneratorFunction]",CV="[object Proxy]";function _u(e){if(!Cs(e))return!1;var t=Dn(e);return t==vV||t==EV||t==bV||t==CV}var Vu=ki["__core-js_shared__"],Zm=function(){var e=/[^.]+$/.exec(Vu&&Vu.keys&&Vu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function TV(e){return!!Zm&&Zm in e}var SV=Function.prototype,xV=SV.toString;function Js(e){if(e!=null){try{return xV.call(e)}catch{}try{return e+""}catch{}}return""}var IV=/[\\^$.*+?()[\]{}|]/g,_V=/^\[object .+?Constructor\]$/,VV=Function.prototype,AV=Object.prototype,$V=VV.toString,LV=AV.hasOwnProperty,MV=RegExp("^"+$V.call(LV).replace(IV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RV(e){if(!Cs(e)||TV(e))return!1;var t=_u(e)?MV:_V;return t.test(Js(e))}function NV(e,t){return e==null?void 0:e[t]}function en(e,t){var i=NV(e,t);return RV(i)?i:void 0}var Au=en(ki,"WeakMap"),Jm=Object.create,kV=function(){function e(){}return function(t){if(!Cs(t))return{};if(Jm)return Jm(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function qV(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function eg(e,t){var i=-1,s=e.length;for(t||(t=Array(s));++i<s;)t[i]=e[i];return t}var OV=800,PV=16,BV=Date.now;function DV(e){var t=0,i=0;return function(){var s=BV(),n=PV-(s-i);if(i=s,n>0){if(++t>=OV)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function QV(e){return function(){return e}}var ol=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),HV=ol?function(e,t){return ol(e,"toString",{configurable:!0,enumerable:!1,value:QV(t),writable:!0})}:Xm,UV=DV(HV);function FV(e,t){for(var i=-1,s=e==null?0:e.length;++i<s&&t(e[i],i,e)!==!1;);return e}var GV=9007199254740991,jV=/^(?:0|[1-9]\d*)$/;function tg(e,t){var i=typeof e;return t=t??GV,!!t&&(i=="number"||i!="symbol"&&jV.test(e))&&e>-1&&e%1==0&&e<t}function $u(e,t,i){t=="__proto__"&&ol?ol(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function la(e,t){return e===t||e!==e&&t!==t}var WV=Object.prototype,zV=WV.hasOwnProperty;function ig(e,t,i){var s=e[t];(!(zV.call(e,t)&&la(s,i))||i===void 0&&!(t in e))&&$u(e,t,i)}function ca(e,t,i,s){var n=!i;i||(i={});for(var r=-1,a=t.length;++r<a;){var o=t[r],u=void 0;u===void 0&&(u=e[o]),n?$u(i,o,u):ig(i,o,u)}return i}var sg=Math.max;function KV(e,t,i){return t=sg(t===void 0?e.length-1:t,0),function(){for(var s=arguments,n=-1,r=sg(s.length-t,0),a=Array(r);++n<r;)a[n]=s[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=s[n];return o[t]=i(a),qV(e,this,o)}}function YV(e,t){return UV(KV(e,t,Xm),e+"")}var XV=9007199254740991;function ng(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XV}function ll(e){return e!=null&&ng(e.length)&&!_u(e)}function ZV(e,t,i){if(!Cs(i))return!1;var s=typeof t;return(s=="number"?ll(i)&&tg(t,i.length):s=="string"&&t in i)?la(i[t],e):!1}function JV(e){return YV(function(t,i){var s=-1,n=i.length,r=n>1?i[n-1]:void 0,a=n>2?i[2]:void 0;for(r=e.length>3&&typeof r=="function"?(n--,r):void 0,a&&ZV(i[0],i[1],a)&&(r=n<3?void 0:r,n=1),t=Object(t);++s<n;){var o=i[s];o&&e(t,o,s,r)}return t})}var eA=Object.prototype;function Lu(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||eA;return e===i}function tA(e,t){for(var i=-1,s=Array(e);++i<e;)s[i]=t(i);return s}var iA="[object Arguments]";function rg(e){return ts(e)&&Dn(e)==iA}var ag=Object.prototype,sA=ag.hasOwnProperty,nA=ag.propertyIsEnumerable,Mu=rg(function(){return arguments}())?rg:function(e){return ts(e)&&sA.call(e,"callee")&&!nA.call(e,"callee")};function rA(){return!1}var og=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lg=og&&typeof module=="object"&&module&&!module.nodeType&&module,aA=lg&&lg.exports===og,cg=aA?ki.Buffer:void 0,oA=cg?cg.isBuffer:void 0,ua=oA||rA,lA="[object Arguments]",cA="[object Array]",uA="[object Boolean]",hA="[object Date]",dA="[object Error]",fA="[object Function]",pA="[object Map]",mA="[object Number]",gA="[object Object]",yA="[object RegExp]",wA="[object Set]",bA="[object String]",vA="[object WeakMap]",EA="[object ArrayBuffer]",CA="[object DataView]",TA="[object Float32Array]",SA="[object Float64Array]",xA="[object Int8Array]",IA="[object Int16Array]",_A="[object Int32Array]",VA="[object Uint8Array]",AA="[object Uint8ClampedArray]",$A="[object Uint16Array]",LA="[object Uint32Array]",Ue={};Ue[TA]=Ue[SA]=Ue[xA]=Ue[IA]=Ue[_A]=Ue[VA]=Ue[AA]=Ue[$A]=Ue[LA]=!0,Ue[lA]=Ue[cA]=Ue[EA]=Ue[uA]=Ue[CA]=Ue[hA]=Ue[dA]=Ue[fA]=Ue[pA]=Ue[mA]=Ue[gA]=Ue[yA]=Ue[wA]=Ue[bA]=Ue[vA]=!1;function MA(e){return ts(e)&&ng(e.length)&&!!Ue[Dn(e)]}function Ru(e){return function(t){return e(t)}}var ug=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ha=ug&&typeof module=="object"&&module&&!module.nodeType&&module,RA=ha&&ha.exports===ug,Nu=RA&&zm.process,Qn=function(){try{var e=ha&&ha.require&&ha.require("util").types;return e||Nu&&Nu.binding&&Nu.binding("util")}catch{}}(),hg=Qn&&Qn.isTypedArray,ku=hg?Ru(hg):MA,NA=Object.prototype,kA=NA.hasOwnProperty;function dg(e,t){var i=Zs(e),s=!i&&Mu(e),n=!i&&!s&&ua(e),r=!i&&!s&&!n&&ku(e),a=i||s||n||r,o=a?tA(e.length,String):[],u=o.length;for(var d in e)(t||kA.call(e,d))&&!(a&&(d=="length"||n&&(d=="offset"||d=="parent")||r&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||tg(d,u)))&&o.push(d);return o}function fg(e,t){return function(i){return e(t(i))}}var qA=fg(Object.keys,Object),OA=Object.prototype,PA=OA.hasOwnProperty;function BA(e){if(!Lu(e))return qA(e);var t=[];for(var i in Object(e))PA.call(e,i)&&i!="constructor"&&t.push(i);return t}function qu(e){return ll(e)?dg(e):BA(e)}function DA(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}var QA=Object.prototype,HA=QA.hasOwnProperty;function UA(e){if(!Cs(e))return DA(e);var t=Lu(e),i=[];for(var s in e)s=="constructor"&&(t||!HA.call(e,s))||i.push(s);return i}function da(e){return ll(e)?dg(e,!0):UA(e)}var fa=en(Object,"create");function FA(){this.__data__=fa?fa(null):{},this.size=0}function GA(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var jA="__lodash_hash_undefined__",WA=Object.prototype,zA=WA.hasOwnProperty;function KA(e){var t=this.__data__;if(fa){var i=t[e];return i===jA?void 0:i}return zA.call(t,e)?t[e]:void 0}var YA=Object.prototype,XA=YA.hasOwnProperty;function ZA(e){var t=this.__data__;return fa?t[e]!==void 0:XA.call(t,e)}var JA="__lodash_hash_undefined__";function e$(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=fa&&t===void 0?JA:t,this}function tn(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}tn.prototype.clear=FA,tn.prototype.delete=GA,tn.prototype.get=KA,tn.prototype.has=ZA,tn.prototype.set=e$;function t$(){this.__data__=[],this.size=0}function cl(e,t){for(var i=e.length;i--;)if(la(e[i][0],t))return i;return-1}var i$=Array.prototype,s$=i$.splice;function n$(e){var t=this.__data__,i=cl(t,e);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():s$.call(t,i,1),--this.size,!0}function r$(e){var t=this.__data__,i=cl(t,e);return i<0?void 0:t[i][1]}function a$(e){return cl(this.__data__,e)>-1}function o$(e,t){var i=this.__data__,s=cl(i,e);return s<0?(++this.size,i.push([e,t])):i[s][1]=t,this}function is(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}is.prototype.clear=t$,is.prototype.delete=n$,is.prototype.get=r$,is.prototype.has=a$,is.prototype.set=o$;var pa=en(ki,"Map");function l$(){this.size=0,this.__data__={hash:new tn,map:new(pa||is),string:new tn}}function c$(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ul(e,t){var i=e.__data__;return c$(t)?i[typeof t=="string"?"string":"hash"]:i.map}function u$(e){var t=ul(this,e).delete(e);return this.size-=t?1:0,t}function h$(e){return ul(this,e).get(e)}function d$(e){return ul(this,e).has(e)}function f$(e,t){var i=ul(this,e),s=i.size;return i.set(e,t),this.size+=i.size==s?0:1,this}function sn(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}sn.prototype.clear=l$,sn.prototype.delete=u$,sn.prototype.get=h$,sn.prototype.has=d$,sn.prototype.set=f$;function pg(e,t){for(var i=-1,s=t.length,n=e.length;++i<s;)e[n+i]=t[i];return e}var Ou=fg(Object.getPrototypeOf,Object),p$="[object Object]",m$=Function.prototype,g$=Object.prototype,mg=m$.toString,y$=g$.hasOwnProperty,w$=mg.call(Object);function b$(e){if(!ts(e)||Dn(e)!=p$)return!1;var t=Ou(e);if(t===null)return!0;var i=y$.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&mg.call(i)==w$}function v$(){this.__data__=new is,this.size=0}function E$(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function C$(e){return this.__data__.get(e)}function T$(e){return this.__data__.has(e)}var S$=200;function x$(e,t){var i=this.__data__;if(i instanceof is){var s=i.__data__;if(!pa||s.length<S$-1)return s.push([e,t]),this.size=++i.size,this;i=this.__data__=new sn(s)}return i.set(e,t),this.size=i.size,this}function qi(e){var t=this.__data__=new is(e);this.size=t.size}qi.prototype.clear=v$,qi.prototype.delete=E$,qi.prototype.get=C$,qi.prototype.has=T$,qi.prototype.set=x$;function I$(e,t){return e&&ca(t,qu(t),e)}function _$(e,t){return e&&ca(t,da(t),e)}var gg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yg=gg&&typeof module=="object"&&module&&!module.nodeType&&module,V$=yg&&yg.exports===gg,wg=V$?ki.Buffer:void 0,bg=wg?wg.allocUnsafe:void 0;function vg(e,t){if(t)return e.slice();var i=e.length,s=bg?bg(i):new e.constructor(i);return e.copy(s),s}function A$(e,t){for(var i=-1,s=e==null?0:e.length,n=0,r=[];++i<s;){var a=e[i];t(a,i,e)&&(r[n++]=a)}return r}function Eg(){return[]}var $$=Object.prototype,L$=$$.propertyIsEnumerable,Cg=Object.getOwnPropertySymbols,Pu=Cg?function(e){return e==null?[]:(e=Object(e),A$(Cg(e),function(t){return L$.call(e,t)}))}:Eg;function M$(e,t){return ca(e,Pu(e),t)}var R$=Object.getOwnPropertySymbols,Tg=R$?function(e){for(var t=[];e;)pg(t,Pu(e)),e=Ou(e);return t}:Eg;function N$(e,t){return ca(e,Tg(e),t)}function Sg(e,t,i){var s=t(e);return Zs(e)?s:pg(s,i(e))}function Bu(e){return Sg(e,qu,Pu)}function k$(e){return Sg(e,da,Tg)}var Du=en(ki,"DataView"),Qu=en(ki,"Promise"),Hu=en(ki,"Set"),xg="[object Map]",q$="[object Object]",Ig="[object Promise]",_g="[object Set]",Vg="[object WeakMap]",Ag="[object DataView]",O$=Js(Du),P$=Js(pa),B$=Js(Qu),D$=Js(Hu),Q$=Js(Au),di=Dn;(Du&&di(new Du(new ArrayBuffer(1)))!=Ag||pa&&di(new pa)!=xg||Qu&&di(Qu.resolve())!=Ig||Hu&&di(new Hu)!=_g||Au&&di(new Au)!=Vg)&&(di=function(e){var t=Dn(e),i=t==q$?e.constructor:void 0,s=i?Js(i):"";if(s)switch(s){case O$:return Ag;case P$:return xg;case B$:return Ig;case D$:return _g;case Q$:return Vg}return t});var H$=Object.prototype,U$=H$.hasOwnProperty;function F$(e){var t=e.length,i=new e.constructor(t);return t&&typeof e[0]=="string"&&U$.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var hl=ki.Uint8Array;function Uu(e){var t=new e.constructor(e.byteLength);return new hl(t).set(new hl(e)),t}function G$(e,t){var i=t?Uu(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var j$=/\w*$/;function W$(e){var t=new e.constructor(e.source,j$.exec(e));return t.lastIndex=e.lastIndex,t}var $g=Es?Es.prototype:void 0,Lg=$g?$g.valueOf:void 0;function z$(e){return Lg?Object(Lg.call(e)):{}}function Mg(e,t){var i=t?Uu(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var K$="[object Boolean]",Y$="[object Date]",X$="[object Map]",Z$="[object Number]",J$="[object RegExp]",eL="[object Set]",tL="[object String]",iL="[object Symbol]",sL="[object ArrayBuffer]",nL="[object DataView]",rL="[object Float32Array]",aL="[object Float64Array]",oL="[object Int8Array]",lL="[object Int16Array]",cL="[object Int32Array]",uL="[object Uint8Array]",hL="[object Uint8ClampedArray]",dL="[object Uint16Array]",fL="[object Uint32Array]";function pL(e,t,i){var s=e.constructor;switch(t){case sL:return Uu(e);case K$:case Y$:return new s(+e);case nL:return G$(e,i);case rL:case aL:case oL:case lL:case cL:case uL:case hL:case dL:case fL:return Mg(e,i);case X$:return new s;case Z$:case tL:return new s(e);case J$:return W$(e);case eL:return new s;case iL:return z$(e)}}function Rg(e){return typeof e.constructor=="function"&&!Lu(e)?kV(Ou(e)):{}}var mL="[object Map]";function gL(e){return ts(e)&&di(e)==mL}var Ng=Qn&&Qn.isMap,yL=Ng?Ru(Ng):gL,wL="[object Set]";function bL(e){return ts(e)&&di(e)==wL}var kg=Qn&&Qn.isSet,vL=kg?Ru(kg):bL,EL=1,CL=2,TL=4,qg="[object Arguments]",SL="[object Array]",xL="[object Boolean]",IL="[object Date]",_L="[object Error]",Og="[object Function]",VL="[object GeneratorFunction]",AL="[object Map]",$L="[object Number]",Pg="[object Object]",LL="[object RegExp]",ML="[object Set]",RL="[object String]",NL="[object Symbol]",kL="[object WeakMap]",qL="[object ArrayBuffer]",OL="[object DataView]",PL="[object Float32Array]",BL="[object Float64Array]",DL="[object Int8Array]",QL="[object Int16Array]",HL="[object Int32Array]",UL="[object Uint8Array]",FL="[object Uint8ClampedArray]",GL="[object Uint16Array]",jL="[object Uint32Array]",He={};He[qg]=He[SL]=He[qL]=He[OL]=He[xL]=He[IL]=He[PL]=He[BL]=He[DL]=He[QL]=He[HL]=He[AL]=He[$L]=He[Pg]=He[LL]=He[ML]=He[RL]=He[NL]=He[UL]=He[FL]=He[GL]=He[jL]=!0,He[_L]=He[Og]=He[kL]=!1;function dl(e,t,i,s,n,r){var a,o=t&EL,u=t&CL,d=t&TL;if(a!==void 0)return a;if(!Cs(e))return e;var f=Zs(e);if(f){if(a=F$(e),!o)return eg(e,a)}else{var y=di(e),m=y==Og||y==VL;if(ua(e))return vg(e,o);if(y==Pg||y==qg||m&&!n){if(a=u||m?{}:Rg(e),!o)return u?N$(e,_$(a,e)):M$(e,I$(a,e))}else{if(!He[y])return n?e:{};a=pL(e,y,o)}}r||(r=new qi);var b=r.get(e);if(b)return b;r.set(e,a),vL(e)?e.forEach(function(R){a.add(dl(R,t,i,R,e,r))}):yL(e)&&e.forEach(function(R,O){a.set(O,dl(R,t,i,O,e,r))});var E=d?u?k$:Bu:u?da:qu,$=f?void 0:E(e);return FV($||e,function(R,O){$&&(O=R,R=e[O]),ig(a,O,dl(R,t,i,O,e,r))}),a}var WL=1,zL=4;function Hn(e){return dl(e,WL|zL)}var KL="__lodash_hash_undefined__";function YL(e){return this.__data__.set(e,KL),this}function XL(e){return this.__data__.has(e)}function fl(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new sn;++t<i;)this.add(e[t])}fl.prototype.add=fl.prototype.push=YL,fl.prototype.has=XL;function ZL(e,t){for(var i=-1,s=e==null?0:e.length;++i<s;)if(t(e[i],i,e))return!0;return!1}function JL(e,t){return e.has(t)}var eM=1,tM=2;function Bg(e,t,i,s,n,r){var a=i&eM,o=e.length,u=t.length;if(o!=u&&!(a&&u>o))return!1;var d=r.get(e),f=r.get(t);if(d&&f)return d==t&&f==e;var y=-1,m=!0,b=i&tM?new fl:void 0;for(r.set(e,t),r.set(t,e);++y<o;){var E=e[y],$=t[y];if(s)var R=a?s($,E,y,t,e,r):s(E,$,y,e,t,r);if(R!==void 0){if(R)continue;m=!1;break}if(b){if(!ZL(t,function(O,N){if(!JL(b,N)&&(E===O||n(E,O,i,s,r)))return b.push(N)})){m=!1;break}}else if(!(E===$||n(E,$,i,s,r))){m=!1;break}}return r.delete(e),r.delete(t),m}function iM(e){var t=-1,i=Array(e.size);return e.forEach(function(s,n){i[++t]=[n,s]}),i}function sM(e){var t=-1,i=Array(e.size);return e.forEach(function(s){i[++t]=s}),i}var nM=1,rM=2,aM="[object Boolean]",oM="[object Date]",lM="[object Error]",cM="[object Map]",uM="[object Number]",hM="[object RegExp]",dM="[object Set]",fM="[object String]",pM="[object Symbol]",mM="[object ArrayBuffer]",gM="[object DataView]",Dg=Es?Es.prototype:void 0,Fu=Dg?Dg.valueOf:void 0;function yM(e,t,i,s,n,r,a){switch(i){case gM:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case mM:return!(e.byteLength!=t.byteLength||!r(new hl(e),new hl(t)));case aM:case oM:case uM:return la(+e,+t);case lM:return e.name==t.name&&e.message==t.message;case hM:case fM:return e==t+"";case cM:var o=iM;case dM:var u=s&nM;if(o||(o=sM),e.size!=t.size&&!u)return!1;var d=a.get(e);if(d)return d==t;s|=rM,a.set(e,t);var f=Bg(o(e),o(t),s,n,r,a);return a.delete(e),f;case pM:if(Fu)return Fu.call(e)==Fu.call(t)}return!1}var wM=1,bM=Object.prototype,vM=bM.hasOwnProperty;function EM(e,t,i,s,n,r){var a=i&wM,o=Bu(e),u=o.length,d=Bu(t),f=d.length;if(u!=f&&!a)return!1;for(var y=u;y--;){var m=o[y];if(!(a?m in t:vM.call(t,m)))return!1}var b=r.get(e),E=r.get(t);if(b&&E)return b==t&&E==e;var $=!0;r.set(e,t),r.set(t,e);for(var R=a;++y<u;){m=o[y];var O=e[m],N=t[m];if(s)var z=a?s(N,O,m,t,e,r):s(O,N,m,e,t,r);if(!(z===void 0?O===N||n(O,N,i,s,r):z)){$=!1;break}R||(R=m=="constructor")}if($&&!R){var V=e.constructor,Z=t.constructor;V!=Z&&"constructor"in e&&"constructor"in t&&!(typeof V=="function"&&V instanceof V&&typeof Z=="function"&&Z instanceof Z)&&($=!1)}return r.delete(e),r.delete(t),$}var CM=1,Qg="[object Arguments]",Hg="[object Array]",pl="[object Object]",TM=Object.prototype,Ug=TM.hasOwnProperty;function SM(e,t,i,s,n,r){var a=Zs(e),o=Zs(t),u=a?Hg:di(e),d=o?Hg:di(t);u=u==Qg?pl:u,d=d==Qg?pl:d;var f=u==pl,y=d==pl,m=u==d;if(m&&ua(e)){if(!ua(t))return!1;a=!0,f=!1}if(m&&!f)return r||(r=new qi),a||ku(e)?Bg(e,t,i,s,n,r):yM(e,t,u,i,s,n,r);if(!(i&CM)){var b=f&&Ug.call(e,"__wrapped__"),E=y&&Ug.call(t,"__wrapped__");if(b||E){var $=b?e.value():e,R=E?t.value():t;return r||(r=new qi),n($,R,i,s,r)}}return m?(r||(r=new qi),EM(e,t,i,s,n,r)):!1}function Fg(e,t,i,s,n){return e===t?!0:e==null||t==null||!ts(e)&&!ts(t)?e!==e&&t!==t:SM(e,t,i,s,Fg,n)}function xM(e){return function(t,i,s){for(var n=-1,r=Object(t),a=s(t),o=a.length;o--;){var u=a[++n];if(i(r[u],u,r)===!1)break}return t}}var IM=xM();function Gu(e,t,i){(i!==void 0&&!la(e[t],i)||i===void 0&&!(t in e))&&$u(e,t,i)}function _M(e){return ts(e)&&ll(e)}function ju(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function VM(e){return ca(e,da(e))}function AM(e,t,i,s,n,r,a){var o=ju(e,i),u=ju(t,i),d=a.get(u);if(d){Gu(e,i,d);return}var f=r?r(o,u,i+"",e,t,a):void 0,y=f===void 0;if(y){var m=Zs(u),b=!m&&ua(u),E=!m&&!b&&ku(u);f=u,m||b||E?Zs(o)?f=o:_M(o)?f=eg(o):b?(y=!1,f=vg(u,!0)):E?(y=!1,f=Mg(u,!0)):f=[]:b$(u)||Mu(u)?(f=o,Mu(o)?f=VM(o):(!Cs(o)||_u(o))&&(f=Rg(u))):y=!1}y&&(a.set(u,f),n(f,u,s,r,a),a.delete(u)),Gu(e,i,f)}function Gg(e,t,i,s,n){e!==t&&IM(t,function(r,a){if(n||(n=new qi),Cs(r))AM(e,t,a,i,Gg,s,n);else{var o=s?s(ju(e,a),r,a+"",e,t,n):void 0;o===void 0&&(o=r),Gu(e,a,o)}},da)}function Wu(e,t){return Fg(e,t)}var Ts=JV(function(e,t,i){Gg(e,t,i)}),he=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(he||{});class Oi{constructor(t,i,s={}){this.attrName=t,this.keyName=i;const n=he.TYPE&he.ATTRIBUTE;this.scope=s.scope!=null?s.scope&he.LEVEL|n:he.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}static keys(t){return Array.from(t.attributes).map(i=>i.name)}add(t,i){return this.canAdd(t,i)?(t.setAttribute(this.keyName,i),!0):!1}canAdd(t,i){return this.whitelist==null?!0:typeof i=="string"?this.whitelist.indexOf(i.replace(/["']/g,""))>-1:this.whitelist.indexOf(i)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const i=t.getAttribute(this.keyName);return this.canAdd(t,i)&&i?i:""}}class Un extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const jg=class of{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,i=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(i){let s=null;try{s=t.parentNode}catch{return null}return this.find(s,i)}return null}create(t,i,s){const n=this.query(i);if(n==null)throw new Un(`Unable to create ${i} blot`);const r=n,a=i instanceof Node||i.nodeType===Node.TEXT_NODE?i:r.create(s),o=new r(t,a,s);return of.blots.set(o.domNode,o),o}find(t,i=!1){return of.find(t,i)}query(t,i=he.ANY){let s;return typeof t=="string"?s=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?s=this.types.text:typeof t=="number"?t&he.LEVEL&he.BLOCK?s=this.types.block:t&he.LEVEL&he.INLINE&&(s=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(n=>(s=this.classes[n],!!s)),s=s||this.tags[t.tagName]),s==null?null:"scope"in s&&i&he.LEVEL&s.scope&&i&he.TYPE&s.scope?s:null}register(...t){return t.map(i=>{const s="blotName"in i,n="attrName"in i;if(!s&&!n)throw new Un("Invalid definition");if(s&&i.blotName==="abstract")throw new Un("Cannot register abstract class");const r=s?i.blotName:n?i.attrName:void 0;return this.types[r]=i,n?typeof i.keyName=="string"&&(this.attributes[i.keyName]=i):s&&(i.className&&(this.classes[i.className]=i),i.tagName&&(Array.isArray(i.tagName)?i.tagName=i.tagName.map(a=>a.toUpperCase()):i.tagName=i.tagName.toUpperCase(),(Array.isArray(i.tagName)?i.tagName:[i.tagName]).forEach(a=>{(this.tags[a]==null||i.className==null)&&(this.tags[a]=i)}))),i})}};jg.blots=new WeakMap;let Fn=jg;function Wg(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(i=>i.indexOf(`${t}-`)===0)}class $M extends Oi{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(i=>i.split("-").slice(0,-1).join("-"))}add(t,i){return this.canAdd(t,i)?(this.remove(t),t.classList.add(`${this.keyName}-${i}`),!0):!1}remove(t){Wg(t,this.keyName).forEach(i=>{t.classList.remove(i)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const i=(Wg(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,i)?i:""}}const fi=$M;function zu(e){const t=e.split("-"),i=t.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return t[0]+i}class LM extends Oi{static keys(t){return(t.getAttribute("style")||"").split(";").map(i=>i.split(":")[0].trim())}add(t,i){return this.canAdd(t,i)?(t.style[zu(this.keyName)]=i,!0):!1}remove(t){t.style[zu(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const i=t.style[zu(this.keyName)];return this.canAdd(t,i)?i:""}}const Ss=LM;class MM{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,i){i?t.add(this.domNode,i)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Fn.find(this.domNode);if(t==null)return;const i=Oi.keys(this.domNode),s=fi.keys(this.domNode),n=Ss.keys(this.domNode);i.concat(s).concat(n).forEach(r=>{const a=t.scroll.query(r,he.ATTRIBUTE);a instanceof Oi&&(this.attributes[a.attrName]=a)})}copy(t){Object.keys(this.attributes).forEach(i=>{const s=this.attributes[i].value(this.domNode);t.format(i,s)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(i=>{this.attributes[i].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,i)=>(t[i]=this.attributes[i].value(this.domNode),t),{})}}const ml=MM,zg=class{constructor(t,i){this.scroll=t,this.domNode=i,Fn.blots.set(i,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new Un("Blot definition missing tagName");let i,s;return Array.isArray(this.tagName)?(typeof t=="string"?(s=t.toUpperCase(),parseInt(s,10).toString()===s&&(s=parseInt(s,10))):typeof t=="number"&&(s=t),typeof s=="number"?i=document.createElement(this.tagName[s-1]):s&&this.tagName.indexOf(s)>-1?i=document.createElement(s):i=document.createElement(this.tagName[0])):i=document.createElement(this.tagName),this.className&&i.classList.add(this.className),i}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),Fn.blots.delete(this.domNode)}deleteAt(t,i){this.isolate(t,i).remove()}formatAt(t,i,s,n){const r=this.isolate(t,i);if(this.scroll.query(s,he.BLOT)!=null&&n)r.wrap(s,n);else if(this.scroll.query(s,he.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);r.wrap(a),a.format(s,n)}}insertAt(t,i,s){const n=s==null?this.scroll.create("text",i):this.scroll.create(i,s),r=this.split(t);this.parent.insertBefore(n,r||void 0)}isolate(t,i){const s=this.split(t);if(s==null)throw new Error("Attempt to isolate at end");return s.split(i),s}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;return this.parent!=null&&(this.parent.insertBefore(s,this.next||void 0),this.remove()),s}split(t,i){return t===0?this:this.next}update(t,i){}wrap(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;if(this.parent!=null&&this.parent.insertBefore(s,this.next||void 0),typeof s.appendChild!="function")throw new Un(`Cannot wrap ${t}`);return s.appendChild(this),s}};zg.blotName="abstract";let Kg=zg;const Yg=class extends Kg{static value(t){return!0}index(t,i){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(i,1):-1}position(t,i){let s=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(s+=1),[this.parent.domNode,s]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Yg.scope=he.INLINE_BLOT;const ht=Yg;class RM{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const i=t.slice(1);this.append(...i)}}at(t){const i=this.iterator();let s=i();for(;s&&t>0;)t-=1,s=i();return s}contains(t){const i=this.iterator();let s=i();for(;s;){if(s===t)return!0;s=i()}return!1}indexOf(t){const i=this.iterator();let s=i(),n=0;for(;s;){if(s===t)return n;n+=1,s=i()}return-1}insertBefore(t,i){t!=null&&(this.remove(t),t.next=i,i!=null?(t.prev=i.prev,i.prev!=null&&(i.prev.next=t),i.prev=t,i===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let i=0,s=this.head;for(;s!=null;){if(s===t)return i;i+=s.length(),s=s.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const i=t;return t!=null&&(t=t.next),i}}find(t,i=!1){const s=this.iterator();let n=s();for(;n;){const r=n.length();if(t<r||i&&t===r&&(n.next==null||n.next.length()!==0))return[n,t];t-=r,n=s()}return[null,0]}forEach(t){const i=this.iterator();let s=i();for(;s;)t(s),s=i()}forEachAt(t,i,s){if(i<=0)return;const[n,r]=this.find(t);let a=t-r;const o=this.iterator(n);let u=o();for(;u&&a<t+i;){const d=u.length();t>a?s(u,t-a,Math.min(i,a+d-t)):s(u,0,Math.min(d,t+i-a)),a+=d,u=o()}}map(t){return this.reduce((i,s)=>(i.push(t(s)),i),[])}reduce(t,i){const s=this.iterator();let n=s();for(;n;)i=t(i,n),n=s();return i}}function Xg(e,t){const i=t.find(e);if(i)return i;try{return t.create(e)}catch{const s=t.create(he.INLINE);return Array.from(e.childNodes).forEach(n=>{s.domNode.appendChild(n)}),e.parentNode&&e.parentNode.replaceChild(s.domNode,e),s.attach(),s}}const Zg=class qs extends Kg{constructor(t,i){super(t,i),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,qs.uiClass&&this.uiNode.classList.add(qs.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new RM,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const i=Xg(t,this.scroll);this.insertBefore(i,this.children.head||void 0)}catch(i){if(i instanceof Un)return;throw i}})}deleteAt(t,i){if(t===0&&i===this.length())return this.remove();this.children.forEachAt(t,i,(s,n,r)=>{s.deleteAt(n,r)})}descendant(t,i=0){const[s,n]=this.children.find(i);return t.blotName==null&&t(s)||t.blotName!=null&&s instanceof t?[s,n]:s instanceof qs?s.descendant(t,n):[null,-1]}descendants(t,i=0,s=Number.MAX_VALUE){let n=[],r=s;return this.children.forEachAt(i,s,(a,o,u)=>{(t.blotName==null&&t(a)||t.blotName!=null&&a instanceof t)&&n.push(a),a instanceof qs&&(n=n.concat(a.descendants(t,o,r))),r-=u}),n}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(i=>{t||this.statics.allowedChildren.some(s=>i instanceof s)||(i.statics.scope===he.BLOCK_BLOT?(i.next!=null&&this.splitAfter(i),i.prev!=null&&this.splitAfter(i.prev),i.parent.unwrap(),t=!0):i instanceof qs?i.unwrap():i.remove())})}formatAt(t,i,s,n){this.children.forEachAt(t,i,(r,a,o)=>{r.formatAt(a,o,s,n)})}insertAt(t,i,s){const[n,r]=this.children.find(t);if(n)n.insertAt(r,i,s);else{const a=s==null?this.scroll.create("text",i):this.scroll.create(i,s);this.appendChild(a)}}insertBefore(t,i){t.parent!=null&&t.parent.children.remove(t);let s=null;this.children.insertBefore(t,i||null),t.parent=this,i!=null&&(s=i.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==s)&&this.domNode.insertBefore(t.domNode,s),t.attach()}length(){return this.children.reduce((t,i)=>t+i.length(),0)}moveChildren(t,i){this.children.forEach(s=>{t.insertBefore(s,i)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i)}else this.remove()}path(t,i=!1){const[s,n]=this.children.find(t,i),r=[[this,t]];return s instanceof qs?r.concat(s.path(n,i)):(s!=null&&r.push([s,n]),r)}removeChild(t){this.children.remove(t)}replaceWith(t,i){const s=typeof t=="string"?this.scroll.create(t,i):t;return s instanceof qs&&this.moveChildren(s),super.replaceWith(s)}split(t,i=!1){if(!i){if(t===0)return this;if(t===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(t,this.length(),(n,r,a)=>{const o=n.split(r,i);o!=null&&s.appendChild(o)}),s}splitAfter(t){const i=this.clone();for(;t.next!=null;)i.appendChild(t.next);return this.parent&&this.parent.insertBefore(i,this.next||void 0),i}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,i){const s=[],n=[];t.forEach(r=>{r.target===this.domNode&&r.type==="childList"&&(s.push(...r.addedNodes),n.push(...r.removedNodes))}),n.forEach(r=>{if(r.parentNode!=null&&r.tagName!=="IFRAME"&&document.body.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(r);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),s.filter(r=>r.parentNode===this.domNode&&r!==this.uiNode).sort((r,a)=>r===a?0:r.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(r=>{let a=null;r.nextSibling!=null&&(a=this.scroll.find(r.nextSibling));const o=Xg(r,this.scroll);(o.next!==a||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,a||void 0))}),this.enforceAllowedChildren()}};Zg.uiClass="";const pi=Zg;function NM(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}const Gn=class Ar extends pi{static create(t){return super.create(t)}static formats(t,i){const s=i.query(Ar.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,i){super(t,i),this.attributes=new ml(this.domNode)}format(t,i){if(t===this.statics.blotName&&!i)this.children.forEach(s=>{s instanceof Ar||(s=s.wrap(Ar.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(t,he.INLINE);if(s==null)return;s instanceof Oi?this.attributes.attribute(s,i):i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i)}}formats(){const t=this.attributes.values(),i=this.statics.formats(this.domNode,this.scroll);return i!=null&&(t[this.statics.blotName]=i),t}formatAt(t,i,s,n){this.formats()[s]!=null||this.scroll.query(s,he.ATTRIBUTE)?this.isolate(t,i).format(s,n):super.formatAt(t,i,s,n)}optimize(t){super.optimize(t);const i=this.formats();if(Object.keys(i).length===0)return this.unwrap();const s=this.next;s instanceof Ar&&s.prev===this&&NM(i,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,i){const s=super.replaceWith(t,i);return this.attributes.copy(s),s}update(t,i){super.update(t,i),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}wrap(t,i){const s=super.wrap(t,i);return s instanceof Ar&&this.attributes.move(s),s}};Gn.allowedChildren=[Gn,ht],Gn.blotName="inline",Gn.scope=he.INLINE_BLOT,Gn.tagName="SPAN";const Ku=Gn,jn=class lf extends pi{static create(t){return super.create(t)}static formats(t,i){const s=i.query(lf.blotName);if(!(s!=null&&t.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,i){super(t,i),this.attributes=new ml(this.domNode)}format(t,i){const s=this.scroll.query(t,he.BLOCK);s!=null&&(s instanceof Oi?this.attributes.attribute(s,i):t===this.statics.blotName&&!i?this.replaceWith(lf.blotName):i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i))}formats(){const t=this.attributes.values(),i=this.statics.formats(this.domNode,this.scroll);return i!=null&&(t[this.statics.blotName]=i),t}formatAt(t,i,s,n){this.scroll.query(s,he.BLOCK)!=null?this.format(s,n):super.formatAt(t,i,s,n)}insertAt(t,i,s){if(s==null||this.scroll.query(i,he.INLINE)!=null)super.insertAt(t,i,s);else{const n=this.split(t);if(n!=null){const r=this.scroll.create(i,s);n.parent.insertBefore(r,n)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,i){const s=super.replaceWith(t,i);return this.attributes.copy(s),s}update(t,i){super.update(t,i),t.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}};jn.blotName="block",jn.scope=he.BLOCK_BLOT,jn.tagName="P",jn.allowedChildren=[Ku,jn,ht];const ma=jn,Yu=class extends pi{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,i){super.deleteAt(t,i),this.enforceAllowedChildren()}formatAt(t,i,s,n){super.formatAt(t,i,s,n),this.enforceAllowedChildren()}insertAt(t,i,s){super.insertAt(t,i,s),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Yu.blotName="container",Yu.scope=he.BLOCK_BLOT;const gl=Yu;class kM extends ht{static formats(t,i){}format(t,i){super.formatAt(0,this.length(),t,i)}formatAt(t,i,s,n){t===0&&i===this.length()?this.format(s,n):super.formatAt(t,i,s,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Ht=kM,qM={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},OM=100,Wn=class extends pi{constructor(t,i){super(null,i),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(s=>{this.update(s)}),this.observer.observe(this.domNode,qM),this.attach()}create(t,i){return this.registry.create(this,t,i)}find(t,i=!1){const s=this.registry.find(t,i);return s?s.scroll===this?s:i?this.find(s.scroll.domNode.parentNode,!0):null:null}query(t,i=he.ANY){return this.registry.query(t,i)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,i){this.update(),t===0&&i===this.length()?this.children.forEach(s=>{s.remove()}):super.deleteAt(t,i)}formatAt(t,i,s,n){this.update(),super.formatAt(t,i,s,n)}insertAt(t,i,s){this.update(),super.insertAt(t,i,s)}optimize(t=[],i={}){super.optimize(i);const s=i.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const r=(u,d=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(s.has(u.domNode)||s.set(u.domNode,[]),d&&r(u.parent))},a=u=>{s.has(u.domNode)&&(u instanceof pi&&u.children.forEach(a),s.delete(u.domNode),u.optimize(i))};let o=t;for(let u=0;o.length>0;u+=1){if(u>=OM)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const f=this.find(d.target,!0);f!=null&&(f.domNode===d.target&&(d.type==="childList"?(r(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(y=>{const m=this.find(y,!1);r(m,!1),m instanceof pi&&m.children.forEach(b=>{r(b,!1)})})):d.type==="attributes"&&r(f.prev)),r(f))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),n=o.slice();n.length>0;)t.push(n.pop())}}update(t,i={}){t=t||this.observer.takeRecords();const s=new WeakMap;t.map(n=>{const r=this.find(n.target,!0);return r==null?null:s.has(r.domNode)?(s.get(r.domNode).push(n),null):(s.set(r.domNode,[n]),r)}).forEach(n=>{n!=null&&n!==this&&s.has(n.domNode)&&n.update(s.get(n.domNode)||[],i)}),i.mutationsMap=s,s.has(this.domNode)&&super.update(s.get(this.domNode),i),this.optimize(t,i)}};Wn.blotName="scroll",Wn.defaultChild=ma,Wn.allowedChildren=[ma,gl],Wn.scope=he.BLOCK_BLOT,Wn.tagName="DIV";const Xu=Wn,Zu=class qb extends ht{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,i){super(t,i),this.text=this.statics.value(this.domNode)}deleteAt(t,i){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+i)}index(t,i){return this.domNode===t?i:-1}insertAt(t,i,s){s==null?(this.text=this.text.slice(0,t)+i+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,i,s)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof qb&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,i=!1){return[this.domNode,t]}split(t,i=!1){if(!i){if(t===0)return this;if(t===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(t,i){t.some(s=>s.type==="characterData"&&s.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Zu.blotName="text",Zu.scope=he.INLINE_BLOT;const yl=Zu,PM=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Oi,AttributorStore:ml,BlockBlot:ma,ClassAttributor:fi,ContainerBlot:gl,EmbedBlot:Ht,InlineBlot:Ku,LeafBlot:ht,ParentBlot:pi,Registry:Fn,Scope:he,ScrollBlot:Xu,StyleAttributor:Ss,TextBlot:yl},Symbol.toStringTag,{value:"Module"}));var wl={exports:{}},Ju,Jg;function BM(){if(Jg)return Ju;Jg=1;var e=-1,t=1,i=0;function s(p,T,g,L,x){if(p===T)return p?[[i,p]]:[];if(g!=null){var S=C(p,T,g);if(S)return S}var _=o(p,T),A=p.substring(0,_);p=p.substring(_),T=T.substring(_),_=d(p,T);var q=p.substring(p.length-_);p=p.substring(0,p.length-_),T=T.substring(0,T.length-_);var H=n(p,T);return A&&H.unshift([i,A]),q&&H.push([i,q]),N(H,x),L&&y(H),H}function n(p,T){var g;if(!p)return[[t,T]];if(!T)return[[e,p]];var L=p.length>T.length?p:T,x=p.length>T.length?T:p,S=L.indexOf(x);if(S!==-1)return g=[[t,L.substring(0,S)],[i,x],[t,L.substring(S+x.length)]],p.length>T.length&&(g[0][0]=g[2][0]=e),g;if(x.length===1)return[[e,p],[t,T]];var _=f(p,T);if(_){var A=_[0],q=_[1],H=_[2],J=_[3],ee=_[4],ae=s(A,H),oe=s(q,J);return ae.concat([[i,ee]],oe)}return r(p,T)}function r(p,T){for(var g=p.length,L=T.length,x=Math.ceil((g+L)/2),S=x,_=2*x,A=new Array(_),q=new Array(_),H=0;H<_;H++)A[H]=-1,q[H]=-1;A[S+1]=0,q[S+1]=0;for(var J=g-L,ee=J%2!==0,ae=0,oe=0,P=0,Q=0,we=0;we<x;we++){for(var fe=-we+ae;fe<=we-oe;fe+=2){var _e=S+fe,Ce;fe===-we||fe!==we&&A[_e-1]<A[_e+1]?Ce=A[_e+1]:Ce=A[_e-1]+1;for(var be=Ce-fe;Ce<g&&be<L&&p.charAt(Ce)===T.charAt(be);)Ce++,be++;if(A[_e]=Ce,Ce>g)oe+=2;else if(be>L)ae+=2;else if(ee){var $e=S+J-fe;if($e>=0&&$e<_&&q[$e]!==-1){var ve=g-q[$e];if(Ce>=ve)return a(p,T,Ce,be)}}}for(var Ve=-we+P;Ve<=we-Q;Ve+=2){var $e=S+Ve,ve;Ve===-we||Ve!==we&&q[$e-1]<q[$e+1]?ve=q[$e+1]:ve=q[$e-1]+1;for(var Te=ve-Ve;ve<g&&Te<L&&p.charAt(g-ve-1)===T.charAt(L-Te-1);)ve++,Te++;if(q[$e]=ve,ve>g)Q+=2;else if(Te>L)P+=2;else if(!ee){var _e=S+J-Ve;if(_e>=0&&_e<_&&A[_e]!==-1){var Ce=A[_e],be=S+Ce-_e;if(ve=g-ve,Ce>=ve)return a(p,T,Ce,be)}}}}return[[e,p],[t,T]]}function a(p,T,g,L){var x=p.substring(0,g),S=T.substring(0,L),_=p.substring(g),A=T.substring(L),q=s(x,S),H=s(_,A);return q.concat(H)}function o(p,T){if(!p||!T||p.charAt(0)!==T.charAt(0))return 0;for(var g=0,L=Math.min(p.length,T.length),x=L,S=0;g<x;)p.substring(S,x)==T.substring(S,x)?(g=x,S=g):L=x,x=Math.floor((L-g)/2+g);return z(p.charCodeAt(x-1))&&x--,x}function u(p,T){var g=p.length,L=T.length;if(g==0||L==0)return 0;g>L?p=p.substring(g-L):g<L&&(T=T.substring(0,g));var x=Math.min(g,L);if(p==T)return x;for(var S=0,_=1;;){var A=p.substring(x-_),q=T.indexOf(A);if(q==-1)return S;_+=q,(q==0||p.substring(x-_)==T.substring(0,_))&&(S=_,_++)}}function d(p,T){if(!p||!T||p.slice(-1)!==T.slice(-1))return 0;for(var g=0,L=Math.min(p.length,T.length),x=L,S=0;g<x;)p.substring(p.length-x,p.length-S)==T.substring(T.length-x,T.length-S)?(g=x,S=g):L=x,x=Math.floor((L-g)/2+g);return V(p.charCodeAt(p.length-x))&&x--,x}function f(p,T){var g=p.length>T.length?p:T,L=p.length>T.length?T:p;if(g.length<4||L.length*2<g.length)return null;function x(oe,P,Q){for(var we=oe.substring(Q,Q+Math.floor(oe.length/4)),fe=-1,_e="",Ce,be,$e,ve;(fe=P.indexOf(we,fe+1))!==-1;){var Ve=o(oe.substring(Q),P.substring(fe)),Te=d(oe.substring(0,Q),P.substring(0,fe));_e.length<Te+Ve&&(_e=P.substring(fe-Te,fe)+P.substring(fe,fe+Ve),Ce=oe.substring(0,Q-Te),be=oe.substring(Q+Ve),$e=P.substring(0,fe-Te),ve=P.substring(fe+Ve))}return _e.length*2>=oe.length?[Ce,be,$e,ve,_e]:null}var S=x(g,L,Math.ceil(g.length/4)),_=x(g,L,Math.ceil(g.length/2)),A;if(!S&&!_)return null;_?S?A=S[4].length>_[4].length?S:_:A=_:A=S;var q,H,J,ee;p.length>T.length?(q=A[0],H=A[1],J=A[2],ee=A[3]):(J=A[0],ee=A[1],q=A[2],H=A[3]);var ae=A[4];return[q,H,J,ee,ae]}function y(p){for(var T=!1,g=[],L=0,x=null,S=0,_=0,A=0,q=0,H=0;S<p.length;)p[S][0]==i?(g[L++]=S,_=q,A=H,q=0,H=0,x=p[S][1]):(p[S][0]==t?q+=p[S][1].length:H+=p[S][1].length,x&&x.length<=Math.max(_,A)&&x.length<=Math.max(q,H)&&(p.splice(g[L-1],0,[e,x]),p[g[L-1]+1][0]=t,L--,L--,S=L>0?g[L-1]:-1,_=0,A=0,q=0,H=0,x=null,T=!0)),S++;for(T&&N(p),O(p),S=1;S<p.length;){if(p[S-1][0]==e&&p[S][0]==t){var J=p[S-1][1],ee=p[S][1],ae=u(J,ee),oe=u(ee,J);ae>=oe?(ae>=J.length/2||ae>=ee.length/2)&&(p.splice(S,0,[i,ee.substring(0,ae)]),p[S-1][1]=J.substring(0,J.length-ae),p[S+1][1]=ee.substring(ae),S++):(oe>=J.length/2||oe>=ee.length/2)&&(p.splice(S,0,[i,J.substring(0,oe)]),p[S-1][0]=t,p[S-1][1]=ee.substring(0,ee.length-oe),p[S+1][0]=e,p[S+1][1]=J.substring(oe),S++),S++}S++}}var m=/[^a-zA-Z0-9]/,b=/\s/,E=/[\r\n]/,$=/\n\r?\n$/,R=/^\r?\n\r?\n/;function O(p){function T(oe,P){if(!oe||!P)return 6;var Q=oe.charAt(oe.length-1),we=P.charAt(0),fe=Q.match(m),_e=we.match(m),Ce=fe&&Q.match(b),be=_e&&we.match(b),$e=Ce&&Q.match(E),ve=be&&we.match(E),Ve=$e&&oe.match($),Te=ve&&P.match(R);return Ve||Te?5:$e||ve?4:fe&&!Ce&&be?3:Ce||be?2:fe||_e?1:0}for(var g=1;g<p.length-1;){if(p[g-1][0]==i&&p[g+1][0]==i){var L=p[g-1][1],x=p[g][1],S=p[g+1][1],_=d(L,x);if(_){var A=x.substring(x.length-_);L=L.substring(0,L.length-_),x=A+x.substring(0,x.length-_),S=A+S}for(var q=L,H=x,J=S,ee=T(L,x)+T(x,S);x.charAt(0)===S.charAt(0);){L+=x.charAt(0),x=x.substring(1)+S.charAt(0),S=S.substring(1);var ae=T(L,x)+T(x,S);ae>=ee&&(ee=ae,q=L,H=x,J=S)}p[g-1][1]!=q&&(q?p[g-1][1]=q:(p.splice(g-1,1),g--),p[g][1]=H,J?p[g+1][1]=J:(p.splice(g+1,1),g--))}g++}}function N(p,T){p.push([i,""]);for(var g=0,L=0,x=0,S="",_="",A;g<p.length;){if(g<p.length-1&&!p[g][1]){p.splice(g,1);continue}switch(p[g][0]){case t:x++,_+=p[g][1],g++;break;case e:L++,S+=p[g][1],g++;break;case i:var q=g-x-L-1;if(T){if(q>=0&&K(p[q][1])){var H=p[q][1].slice(-1);if(p[q][1]=p[q][1].slice(0,-1),S=H+S,_=H+_,!p[q][1]){p.splice(q,1),g--;var J=q-1;p[J]&&p[J][0]===t&&(x++,_=p[J][1]+_,J--),p[J]&&p[J][0]===e&&(L++,S=p[J][1]+S,J--),q=J}}if(Z(p[g][1])){var H=p[g][1].charAt(0);p[g][1]=p[g][1].slice(1),S+=H,_+=H}}if(g<p.length-1&&!p[g][1]){p.splice(g,1);break}if(S.length>0||_.length>0){S.length>0&&_.length>0&&(A=o(_,S),A!==0&&(q>=0?p[q][1]+=_.substring(0,A):(p.splice(0,0,[i,_.substring(0,A)]),g++),_=_.substring(A),S=S.substring(A)),A=d(_,S),A!==0&&(p[g][1]=_.substring(_.length-A)+p[g][1],_=_.substring(0,_.length-A),S=S.substring(0,S.length-A)));var ee=x+L;S.length===0&&_.length===0?(p.splice(g-ee,ee),g=g-ee):S.length===0?(p.splice(g-ee,ee,[t,_]),g=g-ee+1):_.length===0?(p.splice(g-ee,ee,[e,S]),g=g-ee+1):(p.splice(g-ee,ee,[e,S],[t,_]),g=g-ee+2)}g!==0&&p[g-1][0]===i?(p[g-1][1]+=p[g][1],p.splice(g,1)):g++,x=0,L=0,S="",_="";break}}p[p.length-1][1]===""&&p.pop();var ae=!1;for(g=1;g<p.length-1;)p[g-1][0]===i&&p[g+1][0]===i&&(p[g][1].substring(p[g][1].length-p[g-1][1].length)===p[g-1][1]?(p[g][1]=p[g-1][1]+p[g][1].substring(0,p[g][1].length-p[g-1][1].length),p[g+1][1]=p[g-1][1]+p[g+1][1],p.splice(g-1,1),ae=!0):p[g][1].substring(0,p[g+1][1].length)==p[g+1][1]&&(p[g-1][1]+=p[g+1][1],p[g][1]=p[g][1].substring(p[g+1][1].length)+p[g+1][1],p.splice(g+1,1),ae=!0)),g++;ae&&N(p,T)}function z(p){return p>=55296&&p<=56319}function V(p){return p>=56320&&p<=57343}function Z(p){return V(p.charCodeAt(0))}function K(p){return z(p.charCodeAt(p.length-1))}function re(p){for(var T=[],g=0;g<p.length;g++)p[g][1].length>0&&T.push(p[g]);return T}function w(p,T,g,L){return K(p)||Z(L)?null:re([[i,p],[e,T],[t,g],[i,L]])}function C(p,T,g){var L=typeof g=="number"?{index:g,length:0}:g.oldRange,x=typeof g=="number"?null:g.newRange,S=p.length,_=T.length;if(L.length===0&&(x===null||x.length===0)){var A=L.index,q=p.slice(0,A),H=p.slice(A),J=x?x.index:null;e:{var ee=A+_-S;if(J!==null&&J!==ee||ee<0||ee>_)break e;var ae=T.slice(0,ee),oe=T.slice(ee);if(oe!==H)break e;var P=Math.min(A,ee),Q=q.slice(0,P),we=ae.slice(0,P);if(Q!==we)break e;var fe=q.slice(P),_e=ae.slice(P);return w(Q,fe,_e,H)}e:{if(J!==null&&J!==A)break e;var Ce=A,ae=T.slice(0,Ce),oe=T.slice(Ce);if(ae!==q)break e;var be=Math.min(S-Ce,_-Ce),$e=H.slice(H.length-be),ve=oe.slice(oe.length-be);if($e!==ve)break e;var fe=H.slice(0,H.length-be),_e=oe.slice(0,oe.length-be);return w(q,fe,_e,$e)}}if(L.length>0&&x&&x.length===0)e:{var Q=p.slice(0,L.index),$e=p.slice(L.index+L.length),P=Q.length,be=$e.length;if(_<P+be)break e;var we=T.slice(0,P),ve=T.slice(_-be);if(Q!==we||$e!==ve)break e;var fe=p.slice(P,S-be),_e=T.slice(P,_-be);return w(Q,fe,_e,$e)}return null}function I(p,T,g,L){return s(p,T,g,L,!0)}return I.INSERT=t,I.DELETE=e,I.EQUAL=i,Ju=I,Ju}var ga={exports:{}};ga.exports;var ey;function ty(){return ey||(ey=1,function(e,t){var i=200,s="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",y="[object GeneratorFunction]",m="[object Map]",b="[object Number]",E="[object Object]",$="[object Promise]",R="[object RegExp]",O="[object Set]",N="[object String]",z="[object Symbol]",V="[object WeakMap]",Z="[object ArrayBuffer]",K="[object DataView]",re="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",I="[object Int16Array]",p="[object Int32Array]",T="[object Uint8Array]",g="[object Uint8ClampedArray]",L="[object Uint16Array]",x="[object Uint32Array]",S=/[\\^$.*+?()[\]{}|]/g,_=/\w*$/,A=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,H={};H[r]=H[a]=H[Z]=H[K]=H[o]=H[u]=H[re]=H[w]=H[C]=H[I]=H[p]=H[m]=H[b]=H[E]=H[R]=H[O]=H[N]=H[z]=H[T]=H[g]=H[L]=H[x]=!0,H[d]=H[f]=H[V]=!1;var J=typeof bs=="object"&&bs&&bs.Object===Object&&bs,ee=typeof self=="object"&&self&&self.Object===Object&&self,ae=J||ee||Function("return this")(),oe=t&&!t.nodeType&&t,P=oe&&!0&&e&&!e.nodeType&&e,Q=P&&P.exports===oe;function we(h,v){return h.set(v[0],v[1]),h}function fe(h,v){return h.add(v),h}function _e(h,v){for(var k=-1,Y=h?h.length:0;++k<Y&&v(h[k],k,h)!==!1;);return h}function Ce(h,v){for(var k=-1,Y=v.length,xe=h.length;++k<Y;)h[xe+k]=v[k];return h}function be(h,v,k,Y){for(var xe=-1,de=h?h.length:0;++xe<de;)k=v(k,h[xe],xe,h);return k}function $e(h,v){for(var k=-1,Y=Array(h);++k<h;)Y[k]=v(k);return Y}function ve(h,v){return h==null?void 0:h[v]}function Ve(h){var v=!1;if(h!=null&&typeof h.toString!="function")try{v=!!(h+"")}catch{}return v}function Te(h){var v=-1,k=Array(h.size);return h.forEach(function(Y,xe){k[++v]=[xe,Y]}),k}function Ti(h,v){return function(k){return h(v(k))}}function Fi(h){var v=-1,k=Array(h.size);return h.forEach(function(Y){k[++v]=Y}),k}var Ms=Array.prototype,Rs=Function.prototype,pt=Object.prototype,Lt=ae["__core-js_shared__"],Gi=function(){var h=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),ri=Rs.toString,mt=pt.hasOwnProperty,Si=pt.toString,Ns=RegExp("^"+ri.call(mt).replace(S,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ai=Q?ae.Buffer:void 0,xi=ae.Symbol,bn=ae.Uint8Array,Mt=Ti(Object.getPrototypeOf,Object),Cr=Object.create,Tr=pt.propertyIsEnumerable,po=Ms.splice,W=Object.getOwnPropertySymbols,le=ai?ai.isBuffer:void 0,pe=Ti(Object.keys,Object),Le=_i(ae,"DataView"),Ae=_i(ae,"Map"),De=_i(ae,"Promise"),it=_i(ae,"Set"),oi=_i(ae,"WeakMap"),ji=_i(Object,"create"),jt=vt(Le),Ii=vt(Ae),Wi=vt(De),li=vt(it),vn=vt(oi),ci=xi?xi.prototype:void 0,hs=ci?ci.valueOf:void 0;function ds(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Td(){this.__data__=ji?ji(null):{}}function Sd(h){return this.has(h)&&delete this.__data__[h]}function xd(h){var v=this.__data__;if(ji){var k=v[h];return k===s?void 0:k}return mt.call(v,h)?v[h]:void 0}function cc(h){var v=this.__data__;return ji?v[h]!==void 0:mt.call(v,h)}function mo(h,v){var k=this.__data__;return k[h]=ji&&v===void 0?s:v,this}ds.prototype.clear=Td,ds.prototype.delete=Sd,ds.prototype.get=xd,ds.prototype.has=cc,ds.prototype.set=mo;function ot(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Id(){this.__data__=[]}function _d(h){var v=this.__data__,k=xr(v,h);if(k<0)return!1;var Y=v.length-1;return k==Y?v.pop():po.call(v,k,1),!0}function Vd(h){var v=this.__data__,k=xr(v,h);return k<0?void 0:v[k][1]}function Ad(h){return xr(this.__data__,h)>-1}function $d(h,v){var k=this.__data__,Y=xr(k,h);return Y<0?k.push([h,v]):k[Y][1]=v,this}ot.prototype.clear=Id,ot.prototype.delete=_d,ot.prototype.get=Vd,ot.prototype.has=Ad,ot.prototype.set=$d;function gt(h){var v=-1,k=h?h.length:0;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Ld(){this.__data__={hash:new ds,map:new(Ae||ot),string:new ds}}function Md(h){return Cn(this,h).delete(h)}function Rd(h){return Cn(this,h).get(h)}function Nd(h){return Cn(this,h).has(h)}function kd(h,v){return Cn(this,h).set(h,v),this}gt.prototype.clear=Ld,gt.prototype.delete=Md,gt.prototype.get=Rd,gt.prototype.has=Nd,gt.prototype.set=kd;function Rt(h){this.__data__=new ot(h)}function qd(){this.__data__=new ot}function Od(h){return this.__data__.delete(h)}function Pd(h){return this.__data__.get(h)}function Bd(h){return this.__data__.has(h)}function Dd(h,v){var k=this.__data__;if(k instanceof ot){var Y=k.__data__;if(!Ae||Y.length<i-1)return Y.push([h,v]),this;k=this.__data__=new gt(Y)}return k.set(h,v),this}Rt.prototype.clear=qd,Rt.prototype.delete=Od,Rt.prototype.get=Pd,Rt.prototype.has=Bd,Rt.prototype.set=Dd;function Sr(h,v){var k=bo(h)||_r(h)?$e(h.length,String):[],Y=k.length,xe=!!Y;for(var de in h)mt.call(h,de)&&!(xe&&(de=="length"||ef(de,Y)))&&k.push(de);return k}function uc(h,v,k){var Y=h[v];(!(mt.call(h,v)&&mc(Y,k))||k===void 0&&!(v in h))&&(h[v]=k)}function xr(h,v){for(var k=h.length;k--;)if(mc(h[k][0],v))return k;return-1}function zi(h,v){return h&&wo(v,Eo(v),h)}function go(h,v,k,Y,xe,de,ke){var Re;if(Y&&(Re=de?Y(h,xe,de,ke):Y(h)),Re!==void 0)return Re;if(!Yi(h))return h;var et=bo(h);if(et){if(Re=Zd(h),!v)return Kd(h,Re)}else{var Pe=ps(h),yt=Pe==f||Pe==y;if(gc(h))return Ir(h,v);if(Pe==E||Pe==r||yt&&!de){if(Ve(h))return de?h:{};if(Re=Ki(yt?{}:h),!v)return Yd(h,zi(Re,h))}else{if(!H[Pe])return de?h:{};Re=Jd(h,Pe,go,v)}}ke||(ke=new Rt);var Nt=ke.get(h);if(Nt)return Nt;if(ke.set(h,Re),!et)var st=k?Xd(h):Eo(h);return _e(st||h,function(wt,lt){st&&(lt=wt,wt=h[lt]),uc(Re,lt,go(wt,v,k,Y,lt,h,ke))}),Re}function Qd(h){return Yi(h)?Cr(h):{}}function Hd(h,v,k){var Y=v(h);return bo(h)?Y:Ce(Y,k(h))}function Ud(h){return Si.call(h)}function Fd(h){if(!Yi(h)||sf(h))return!1;var v=vo(h)||Ve(h)?Ns:A;return v.test(vt(h))}function Gd(h){if(!fc(h))return pe(h);var v=[];for(var k in Object(h))mt.call(h,k)&&k!="constructor"&&v.push(k);return v}function Ir(h,v){if(v)return h.slice();var k=new h.constructor(h.length);return h.copy(k),k}function yo(h){var v=new h.constructor(h.byteLength);return new bn(v).set(new bn(h)),v}function En(h,v){var k=v?yo(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.byteLength)}function hc(h,v,k){var Y=v?k(Te(h),!0):Te(h);return be(Y,we,new h.constructor)}function dc(h){var v=new h.constructor(h.source,_.exec(h));return v.lastIndex=h.lastIndex,v}function jd(h,v,k){var Y=v?k(Fi(h),!0):Fi(h);return be(Y,fe,new h.constructor)}function Wd(h){return hs?Object(hs.call(h)):{}}function zd(h,v){var k=v?yo(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.length)}function Kd(h,v){var k=-1,Y=h.length;for(v||(v=Array(Y));++k<Y;)v[k]=h[k];return v}function wo(h,v,k,Y){k||(k={});for(var xe=-1,de=v.length;++xe<de;){var ke=v[xe],Re=void 0;uc(k,ke,Re===void 0?h[ke]:Re)}return k}function Yd(h,v){return wo(h,fs(h),v)}function Xd(h){return Hd(h,Eo,fs)}function Cn(h,v){var k=h.__data__;return tf(v)?k[typeof v=="string"?"string":"hash"]:k.map}function _i(h,v){var k=ve(h,v);return Fd(k)?k:void 0}var fs=W?Ti(W,Object):rf,ps=Ud;(Le&&ps(new Le(new ArrayBuffer(1)))!=K||Ae&&ps(new Ae)!=m||De&&ps(De.resolve())!=$||it&&ps(new it)!=O||oi&&ps(new oi)!=V)&&(ps=function(h){var v=Si.call(h),k=v==E?h.constructor:void 0,Y=k?vt(k):void 0;if(Y)switch(Y){case jt:return K;case Ii:return m;case Wi:return $;case li:return O;case vn:return V}return v});function Zd(h){var v=h.length,k=h.constructor(v);return v&&typeof h[0]=="string"&&mt.call(h,"index")&&(k.index=h.index,k.input=h.input),k}function Ki(h){return typeof h.constructor=="function"&&!fc(h)?Qd(Mt(h)):{}}function Jd(h,v,k,Y){var xe=h.constructor;switch(v){case Z:return yo(h);case o:case u:return new xe(+h);case K:return En(h,Y);case re:case w:case C:case I:case p:case T:case g:case L:case x:return zd(h,Y);case m:return hc(h,Y,k);case b:case N:return new xe(h);case R:return dc(h);case O:return jd(h,Y,k);case z:return Wd(h)}}function ef(h,v){return v=v??n,!!v&&(typeof h=="number"||q.test(h))&&h>-1&&h%1==0&&h<v}function tf(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function sf(h){return!!Gi&&Gi in h}function fc(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||pt;return h===k}function vt(h){if(h!=null){try{return ri.call(h)}catch{}try{return h+""}catch{}}return""}function pc(h){return go(h,!0,!0)}function mc(h,v){return h===v||h!==h&&v!==v}function _r(h){return nf(h)&&mt.call(h,"callee")&&(!Tr.call(h,"callee")||Si.call(h)==r)}var bo=Array.isArray;function Vr(h){return h!=null&&yc(h.length)&&!vo(h)}function nf(h){return wc(h)&&Vr(h)}var gc=le||af;function vo(h){var v=Yi(h)?Si.call(h):"";return v==f||v==y}function yc(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=n}function Yi(h){var v=typeof h;return!!h&&(v=="object"||v=="function")}function wc(h){return!!h&&typeof h=="object"}function Eo(h){return Vr(h)?Sr(h):Gd(h)}function rf(){return[]}function af(){return!1}e.exports=pc}(ga,ga.exports)),ga.exports}var ya={exports:{}};ya.exports;var iy;function sy(){return iy||(iy=1,function(e,t){var i=200,s="__lodash_hash_undefined__",n=1,r=2,a=9007199254740991,o="[object Arguments]",u="[object Array]",d="[object AsyncFunction]",f="[object Boolean]",y="[object Date]",m="[object Error]",b="[object Function]",E="[object GeneratorFunction]",$="[object Map]",R="[object Number]",O="[object Null]",N="[object Object]",z="[object Promise]",V="[object Proxy]",Z="[object RegExp]",K="[object Set]",re="[object String]",w="[object Symbol]",C="[object Undefined]",I="[object WeakMap]",p="[object ArrayBuffer]",T="[object DataView]",g="[object Float32Array]",L="[object Float64Array]",x="[object Int8Array]",S="[object Int16Array]",_="[object Int32Array]",A="[object Uint8Array]",q="[object Uint8ClampedArray]",H="[object Uint16Array]",J="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,P={};P[g]=P[L]=P[x]=P[S]=P[_]=P[A]=P[q]=P[H]=P[J]=!0,P[o]=P[u]=P[p]=P[f]=P[T]=P[y]=P[m]=P[b]=P[$]=P[R]=P[N]=P[Z]=P[K]=P[re]=P[I]=!1;var Q=typeof bs=="object"&&bs&&bs.Object===Object&&bs,we=typeof self=="object"&&self&&self.Object===Object&&self,fe=Q||we||Function("return this")(),_e=t&&!t.nodeType&&t,Ce=_e&&!0&&e&&!e.nodeType&&e,be=Ce&&Ce.exports===_e,$e=be&&Q.process,ve=function(){try{return $e&&$e.binding&&$e.binding("util")}catch{}}(),Ve=ve&&ve.isTypedArray;function Te(h,v){for(var k=-1,Y=h==null?0:h.length,xe=0,de=[];++k<Y;){var ke=h[k];v(ke,k,h)&&(de[xe++]=ke)}return de}function Ti(h,v){for(var k=-1,Y=v.length,xe=h.length;++k<Y;)h[xe+k]=v[k];return h}function Fi(h,v){for(var k=-1,Y=h==null?0:h.length;++k<Y;)if(v(h[k],k,h))return!0;return!1}function Ms(h,v){for(var k=-1,Y=Array(h);++k<h;)Y[k]=v(k);return Y}function Rs(h){return function(v){return h(v)}}function pt(h,v){return h.has(v)}function Lt(h,v){return h==null?void 0:h[v]}function Gi(h){var v=-1,k=Array(h.size);return h.forEach(function(Y,xe){k[++v]=[xe,Y]}),k}function ri(h,v){return function(k){return h(v(k))}}function mt(h){var v=-1,k=Array(h.size);return h.forEach(function(Y){k[++v]=Y}),k}var Si=Array.prototype,Ns=Function.prototype,ai=Object.prototype,xi=fe["__core-js_shared__"],bn=Ns.toString,Mt=ai.hasOwnProperty,Cr=function(){var h=/[^.]+$/.exec(xi&&xi.keys&&xi.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Tr=ai.toString,po=RegExp("^"+bn.call(Mt).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=be?fe.Buffer:void 0,le=fe.Symbol,pe=fe.Uint8Array,Le=ai.propertyIsEnumerable,Ae=Si.splice,De=le?le.toStringTag:void 0,it=Object.getOwnPropertySymbols,oi=W?W.isBuffer:void 0,ji=ri(Object.keys,Object),jt=fs(fe,"DataView"),Ii=fs(fe,"Map"),Wi=fs(fe,"Promise"),li=fs(fe,"Set"),vn=fs(fe,"WeakMap"),ci=fs(Object,"create"),hs=vt(jt),ds=vt(Ii),Td=vt(Wi),Sd=vt(li),xd=vt(vn),cc=le?le.prototype:void 0,mo=cc?cc.valueOf:void 0;function ot(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Id(){this.__data__=ci?ci(null):{},this.size=0}function _d(h){var v=this.has(h)&&delete this.__data__[h];return this.size-=v?1:0,v}function Vd(h){var v=this.__data__;if(ci){var k=v[h];return k===s?void 0:k}return Mt.call(v,h)?v[h]:void 0}function Ad(h){var v=this.__data__;return ci?v[h]!==void 0:Mt.call(v,h)}function $d(h,v){var k=this.__data__;return this.size+=this.has(h)?0:1,k[h]=ci&&v===void 0?s:v,this}ot.prototype.clear=Id,ot.prototype.delete=_d,ot.prototype.get=Vd,ot.prototype.has=Ad,ot.prototype.set=$d;function gt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function Ld(){this.__data__=[],this.size=0}function Md(h){var v=this.__data__,k=Ir(v,h);if(k<0)return!1;var Y=v.length-1;return k==Y?v.pop():Ae.call(v,k,1),--this.size,!0}function Rd(h){var v=this.__data__,k=Ir(v,h);return k<0?void 0:v[k][1]}function Nd(h){return Ir(this.__data__,h)>-1}function kd(h,v){var k=this.__data__,Y=Ir(k,h);return Y<0?(++this.size,k.push([h,v])):k[Y][1]=v,this}gt.prototype.clear=Ld,gt.prototype.delete=Md,gt.prototype.get=Rd,gt.prototype.has=Nd,gt.prototype.set=kd;function Rt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v<k;){var Y=h[v];this.set(Y[0],Y[1])}}function qd(){this.size=0,this.__data__={hash:new ot,map:new(Ii||gt),string:new ot}}function Od(h){var v=_i(this,h).delete(h);return this.size-=v?1:0,v}function Pd(h){return _i(this,h).get(h)}function Bd(h){return _i(this,h).has(h)}function Dd(h,v){var k=_i(this,h),Y=k.size;return k.set(h,v),this.size+=k.size==Y?0:1,this}Rt.prototype.clear=qd,Rt.prototype.delete=Od,Rt.prototype.get=Pd,Rt.prototype.has=Bd,Rt.prototype.set=Dd;function Sr(h){var v=-1,k=h==null?0:h.length;for(this.__data__=new Rt;++v<k;)this.add(h[v])}function uc(h){return this.__data__.set(h,s),this}function xr(h){return this.__data__.has(h)}Sr.prototype.add=Sr.prototype.push=uc,Sr.prototype.has=xr;function zi(h){var v=this.__data__=new gt(h);this.size=v.size}function go(){this.__data__=new gt,this.size=0}function Qd(h){var v=this.__data__,k=v.delete(h);return this.size=v.size,k}function Hd(h){return this.__data__.get(h)}function Ud(h){return this.__data__.has(h)}function Fd(h,v){var k=this.__data__;if(k instanceof gt){var Y=k.__data__;if(!Ii||Y.length<i-1)return Y.push([h,v]),this.size=++k.size,this;k=this.__data__=new Rt(Y)}return k.set(h,v),this.size=k.size,this}zi.prototype.clear=go,zi.prototype.delete=Qd,zi.prototype.get=Hd,zi.prototype.has=Ud,zi.prototype.set=Fd;function Gd(h,v){var k=_r(h),Y=!k&&mc(h),xe=!k&&!Y&&Vr(h),de=!k&&!Y&&!xe&&wc(h),ke=k||Y||xe||de,Re=ke?Ms(h.length,String):[],et=Re.length;for(var Pe in h)Mt.call(h,Pe)&&!(ke&&(Pe=="length"||xe&&(Pe=="offset"||Pe=="parent")||de&&(Pe=="buffer"||Pe=="byteLength"||Pe=="byteOffset")||Jd(Pe,et)))&&Re.push(Pe);return Re}function Ir(h,v){for(var k=h.length;k--;)if(pc(h[k][0],v))return k;return-1}function yo(h,v,k){var Y=v(h);return _r(h)?Y:Ti(Y,k(h))}function En(h){return h==null?h===void 0?C:O:De&&De in Object(h)?ps(h):fc(h)}function hc(h){return Yi(h)&&En(h)==o}function dc(h,v,k,Y,xe){return h===v?!0:h==null||v==null||!Yi(h)&&!Yi(v)?h!==h&&v!==v:jd(h,v,k,Y,dc,xe)}function jd(h,v,k,Y,xe,de){var ke=_r(h),Re=_r(v),et=ke?u:Ki(h),Pe=Re?u:Ki(v);et=et==o?N:et,Pe=Pe==o?N:Pe;var yt=et==N,Nt=Pe==N,st=et==Pe;if(st&&Vr(h)){if(!Vr(v))return!1;ke=!0,yt=!1}if(st&&!yt)return de||(de=new zi),ke||wc(h)?wo(h,v,k,Y,xe,de):Yd(h,v,et,k,Y,xe,de);if(!(k&n)){var wt=yt&&Mt.call(h,"__wrapped__"),lt=Nt&&Mt.call(v,"__wrapped__");if(wt||lt){var ks=wt?h.value():h,ms=lt?v.value():v;return de||(de=new zi),xe(ks,ms,k,Y,de)}}return st?(de||(de=new zi),Xd(h,v,k,Y,xe,de)):!1}function Wd(h){if(!yc(h)||tf(h))return!1;var v=gc(h)?po:ae;return v.test(vt(h))}function zd(h){return Yi(h)&&vo(h.length)&&!!P[En(h)]}function Kd(h){if(!sf(h))return ji(h);var v=[];for(var k in Object(h))Mt.call(h,k)&&k!="constructor"&&v.push(k);return v}function wo(h,v,k,Y,xe,de){var ke=k&n,Re=h.length,et=v.length;if(Re!=et&&!(ke&&et>Re))return!1;var Pe=de.get(h);if(Pe&&de.get(v))return Pe==v;var yt=-1,Nt=!0,st=k&r?new Sr:void 0;for(de.set(h,v),de.set(v,h);++yt<Re;){var wt=h[yt],lt=v[yt];if(Y)var ks=ke?Y(lt,wt,yt,v,h,de):Y(wt,lt,yt,h,v,de);if(ks!==void 0){if(ks)continue;Nt=!1;break}if(st){if(!Fi(v,function(ms,Tn){if(!pt(st,Tn)&&(wt===ms||xe(wt,ms,k,Y,de)))return st.push(Tn)})){Nt=!1;break}}else if(!(wt===lt||xe(wt,lt,k,Y,de))){Nt=!1;break}}return de.delete(h),de.delete(v),Nt}function Yd(h,v,k,Y,xe,de,ke){switch(k){case T:if(h.byteLength!=v.byteLength||h.byteOffset!=v.byteOffset)return!1;h=h.buffer,v=v.buffer;case p:return!(h.byteLength!=v.byteLength||!de(new pe(h),new pe(v)));case f:case y:case R:return pc(+h,+v);case m:return h.name==v.name&&h.message==v.message;case Z:case re:return h==v+"";case $:var Re=Gi;case K:var et=Y&n;if(Re||(Re=mt),h.size!=v.size&&!et)return!1;var Pe=ke.get(h);if(Pe)return Pe==v;Y|=r,ke.set(h,v);var yt=wo(Re(h),Re(v),Y,xe,de,ke);return ke.delete(h),yt;case w:if(mo)return mo.call(h)==mo.call(v)}return!1}function Xd(h,v,k,Y,xe,de){var ke=k&n,Re=Cn(h),et=Re.length,Pe=Cn(v),yt=Pe.length;if(et!=yt&&!ke)return!1;for(var Nt=et;Nt--;){var st=Re[Nt];if(!(ke?st in v:Mt.call(v,st)))return!1}var wt=de.get(h);if(wt&&de.get(v))return wt==v;var lt=!0;de.set(h,v),de.set(v,h);for(var ks=ke;++Nt<et;){st=Re[Nt];var ms=h[st],Tn=v[st];if(Y)var kb=ke?Y(Tn,ms,st,v,h,de):Y(ms,Tn,st,h,v,de);if(!(kb===void 0?ms===Tn||xe(ms,Tn,k,Y,de):kb)){lt=!1;break}ks||(ks=st=="constructor")}if(lt&&!ks){var bc=h.constructor,vc=v.constructor;bc!=vc&&"constructor"in h&&"constructor"in v&&!(typeof bc=="function"&&bc instanceof bc&&typeof vc=="function"&&vc instanceof vc)&&(lt=!1)}return de.delete(h),de.delete(v),lt}function Cn(h){return yo(h,Eo,Zd)}function _i(h,v){var k=h.__data__;return ef(v)?k[typeof v=="string"?"string":"hash"]:k.map}function fs(h,v){var k=Lt(h,v);return Wd(k)?k:void 0}function ps(h){var v=Mt.call(h,De),k=h[De];try{h[De]=void 0;var Y=!0}catch{}var xe=Tr.call(h);return Y&&(v?h[De]=k:delete h[De]),xe}var Zd=it?function(h){return h==null?[]:(h=Object(h),Te(it(h),function(v){return Le.call(h,v)}))}:rf,Ki=En;(jt&&Ki(new jt(new ArrayBuffer(1)))!=T||Ii&&Ki(new Ii)!=$||Wi&&Ki(Wi.resolve())!=z||li&&Ki(new li)!=K||vn&&Ki(new vn)!=I)&&(Ki=function(h){var v=En(h),k=v==N?h.constructor:void 0,Y=k?vt(k):"";if(Y)switch(Y){case hs:return T;case ds:return $;case Td:return z;case Sd:return K;case xd:return I}return v});function Jd(h,v){return v=v??a,!!v&&(typeof h=="number"||oe.test(h))&&h>-1&&h%1==0&&h<v}function ef(h){var v=typeof h;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?h!=="__proto__":h===null}function tf(h){return!!Cr&&Cr in h}function sf(h){var v=h&&h.constructor,k=typeof v=="function"&&v.prototype||ai;return h===k}function fc(h){return Tr.call(h)}function vt(h){if(h!=null){try{return bn.call(h)}catch{}try{return h+""}catch{}}return""}function pc(h,v){return h===v||h!==h&&v!==v}var mc=hc(function(){return arguments}())?hc:function(h){return Yi(h)&&Mt.call(h,"callee")&&!Le.call(h,"callee")},_r=Array.isArray;function bo(h){return h!=null&&vo(h.length)&&!gc(h)}var Vr=oi||af;function nf(h,v){return dc(h,v)}function gc(h){if(!yc(h))return!1;var v=En(h);return v==b||v==E||v==d||v==V}function vo(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=a}function yc(h){var v=typeof h;return h!=null&&(v=="object"||v=="function")}function Yi(h){return h!=null&&typeof h=="object"}var wc=Ve?Rs(Ve):zd;function Eo(h){return bo(h)?Gd(h):Kd(h)}function rf(){return[]}function af(){return!1}e.exports=nf}(ya,ya.exports)),ya.exports}var bl={},ny;function DM(){if(ny)return bl;ny=1,Object.defineProperty(bl,"__esModule",{value:!0});const e=ty(),t=sy();var i;return function(s){function n(u={},d={},f=!1){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});let y=e(d);f||(y=Object.keys(y).reduce((m,b)=>(y[b]!=null&&(m[b]=y[b]),m),{}));for(const m in u)u[m]!==void 0&&d[m]===void 0&&(y[m]=u[m]);return Object.keys(y).length>0?y:void 0}s.compose=n;function r(u={},d={}){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});const f=Object.keys(u).concat(Object.keys(d)).reduce((y,m)=>(t(u[m],d[m])||(y[m]=d[m]===void 0?null:d[m]),y),{});return Object.keys(f).length>0?f:void 0}s.diff=r;function a(u={},d={}){u=u||{};const f=Object.keys(d).reduce((y,m)=>(d[m]!==u[m]&&u[m]!==void 0&&(y[m]=d[m]),y),{});return Object.keys(u).reduce((y,m)=>(u[m]!==d[m]&&d[m]===void 0&&(y[m]=null),y),f)}s.invert=a;function o(u,d,f=!1){if(typeof u!="object")return d;if(typeof d!="object")return;if(!f)return d;const y=Object.keys(d).reduce((m,b)=>(u[b]===void 0&&(m[b]=d[b]),m),{});return Object.keys(y).length>0?y:void 0}s.transform=o}(i||(i={})),bl.default=i,bl}var vl={},ry;function ay(){if(ry)return vl;ry=1,Object.defineProperty(vl,"__esModule",{value:!0});var e;return function(t){function i(s){return typeof s.delete=="number"?s.delete:typeof s.retain=="number"?s.retain:typeof s.retain=="object"&&s.retain!==null?1:typeof s.insert=="string"?s.insert.length:1}t.length=i}(e||(e={})),vl.default=e,vl}var El={},oy;function QM(){if(oy)return El;oy=1,Object.defineProperty(El,"__esModule",{value:!0});const e=ay();class t{constructor(s){this.ops=s,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(s){s||(s=1/0);const n=this.ops[this.index];if(n){const r=this.offset,a=e.default.length(n);if(s>=a-r?(s=a-r,this.index+=1,this.offset=0):this.offset+=s,typeof n.delete=="number")return{delete:s};{const o={};return n.attributes&&(o.attributes=n.attributes),typeof n.retain=="number"?o.retain=s:typeof n.retain=="object"&&n.retain!==null?o.retain=n.retain:typeof n.insert=="string"?o.insert=n.insert.substr(r,s):o.insert=n.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?e.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const s=this.ops[this.index];return s?typeof s.delete=="number"?"delete":typeof s.retain=="number"||typeof s.retain=="object"&&s.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const s=this.offset,n=this.index,r=this.next(),a=this.ops.slice(this.index);return this.offset=s,this.index=n,[r].concat(a)}}else return[]}}return El.default=t,El}var ly;function HM(){return ly||(ly=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const i=BM(),s=ty(),n=sy(),r=DM();t.AttributeMap=r.default;const a=ay();t.Op=a.default;const o=QM();t.OpIterator=o.default;const u="\0",d=(y,m)=>{if(typeof y!="object"||y===null)throw new Error(`cannot retain a ${typeof y}`);if(typeof m!="object"||m===null)throw new Error(`cannot retain a ${typeof m}`);const b=Object.keys(y)[0];if(!b||b!==Object.keys(m)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(m)[0]}`);return[b,y[b],m[b]]};class f{constructor(m){Array.isArray(m)?this.ops=m:m!=null&&Array.isArray(m.ops)?this.ops=m.ops:this.ops=[]}static registerEmbed(m,b){this.handlers[m]=b}static unregisterEmbed(m){delete this.handlers[m]}static getHandler(m){const b=this.handlers[m];if(!b)throw new Error(`no handlers for embed type "${m}"`);return b}insert(m,b){const E={};return typeof m=="string"&&m.length===0?this:(E.insert=m,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(E.attributes=b),this.push(E))}delete(m){return m<=0?this:this.push({delete:m})}retain(m,b){if(typeof m=="number"&&m<=0)return this;const E={retain:m};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(E.attributes=b),this.push(E)}push(m){let b=this.ops.length,E=this.ops[b-1];if(m=s(m),typeof E=="object"){if(typeof m.delete=="number"&&typeof E.delete=="number")return this.ops[b-1]={delete:E.delete+m.delete},this;if(typeof E.delete=="number"&&m.insert!=null&&(b-=1,E=this.ops[b-1],typeof E!="object"))return this.ops.unshift(m),this;if(n(m.attributes,E.attributes)){if(typeof m.insert=="string"&&typeof E.insert=="string")return this.ops[b-1]={insert:E.insert+m.insert},typeof m.attributes=="object"&&(this.ops[b-1].attributes=m.attributes),this;if(typeof m.retain=="number"&&typeof E.retain=="number")return this.ops[b-1]={retain:E.retain+m.retain},typeof m.attributes=="object"&&(this.ops[b-1].attributes=m.attributes),this}}return b===this.ops.length?this.ops.push(m):this.ops.splice(b,0,m),this}chop(){const m=this.ops[this.ops.length-1];return m&&typeof m.retain=="number"&&!m.attributes&&this.ops.pop(),this}filter(m){return this.ops.filter(m)}forEach(m){this.ops.forEach(m)}map(m){return this.ops.map(m)}partition(m){const b=[],E=[];return this.forEach($=>{(m($)?b:E).push($)}),[b,E]}reduce(m,b){return this.ops.reduce(m,b)}changeLength(){return this.reduce((m,b)=>b.insert?m+a.default.length(b):b.delete?m-b.delete:m,0)}length(){return this.reduce((m,b)=>m+a.default.length(b),0)}slice(m=0,b=1/0){const E=[],$=new o.default(this.ops);let R=0;for(;R<b&&$.hasNext();){let O;R<m?O=$.next(m-R):(O=$.next(b-R),E.push(O)),R+=a.default.length(O)}return new f(E)}compose(m){const b=new o.default(this.ops),E=new o.default(m.ops),$=[],R=E.peek();if(R!=null&&typeof R.retain=="number"&&R.attributes==null){let N=R.retain;for(;b.peekType()==="insert"&&b.peekLength()<=N;)N-=b.peekLength(),$.push(b.next());R.retain-N>0&&E.next(R.retain-N)}const O=new f($);for(;b.hasNext()||E.hasNext();)if(E.peekType()==="insert")O.push(E.next());else if(b.peekType()==="delete")O.push(b.next());else{const N=Math.min(b.peekLength(),E.peekLength()),z=b.next(N),V=E.next(N);if(V.retain){const Z={};if(typeof z.retain=="number")Z.retain=typeof V.retain=="number"?N:V.retain;else if(typeof V.retain=="number")z.retain==null?Z.insert=z.insert:Z.retain=z.retain;else{const re=z.retain==null?"insert":"retain",[w,C,I]=d(z[re],V.retain),p=f.getHandler(w);Z[re]={[w]:p.compose(C,I,re==="retain")}}const K=r.default.compose(z.attributes,V.attributes,typeof z.retain=="number");if(K&&(Z.attributes=K),O.push(Z),!E.hasNext()&&n(O.ops[O.ops.length-1],Z)){const re=new f(b.rest());return O.concat(re).chop()}}else typeof V.delete=="number"&&(typeof z.retain=="number"||typeof z.retain=="object"&&z.retain!==null)&&O.push(V)}return O.chop()}concat(m){const b=new f(this.ops.slice());return m.ops.length>0&&(b.push(m.ops[0]),b.ops=b.ops.concat(m.ops.slice(1))),b}diff(m,b){if(this.ops===m.ops)return new f;const E=[this,m].map(z=>z.map(V=>{if(V.insert!=null)return typeof V.insert=="string"?V.insert:u;const Z=z===m?"on":"with";throw new Error("diff() called "+Z+" non-document")}).join("")),$=new f,R=i(E[0],E[1],b,!0),O=new o.default(this.ops),N=new o.default(m.ops);return R.forEach(z=>{let V=z[1].length;for(;V>0;){let Z=0;switch(z[0]){case i.INSERT:Z=Math.min(N.peekLength(),V),$.push(N.next(Z));break;case i.DELETE:Z=Math.min(V,O.peekLength()),O.next(Z),$.delete(Z);break;case i.EQUAL:Z=Math.min(O.peekLength(),N.peekLength(),V);const K=O.next(Z),re=N.next(Z);n(K.insert,re.insert)?$.retain(Z,r.default.diff(K.attributes,re.attributes)):$.push(re).delete(Z);break}V-=Z}}),$.chop()}eachLine(m,b=`
|
108
108
|
`){const E=new o.default(this.ops);let $=new f,R=0;for(;E.hasNext();){if(E.peekType()!=="insert")return;const O=E.peek(),N=a.default.length(O)-E.peekLength(),z=typeof O.insert=="string"?O.insert.indexOf(b,N)-N:-1;if(z<0)$.push(E.next());else if(z>0)$.push(E.next(z));else{if(m($,E.next(1).attributes||{},R)===!1)return;R+=1,$=new f}}$.length()>0&&m($,{},R)}invert(m){const b=new f;return this.reduce((E,$)=>{if($.insert)b.delete(a.default.length($));else{if(typeof $.retain=="number"&&$.attributes==null)return b.retain($.retain),E+$.retain;if($.delete||typeof $.retain=="number"){const R=$.delete||$.retain;return m.slice(E,E+R).forEach(N=>{$.delete?b.push(N):$.retain&&$.attributes&&b.retain(a.default.length(N),r.default.invert($.attributes,N.attributes))}),E+R}else if(typeof $.retain=="object"&&$.retain!==null){const R=m.slice(E,E+1),O=new o.default(R.ops).next(),[N,z,V]=d($.retain,O.insert),Z=f.getHandler(N);return b.retain({[N]:Z.invert(z,V)},r.default.invert($.attributes,O.attributes)),E+1}}return E},0),b.chop()}transform(m,b=!1){if(b=!!b,typeof m=="number")return this.transformPosition(m,b);const E=m,$=new o.default(this.ops),R=new o.default(E.ops),O=new f;for(;$.hasNext()||R.hasNext();)if($.peekType()==="insert"&&(b||R.peekType()!=="insert"))O.retain(a.default.length($.next()));else if(R.peekType()==="insert")O.push(R.next());else{const N=Math.min($.peekLength(),R.peekLength()),z=$.next(N),V=R.next(N);if(z.delete)continue;if(V.delete)O.push(V);else{const Z=z.retain,K=V.retain;let re=typeof K=="object"&&K!==null?K:N;if(typeof Z=="object"&&Z!==null&&typeof K=="object"&&K!==null){const w=Object.keys(Z)[0];if(w===Object.keys(K)[0]){const C=f.getHandler(w);C&&(re={[w]:C.transform(Z[w],K[w],b)})}}O.retain(re,r.default.transform(z.attributes,V.attributes,b))}}return O.chop()}transformPosition(m,b=!1){b=!!b;const E=new o.default(this.ops);let $=0;for(;E.hasNext()&&$<=m;){const R=E.peekLength(),O=E.peekType();if(E.next(),O==="delete"){m-=Math.min(R,m-$);continue}else O==="insert"&&($<m||!b)&&(m+=R);$+=R}return m}}f.Op=a.default,f.OpIterator=o.default,f.AttributeMap=r.default,f.handlers={},t.default=f,e.exports=f,e.exports.default=f}(wl,wl.exports)),wl.exports}var Jt=HM();const ue=Xp(Jt);class mi extends Ht{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}mi.blotName="break",mi.tagName="BR";let gi=class extends yl{};function Cl(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}const Ui=class Ui extends Ku{static compare(t,i){const s=Ui.order.indexOf(t),n=Ui.order.indexOf(i);return s>=0||n>=0?s-n:t===i?0:t<i?-1:1}formatAt(t,i,s,n){if(Ui.compare(this.statics.blotName,s)<0&&this.scroll.query(s,he.BLOT)){const r=this.isolate(t,i);n&&r.wrap(s,n)}else super.formatAt(t,i,s,n)}optimize(t){if(super.optimize(t),this.parent instanceof Ui&&Ui.compare(this.statics.blotName,this.parent.statics.blotName)>0){const i=this.parent.isolate(this.offset(),this.length());this.moveChildren(i),i.wrap(this)}}};te(Ui,"allowedChildren",[Ui,mi,Ht,gi]),te(Ui,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Pi=Ui;const cy=1;class rt extends ma{constructor(){super(...arguments);te(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=uy(this)),this.cache.delta}deleteAt(i,s){super.deleteAt(i,s),this.cache={}}formatAt(i,s,n,r){s<=0||(this.scroll.query(n,he.BLOCK)?i+s===this.length()&&this.format(n,r):super.formatAt(i,Math.min(s,this.length()-i-1),n,r),this.cache={})}insertAt(i,s,n){if(n!=null){super.insertAt(i,s,n),this.cache={};return}if(s.length===0)return;const r=s.split(`
|
109
109
|
`),a=r.shift();a.length>0&&(i<this.length()-1||this.children.tail==null?super.insertAt(Math.min(i,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});let o=this;r.reduce((u,d)=>(o=o.split(u,!0),o.insertAt(0,d),d.length),i+a.length)}insertBefore(i,s){const{head:n}=this.children;super.insertBefore(i,s),n instanceof mi&&n.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+cy),this.cache.length}moveChildren(i,s){super.moveChildren(i,s),this.cache={}}optimize(i){super.optimize(i),this.cache={}}path(i){return super.path(i,!0)}removeChild(i){super.removeChild(i),this.cache={}}split(i){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(s&&(i===0||i>=this.length()-cy)){const r=this.clone();return i===0?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}const n=super.split(i,s);return this.cache={},n}}rt.blotName="block",rt.tagName="P",rt.defaultChild=mi,rt.allowedChildren=[mi,Pi,Ht,gi];class ei extends Ht{attach(){super.attach(),this.attributes=new ml(this.domNode)}delta(){return new ue().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,i){const s=this.scroll.query(t,he.BLOCK_ATTRIBUTE);s!=null&&this.attributes.attribute(s,i)}formatAt(t,i,s,n){this.format(s,n)}insertAt(t,i,s){if(s!=null){super.insertAt(t,i,s);return}const n=i.split(`
|
110
110
|
`),r=n.pop(),a=n.map(u=>{const d=this.scroll.create(rt.blotName);return d.insertAt(0,u),d}),o=this.split(t);a.forEach(u=>{this.parent.insertBefore(u,o)}),r&&this.parent.insertBefore(this.scroll.create("text",r),o)}}ei.scope=he.BLOCK_BLOT;function uy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(ht).reduce((i,s)=>s.length()===0?i:i.insert(s.value(),ti(s,{},t)),new ue).insert(`
|
@@ -175,7 +175,7 @@ ${Cl(this.code(t,i))}
|
|
175
175
|
* @author RubaXa <trash@rubaxa.org>
|
176
176
|
* @author owenm <owen23355@gmail.com>
|
177
177
|
* @license MIT
|
178
|
-
*/function dw(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,s)}return i}function Di(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?dw(Object(i),!0).forEach(function(s){Iq(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dw(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function kl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kl=function(t){return typeof t}:kl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(e)}function Iq(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function os(){return os=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},os.apply(this,arguments)}function _q(e,t){if(e==null)return{};var i={},s=Object.keys(e),n,r;for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function Vq(e,t){if(e==null)return{};var i=_q(e,t),s,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)s=r[n],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}var Aq="1.15.3";function ls(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var cs=ls(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),qa=ls(/Edge/i),fw=ls(/firefox/i),Oa=ls(/safari/i)&&!ls(/chrome/i)&&!ls(/android/i),pw=ls(/iP(ad|od|hone)/i),mw=ls(/chrome/i)&&ls(/android/i),gw={capture:!1,passive:!1};function qe(e,t,i){e.addEventListener(t,i,!cs&&gw)}function Me(e,t,i){e.removeEventListener(t,i,!cs&&gw)}function ql(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function yw(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function vi(e,t,i,s){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&ql(e,t):ql(e,t))||s&&e===i)return e;if(e===i)break}while(e=yw(e))}return null}var ww=/\s+/g;function Ft(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(ww," ").replace(" "+t+" "," ");e.className=(s+(i?" "+t:"")).replace(ww," ")}}function ge(e,t,i){var s=e&&e.style;if(s){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=i+(typeof i=="string"?"":"px")}}function er(e,t){var i="";if(typeof e=="string")i=e;else do{var s=ge(e,"transform");s&&s!=="none"&&(i=s+" "+i)}while(!t&&(e=e.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function bw(e,t,i){if(e){var s=e.getElementsByTagName(t),n=0,r=s.length;if(i)for(;n<r;n++)i(s[n],n);return s}return[]}function Qi(){var e=document.scrollingElement;return e||document.documentElement}function Xe(e,t,i,s,n){if(!(!e.getBoundingClientRect&&e!==window)){var r,a,o,u,d,f,y;if(e!==window&&e.parentNode&&e!==Qi()?(r=e.getBoundingClientRect(),a=r.top,o=r.left,u=r.bottom,d=r.right,f=r.height,y=r.width):(a=0,o=0,u=window.innerHeight,d=window.innerWidth,f=window.innerHeight,y=window.innerWidth),(t||i)&&e!==window&&(n=n||e.parentNode,!cs))do if(n&&n.getBoundingClientRect&&(ge(n,"transform")!=="none"||i&&ge(n,"position")!=="static")){var m=n.getBoundingClientRect();a-=m.top+parseInt(ge(n,"border-top-width")),o-=m.left+parseInt(ge(n,"border-left-width")),u=a+r.height,d=o+r.width;break}while(n=n.parentNode);if(s&&e!==window){var b=er(n||e),E=b&&b.a,$=b&&b.d;b&&(a/=$,o/=E,y/=E,f/=$,u=a+f,d=o+y)}return{top:a,left:o,bottom:u,right:d,width:y,height:f}}}function vw(e,t,i){for(var s=_s(e,!0),n=Xe(e)[t];s;){var r=Xe(s)[i],a=void 0;if(a=n>=r,!a)return s;if(s===Qi())break;s=_s(s,!1)}return!1}function tr(e,t,i,s){for(var n=0,r=0,a=e.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==ye.ghost&&(s||a[r]!==ye.dragged)&&vi(a[r],i.draggable,e,!1)){if(n===t)return a[r];n++}r++}return null}function Qh(e,t){for(var i=e.lastElementChild;i&&(i===ye.ghost||ge(i,"display")==="none"||t&&!ql(i,t));)i=i.previousElementSibling;return i||null}function si(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ye.clone&&(!t||ql(e,t))&&i++;return i}function Ew(e){var t=0,i=0,s=Qi();if(e)do{var n=er(e),r=n.a,a=n.d;t+=e.scrollLeft*r,i+=e.scrollTop*a}while(e!==s&&(e=e.parentNode));return[t,i]}function $q(e,t){for(var i in e)if(e.hasOwnProperty(i)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[i][s])return Number(i)}return-1}function _s(e,t){if(!e||!e.getBoundingClientRect)return Qi();var i=e,s=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var n=ge(i);if(i.clientWidth<i.scrollWidth&&(n.overflowX=="auto"||n.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(n.overflowY=="auto"||n.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return Qi();if(s||t)return i;s=!0}}while(i=i.parentNode);return Qi()}function Lq(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function Hh(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Pa;function Cw(e,t){return function(){if(!Pa){var i=arguments,s=this;i.length===1?e.call(s,i[0]):e.apply(s,i),Pa=setTimeout(function(){Pa=void 0},t)}}}function Mq(){clearTimeout(Pa),Pa=void 0}function Tw(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function Sw(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function xw(e,t,i){var s={};return Array.from(e.children).forEach(function(n){var r,a,o,u;if(!(!vi(n,t.draggable,e,!1)||n.animated||n===i)){var d=Xe(n);s.left=Math.min((r=s.left)!==null&&r!==void 0?r:1/0,d.left),s.top=Math.min((a=s.top)!==null&&a!==void 0?a:1/0,d.top),s.right=Math.max((o=s.right)!==null&&o!==void 0?o:-1/0,d.right),s.bottom=Math.max((u=s.bottom)!==null&&u!==void 0?u:-1/0,d.bottom)}}),s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var Vt="Sortable"+new Date().getTime();function Rq(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(n){if(!(ge(n,"display")==="none"||n===ye.ghost)){e.push({target:n,rect:Xe(n)});var r=Di({},e[e.length-1].rect);if(n.thisAnimationDuration){var a=er(n,!0);a&&(r.top-=a.f,r.left-=a.e)}n.fromRect=r}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice($q(e,{target:s}),1)},animateAll:function(s){var n=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var r=!1,a=0;e.forEach(function(o){var u=0,d=o.target,f=d.fromRect,y=Xe(d),m=d.prevFromRect,b=d.prevToRect,E=o.rect,$=er(d,!0);$&&(y.top-=$.f,y.left-=$.e),d.toRect=y,d.thisAnimationDuration&&Hh(m,y)&&!Hh(f,y)&&(E.top-y.top)/(E.left-y.left)===(f.top-y.top)/(f.left-y.left)&&(u=kq(E,m,b,n.options)),Hh(y,f)||(d.prevFromRect=f,d.prevToRect=y,u||(u=n.options.animation),n.animate(d,E,y,u)),u&&(r=!0,a=Math.max(a,u),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},u),d.thisAnimationDuration=u)}),clearTimeout(t),r?t=setTimeout(function(){typeof s=="function"&&s()},a):typeof s=="function"&&s(),e=[]},animate:function(s,n,r,a){if(a){ge(s,"transition",""),ge(s,"transform","");var o=er(this.el),u=o&&o.a,d=o&&o.d,f=(n.left-r.left)/(u||1),y=(n.top-r.top)/(d||1);s.animatingX=!!f,s.animatingY=!!y,ge(s,"transform","translate3d("+f+"px,"+y+"px,0)"),this.forRepaintDummy=Nq(s),ge(s,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ge(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){ge(s,"transition",""),ge(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},a)}}}}function Nq(e){return e.offsetWidth}function kq(e,t,i,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*s.animation}var ir=[],Uh={initializeByDefault:!0},Ba={mount:function(t){for(var i in Uh)Uh.hasOwnProperty(i)&&!(i in t)&&(t[i]=Uh[i]);ir.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),ir.push(t)},pluginEvent:function(t,i,s){var n=this;this.eventCanceled=!1,s.cancel=function(){n.eventCanceled=!0};var r=t+"Global";ir.forEach(function(a){i[a.pluginName]&&(i[a.pluginName][r]&&i[a.pluginName][r](Di({sortable:i},s)),i.options[a.pluginName]&&i[a.pluginName][t]&&i[a.pluginName][t](Di({sortable:i},s)))})},initializePlugins:function(t,i,s,n){ir.forEach(function(o){var u=o.pluginName;if(!(!t.options[u]&&!o.initializeByDefault)){var d=new o(t,i,t.options);d.sortable=t,d.options=t.options,t[u]=d,os(s,d.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,i){var s={};return ir.forEach(function(n){typeof n.eventProperties=="function"&&os(s,n.eventProperties.call(i[n.pluginName],t))}),s},modifyOption:function(t,i,s){var n;return ir.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[i]=="function"&&(n=r.optionListeners[i].call(t[r.pluginName],s))}),n}};function qq(e){var t=e.sortable,i=e.rootEl,s=e.name,n=e.targetEl,r=e.cloneEl,a=e.toEl,o=e.fromEl,u=e.oldIndex,d=e.newIndex,f=e.oldDraggableIndex,y=e.newDraggableIndex,m=e.originalEvent,b=e.putSortable,E=e.extraEventProperties;if(t=t||i&&i[Vt],!!t){var $,R=t.options,O="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!cs&&!qa?$=new CustomEvent(s,{bubbles:!0,cancelable:!0}):($=document.createEvent("Event"),$.initEvent(s,!0,!0)),$.to=a||i,$.from=o||i,$.item=n||i,$.clone=r,$.oldIndex=u,$.newIndex=d,$.oldDraggableIndex=f,$.newDraggableIndex=y,$.originalEvent=m,$.pullMode=b?b.lastPutMode:void 0;var N=Di(Di({},E),Ba.getEventProperties(s,t));for(var z in N)$[z]=N[z];i&&i.dispatchEvent($),R[O]&&R[O].call(t,$)}}var Oq=["evt"],At=function(t,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=s.evt,r=Vq(s,Oq);Ba.pluginEvent.bind(ye)(t,i,Di({dragEl:ne,parentEl:We,ghostEl:Ee,rootEl:Fe,nextEl:ln,lastDownEl:Ol,cloneEl:je,cloneHidden:Vs,dragStarted:Qa,putSortable:at,activeSortable:ye.active,originalEvent:n,oldIndex:sr,oldDraggableIndex:Da,newIndex:Gt,newDraggableIndex:As,hideGhostForTarget:Mw,unhideGhostForTarget:Rw,cloneNowHidden:function(){Vs=!0},cloneNowShown:function(){Vs=!1},dispatchSortableEvent:function(o){bt({sortable:i,name:o,originalEvent:n})}},r))};function bt(e){qq(Di({putSortable:at,cloneEl:je,targetEl:ne,rootEl:Fe,oldIndex:sr,oldDraggableIndex:Da,newIndex:Gt,newDraggableIndex:As},e))}var ne,We,Ee,Fe,ln,Ol,je,Vs,sr,Gt,Da,As,Pl,at,nr=!1,Bl=!1,Dl=[],cn,Ei,Fh,Gh,Iw,_w,Qa,rr,Ha,Ua=!1,Ql=!1,Hl,ft,jh=[],Wh=!1,Ul=[],Fl=typeof document<"u",Gl=pw,Vw=qa||cs?"cssFloat":"float",Pq=Fl&&!mw&&!pw&&"draggable"in document.createElement("div"),Aw=function(){if(Fl){if(cs)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),$w=function(t,i){var s=ge(t),n=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),r=tr(t,0,i),a=tr(t,1,i),o=r&&ge(r),u=a&&ge(a),d=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Xe(r).width,f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Xe(a).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&o.float!=="none"){var y=o.float==="left"?"left":"right";return a&&(u.clear==="both"||u.clear===y)?"vertical":"horizontal"}return r&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||d>=n&&s[Vw]==="none"||a&&s[Vw]==="none"&&d+f>n)?"vertical":"horizontal"},Bq=function(t,i,s){var n=s?t.left:t.top,r=s?t.right:t.bottom,a=s?t.width:t.height,o=s?i.left:i.top,u=s?i.right:i.bottom,d=s?i.width:i.height;return n===o||r===u||n+a/2===o+d/2},Dq=function(t,i){var s;return Dl.some(function(n){var r=n[Vt].options.emptyInsertThreshold;if(!(!r||Qh(n))){var a=Xe(n),o=t>=a.left-r&&t<=a.right+r,u=i>=a.top-r&&i<=a.bottom+r;if(o&&u)return s=n}}),s},Lw=function(t){function i(r,a){return function(o,u,d,f){var y=o.options.group.name&&u.options.group.name&&o.options.group.name===u.options.group.name;if(r==null&&(a||y))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return i(r(o,u,d,f),a)(o,u,d,f);var m=(a?o:u).options.group.name;return r===!0||typeof r=="string"&&r===m||r.join&&r.indexOf(m)>-1}}var s={},n=t.group;(!n||kl(n)!="object")&&(n={name:n}),s.name=n.name,s.checkPull=i(n.pull,!0),s.checkPut=i(n.put),s.revertClone=n.revertClone,t.group=s},Mw=function(){!Aw&&Ee&&ge(Ee,"display","none")},Rw=function(){!Aw&&Ee&&ge(Ee,"display","")};Fl&&!mw&&document.addEventListener("click",function(e){if(Bl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Bl=!1,!1},!0);var un=function(t){if(ne){t=t.touches?t.touches[0]:t;var i=Dq(t.clientX,t.clientY);if(i){var s={};for(var n in t)t.hasOwnProperty(n)&&(s[n]=t[n]);s.target=s.rootEl=i,s.preventDefault=void 0,s.stopPropagation=void 0,i[Vt]._onDragOver(s)}}},Qq=function(t){ne&&ne.parentNode[Vt]._isOutsideThisEl(t.target)};function ye(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=os({},t),e[Vt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return $w(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ye.supportPointer!==!1&&"PointerEvent"in window&&!Oa,emptyInsertThreshold:5};Ba.initializePlugins(this,e,i);for(var s in i)!(s in t)&&(t[s]=i[s]);Lw(t);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=t.forceFallback?!1:Pq,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?qe(e,"pointerdown",this._onTapStart):(qe(e,"mousedown",this._onTapStart),qe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(qe(e,"dragover",this),qe(e,"dragenter",this)),Dl.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),os(this,Rq())}ye.prototype={constructor:ye,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(rr=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,ne):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,s=this.el,n=this.options,r=n.preventOnFilter,a=t.type,o=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(o||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,f=n.filter;if(Kq(s),!ne&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||n.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Oa&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=vi(u,n.draggable,s,!1),!(u&&u.animated)&&Ol!==u)){if(sr=si(u),Da=si(u,n.draggable),typeof f=="function"){if(f.call(this,t,u,this)){bt({sortable:i,rootEl:d,name:"filter",targetEl:u,toEl:s,fromEl:s}),At("filter",i,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(f&&(f=f.split(",").some(function(y){if(y=vi(d,y.trim(),s,!1),y)return bt({sortable:i,rootEl:y,name:"filter",targetEl:u,fromEl:s,toEl:s}),At("filter",i,{evt:t}),!0}),f)){r&&t.cancelable&&t.preventDefault();return}n.handle&&!vi(d,n.handle,s,!1)||this._prepareDragStart(t,o,u)}}},_prepareDragStart:function(t,i,s){var n=this,r=n.el,a=n.options,o=r.ownerDocument,u;if(s&&!ne&&s.parentNode===r){var d=Xe(s);if(Fe=r,ne=s,We=ne.parentNode,ln=ne.nextSibling,Ol=s,Pl=a.group,ye.dragged=ne,cn={target:ne,clientX:(i||t).clientX,clientY:(i||t).clientY},Iw=cn.clientX-d.left,_w=cn.clientY-d.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,ne.style["will-change"]="all",u=function(){if(At("delayEnded",n,{evt:t}),ye.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!fw&&n.nativeDraggable&&(ne.draggable=!0),n._triggerDragStart(t,i),bt({sortable:n,name:"choose",originalEvent:t}),Ft(ne,a.chosenClass,!0)},a.ignore.split(",").forEach(function(f){bw(ne,f.trim(),zh)}),qe(o,"dragover",un),qe(o,"mousemove",un),qe(o,"touchmove",un),qe(o,"mouseup",n._onDrop),qe(o,"touchend",n._onDrop),qe(o,"touchcancel",n._onDrop),fw&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),At("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(qa||cs))){if(ye.eventCanceled){this._onDrop();return}qe(o,"mouseup",n._disableDelayedDrag),qe(o,"touchend",n._disableDelayedDrag),qe(o,"touchcancel",n._disableDelayedDrag),qe(o,"mousemove",n._delayedDragTouchMoveHandler),qe(o,"touchmove",n._delayedDragTouchMoveHandler),a.supportPointer&&qe(o,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(u,a.delay)}else u()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ne&&zh(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Me(t,"mouseup",this._disableDelayedDrag),Me(t,"touchend",this._disableDelayedDrag),Me(t,"touchcancel",this._disableDelayedDrag),Me(t,"mousemove",this._delayedDragTouchMoveHandler),Me(t,"touchmove",this._delayedDragTouchMoveHandler),Me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?qe(document,"pointermove",this._onTouchMove):i?qe(document,"touchmove",this._onTouchMove):qe(document,"mousemove",this._onTouchMove):(qe(ne,"dragend",this),qe(Fe,"dragstart",this._onDragStart));try{document.selection?Wl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(nr=!1,Fe&&ne){At("dragStarted",this,{evt:i}),this.nativeDraggable&&qe(document,"dragover",Qq);var s=this.options;!t&&Ft(ne,s.dragClass,!1),Ft(ne,s.ghostClass,!0),ye.active=this,t&&this._appendGhost(),bt({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(Ei){this._lastX=Ei.clientX,this._lastY=Ei.clientY,Mw();for(var t=document.elementFromPoint(Ei.clientX,Ei.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ei.clientX,Ei.clientY),t!==i);)i=t;if(ne.parentNode[Vt]._isOutsideThisEl(t),i)do{if(i[Vt]){var s=void 0;if(s=i[Vt]._onDragOver({clientX:Ei.clientX,clientY:Ei.clientY,target:t,rootEl:i}),s&&!this.options.dragoverBubble)break}t=i}while(i=yw(i));Rw()}},_onTouchMove:function(t){if(cn){var i=this.options,s=i.fallbackTolerance,n=i.fallbackOffset,r=t.touches?t.touches[0]:t,a=Ee&&er(Ee,!0),o=Ee&&a&&a.a,u=Ee&&a&&a.d,d=Gl&&ft&&Ew(ft),f=(r.clientX-cn.clientX+n.x)/(o||1)+(d?d[0]-jh[0]:0)/(o||1),y=(r.clientY-cn.clientY+n.y)/(u||1)+(d?d[1]-jh[1]:0)/(u||1);if(!ye.active&&!nr){if(s&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Ee){a?(a.e+=f-(Fh||0),a.f+=y-(Gh||0)):a={a:1,b:0,c:0,d:1,e:f,f:y};var m="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ge(Ee,"webkitTransform",m),ge(Ee,"mozTransform",m),ge(Ee,"msTransform",m),ge(Ee,"transform",m),Fh=f,Gh=y,Ei=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ee){var t=this.options.fallbackOnBody?document.body:Fe,i=Xe(ne,!0,Gl,!0,t),s=this.options;if(Gl){for(ft=t;ge(ft,"position")==="static"&&ge(ft,"transform")==="none"&&ft!==document;)ft=ft.parentNode;ft!==document.body&&ft!==document.documentElement?(ft===document&&(ft=Qi()),i.top+=ft.scrollTop,i.left+=ft.scrollLeft):ft=Qi(),jh=Ew(ft)}Ee=ne.cloneNode(!0),Ft(Ee,s.ghostClass,!1),Ft(Ee,s.fallbackClass,!0),Ft(Ee,s.dragClass,!0),ge(Ee,"transition",""),ge(Ee,"transform",""),ge(Ee,"box-sizing","border-box"),ge(Ee,"margin",0),ge(Ee,"top",i.top),ge(Ee,"left",i.left),ge(Ee,"width",i.width),ge(Ee,"height",i.height),ge(Ee,"opacity","0.8"),ge(Ee,"position",Gl?"absolute":"fixed"),ge(Ee,"zIndex","100000"),ge(Ee,"pointerEvents","none"),ye.ghost=Ee,t.appendChild(Ee),ge(Ee,"transform-origin",Iw/parseInt(Ee.style.width)*100+"% "+_w/parseInt(Ee.style.height)*100+"%")}},_onDragStart:function(t,i){var s=this,n=t.dataTransfer,r=s.options;if(At("dragStart",this,{evt:t}),ye.eventCanceled){this._onDrop();return}At("setupClone",this),ye.eventCanceled||(je=Sw(ne),je.removeAttribute("id"),je.draggable=!1,je.style["will-change"]="",this._hideClone(),Ft(je,this.options.chosenClass,!1),ye.clone=je),s.cloneId=Wl(function(){At("clone",s),!ye.eventCanceled&&(s.options.removeCloneOnHide||Fe.insertBefore(je,ne),s._hideClone(),bt({sortable:s,name:"clone"}))}),!i&&Ft(ne,r.dragClass,!0),i?(Bl=!0,s._loopId=setInterval(s._emulateDragOver,50)):(Me(document,"mouseup",s._onDrop),Me(document,"touchend",s._onDrop),Me(document,"touchcancel",s._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(s,n,ne)),qe(document,"drop",s),ge(ne,"transform","translateZ(0)")),nr=!0,s._dragStartId=Wl(s._dragStarted.bind(s,i,t)),qe(document,"selectstart",s),Qa=!0,Oa&&ge(document.body,"user-select","none")},_onDragOver:function(t){var i=this.el,s=t.target,n,r,a,o=this.options,u=o.group,d=ye.active,f=Pl===u,y=o.sort,m=at||d,b,E=this,$=!1;if(Wh)return;function R(A,q){At(A,E,Di({evt:t,isOwner:f,axis:b?"vertical":"horizontal",revert:a,dragRect:n,targetRect:r,canSort:y,fromSortable:m,target:s,completed:N,onMove:function(J,ee){return jl(Fe,i,ne,n,J,Xe(J),t,ee)},changed:z},q))}function O(){R("dragOverAnimationCapture"),E.captureAnimationState(),E!==m&&m.captureAnimationState()}function N(A){return R("dragOverCompleted",{insertion:A}),A&&(f?d._hideClone():d._showClone(E),E!==m&&(Ft(ne,at?at.options.ghostClass:d.options.ghostClass,!1),Ft(ne,o.ghostClass,!0)),at!==E&&E!==ye.active?at=E:E===ye.active&&at&&(at=null),m===E&&(E._ignoreWhileAnimating=s),E.animateAll(function(){R("dragOverAnimationComplete"),E._ignoreWhileAnimating=null}),E!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(s===ne&&!ne.animated||s===i&&!s.animated)&&(rr=null),!o.dragoverBubble&&!t.rootEl&&s!==document&&(ne.parentNode[Vt]._isOutsideThisEl(t.target),!A&&un(t)),!o.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),$=!0}function z(){Gt=si(ne),As=si(ne,o.draggable),bt({sortable:E,name:"change",toEl:i,newIndex:Gt,newDraggableIndex:As,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=vi(s,o.draggable,i,!0),R("dragOver"),ye.eventCanceled)return $;if(ne.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||E._ignoreWhileAnimating===s)return N(!1);if(Bl=!1,d&&!o.disabled&&(f?y||(a=We!==Fe):at===this||(this.lastPutMode=Pl.checkPull(this,d,ne,t))&&u.checkPut(this,d,ne,t))){if(b=this._getDirection(t,s)==="vertical",n=Xe(ne),R("dragOverValid"),ye.eventCanceled)return $;if(a)return We=Fe,O(),this._hideClone(),R("revert"),ye.eventCanceled||(ln?Fe.insertBefore(ne,ln):Fe.appendChild(ne)),N(!0);var V=Qh(i,o.draggable);if(!V||Gq(t,b,this)&&!V.animated){if(V===ne)return N(!1);if(V&&i===t.target&&(s=V),s&&(r=Xe(s)),jl(Fe,i,ne,n,s,r,t,!!s)!==!1)return O(),V&&V.nextSibling?i.insertBefore(ne,V.nextSibling):i.appendChild(ne),We=i,z(),N(!0)}else if(V&&Fq(t,b,this)){var Z=tr(i,0,o,!0);if(Z===ne)return N(!1);if(s=Z,r=Xe(s),jl(Fe,i,ne,n,s,r,t,!1)!==!1)return O(),i.insertBefore(ne,Z),We=i,z(),N(!0)}else if(s.parentNode===i){r=Xe(s);var K=0,re,w=ne.parentNode!==i,C=!Bq(ne.animated&&ne.toRect||n,s.animated&&s.toRect||r,b),I=b?"top":"left",p=vw(s,"top","top")||vw(ne,"top","top"),T=p?p.scrollTop:void 0;rr!==s&&(re=r[I],Ua=!1,Ql=!C&&o.invertSwap||w),K=jq(t,s,r,b,C?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Ql,rr===s);var g;if(K!==0){var L=si(ne);do L-=K,g=We.children[L];while(g&&(ge(g,"display")==="none"||g===Ee))}if(K===0||g===s)return N(!1);rr=s,Ha=K;var x=s.nextElementSibling,S=!1;S=K===1;var _=jl(Fe,i,ne,n,s,r,t,S);if(_!==!1)return(_===1||_===-1)&&(S=_===1),Wh=!0,setTimeout(Uq,30),O(),S&&!x?i.appendChild(ne):s.parentNode.insertBefore(ne,S?x:s),p&&Tw(p,0,T-p.scrollTop),We=ne.parentNode,re!==void 0&&!Ql&&(Hl=Math.abs(re-Xe(s)[I])),z(),N(!0)}if(i.contains(ne))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Me(document,"mousemove",this._onTouchMove),Me(document,"touchmove",this._onTouchMove),Me(document,"pointermove",this._onTouchMove),Me(document,"dragover",un),Me(document,"mousemove",un),Me(document,"touchmove",un)},_offUpEvents:function(){var t=this.el.ownerDocument;Me(t,"mouseup",this._onDrop),Me(t,"touchend",this._onDrop),Me(t,"pointerup",this._onDrop),Me(t,"touchcancel",this._onDrop),Me(document,"selectstart",this)},_onDrop:function(t){var i=this.el,s=this.options;if(Gt=si(ne),As=si(ne,s.draggable),At("drop",this,{evt:t}),We=ne&&ne.parentNode,Gt=si(ne),As=si(ne,s.draggable),ye.eventCanceled){this._nulling();return}nr=!1,Ql=!1,Ua=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Kh(this.cloneId),Kh(this._dragStartId),this.nativeDraggable&&(Me(document,"drop",this),Me(i,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Oa&&ge(document.body,"user-select",""),ge(ne,"transform",""),t&&(Qa&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Ee&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),(Fe===We||at&&at.lastPutMode!=="clone")&&je&&je.parentNode&&je.parentNode.removeChild(je),ne&&(this.nativeDraggable&&Me(ne,"dragend",this),zh(ne),ne.style["will-change"]="",Qa&&!nr&&Ft(ne,at?at.options.ghostClass:this.options.ghostClass,!1),Ft(ne,this.options.chosenClass,!1),bt({sortable:this,name:"unchoose",toEl:We,newIndex:null,newDraggableIndex:null,originalEvent:t}),Fe!==We?(Gt>=0&&(bt({rootEl:We,name:"add",toEl:We,fromEl:Fe,originalEvent:t}),bt({sortable:this,name:"remove",toEl:We,originalEvent:t}),bt({rootEl:We,name:"sort",toEl:We,fromEl:Fe,originalEvent:t}),bt({sortable:this,name:"sort",toEl:We,originalEvent:t})),at&&at.save()):Gt!==sr&&Gt>=0&&(bt({sortable:this,name:"update",toEl:We,originalEvent:t}),bt({sortable:this,name:"sort",toEl:We,originalEvent:t})),ye.active&&((Gt==null||Gt===-1)&&(Gt=sr,As=Da),bt({sortable:this,name:"end",toEl:We,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Fe=ne=We=Ee=ln=je=Ol=Vs=cn=Ei=Qa=Gt=As=sr=Da=rr=Ha=at=Pl=ye.dragged=ye.ghost=ye.clone=ye.active=null,Ul.forEach(function(t){t.checked=!0}),Ul.length=Fh=Gh=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ne&&(this._onDragOver(t),Hq(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,s=this.el.children,n=0,r=s.length,a=this.options;n<r;n++)i=s[n],vi(i,a.draggable,this.el,!1)&&t.push(i.getAttribute(a.dataIdAttr)||zq(i));return t},sort:function(t,i){var s={},n=this.el;this.toArray().forEach(function(r,a){var o=n.children[a];vi(o,this.options.draggable,n,!1)&&(s[r]=o)},this),i&&this.captureAnimationState(),t.forEach(function(r){s[r]&&(n.removeChild(s[r]),n.appendChild(s[r]))}),i&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,i){return vi(t,i||this.options.draggable,this.el,!1)},option:function(t,i){var s=this.options;if(i===void 0)return s[t];var n=Ba.modifyOption(this,t,i);typeof n<"u"?s[t]=n:s[t]=i,t==="group"&&Lw(s)},destroy:function(){At("destroy",this);var t=this.el;t[Vt]=null,Me(t,"mousedown",this._onTapStart),Me(t,"touchstart",this._onTapStart),Me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Me(t,"dragover",this),Me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(i){i.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Dl.splice(Dl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Vs){if(At("hideClone",this),ye.eventCanceled)return;ge(je,"display","none"),this.options.removeCloneOnHide&&je.parentNode&&je.parentNode.removeChild(je),Vs=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Vs){if(At("showClone",this),ye.eventCanceled)return;ne.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(je,ne):ln?Fe.insertBefore(je,ln):Fe.appendChild(je),this.options.group.revertClone&&this.animate(ne,je),ge(je,"display",""),Vs=!1}}};function Hq(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function jl(e,t,i,s,n,r,a,o){var u,d=e[Vt],f=d.options.onMove,y;return window.CustomEvent&&!cs&&!qa?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=t,u.from=e,u.dragged=i,u.draggedRect=s,u.related=n||t,u.relatedRect=r||Xe(t),u.willInsertAfter=o,u.originalEvent=a,e.dispatchEvent(u),f&&(y=f.call(d,u,a)),y}function zh(e){e.draggable=!1}function Uq(){Wh=!1}function Fq(e,t,i){var s=Xe(tr(i.el,0,i.options,!0)),n=xw(i.el,i.options,Ee),r=10;return t?e.clientX<n.left-r||e.clientY<s.top&&e.clientX<s.right:e.clientY<n.top-r||e.clientY<s.bottom&&e.clientX<s.left}function Gq(e,t,i){var s=Xe(Qh(i.el,i.options.draggable)),n=xw(i.el,i.options,Ee),r=10;return t?e.clientX>n.right+r||e.clientY>s.bottom&&e.clientX>s.left:e.clientY>n.bottom+r||e.clientX>s.right&&e.clientY>s.top}function jq(e,t,i,s,n,r,a,o){var u=s?e.clientY:e.clientX,d=s?i.height:i.width,f=s?i.top:i.left,y=s?i.bottom:i.right,m=!1;if(!a){if(o&&Hl<d*n){if(!Ua&&(Ha===1?u>f+d*r/2:u<y-d*r/2)&&(Ua=!0),Ua)m=!0;else if(Ha===1?u<f+Hl:u>y-Hl)return-Ha}else if(u>f+d*(1-n)/2&&u<y-d*(1-n)/2)return Wq(t)}return m=m||a,m&&(u<f+d*r/2||u>y-d*r/2)?u>f+d/2?1:-1:0}function Wq(e){return si(ne)<si(e)?1:-1}function zq(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,s=0;i--;)s+=t.charCodeAt(i);return s.toString(36)}function Kq(e){Ul.length=0;for(var t=e.getElementsByTagName("input"),i=t.length;i--;){var s=t[i];s.checked&&Ul.push(s)}}function Wl(e){return setTimeout(e,0)}function Kh(e){return clearTimeout(e)}Fl&&qe(document,"touchmove",function(e){(ye.active||nr)&&e.cancelable&&e.preventDefault()}),ye.utils={on:qe,off:Me,css:ge,find:bw,is:function(t,i){return!!vi(t,i,t,!1)},extend:Lq,throttle:Cw,closest:vi,toggleClass:Ft,clone:Sw,index:si,nextTick:Wl,cancelNextTick:Kh,detectDirection:$w,getChild:tr,expando:Vt},ye.get=function(e){return e[Vt]},ye.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(ye.utils=Di(Di({},ye.utils),s.utils)),Ba.mount(s)})},ye.create=function(e,t){return new ye(e,t)},ye.version=Aq;var Ze=[],Fa,Yh,Xh=!1,Zh,Jh,zl,Ga;function Yq(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(i){var s=i.originalEvent;this.sortable.nativeDraggable?qe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?qe(document,"pointermove",this._handleFallbackAutoScroll):s.touches?qe(document,"touchmove",this._handleFallbackAutoScroll):qe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(i){var s=i.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?Me(document,"dragover",this._handleAutoScroll):(Me(document,"pointermove",this._handleFallbackAutoScroll),Me(document,"touchmove",this._handleFallbackAutoScroll),Me(document,"mousemove",this._handleFallbackAutoScroll)),Nw(),Kl(),Mq()},nulling:function(){zl=Yh=Fa=Xh=Ga=Zh=Jh=null,Ze.length=0},_handleFallbackAutoScroll:function(i){this._handleAutoScroll(i,!0)},_handleAutoScroll:function(i,s){var n=this,r=(i.touches?i.touches[0]:i).clientX,a=(i.touches?i.touches[0]:i).clientY,o=document.elementFromPoint(r,a);if(zl=i,s||this.options.forceAutoScrollFallback||qa||cs||Oa){ed(i,this.options,o,s);var u=_s(o,!0);Xh&&(!Ga||r!==Zh||a!==Jh)&&(Ga&&Nw(),Ga=setInterval(function(){var d=_s(document.elementFromPoint(r,a),!0);d!==u&&(u=d,Kl()),ed(i,n.options,d,s)},10),Zh=r,Jh=a)}else{if(!this.options.bubbleScroll||_s(o,!0)===Qi()){Kl();return}ed(i,this.options,_s(o,!1),!1)}}},os(e,{pluginName:"scroll",initializeByDefault:!0})}function Kl(){Ze.forEach(function(e){clearInterval(e.pid)}),Ze=[]}function Nw(){clearInterval(Ga)}var ed=Cw(function(e,t,i,s){if(t.scroll){var n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,o=t.scrollSpeed,u=Qi(),d=!1,f;Yh!==i&&(Yh=i,Kl(),Fa=t.scroll,f=t.scrollFn,Fa===!0&&(Fa=_s(i,!0)));var y=0,m=Fa;do{var b=m,E=Xe(b),$=E.top,R=E.bottom,O=E.left,N=E.right,z=E.width,V=E.height,Z=void 0,K=void 0,re=b.scrollWidth,w=b.scrollHeight,C=ge(b),I=b.scrollLeft,p=b.scrollTop;b===u?(Z=z<re&&(C.overflowX==="auto"||C.overflowX==="scroll"||C.overflowX==="visible"),K=V<w&&(C.overflowY==="auto"||C.overflowY==="scroll"||C.overflowY==="visible")):(Z=z<re&&(C.overflowX==="auto"||C.overflowX==="scroll"),K=V<w&&(C.overflowY==="auto"||C.overflowY==="scroll"));var T=Z&&(Math.abs(N-n)<=a&&I+z<re)-(Math.abs(O-n)<=a&&!!I),g=K&&(Math.abs(R-r)<=a&&p+V<w)-(Math.abs($-r)<=a&&!!p);if(!Ze[y])for(var L=0;L<=y;L++)Ze[L]||(Ze[L]={});(Ze[y].vx!=T||Ze[y].vy!=g||Ze[y].el!==b)&&(Ze[y].el=b,Ze[y].vx=T,Ze[y].vy=g,clearInterval(Ze[y].pid),(T!=0||g!=0)&&(d=!0,Ze[y].pid=setInterval((function(){s&&this.layer===0&&ye.active._onTouchMove(zl);var x=Ze[this.layer].vy?Ze[this.layer].vy*o:0,S=Ze[this.layer].vx?Ze[this.layer].vx*o:0;typeof f=="function"&&f.call(ye.dragged.parentNode[Vt],S,x,e,zl,Ze[this.layer].el)!=="continue"||Tw(Ze[this.layer].el,S,x)}).bind({layer:y}),24))),y++}while(t.bubbleScroll&&m!==u&&(m=_s(m,!1)));Xh=d}},30),kw=function(t){var i=t.originalEvent,s=t.putSortable,n=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,o=t.hideGhostForTarget,u=t.unhideGhostForTarget;if(i){var d=s||r;o();var f=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i,y=document.elementFromPoint(f.clientX,f.clientY);u(),d&&!d.el.contains(y)&&(a("spill"),this.onSpill({dragEl:n,putSortable:s}))}};function td(){}td.prototype={startIndex:null,dragStart:function(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function(t){var i=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var n=tr(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(i,n):this.sortable.el.appendChild(i),this.sortable.animateAll(),s&&s.animateAll()},drop:kw},os(td,{pluginName:"revertOnSpill"});function id(){}id.prototype={onSpill:function(t){var i=t.dragEl,s=t.putSortable,n=s||this.sortable;n.captureAnimationState(),i.parentNode&&i.parentNode.removeChild(i),n.animateAll()},drop:kw},os(id,{pluginName:"removeOnSpill"}),ye.mount(new Yq),ye.mount(id,td);class Xq{constructor(t,i){te(this,"options",{interactionSubType:"default",maxChoices:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});return this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-order-source-wrapper"),this.sortable=null,this.isDisabled=!1,this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.notifyUpdate=this.notifyUpdate.bind(this),this.options.interactionSubType==="default"?this.sortable=new ye(this.sourcewrapper,{animation:400,onEnd:this.notifyUpdate}):this.options.interactionSubType==="ordermatch"&&(this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentTargetCount=0,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.targetwrapper=this.wrapper.querySelector(".qti-order-target-wrapper"),this.initializeTargets(this.targetwrapper),this.restoreResponse()),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"response"in t&&(this.options.response=t.response),"maxChoices"in t&&(this.options.maxChoices=t.maxChoices),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onSelectionsLimit"in t&&(this.options.onSelectionsLimit=t.onSelectionsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(t){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse(t)})}notifySelectionsLimit(){this.options.onSelectionsLimit!==null&&this.options.onSelectionsLimit()}toggleDisable(t){if(this.isDisabled=t,this.options.interactionSubType==="default"&&this.sortable!==null){this.sortable.option("disabled",t);const i=this.sourcewrapper.querySelectorAll(".draggable");this.enableDisableDraggers(i,t);return}this.enableDisableDraggers(this.draggers,t)}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,s,n){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.identifyTargets(!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=s,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=s-this.startingY,r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,this.removePlaceholder(r),this.addPlaceholder(r),r.classList.contains("dragging")||r.classList.add("dragging"),this.setCurrentDragger(r),this.addListeners(r,n)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const s=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(s),s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const n=s.getBoundingClientRect();this.findDraggerTarget(s,n,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(s,n,this.sources)}constrainDraggerToWrapper(t){const i=t.getBoundingClientRect(),s=this.wrapper.getBoundingClientRect(),n=this.startingX+this.offsetX-s.x,r=this.startingY+this.offsetY-s.y,a=this.startingX+i.width+this.offsetX-(s.x+s.width),o=this.startingY+i.height+this.offsetY-(s.y+s.height);n<0&&(this.offsetX=this.offsetX-n),a>0&&(this.offsetX=this.offsetX-a),r<0&&(this.offsetY=this.offsetY-r),o>0&&(this.offsetY=this.offsetY-o)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,s){const n=this.currentDragger;if(this.itemTarget===null?n.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,n.removeAttribute("style"),this.removePlaceholder(n),n.classList.contains("dragging")&&n.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,n),this.setCurrentDragger(null),this.removeListeners(n,s);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxChoices(this.itemStart,this.itemTarget,n)){this.resetDraggerToItemStart(this.itemStart,n),this.notifySelectionsLimit(),this.setCurrentDragger(null),this.removeListeners(n,s);return}this.itemStart.classList.remove("full"),this.setDraggerToItemTarget(this.itemTarget,n),this.itemTarget.classList.contains("source")&&(this.decrementTargetCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("target")||this.incrementTargetCount(),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(n,s)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}setDraggerToItemTarget(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}findDraggerTarget(t,i,s){s.forEach(n=>{const r=n.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&n.classList.contains("source")||n.classList.contains("full"))return;n.classList.add("active"),this.itemTarget=n}else n.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const s=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<s.bottom&&i.right-t.offsetWidth/2>s.left&&i.bottom-t.offsetHeight/2>s.top&&i.left+t.offsetWidth/2<s.right){for(let n=0;n<this.sources.length;n++)if(!this.sources[n].classList.contains("full")){this.sources[n].classList.add("active"),this.itemTarget=this.sources[n];break}}else for(let n=0;n<this.sources.length;n++)this.sources[n].classList.contains("active")&&this.sources[n].classList.remove("active")}addPlaceholder(t){const i=t.getBoundingClientRect(),s=document.createElement("div");s.classList.add("dragger-placeholder"),s.style.width=`${i.width}px`,s.style.height=`${i.height}px`,t.parentNode.insertBefore(s,t)}removePlaceholder(t){const i=t.parentNode.querySelector(".dragger-placeholder");i!==null&&t.parentNode.removeChild(i)}enableDisableDraggers(t,i){t.forEach(s=>{i?s.classList.add("disabled"):s.classList.remove("disabled")})}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full")},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,s)=>{const n=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",n),i.setAttribute("data-order",s),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t){for(let i=0;i<this.targets.length;i++)t&&!this.targets[i].classList.contains("full")&&this.targets[i].classList.add("target-active");t&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],s=t.children;for(let n=0;n<s.length;n++){const r=s[n].querySelector("div.draggable");if(r){const a=r.getAttribute("data-order");i.push([1*a,s[n]])}}i.sort(function(n,r){return n[0]-r[0]});for(let n=0;n<i.length;n++)t.appendChild(i[n][1])}getResponse(){return this.options.interactionSubType==="default"?this.computeResponse({target:this.sourcewrapper}):this.computeResponse()}computeResponse(t){let i=[];switch(this.options.interactionSubType){case"default":t.target.querySelectorAll(".qti-simple-choice").forEach(s=>{i.push(s.getAttribute("data-identifier"))});break;case"ordermatch":this.targets.forEach(s=>{if(s.classList.contains("full")){const n=s.querySelector(".draggable");if(n!==null){i.push(n.getAttribute("data-identifier"));return}}i.push(null)});break}return i}restoreResponse(){this.options.response!==null&&this.options.response.forEach((t,i)=>{if(t!==null){const s=this.findSourceDraggerByIdentifier(t);this.emptyDraggerParent(s),this.addSourceDraggerToTargetAtIndex(i,s)}},this)}findSourceDraggerByIdentifier(t){for(let i=0;i<this.draggers.length;i++)if(t===this.draggers[i].getAttribute("data-identifier"))return this.draggers[i];return null}addSourceDraggerToTargetAtIndex(t,i){const s=this.targets[t];s.append(i),s.classList.add("full")}addTargetDraggerToSourceAtIndex(t,i){const s=this.sources[t];s.append(i),s.classList.add("full")}emptyDraggerParent(t){t.parentNode.classList.remove("full")}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].getAttribute("data-identifier"))return this.sources[i];return null}isExceedingMaxChoices(t,i){return!(this.options.maxChoices===0||i.classList.contains("source")||t.classList.contains("target")||this.currentTargetCount<this.options.maxChoices)}initializeCurrentTargetCount(){this.currentTargetCount=0}incrementTargetCount(){this.currentTargetCount+=1}decrementTargetCount(){this.currentTargetCount!==0&&(this.currentTargetCount-=1)}reset(){this.options.interactionSubType==="ordermatch"&&(this.resetDraggersToSources(),this.initializeCurrentTargetCount()),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{if(t.classList.contains("full")){const i=t.querySelector(".draggable"),s=this.findSourceByIdentifier(i.getAttribute("data-identifier"));if(s.classList.contains("full"))return;this.emptyDraggerParent(i),s.append(i),s.classList.add("full")}},this)}destroy(){this.options.interactionSubType==="ordermatch"&&(this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.draggers.forEach(t=>{t.removeEventListener("touchstart",this.handleTouchStart),t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd),t.removeEventListener("mousedown",this.handleDragStart)},this),this.targetwrapper.remove())}}const Zq=new F,Jq=new ie,eO={emits:["orderGroupReady","orderGroupUpdate","orderGroupSelectionsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String,default:"horizontal"},maxChoices:{required:!1,type:Number},interactionSubType:{required:!0,type:String},priorState:{required:!1,type:Object,default:null}},data(){return{choices:[],response:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,promptElement:null,isOrientationVertical:!1,presentationFactory:null,sortable:null,isQtiValid:!0}},computed:{computedMaxChoices(){return this.maxChoices===null?0:this.maxChoices}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.sortable!==null&&this.sortable.toggleDisable(!0)},enable(){this.sortable!==null&&this.sortable.toggleDisable(!1)},getPromptElement(){return this.promptElement},setPromptElement(e){this.promptElement=e},validateChildren(){let e=0;this.$slots.default&&this.$slots.default()[0].children.forEach(t=>{if(Zq.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e>0)throw new c("Invalid element order. qti-prompt must come before qti-simple-choice's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new c("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e+=1;throw new c('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children[0].children.forEach(t=>{t.component!==null&&t.type.name==="QtiSimpleChoice"&&this.choices.push(t.component.proxy)})},processGroupUI(e){if(this.hasPrompt){const i=this.$refs.ordergroup.querySelector(".qti-prompt");i!==null&&this.setPromptElement(i.cloneNode(!0))}const t=this.createContainer(this.choices,this.priorState);this.processContainerChoices(t),this.presentationFactory.initialize(this.$refs.root,this),this.sortable=new Xq(this.$refs.root,{interactionSubType:this.interactionSubType,maxChoices:this.computedMaxChoices,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onSelectionsLimit:this.handleSelectionsLimit})},resetGroupUI(){this.sortable!==null&&(this.sortable.reset(),this.sortable=null,this.processGroupUI(null))},handleWidgetReady(e){this.setResponse(e.response),this.$emit("orderGroupReady",{choices:this.choices,response:this.getResponse()})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("orderGroupUpdate",{response:this.getResponse()})},handleSelectionsLimit(){this.$emit("orderGroupSelectionsLimit")},processContainerChoices(e){this.choices.splice(0,this.choices.length),this.$refs.ordergroup.innerHTML="",e.forEach(t=>{this.$refs.ordergroup.appendChild(t.node.$el),this.choices.push(t.node)},this)},createContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),this.isShuffle&&Jq.shuffleArrayFixed(i),i):(this.getPriorValue(this.interactionSubType).forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},getPriorValue(e){return this.priorState===null?[]:e==="default"?this.priorState.state.order:this.priorState.state.oorder},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Order Interaction State Invalid. Choice identifier "'+e+'" not found.')},initializeOrderGroup(){this.isShuffle=this.shuffle==="true",this.isOrientationVertical=this.orientation==="vertical",this.presentationFactory=new xq}},created(){try{if(typeof this.cardinality>"u")throw new c("Undefined qti-order-interaction cardinality");if(this.cardinality!=="ordered")throw new c('qti-order-interaction cardinality must be "ordered"');this.initializeOrderGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiOrderInteraction][ValidationError]",e.name,e.message),new c(e.message)}},mounted(){if(this.isQtiValid)try{if(this.orderInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.priorState===null)return this.processGroupUI(null);if(this.interactionSubType==="default")return this.processGroupUI(this.priorState.order);this.interactionSubType==="ordermatch"&&this.processGroupUI(this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiOrderInteraction][ValidationException]",e.message),new c(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiOrderInteraction][EvaluationException]",e.message),new B(e.message)}},beforeUnmount(){this.sortable.destroy(),this.sortable=null}},tO={ref:"root",class:"qti-order-interaction-wrapper"},iO={ref:"ordergroup",class:"qti-order-source-wrapper"};function sO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tO,[l.createElementVNode("ul",iO,[l.renderSlot(e.$slots,"default")],512)],512)}const nO=D(eO,[["render",sO]]),rO={name:"QtiGapText",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"}},data(){return{id:null,isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},aO=["data-identifier","data-match-max","data-match-min","data-match-group"],oO={ref:"text",class:"gap-choice-text draggable"};function lO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("li",{ref:"choicetext","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-text source"},[l.createElementVNode("div",oO,[l.renderSlot(e.$slots,"default")],512)],8,aO)}const cO=D(rO,[["render",lO]]),uO={name:"QtiGapImg",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"},objectLabel:{required:!1,type:String,default:null},top:{required:!1,type:String,default:null},left:{required:!1,type:String,default:null}},data(){return{isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},hO=["data-identifier","data-match-max","data-match-min","data-match-group"],dO={ref:"image",class:"gap-choice-img draggable"};function fO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("li",{ref:"choiceimage","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-img source"},[l.createElementVNode("div",dO,[l.renderSlot(e.$slots,"default")],512)],8,hO)}const pO=D(uO,[["render",fO]]),mO={name:"QtiGap",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},required:{required:!1,type:String,default:"false"}},data(){return{id:null,isRequired:!1,inputWidthClass:"",isQtiValid:!0}},methods:{},created(){this.isRequired=this.required!=="false"},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},gO=["data-identifier","data-required","data-match-group"];function yO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("span",{ref:"gap","data-identifier":i.identifier,"data-required":n.isRequired,"data-match-max":"1","data-match-group":i.matchGroup,class:"gap-match-gap"},null,8,gO)}const wO=D(mO,[["render",yO]]),bO=new F,vO={name:"QtiHottext",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"}},data(){return{id:null,checked:"false",isRadio:!0,isDisabled:!1,isQtiValid:!0}},inheritAttrs:!0,methods:{handleClick(e){e.preventDefault(),!this.isDisabled&&(this.isRadio?this.triggerChecked(this.identifier,"true"):(this.toggleChecked(),this.triggerChecked(this.identifier,this.checked)))},handleKeydown(e){switch(e.code){case"Space":case"Enter":if(e.stopPropagation(),e.preventDefault(),this.isDisabled)return;this.toggleChecked(),this.triggerChecked(this.identifier,this.checked);break}},triggerChecked(e,t){const i=new CustomEvent("setChecked",{bubbles:!0,cancelable:!0,detail:{identifier:e,checked:t}});this.$refs.hottext.dispatchEvent(i)},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},setFocus(){this.$refs.hottext.focus()},setIsDisabled(e){this.isDisabled=e},initialize(){switch(this.$parent.cardinality){case"multiple":this.isRadio=!1,this.tabIndex=0;break;default:this.isRadio=!0,this.tabIndex=0;break}},createId(){if(this.$refs.hottext.hasAttribute("id")){this.id=this.$refs.hottext.getAttribute("id");return}this.id="hottext_"+bO.randomString(5,"a")+"_"+this.identifier,this.$refs.hottext.setAttribute("id",this.id)}},created(){this.initialize()},mounted(){if(this.isQtiValid)try{this.createId(),console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},EO=["data-identifier","aria-checked","tabindex"];function CO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("span",{ref:"hottext","data-identifier":i.identifier,"aria-checked":n.checked,tabindex:e.tabIndex,onClick:t[0]||(t[0]=(...a)=>r.handleClick&&r.handleClick(...a)),onKeydown:t[1]||(t[1]=(...a)=>r.handleKeydown&&r.handleKeydown(...a)),class:"qti-hottext"},[l.renderSlot(e.$slots,"default")],40,EO)}const TO=D(vO,[["render",CO]]),SO=new F,xO={name:"QtiHotspotChoice",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},shape:{required:!0,type:String},coords:{required:!0,type:String},hotspotLabel:{required:!1,type:String,default:""},ariaLabel:{required:!1,type:String,default:""}},data(){return{shapeData:null,shapeColorProperties:null,checked:"false",isRadio:!0,isQtiValid:!0}},inheritAttrs:!0,methods:{getIdentifier(){return this.identifier},getShape(){return this.shape},getChecked(){return this.checked},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},getRole(){return this.isRadio?"radio":"checkbox"},getAriaLabel(){return this.ariaLabel.length>0?this.ariaLabel:this.hotspotLabel},getShapeColorProperties(){return this.shapeColorProperties},setShapeColorProperties(e){this.shapeColorProperties=e},getShapeData(){return this.shapeData},setShapeData(){const e=this.coords.split(",");switch(this.shape){case"circle":if(e.length!=3)return;this.shapeData=e;return;case"rect":if(e.length!==4)return;e[2]=parseInt(e[2])-parseInt(e[0]),e[3]=parseInt(e[3])-parseInt(e[1]),this.shapeData=e;return;case"poly":this.shapeData=this.computePolyShapeData(this.transformPolyCoords(e));return;case"ellipse":if(e.length!=4)return;this.shapeData=e;return;case"default":this.shapeData="";return}},transformPolyCoords(e){let t="";if(e.length%2!=0)return t;for(let i=0;i<e.length;i+=2)t+=`${e[i]},${e[i+1]}`,i+2<e.length&&(t+=" ");return t},computePolyShapeData(e){const t=e.indexOf(" ");return"M "+[e.slice(0,t),"L",e.slice(t)].join(" ")+" z"},getShapeElement(){let e=null;const t=this.getShapeData();if(t==null)return null;switch(this.getShape()){case"circle":e=document.createElementNS("http://www.w3.org/2000/svg","circle"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("r",t[2]);break;case"rect":e=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.setAttribute("x",t[0]),e.setAttribute("y",t[1]),e.setAttribute("width",t[2]),e.setAttribute("height",t[3]);break;case"poly":e=document.createElementNS("http://www.w3.org/2000/svg","path"),e.setAttribute("d",t);break;case"ellipse":e=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("rx",t[2]),e.setAttribute("ry",t[3]);break}return e!==null&&(e.setAttribute("class","qti3-player-hotspot-choice"),e.setAttribute("tabindex","0"),e.setAttribute("data-identifier",this.getIdentifier()),e.setAttribute("role",this.getRole()),e.setAttribute("aria-checked","false"),e.setAttribute("aria-label",this.getAriaLabel()),e.setAttribute("fill",`${this.shapeColorProperties.fillColor}`),e.setAttribute("fill-opacity",`${this.shapeColorProperties.fillOpacity}`),e.setAttribute("opacity",`${this.shapeColorProperties.unselectedOpacity}`),e.setAttribute("stroke",`${this.shapeColorProperties.strokeColor}`),e.setAttribute("stroke-width",`${this.shapeColorProperties.strokeWidth}`)),e},initialize(){switch(SO.validateShapeAttribute(this.shape),this.$parent.cardinality){case"multiple":this.isRadio=!1;break;default:this.isRadio=!0;break}this.setShapeData(),this.setShapeColorProperties(this.$parent.getShapeColorProperties())}},created(){try{this.initialize()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message)}},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},IO={ref:"hotspotchoice",class:"qti-hotspot-choice"};function _O(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",IO,[l.renderSlot(e.$slots,"default")],512)}const VO=D(xO,[["render",_O]]),AO=new F,$O={name:"QtiInteractionModules",props:{primaryConfiguration:{required:!1,type:String,default:""},secondaryConfiguration:{required:!1,type:String,default:""}},data(){return{modules:[],isQtiValid:!0}},inheritAttrs:!0,methods:{getPrimaryConfiguration(){return this.primaryConfiguration},getSecondaryConfiguration(){return this.secondaryConfiguration},getModules(){return this.modules},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(AO.isValidSlot(e)){if(e.type.name==="QtiInteractionModule")return;throw new c('Node is not a qti-interaction-module: "'+e.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.type.name==="QtiInteractionModule"&&t.component!==null&&this.modules.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("[PCI]["+this.$options.name+"][PrimaryCfg="+this.primaryConfiguration+"][SecondaryCfg="+this.secondaryConfiguration+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},LO={ref:"root",class:"qti-interaction-modules"};function MO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",LO,[l.renderSlot(e.$slots,"default")],512)}const RO=D($O,[["render",MO]]),NO={name:"QtiInteractionModule",props:{id:{required:!0,type:String},primaryPath:{required:!1,type:String,default:""},fallbackPath:{required:!1,type:String,default:""}},data(){return{isQtiValid:!0}},inheritAttrs:!0,methods:{getId(){return this.id},getPrimaryPath(){return this.primaryPath},getFallbackPath(){return this.fallbackPath}},mounted(){if(this.isQtiValid)try{console.log("[PCI]["+this.$options.name+"][Id="+this.id+"]","[Primary="+this.primaryPath+"]","[Fallback="+this.fallbackPath+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},kO={ref:"root",class:"qti-interaction-module"};function qO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",kO,null,512)}const OO=D(NO,[["render",qO]]),PO={name:"QtiInteractionMarkup",props:{},data(){return{markup:"",isQtiValid:!0}},inheritAttrs:!0,methods:{getMarkup(){return this.markup},setMarkup(e){this.markup=e}},mounted(){if(this.isQtiValid)try{this.setMarkup(this.$refs.root.innerHTML),console.log("[PCI]["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},BO={ref:"root",class:"qti-interaction-markup"};function DO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",BO,[l.renderSlot(e.$slots,"default")],512)}const QO=D(PO,[["render",DO]]),qw=new F,ar=new ie,HO={name:"QtiTemplateVariable",props:{templateIdentifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.templateIdentifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return ar.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=qw.validateVariableIdentifierAttribute(M,this.getIdentifier());if(typeof e>"u")return this.setValue(ar.valueToPciJson(ar.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",{base:null}),this.setValue(ar.valueToPciJson(ar.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=ar.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{let e=qw.validateVariableIdentifierAttribute(M,this.getIdentifier());this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},UO={class:"qti-template-variable"};function FO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",UO)}const GO=D(HO,[["render",FO]]),Ow=new F,or=new ie,jO={name:"QtiContextVariable",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return or.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=Ow.validateVariableIdentifierAttribute(M,this.identifier);if(typeof e>"u")return this.setValue(or.valueToPciJson(or.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiContextVariable]["+this.identifier+"] value:",{base:null}),this.setValue(or.valueToPciJson(or.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=or.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiContextVariable]["+this.identifier+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{let e=Ow.validateVariableIdentifierAttribute(M,this.identifier);this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},WO={class:"qti-context-variable"};function zO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",WO)}const KO=D(jO,[["render",zO]]),Pw=new F,YO=new ie,XO={name:"QtiResponseProcessing",props:{template:{type:String,required:!1}},data(){return{responseRules:[],isQtiValid:!0,matchCorrectXml:`<qti-response-condition>
|
178
|
+
*/function dw(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,s)}return i}function Di(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?dw(Object(i),!0).forEach(function(s){Iq(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dw(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function kl(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kl=function(t){return typeof t}:kl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(e)}function Iq(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function os(){return os=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},os.apply(this,arguments)}function _q(e,t){if(e==null)return{};var i={},s=Object.keys(e),n,r;for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function Vq(e,t){if(e==null)return{};var i=_q(e,t),s,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)s=r[n],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}var Aq="1.15.3";function ls(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var cs=ls(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),qa=ls(/Edge/i),fw=ls(/firefox/i),Oa=ls(/safari/i)&&!ls(/chrome/i)&&!ls(/android/i),pw=ls(/iP(ad|od|hone)/i),mw=ls(/chrome/i)&&ls(/android/i),gw={capture:!1,passive:!1};function qe(e,t,i){e.addEventListener(t,i,!cs&&gw)}function Me(e,t,i){e.removeEventListener(t,i,!cs&&gw)}function ql(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function yw(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function vi(e,t,i,s){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&ql(e,t):ql(e,t))||s&&e===i)return e;if(e===i)break}while(e=yw(e))}return null}var ww=/\s+/g;function Ft(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(ww," ").replace(" "+t+" "," ");e.className=(s+(i?" "+t:"")).replace(ww," ")}}function ge(e,t,i){var s=e&&e.style;if(s){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=i+(typeof i=="string"?"":"px")}}function er(e,t){var i="";if(typeof e=="string")i=e;else do{var s=ge(e,"transform");s&&s!=="none"&&(i=s+" "+i)}while(!t&&(e=e.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function bw(e,t,i){if(e){var s=e.getElementsByTagName(t),n=0,r=s.length;if(i)for(;n<r;n++)i(s[n],n);return s}return[]}function Qi(){var e=document.scrollingElement;return e||document.documentElement}function Ze(e,t,i,s,n){if(!(!e.getBoundingClientRect&&e!==window)){var r,a,o,u,d,f,y;if(e!==window&&e.parentNode&&e!==Qi()?(r=e.getBoundingClientRect(),a=r.top,o=r.left,u=r.bottom,d=r.right,f=r.height,y=r.width):(a=0,o=0,u=window.innerHeight,d=window.innerWidth,f=window.innerHeight,y=window.innerWidth),(t||i)&&e!==window&&(n=n||e.parentNode,!cs))do if(n&&n.getBoundingClientRect&&(ge(n,"transform")!=="none"||i&&ge(n,"position")!=="static")){var m=n.getBoundingClientRect();a-=m.top+parseInt(ge(n,"border-top-width")),o-=m.left+parseInt(ge(n,"border-left-width")),u=a+r.height,d=o+r.width;break}while(n=n.parentNode);if(s&&e!==window){var b=er(n||e),E=b&&b.a,$=b&&b.d;b&&(a/=$,o/=E,y/=E,f/=$,u=a+f,d=o+y)}return{top:a,left:o,bottom:u,right:d,width:y,height:f}}}function vw(e,t,i){for(var s=_s(e,!0),n=Ze(e)[t];s;){var r=Ze(s)[i],a=void 0;if(a=n>=r,!a)return s;if(s===Qi())break;s=_s(s,!1)}return!1}function tr(e,t,i,s){for(var n=0,r=0,a=e.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==ye.ghost&&(s||a[r]!==ye.dragged)&&vi(a[r],i.draggable,e,!1)){if(n===t)return a[r];n++}r++}return null}function Qh(e,t){for(var i=e.lastElementChild;i&&(i===ye.ghost||ge(i,"display")==="none"||t&&!ql(i,t));)i=i.previousElementSibling;return i||null}function si(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ye.clone&&(!t||ql(e,t))&&i++;return i}function Ew(e){var t=0,i=0,s=Qi();if(e)do{var n=er(e),r=n.a,a=n.d;t+=e.scrollLeft*r,i+=e.scrollTop*a}while(e!==s&&(e=e.parentNode));return[t,i]}function $q(e,t){for(var i in e)if(e.hasOwnProperty(i)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[i][s])return Number(i)}return-1}function _s(e,t){if(!e||!e.getBoundingClientRect)return Qi();var i=e,s=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var n=ge(i);if(i.clientWidth<i.scrollWidth&&(n.overflowX=="auto"||n.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(n.overflowY=="auto"||n.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return Qi();if(s||t)return i;s=!0}}while(i=i.parentNode);return Qi()}function Lq(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function Hh(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Pa;function Cw(e,t){return function(){if(!Pa){var i=arguments,s=this;i.length===1?e.call(s,i[0]):e.apply(s,i),Pa=setTimeout(function(){Pa=void 0},t)}}}function Mq(){clearTimeout(Pa),Pa=void 0}function Tw(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function Sw(e){var t=window.Polymer,i=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):i?i(e).clone(!0)[0]:e.cloneNode(!0)}function xw(e,t,i){var s={};return Array.from(e.children).forEach(function(n){var r,a,o,u;if(!(!vi(n,t.draggable,e,!1)||n.animated||n===i)){var d=Ze(n);s.left=Math.min((r=s.left)!==null&&r!==void 0?r:1/0,d.left),s.top=Math.min((a=s.top)!==null&&a!==void 0?a:1/0,d.top),s.right=Math.max((o=s.right)!==null&&o!==void 0?o:-1/0,d.right),s.bottom=Math.max((u=s.bottom)!==null&&u!==void 0?u:-1/0,d.bottom)}}),s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var Vt="Sortable"+new Date().getTime();function Rq(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(n){if(!(ge(n,"display")==="none"||n===ye.ghost)){e.push({target:n,rect:Ze(n)});var r=Di({},e[e.length-1].rect);if(n.thisAnimationDuration){var a=er(n,!0);a&&(r.top-=a.f,r.left-=a.e)}n.fromRect=r}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice($q(e,{target:s}),1)},animateAll:function(s){var n=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var r=!1,a=0;e.forEach(function(o){var u=0,d=o.target,f=d.fromRect,y=Ze(d),m=d.prevFromRect,b=d.prevToRect,E=o.rect,$=er(d,!0);$&&(y.top-=$.f,y.left-=$.e),d.toRect=y,d.thisAnimationDuration&&Hh(m,y)&&!Hh(f,y)&&(E.top-y.top)/(E.left-y.left)===(f.top-y.top)/(f.left-y.left)&&(u=kq(E,m,b,n.options)),Hh(y,f)||(d.prevFromRect=f,d.prevToRect=y,u||(u=n.options.animation),n.animate(d,E,y,u)),u&&(r=!0,a=Math.max(a,u),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},u),d.thisAnimationDuration=u)}),clearTimeout(t),r?t=setTimeout(function(){typeof s=="function"&&s()},a):typeof s=="function"&&s(),e=[]},animate:function(s,n,r,a){if(a){ge(s,"transition",""),ge(s,"transform","");var o=er(this.el),u=o&&o.a,d=o&&o.d,f=(n.left-r.left)/(u||1),y=(n.top-r.top)/(d||1);s.animatingX=!!f,s.animatingY=!!y,ge(s,"transform","translate3d("+f+"px,"+y+"px,0)"),this.forRepaintDummy=Nq(s),ge(s,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ge(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){ge(s,"transition",""),ge(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},a)}}}}function Nq(e){return e.offsetWidth}function kq(e,t,i,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*s.animation}var ir=[],Uh={initializeByDefault:!0},Ba={mount:function(t){for(var i in Uh)Uh.hasOwnProperty(i)&&!(i in t)&&(t[i]=Uh[i]);ir.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),ir.push(t)},pluginEvent:function(t,i,s){var n=this;this.eventCanceled=!1,s.cancel=function(){n.eventCanceled=!0};var r=t+"Global";ir.forEach(function(a){i[a.pluginName]&&(i[a.pluginName][r]&&i[a.pluginName][r](Di({sortable:i},s)),i.options[a.pluginName]&&i[a.pluginName][t]&&i[a.pluginName][t](Di({sortable:i},s)))})},initializePlugins:function(t,i,s,n){ir.forEach(function(o){var u=o.pluginName;if(!(!t.options[u]&&!o.initializeByDefault)){var d=new o(t,i,t.options);d.sortable=t,d.options=t.options,t[u]=d,os(s,d.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,i){var s={};return ir.forEach(function(n){typeof n.eventProperties=="function"&&os(s,n.eventProperties.call(i[n.pluginName],t))}),s},modifyOption:function(t,i,s){var n;return ir.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[i]=="function"&&(n=r.optionListeners[i].call(t[r.pluginName],s))}),n}};function qq(e){var t=e.sortable,i=e.rootEl,s=e.name,n=e.targetEl,r=e.cloneEl,a=e.toEl,o=e.fromEl,u=e.oldIndex,d=e.newIndex,f=e.oldDraggableIndex,y=e.newDraggableIndex,m=e.originalEvent,b=e.putSortable,E=e.extraEventProperties;if(t=t||i&&i[Vt],!!t){var $,R=t.options,O="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!cs&&!qa?$=new CustomEvent(s,{bubbles:!0,cancelable:!0}):($=document.createEvent("Event"),$.initEvent(s,!0,!0)),$.to=a||i,$.from=o||i,$.item=n||i,$.clone=r,$.oldIndex=u,$.newIndex=d,$.oldDraggableIndex=f,$.newDraggableIndex=y,$.originalEvent=m,$.pullMode=b?b.lastPutMode:void 0;var N=Di(Di({},E),Ba.getEventProperties(s,t));for(var z in N)$[z]=N[z];i&&i.dispatchEvent($),R[O]&&R[O].call(t,$)}}var Oq=["evt"],At=function(t,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=s.evt,r=Vq(s,Oq);Ba.pluginEvent.bind(ye)(t,i,Di({dragEl:ne,parentEl:ze,ghostEl:Ee,rootEl:Fe,nextEl:ln,lastDownEl:Ol,cloneEl:We,cloneHidden:Vs,dragStarted:Qa,putSortable:at,activeSortable:ye.active,originalEvent:n,oldIndex:sr,oldDraggableIndex:Da,newIndex:Gt,newDraggableIndex:As,hideGhostForTarget:Mw,unhideGhostForTarget:Rw,cloneNowHidden:function(){Vs=!0},cloneNowShown:function(){Vs=!1},dispatchSortableEvent:function(o){bt({sortable:i,name:o,originalEvent:n})}},r))};function bt(e){qq(Di({putSortable:at,cloneEl:We,targetEl:ne,rootEl:Fe,oldIndex:sr,oldDraggableIndex:Da,newIndex:Gt,newDraggableIndex:As},e))}var ne,ze,Ee,Fe,ln,Ol,We,Vs,sr,Gt,Da,As,Pl,at,nr=!1,Bl=!1,Dl=[],cn,Ei,Fh,Gh,Iw,_w,Qa,rr,Ha,Ua=!1,Ql=!1,Hl,ft,jh=[],Wh=!1,Ul=[],Fl=typeof document<"u",Gl=pw,Vw=qa||cs?"cssFloat":"float",Pq=Fl&&!mw&&!pw&&"draggable"in document.createElement("div"),Aw=function(){if(Fl){if(cs)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),$w=function(t,i){var s=ge(t),n=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),r=tr(t,0,i),a=tr(t,1,i),o=r&&ge(r),u=a&&ge(a),d=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Ze(r).width,f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Ze(a).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&o.float!=="none"){var y=o.float==="left"?"left":"right";return a&&(u.clear==="both"||u.clear===y)?"vertical":"horizontal"}return r&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||d>=n&&s[Vw]==="none"||a&&s[Vw]==="none"&&d+f>n)?"vertical":"horizontal"},Bq=function(t,i,s){var n=s?t.left:t.top,r=s?t.right:t.bottom,a=s?t.width:t.height,o=s?i.left:i.top,u=s?i.right:i.bottom,d=s?i.width:i.height;return n===o||r===u||n+a/2===o+d/2},Dq=function(t,i){var s;return Dl.some(function(n){var r=n[Vt].options.emptyInsertThreshold;if(!(!r||Qh(n))){var a=Ze(n),o=t>=a.left-r&&t<=a.right+r,u=i>=a.top-r&&i<=a.bottom+r;if(o&&u)return s=n}}),s},Lw=function(t){function i(r,a){return function(o,u,d,f){var y=o.options.group.name&&u.options.group.name&&o.options.group.name===u.options.group.name;if(r==null&&(a||y))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return i(r(o,u,d,f),a)(o,u,d,f);var m=(a?o:u).options.group.name;return r===!0||typeof r=="string"&&r===m||r.join&&r.indexOf(m)>-1}}var s={},n=t.group;(!n||kl(n)!="object")&&(n={name:n}),s.name=n.name,s.checkPull=i(n.pull,!0),s.checkPut=i(n.put),s.revertClone=n.revertClone,t.group=s},Mw=function(){!Aw&&Ee&&ge(Ee,"display","none")},Rw=function(){!Aw&&Ee&&ge(Ee,"display","")};Fl&&!mw&&document.addEventListener("click",function(e){if(Bl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Bl=!1,!1},!0);var un=function(t){if(ne){t=t.touches?t.touches[0]:t;var i=Dq(t.clientX,t.clientY);if(i){var s={};for(var n in t)t.hasOwnProperty(n)&&(s[n]=t[n]);s.target=s.rootEl=i,s.preventDefault=void 0,s.stopPropagation=void 0,i[Vt]._onDragOver(s)}}},Qq=function(t){ne&&ne.parentNode[Vt]._isOutsideThisEl(t.target)};function ye(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=os({},t),e[Vt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return $w(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ye.supportPointer!==!1&&"PointerEvent"in window&&!Oa,emptyInsertThreshold:5};Ba.initializePlugins(this,e,i);for(var s in i)!(s in t)&&(t[s]=i[s]);Lw(t);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=t.forceFallback?!1:Pq,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?qe(e,"pointerdown",this._onTapStart):(qe(e,"mousedown",this._onTapStart),qe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(qe(e,"dragover",this),qe(e,"dragenter",this)),Dl.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),os(this,Rq())}ye.prototype={constructor:ye,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(rr=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,ne):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,s=this.el,n=this.options,r=n.preventOnFilter,a=t.type,o=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(o||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,f=n.filter;if(Kq(s),!ne&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||n.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Oa&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=vi(u,n.draggable,s,!1),!(u&&u.animated)&&Ol!==u)){if(sr=si(u),Da=si(u,n.draggable),typeof f=="function"){if(f.call(this,t,u,this)){bt({sortable:i,rootEl:d,name:"filter",targetEl:u,toEl:s,fromEl:s}),At("filter",i,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(f&&(f=f.split(",").some(function(y){if(y=vi(d,y.trim(),s,!1),y)return bt({sortable:i,rootEl:y,name:"filter",targetEl:u,fromEl:s,toEl:s}),At("filter",i,{evt:t}),!0}),f)){r&&t.cancelable&&t.preventDefault();return}n.handle&&!vi(d,n.handle,s,!1)||this._prepareDragStart(t,o,u)}}},_prepareDragStart:function(t,i,s){var n=this,r=n.el,a=n.options,o=r.ownerDocument,u;if(s&&!ne&&s.parentNode===r){var d=Ze(s);if(Fe=r,ne=s,ze=ne.parentNode,ln=ne.nextSibling,Ol=s,Pl=a.group,ye.dragged=ne,cn={target:ne,clientX:(i||t).clientX,clientY:(i||t).clientY},Iw=cn.clientX-d.left,_w=cn.clientY-d.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,ne.style["will-change"]="all",u=function(){if(At("delayEnded",n,{evt:t}),ye.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!fw&&n.nativeDraggable&&(ne.draggable=!0),n._triggerDragStart(t,i),bt({sortable:n,name:"choose",originalEvent:t}),Ft(ne,a.chosenClass,!0)},a.ignore.split(",").forEach(function(f){bw(ne,f.trim(),zh)}),qe(o,"dragover",un),qe(o,"mousemove",un),qe(o,"touchmove",un),qe(o,"mouseup",n._onDrop),qe(o,"touchend",n._onDrop),qe(o,"touchcancel",n._onDrop),fw&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),At("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(qa||cs))){if(ye.eventCanceled){this._onDrop();return}qe(o,"mouseup",n._disableDelayedDrag),qe(o,"touchend",n._disableDelayedDrag),qe(o,"touchcancel",n._disableDelayedDrag),qe(o,"mousemove",n._delayedDragTouchMoveHandler),qe(o,"touchmove",n._delayedDragTouchMoveHandler),a.supportPointer&&qe(o,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(u,a.delay)}else u()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ne&&zh(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Me(t,"mouseup",this._disableDelayedDrag),Me(t,"touchend",this._disableDelayedDrag),Me(t,"touchcancel",this._disableDelayedDrag),Me(t,"mousemove",this._delayedDragTouchMoveHandler),Me(t,"touchmove",this._delayedDragTouchMoveHandler),Me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?qe(document,"pointermove",this._onTouchMove):i?qe(document,"touchmove",this._onTouchMove):qe(document,"mousemove",this._onTouchMove):(qe(ne,"dragend",this),qe(Fe,"dragstart",this._onDragStart));try{document.selection?Wl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(nr=!1,Fe&&ne){At("dragStarted",this,{evt:i}),this.nativeDraggable&&qe(document,"dragover",Qq);var s=this.options;!t&&Ft(ne,s.dragClass,!1),Ft(ne,s.ghostClass,!0),ye.active=this,t&&this._appendGhost(),bt({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(Ei){this._lastX=Ei.clientX,this._lastY=Ei.clientY,Mw();for(var t=document.elementFromPoint(Ei.clientX,Ei.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ei.clientX,Ei.clientY),t!==i);)i=t;if(ne.parentNode[Vt]._isOutsideThisEl(t),i)do{if(i[Vt]){var s=void 0;if(s=i[Vt]._onDragOver({clientX:Ei.clientX,clientY:Ei.clientY,target:t,rootEl:i}),s&&!this.options.dragoverBubble)break}t=i}while(i=yw(i));Rw()}},_onTouchMove:function(t){if(cn){var i=this.options,s=i.fallbackTolerance,n=i.fallbackOffset,r=t.touches?t.touches[0]:t,a=Ee&&er(Ee,!0),o=Ee&&a&&a.a,u=Ee&&a&&a.d,d=Gl&&ft&&Ew(ft),f=(r.clientX-cn.clientX+n.x)/(o||1)+(d?d[0]-jh[0]:0)/(o||1),y=(r.clientY-cn.clientY+n.y)/(u||1)+(d?d[1]-jh[1]:0)/(u||1);if(!ye.active&&!nr){if(s&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Ee){a?(a.e+=f-(Fh||0),a.f+=y-(Gh||0)):a={a:1,b:0,c:0,d:1,e:f,f:y};var m="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ge(Ee,"webkitTransform",m),ge(Ee,"mozTransform",m),ge(Ee,"msTransform",m),ge(Ee,"transform",m),Fh=f,Gh=y,Ei=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ee){var t=this.options.fallbackOnBody?document.body:Fe,i=Ze(ne,!0,Gl,!0,t),s=this.options;if(Gl){for(ft=t;ge(ft,"position")==="static"&&ge(ft,"transform")==="none"&&ft!==document;)ft=ft.parentNode;ft!==document.body&&ft!==document.documentElement?(ft===document&&(ft=Qi()),i.top+=ft.scrollTop,i.left+=ft.scrollLeft):ft=Qi(),jh=Ew(ft)}Ee=ne.cloneNode(!0),Ft(Ee,s.ghostClass,!1),Ft(Ee,s.fallbackClass,!0),Ft(Ee,s.dragClass,!0),ge(Ee,"transition",""),ge(Ee,"transform",""),ge(Ee,"box-sizing","border-box"),ge(Ee,"margin",0),ge(Ee,"top",i.top),ge(Ee,"left",i.left),ge(Ee,"width",i.width),ge(Ee,"height",i.height),ge(Ee,"opacity","0.8"),ge(Ee,"position",Gl?"absolute":"fixed"),ge(Ee,"zIndex","100000"),ge(Ee,"pointerEvents","none"),ye.ghost=Ee,t.appendChild(Ee),ge(Ee,"transform-origin",Iw/parseInt(Ee.style.width)*100+"% "+_w/parseInt(Ee.style.height)*100+"%")}},_onDragStart:function(t,i){var s=this,n=t.dataTransfer,r=s.options;if(At("dragStart",this,{evt:t}),ye.eventCanceled){this._onDrop();return}At("setupClone",this),ye.eventCanceled||(We=Sw(ne),We.removeAttribute("id"),We.draggable=!1,We.style["will-change"]="",this._hideClone(),Ft(We,this.options.chosenClass,!1),ye.clone=We),s.cloneId=Wl(function(){At("clone",s),!ye.eventCanceled&&(s.options.removeCloneOnHide||Fe.insertBefore(We,ne),s._hideClone(),bt({sortable:s,name:"clone"}))}),!i&&Ft(ne,r.dragClass,!0),i?(Bl=!0,s._loopId=setInterval(s._emulateDragOver,50)):(Me(document,"mouseup",s._onDrop),Me(document,"touchend",s._onDrop),Me(document,"touchcancel",s._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(s,n,ne)),qe(document,"drop",s),ge(ne,"transform","translateZ(0)")),nr=!0,s._dragStartId=Wl(s._dragStarted.bind(s,i,t)),qe(document,"selectstart",s),Qa=!0,Oa&&ge(document.body,"user-select","none")},_onDragOver:function(t){var i=this.el,s=t.target,n,r,a,o=this.options,u=o.group,d=ye.active,f=Pl===u,y=o.sort,m=at||d,b,E=this,$=!1;if(Wh)return;function R(A,q){At(A,E,Di({evt:t,isOwner:f,axis:b?"vertical":"horizontal",revert:a,dragRect:n,targetRect:r,canSort:y,fromSortable:m,target:s,completed:N,onMove:function(J,ee){return jl(Fe,i,ne,n,J,Ze(J),t,ee)},changed:z},q))}function O(){R("dragOverAnimationCapture"),E.captureAnimationState(),E!==m&&m.captureAnimationState()}function N(A){return R("dragOverCompleted",{insertion:A}),A&&(f?d._hideClone():d._showClone(E),E!==m&&(Ft(ne,at?at.options.ghostClass:d.options.ghostClass,!1),Ft(ne,o.ghostClass,!0)),at!==E&&E!==ye.active?at=E:E===ye.active&&at&&(at=null),m===E&&(E._ignoreWhileAnimating=s),E.animateAll(function(){R("dragOverAnimationComplete"),E._ignoreWhileAnimating=null}),E!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(s===ne&&!ne.animated||s===i&&!s.animated)&&(rr=null),!o.dragoverBubble&&!t.rootEl&&s!==document&&(ne.parentNode[Vt]._isOutsideThisEl(t.target),!A&&un(t)),!o.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),$=!0}function z(){Gt=si(ne),As=si(ne,o.draggable),bt({sortable:E,name:"change",toEl:i,newIndex:Gt,newDraggableIndex:As,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=vi(s,o.draggable,i,!0),R("dragOver"),ye.eventCanceled)return $;if(ne.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||E._ignoreWhileAnimating===s)return N(!1);if(Bl=!1,d&&!o.disabled&&(f?y||(a=ze!==Fe):at===this||(this.lastPutMode=Pl.checkPull(this,d,ne,t))&&u.checkPut(this,d,ne,t))){if(b=this._getDirection(t,s)==="vertical",n=Ze(ne),R("dragOverValid"),ye.eventCanceled)return $;if(a)return ze=Fe,O(),this._hideClone(),R("revert"),ye.eventCanceled||(ln?Fe.insertBefore(ne,ln):Fe.appendChild(ne)),N(!0);var V=Qh(i,o.draggable);if(!V||Gq(t,b,this)&&!V.animated){if(V===ne)return N(!1);if(V&&i===t.target&&(s=V),s&&(r=Ze(s)),jl(Fe,i,ne,n,s,r,t,!!s)!==!1)return O(),V&&V.nextSibling?i.insertBefore(ne,V.nextSibling):i.appendChild(ne),ze=i,z(),N(!0)}else if(V&&Fq(t,b,this)){var Z=tr(i,0,o,!0);if(Z===ne)return N(!1);if(s=Z,r=Ze(s),jl(Fe,i,ne,n,s,r,t,!1)!==!1)return O(),i.insertBefore(ne,Z),ze=i,z(),N(!0)}else if(s.parentNode===i){r=Ze(s);var K=0,re,w=ne.parentNode!==i,C=!Bq(ne.animated&&ne.toRect||n,s.animated&&s.toRect||r,b),I=b?"top":"left",p=vw(s,"top","top")||vw(ne,"top","top"),T=p?p.scrollTop:void 0;rr!==s&&(re=r[I],Ua=!1,Ql=!C&&o.invertSwap||w),K=jq(t,s,r,b,C?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Ql,rr===s);var g;if(K!==0){var L=si(ne);do L-=K,g=ze.children[L];while(g&&(ge(g,"display")==="none"||g===Ee))}if(K===0||g===s)return N(!1);rr=s,Ha=K;var x=s.nextElementSibling,S=!1;S=K===1;var _=jl(Fe,i,ne,n,s,r,t,S);if(_!==!1)return(_===1||_===-1)&&(S=_===1),Wh=!0,setTimeout(Uq,30),O(),S&&!x?i.appendChild(ne):s.parentNode.insertBefore(ne,S?x:s),p&&Tw(p,0,T-p.scrollTop),ze=ne.parentNode,re!==void 0&&!Ql&&(Hl=Math.abs(re-Ze(s)[I])),z(),N(!0)}if(i.contains(ne))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Me(document,"mousemove",this._onTouchMove),Me(document,"touchmove",this._onTouchMove),Me(document,"pointermove",this._onTouchMove),Me(document,"dragover",un),Me(document,"mousemove",un),Me(document,"touchmove",un)},_offUpEvents:function(){var t=this.el.ownerDocument;Me(t,"mouseup",this._onDrop),Me(t,"touchend",this._onDrop),Me(t,"pointerup",this._onDrop),Me(t,"touchcancel",this._onDrop),Me(document,"selectstart",this)},_onDrop:function(t){var i=this.el,s=this.options;if(Gt=si(ne),As=si(ne,s.draggable),At("drop",this,{evt:t}),ze=ne&&ne.parentNode,Gt=si(ne),As=si(ne,s.draggable),ye.eventCanceled){this._nulling();return}nr=!1,Ql=!1,Ua=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Kh(this.cloneId),Kh(this._dragStartId),this.nativeDraggable&&(Me(document,"drop",this),Me(i,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Oa&&ge(document.body,"user-select",""),ge(ne,"transform",""),t&&(Qa&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Ee&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),(Fe===ze||at&&at.lastPutMode!=="clone")&&We&&We.parentNode&&We.parentNode.removeChild(We),ne&&(this.nativeDraggable&&Me(ne,"dragend",this),zh(ne),ne.style["will-change"]="",Qa&&!nr&&Ft(ne,at?at.options.ghostClass:this.options.ghostClass,!1),Ft(ne,this.options.chosenClass,!1),bt({sortable:this,name:"unchoose",toEl:ze,newIndex:null,newDraggableIndex:null,originalEvent:t}),Fe!==ze?(Gt>=0&&(bt({rootEl:ze,name:"add",toEl:ze,fromEl:Fe,originalEvent:t}),bt({sortable:this,name:"remove",toEl:ze,originalEvent:t}),bt({rootEl:ze,name:"sort",toEl:ze,fromEl:Fe,originalEvent:t}),bt({sortable:this,name:"sort",toEl:ze,originalEvent:t})),at&&at.save()):Gt!==sr&&Gt>=0&&(bt({sortable:this,name:"update",toEl:ze,originalEvent:t}),bt({sortable:this,name:"sort",toEl:ze,originalEvent:t})),ye.active&&((Gt==null||Gt===-1)&&(Gt=sr,As=Da),bt({sortable:this,name:"end",toEl:ze,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Fe=ne=ze=Ee=ln=We=Ol=Vs=cn=Ei=Qa=Gt=As=sr=Da=rr=Ha=at=Pl=ye.dragged=ye.ghost=ye.clone=ye.active=null,Ul.forEach(function(t){t.checked=!0}),Ul.length=Fh=Gh=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ne&&(this._onDragOver(t),Hq(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,s=this.el.children,n=0,r=s.length,a=this.options;n<r;n++)i=s[n],vi(i,a.draggable,this.el,!1)&&t.push(i.getAttribute(a.dataIdAttr)||zq(i));return t},sort:function(t,i){var s={},n=this.el;this.toArray().forEach(function(r,a){var o=n.children[a];vi(o,this.options.draggable,n,!1)&&(s[r]=o)},this),i&&this.captureAnimationState(),t.forEach(function(r){s[r]&&(n.removeChild(s[r]),n.appendChild(s[r]))}),i&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,i){return vi(t,i||this.options.draggable,this.el,!1)},option:function(t,i){var s=this.options;if(i===void 0)return s[t];var n=Ba.modifyOption(this,t,i);typeof n<"u"?s[t]=n:s[t]=i,t==="group"&&Lw(s)},destroy:function(){At("destroy",this);var t=this.el;t[Vt]=null,Me(t,"mousedown",this._onTapStart),Me(t,"touchstart",this._onTapStart),Me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Me(t,"dragover",this),Me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(i){i.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Dl.splice(Dl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Vs){if(At("hideClone",this),ye.eventCanceled)return;ge(We,"display","none"),this.options.removeCloneOnHide&&We.parentNode&&We.parentNode.removeChild(We),Vs=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Vs){if(At("showClone",this),ye.eventCanceled)return;ne.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(We,ne):ln?Fe.insertBefore(We,ln):Fe.appendChild(We),this.options.group.revertClone&&this.animate(ne,We),ge(We,"display",""),Vs=!1}}};function Hq(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function jl(e,t,i,s,n,r,a,o){var u,d=e[Vt],f=d.options.onMove,y;return window.CustomEvent&&!cs&&!qa?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=t,u.from=e,u.dragged=i,u.draggedRect=s,u.related=n||t,u.relatedRect=r||Ze(t),u.willInsertAfter=o,u.originalEvent=a,e.dispatchEvent(u),f&&(y=f.call(d,u,a)),y}function zh(e){e.draggable=!1}function Uq(){Wh=!1}function Fq(e,t,i){var s=Ze(tr(i.el,0,i.options,!0)),n=xw(i.el,i.options,Ee),r=10;return t?e.clientX<n.left-r||e.clientY<s.top&&e.clientX<s.right:e.clientY<n.top-r||e.clientY<s.bottom&&e.clientX<s.left}function Gq(e,t,i){var s=Ze(Qh(i.el,i.options.draggable)),n=xw(i.el,i.options,Ee),r=10;return t?e.clientX>n.right+r||e.clientY>s.bottom&&e.clientX>s.left:e.clientY>n.bottom+r||e.clientX>s.right&&e.clientY>s.top}function jq(e,t,i,s,n,r,a,o){var u=s?e.clientY:e.clientX,d=s?i.height:i.width,f=s?i.top:i.left,y=s?i.bottom:i.right,m=!1;if(!a){if(o&&Hl<d*n){if(!Ua&&(Ha===1?u>f+d*r/2:u<y-d*r/2)&&(Ua=!0),Ua)m=!0;else if(Ha===1?u<f+Hl:u>y-Hl)return-Ha}else if(u>f+d*(1-n)/2&&u<y-d*(1-n)/2)return Wq(t)}return m=m||a,m&&(u<f+d*r/2||u>y-d*r/2)?u>f+d/2?1:-1:0}function Wq(e){return si(ne)<si(e)?1:-1}function zq(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,s=0;i--;)s+=t.charCodeAt(i);return s.toString(36)}function Kq(e){Ul.length=0;for(var t=e.getElementsByTagName("input"),i=t.length;i--;){var s=t[i];s.checked&&Ul.push(s)}}function Wl(e){return setTimeout(e,0)}function Kh(e){return clearTimeout(e)}Fl&&qe(document,"touchmove",function(e){(ye.active||nr)&&e.cancelable&&e.preventDefault()}),ye.utils={on:qe,off:Me,css:ge,find:bw,is:function(t,i){return!!vi(t,i,t,!1)},extend:Lq,throttle:Cw,closest:vi,toggleClass:Ft,clone:Sw,index:si,nextTick:Wl,cancelNextTick:Kh,detectDirection:$w,getChild:tr,expando:Vt},ye.get=function(e){return e[Vt]},ye.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(ye.utils=Di(Di({},ye.utils),s.utils)),Ba.mount(s)})},ye.create=function(e,t){return new ye(e,t)},ye.version=Aq;var Je=[],Fa,Yh,Xh=!1,Zh,Jh,zl,Ga;function Yq(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(i){var s=i.originalEvent;this.sortable.nativeDraggable?qe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?qe(document,"pointermove",this._handleFallbackAutoScroll):s.touches?qe(document,"touchmove",this._handleFallbackAutoScroll):qe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(i){var s=i.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?Me(document,"dragover",this._handleAutoScroll):(Me(document,"pointermove",this._handleFallbackAutoScroll),Me(document,"touchmove",this._handleFallbackAutoScroll),Me(document,"mousemove",this._handleFallbackAutoScroll)),Nw(),Kl(),Mq()},nulling:function(){zl=Yh=Fa=Xh=Ga=Zh=Jh=null,Je.length=0},_handleFallbackAutoScroll:function(i){this._handleAutoScroll(i,!0)},_handleAutoScroll:function(i,s){var n=this,r=(i.touches?i.touches[0]:i).clientX,a=(i.touches?i.touches[0]:i).clientY,o=document.elementFromPoint(r,a);if(zl=i,s||this.options.forceAutoScrollFallback||qa||cs||Oa){ed(i,this.options,o,s);var u=_s(o,!0);Xh&&(!Ga||r!==Zh||a!==Jh)&&(Ga&&Nw(),Ga=setInterval(function(){var d=_s(document.elementFromPoint(r,a),!0);d!==u&&(u=d,Kl()),ed(i,n.options,d,s)},10),Zh=r,Jh=a)}else{if(!this.options.bubbleScroll||_s(o,!0)===Qi()){Kl();return}ed(i,this.options,_s(o,!1),!1)}}},os(e,{pluginName:"scroll",initializeByDefault:!0})}function Kl(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function Nw(){clearInterval(Ga)}var ed=Cw(function(e,t,i,s){if(t.scroll){var n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,o=t.scrollSpeed,u=Qi(),d=!1,f;Yh!==i&&(Yh=i,Kl(),Fa=t.scroll,f=t.scrollFn,Fa===!0&&(Fa=_s(i,!0)));var y=0,m=Fa;do{var b=m,E=Ze(b),$=E.top,R=E.bottom,O=E.left,N=E.right,z=E.width,V=E.height,Z=void 0,K=void 0,re=b.scrollWidth,w=b.scrollHeight,C=ge(b),I=b.scrollLeft,p=b.scrollTop;b===u?(Z=z<re&&(C.overflowX==="auto"||C.overflowX==="scroll"||C.overflowX==="visible"),K=V<w&&(C.overflowY==="auto"||C.overflowY==="scroll"||C.overflowY==="visible")):(Z=z<re&&(C.overflowX==="auto"||C.overflowX==="scroll"),K=V<w&&(C.overflowY==="auto"||C.overflowY==="scroll"));var T=Z&&(Math.abs(N-n)<=a&&I+z<re)-(Math.abs(O-n)<=a&&!!I),g=K&&(Math.abs(R-r)<=a&&p+V<w)-(Math.abs($-r)<=a&&!!p);if(!Je[y])for(var L=0;L<=y;L++)Je[L]||(Je[L]={});(Je[y].vx!=T||Je[y].vy!=g||Je[y].el!==b)&&(Je[y].el=b,Je[y].vx=T,Je[y].vy=g,clearInterval(Je[y].pid),(T!=0||g!=0)&&(d=!0,Je[y].pid=setInterval((function(){s&&this.layer===0&&ye.active._onTouchMove(zl);var x=Je[this.layer].vy?Je[this.layer].vy*o:0,S=Je[this.layer].vx?Je[this.layer].vx*o:0;typeof f=="function"&&f.call(ye.dragged.parentNode[Vt],S,x,e,zl,Je[this.layer].el)!=="continue"||Tw(Je[this.layer].el,S,x)}).bind({layer:y}),24))),y++}while(t.bubbleScroll&&m!==u&&(m=_s(m,!1)));Xh=d}},30),kw=function(t){var i=t.originalEvent,s=t.putSortable,n=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,o=t.hideGhostForTarget,u=t.unhideGhostForTarget;if(i){var d=s||r;o();var f=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i,y=document.elementFromPoint(f.clientX,f.clientY);u(),d&&!d.el.contains(y)&&(a("spill"),this.onSpill({dragEl:n,putSortable:s}))}};function td(){}td.prototype={startIndex:null,dragStart:function(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function(t){var i=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var n=tr(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(i,n):this.sortable.el.appendChild(i),this.sortable.animateAll(),s&&s.animateAll()},drop:kw},os(td,{pluginName:"revertOnSpill"});function id(){}id.prototype={onSpill:function(t){var i=t.dragEl,s=t.putSortable,n=s||this.sortable;n.captureAnimationState(),i.parentNode&&i.parentNode.removeChild(i),n.animateAll()},drop:kw},os(id,{pluginName:"removeOnSpill"}),ye.mount(new Yq),ye.mount(id,td);class Xq{constructor(t,i){te(this,"options",{interactionSubType:"default",maxChoices:0,response:null,onReady:null,onUpdate:null,onSelectionsLimit:null});return this.wrapper=t,this.sourcewrapper=this.wrapper.querySelector(".qti-order-source-wrapper"),this.sortable=null,this.isDisabled=!1,this.processOptions(i),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragMove=this.handleDragMove.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.notifyUpdate=this.notifyUpdate.bind(this),this.options.interactionSubType==="default"?this.sortable=new ye(this.sourcewrapper,{animation:400,onEnd:this.notifyUpdate}):this.options.interactionSubType==="ordermatch"&&(this.itemTarget=null,this.itemStart=null,this.isItemStartSource=!0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.startingX=0,this.startingY=0,this.currentTargetCount=0,this.currentDragger=null,this.initializeSources(this.sourcewrapper),this.targetwrapper=this.wrapper.querySelector(".qti-order-target-wrapper"),this.initializeTargets(this.targetwrapper),this.restoreResponse()),this.notifyReady(),this}processOptions(t){"interactionSubType"in t&&(this.options.interactionSubType=t.interactionSubType),"response"in t&&(this.options.response=t.response),"maxChoices"in t&&(this.options.maxChoices=t.maxChoices),"onReady"in t&&(this.options.onReady=t.onReady),"onUpdate"in t&&(this.options.onUpdate=t.onUpdate),"onSelectionsLimit"in t&&(this.options.onSelectionsLimit=t.onSelectionsLimit)}notifyReady(){this.options.onReady!==null&&this.options.onReady({response:this.getResponse()})}notifyUpdate(t){this.options.onUpdate!==null&&this.options.onUpdate({response:this.computeResponse(t)})}notifySelectionsLimit(){this.options.onSelectionsLimit!==null&&this.options.onSelectionsLimit()}toggleDisable(t){if(this.isDisabled=t,this.options.interactionSubType==="default"&&this.sortable!==null){this.sortable.option("disabled",t);const i=this.sourcewrapper.querySelectorAll(".draggable");this.enableDisableDraggers(i,t);return}this.enableDisableDraggers(this.draggers,t)}handleDragStart(t){if(t.preventDefault(),!this.isDisabled&&t.button==0)return this.interactionStart(t.target,t.clientX,t.clientY,!1),!1}handleTouchStart(t){if(t.preventDefault(),!this.isDisabled)return t.targetTouches.length!=1||this.interactionStart(t.target,t.touches[0].pageX,t.touches[0].pageY,!0),!1}interactionStart(t,i,s,n){const r=this.getClosestElement(t,"draggable");this.itemStart=r.parentNode,this.isItemStartSource=this.itemStart.classList.contains("source"),this.identifyTargets(!0),this.itemTarget=null;const a=r.getBoundingClientRect();this.initialX=i,this.initialY=s,this.startingX=a.left,this.startingY=a.top,this.offsetX=i-this.startingX,this.offsetY=s-this.startingY,r.style.userSelect="none",r.style.width=a.width+"px",r.style.height=a.height+"px",r.style.transform=`translateX(${a.left}px) translateY(${a.top}px) translateZ(0)`,this.removePlaceholder(r),this.addPlaceholder(r),r.classList.contains("dragging")||r.classList.add("dragging"),this.setCurrentDragger(r),this.addListeners(r,n)}handleDragMove(t){t.preventDefault(),!this.isDisabled&&this.interactionMove(t.clientX,t.clientY)}handleTouchMove(t){t.preventDefault(),!this.isDisabled&&t.targetTouches.length==1&&this.interactionMove(t.touches[0].clientX,t.touches[0].clientY)}interactionMove(t,i){const s=this.currentDragger;this.offsetX=t-this.initialX,this.offsetY=i-this.initialY,this.constrainDraggerToWrapper(s),s.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0) scale(1)`;const n=s.getBoundingClientRect();this.findDraggerTarget(s,n,this.targets),this.isItemStartSource||this.findSourceDraggerTarget(s,n,this.sources)}constrainDraggerToWrapper(t){const i=t.getBoundingClientRect(),s=this.wrapper.getBoundingClientRect(),n=this.startingX+this.offsetX-s.x,r=this.startingY+this.offsetY-s.y,a=this.startingX+i.width+this.offsetX-(s.x+s.width),o=this.startingY+i.height+this.offsetY-(s.y+s.height);n<0&&(this.offsetX=this.offsetX-n),a>0&&(this.offsetX=this.offsetX-a),r<0&&(this.offsetY=this.offsetY-r),o>0&&(this.offsetY=this.offsetY-o)}handleDragEnd(t){this.isDisabled||this.interactionEnd(t.clientX,t.clientY,!1)}handleTouchEnd(t){this.isDisabled||this.interactionEnd(t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0)}interactionEnd(t,i,s){const n=this.currentDragger;if(this.itemTarget===null?n.style.transform=`translateX(${this.startingX}px) translateY(${this.startingY}px) translateZ(0)`:n.style.transform=`translateX(${this.startingX+this.offsetX}px) translateY(${this.startingY+this.offsetY}px) translateZ(0)`,n.removeAttribute("style"),this.removePlaceholder(n),n.classList.contains("dragging")&&n.classList.remove("dragging"),this.clearTargetHighlights(),this.itemTarget===null){this.resetDraggerToItemStart(this.itemStart,n),this.setCurrentDragger(null),this.removeListeners(n,s);return}if(this.itemTarget.classList.contains("active")){if(this.itemTarget.classList.remove("active"),this.isExceedingMaxChoices(this.itemStart,this.itemTarget,n)){this.resetDraggerToItemStart(this.itemStart,n),this.notifySelectionsLimit(),this.setCurrentDragger(null),this.removeListeners(n,s);return}this.itemStart.classList.remove("full"),this.setDraggerToItemTarget(this.itemTarget,n),this.itemTarget.classList.contains("source")&&(this.decrementTargetCount(),this.sortContainerElements(this.sourcewrapper)),this.itemStart.classList.contains("target")||this.incrementTargetCount(),this.notifyUpdate()}this.setCurrentDragger(null),this.removeListeners(n,s)}setCurrentDragger(t){this.currentDragger=t}resetDraggerToItemStart(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}setDraggerToItemTarget(t,i){t.append(i),t.classList.add("full"),i.setAttribute("style","width:100%")}findDraggerTarget(t,i,s){s.forEach(n=>{const r=n.getBoundingClientRect();if(i.top+t.offsetHeight/2<r.bottom&&i.right-t.offsetWidth/2>r.left&&i.bottom-t.offsetHeight/2>r.top&&i.left+t.offsetWidth/2<r.right){if(this.isItemStartSource&&n.classList.contains("source")||n.classList.contains("full"))return;n.classList.add("active"),this.itemTarget=n}else n.classList.remove("active")},this)}findSourceDraggerTarget(t,i){const s=this.sourcewrapper.getBoundingClientRect();if(i.top+t.offsetHeight/2<s.bottom&&i.right-t.offsetWidth/2>s.left&&i.bottom-t.offsetHeight/2>s.top&&i.left+t.offsetWidth/2<s.right){for(let n=0;n<this.sources.length;n++)if(!this.sources[n].classList.contains("full")){this.sources[n].classList.add("active"),this.itemTarget=this.sources[n];break}}else for(let n=0;n<this.sources.length;n++)this.sources[n].classList.contains("active")&&this.sources[n].classList.remove("active")}addPlaceholder(t){const i=t.getBoundingClientRect(),s=document.createElement("div");s.classList.add("dragger-placeholder"),s.style.width=`${i.width}px`,s.style.height=`${i.height}px`,t.parentNode.insertBefore(s,t)}removePlaceholder(t){const i=t.parentNode.querySelector(".dragger-placeholder");i!==null&&t.parentNode.removeChild(i)}enableDisableDraggers(t,i){t.forEach(s=>{i?s.classList.add("disabled"):s.classList.remove("disabled")})}initializeSources(t){this.sources=t.querySelectorAll(".source"),this.sources.forEach(i=>{i.classList.add("full")},this),this.draggers=t.querySelectorAll(".draggable"),this.draggers.forEach((i,s)=>{const n=i.parentNode.getAttribute("data-identifier");i.setAttribute("data-identifier",n),i.setAttribute("data-order",s),i.setAttribute("tabindex",0),i.addEventListener("mousedown",this.handleDragStart),i.addEventListener("touchstart",this.handleTouchStart)},this)}initializeTargets(t){this.targets=t.querySelectorAll(".target"),this.targets.forEach(i=>{i.setAttribute("tabindex",0)})}identifyTargets(t){for(let i=0;i<this.targets.length;i++)t&&!this.targets[i].classList.contains("full")&&this.targets[i].classList.add("target-active");t&&!this.isItemStartSource&&this.sourcewrapper.classList.add("target-active")}addListeners(t,i){i?(this.removeListeners(t,i),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)):(this.removeListeners(t,i),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd))}removeListeners(t,i){i?(t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)):(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd))}clearTargetHighlights(){this.targets.forEach(t=>{t.classList.remove("target-active")},this),this.sourcewrapper.classList.remove("target-active")}getClosestElement(t,i){return t?t&&t.classList.contains(i)?t:this.getClosestElement(t.parentElement,i):!1}sortContainerElements(t){let i=[],s=t.children;for(let n=0;n<s.length;n++){const r=s[n].querySelector("div.draggable");if(r){const a=r.getAttribute("data-order");i.push([1*a,s[n]])}}i.sort(function(n,r){return n[0]-r[0]});for(let n=0;n<i.length;n++)t.appendChild(i[n][1])}getResponse(){return this.options.interactionSubType==="default"?this.computeResponse({target:this.sourcewrapper}):this.computeResponse()}computeResponse(t){let i=[];switch(this.options.interactionSubType){case"default":t.target.querySelectorAll(".qti-simple-choice").forEach(s=>{i.push(s.getAttribute("data-identifier"))});break;case"ordermatch":this.targets.forEach(s=>{if(s.classList.contains("full")){const n=s.querySelector(".draggable");if(n!==null){i.push(n.getAttribute("data-identifier"));return}}i.push(null)});break}return i}restoreResponse(){this.options.response!==null&&this.options.response.forEach((t,i)=>{if(t!==null){const s=this.findSourceDraggerByIdentifier(t);this.emptyDraggerParent(s),this.addSourceDraggerToTargetAtIndex(i,s)}},this)}findSourceDraggerByIdentifier(t){for(let i=0;i<this.draggers.length;i++)if(t===this.draggers[i].getAttribute("data-identifier"))return this.draggers[i];return null}addSourceDraggerToTargetAtIndex(t,i){const s=this.targets[t];s.append(i),s.classList.add("full")}addTargetDraggerToSourceAtIndex(t,i){const s=this.sources[t];s.append(i),s.classList.add("full")}emptyDraggerParent(t){t.parentNode.classList.remove("full")}findSourceByIdentifier(t){for(let i=0;i<this.sources.length;i++)if(t===this.sources[i].getAttribute("data-identifier"))return this.sources[i];return null}isExceedingMaxChoices(t,i){return!(this.options.maxChoices===0||i.classList.contains("source")||t.classList.contains("target")||this.currentTargetCount<this.options.maxChoices)}initializeCurrentTargetCount(){this.currentTargetCount=0}incrementTargetCount(){this.currentTargetCount+=1}decrementTargetCount(){this.currentTargetCount!==0&&(this.currentTargetCount-=1)}reset(){this.options.interactionSubType==="ordermatch"&&(this.resetDraggersToSources(),this.initializeCurrentTargetCount()),this.destroy()}resetDraggersToSources(){this.targets.forEach(t=>{if(t.classList.contains("full")){const i=t.querySelector(".draggable"),s=this.findSourceByIdentifier(i.getAttribute("data-identifier"));if(s.classList.contains("full"))return;this.emptyDraggerParent(i),s.append(i),s.classList.add("full")}},this)}destroy(){this.options.interactionSubType==="ordermatch"&&(this.currentDragger!==null&&(document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)),this.draggers.forEach(t=>{t.removeEventListener("touchstart",this.handleTouchStart),t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd),t.removeEventListener("mousedown",this.handleDragStart)},this),this.targetwrapper.remove())}}const Zq=new F,Jq=new ie,eO={emits:["orderGroupReady","orderGroupUpdate","orderGroupSelectionsLimit"],props:{responseIdentifier:{required:!0,type:String},cardinality:{required:!0,type:String},shuffle:{required:!1,type:String,default:"false"},orientation:{required:!1,type:String,default:"horizontal"},maxChoices:{required:!1,type:Number},interactionSubType:{required:!0,type:String},priorState:{required:!1,type:Object,default:null}},data(){return{choices:[],response:null,role:null,isRadio:null,isShuffle:null,hasPrompt:!1,promptElement:null,isOrientationVertical:!1,presentationFactory:null,sortable:null,isQtiValid:!0}},computed:{computedMaxChoices(){return this.maxChoices===null?0:this.maxChoices}},methods:{getResponse(){return this.response},setResponse(e){this.response=e},disable(){this.sortable!==null&&this.sortable.toggleDisable(!0)},enable(){this.sortable!==null&&this.sortable.toggleDisable(!1)},getPromptElement(){return this.promptElement},setPromptElement(e){this.promptElement=e},validateChildren(){let e=0;this.$slots.default&&this.$slots.default()[0].children.forEach(t=>{if(Zq.isValidSlot(t)){if(t.type.name==="QtiPrompt"){if(e>0)throw new c("Invalid element order. qti-prompt must come before qti-simple-choice's");if(!this.hasPrompt)return this.hasPrompt=!0;throw new c("Maximum of 1 qti-prompt element permitted")}if(t.type.name==="QtiSimpleChoice")return e+=1;throw new c('Node is not a qti-simple-choice: "'+t.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children[0].children[0].children.forEach(t=>{t.component!==null&&t.type.name==="QtiSimpleChoice"&&this.choices.push(t.component.proxy)})},processGroupUI(e){if(this.hasPrompt){const i=this.$refs.ordergroup.querySelector(".qti-prompt");i!==null&&this.setPromptElement(i.cloneNode(!0))}const t=this.createContainer(this.choices,this.priorState);this.processContainerChoices(t),this.presentationFactory.initialize(this.$refs.root,this),this.sortable=new Xq(this.$refs.root,{interactionSubType:this.interactionSubType,maxChoices:this.computedMaxChoices,response:e,onReady:this.handleWidgetReady,onUpdate:this.handleWidgetUpdate,onSelectionsLimit:this.handleSelectionsLimit})},resetGroupUI(){this.sortable!==null&&(this.sortable.reset(),this.sortable=null,this.processGroupUI(null))},handleWidgetReady(e){this.setResponse(e.response),this.$emit("orderGroupReady",{choices:this.choices,response:this.getResponse()})},handleWidgetUpdate(e){this.setResponse(e.response),this.$emit("orderGroupUpdate",{response:this.getResponse()})},handleSelectionsLimit(){this.$emit("orderGroupSelectionsLimit")},processContainerChoices(e){this.choices.splice(0,this.choices.length),this.$refs.ordergroup.innerHTML="",e.forEach(t=>{this.$refs.ordergroup.appendChild(t.node.$el),this.choices.push(t.node)},this)},createContainer(e,t){let i=[];return t===null?(e.forEach(s=>{i.push({fixed:s.fixed==="true",node:s})}),this.isShuffle&&Jq.shuffleArrayFixed(i),i):(this.getPriorValue(this.interactionSubType).forEach(s=>{i.push({node:this.findChoiceByIdentifier(s,e)})},this),i)},getPriorValue(e){return this.priorState===null?[]:e==="default"?this.priorState.state.order:this.priorState.state.oorder},findChoiceByIdentifier(e,t){for(let i=0;i<t.length;i++)if(t[i].$el.getAttribute("data-identifier")===e)return t[i];throw new B('Order Interaction State Invalid. Choice identifier "'+e+'" not found.')},initializeOrderGroup(){this.isShuffle=this.shuffle==="true",this.isOrientationVertical=this.orientation==="vertical",this.presentationFactory=new xq}},created(){try{if(typeof this.cardinality>"u")throw new c("Undefined qti-order-interaction cardinality");if(this.cardinality!=="ordered")throw new c('qti-order-interaction cardinality must be "ordered"');this.initializeOrderGroup(),this.validateChildren()}catch(e){throw this.isQtiValid=!1,console.log("[QtiOrderInteraction][ValidationError]",e.name,e.message),new c(e.message)}},mounted(){if(this.isQtiValid)try{if(this.orderInteractionClassAttribute=this.$parent.$refs.root.classList,this.processChildren(),this.priorState===null)return this.processGroupUI(null);if(this.interactionSubType==="default")return this.processGroupUI(this.priorState.order);this.interactionSubType==="ordermatch"&&this.processGroupUI(this.priorState.value)}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw console.log("[QtiOrderInteraction][ValidationException]",e.message),new c(e.message);if(e.name==="QtiEvaluationException")throw console.log("[QtiOrderInteraction][EvaluationException]",e.message),new B(e.message)}},beforeUnmount(){this.sortable.destroy(),this.sortable=null}},tO={ref:"root",class:"qti-order-interaction-wrapper"},iO={ref:"ordergroup",class:"qti-order-source-wrapper"};function sO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",tO,[l.createElementVNode("ul",iO,[l.renderSlot(e.$slots,"default")],512)],512)}const nO=D(eO,[["render",sO]]),rO={name:"QtiGapText",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"}},data(){return{id:null,isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},aO=["data-identifier","data-match-max","data-match-min","data-match-group"],oO={ref:"text",class:"gap-choice-text draggable"};function lO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("li",{ref:"choicetext","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-text source"},[l.createElementVNode("div",oO,[l.renderSlot(e.$slots,"default")],512)],8,aO)}const cO=D(rO,[["render",lO]]),uO={name:"QtiGapImg",props:{identifier:{required:!0,type:String},fixed:{required:!1,type:String,default:"false"},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},matchMax:{required:!0,type:String},matchMin:{required:!1,type:String,default:"0"},objectLabel:{required:!1,type:String,default:null},top:{required:!1,type:String,default:null},left:{required:!1,type:String,default:null}},data(){return{isQtiValid:!0}},methods:{},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},hO=["data-identifier","data-match-max","data-match-min","data-match-group"],dO={ref:"image",class:"gap-choice-img draggable"};function fO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("li",{ref:"choiceimage","data-identifier":i.identifier,"data-match-max":i.matchMax,"data-match-min":i.matchMin,"data-match-group":i.matchGroup,class:"qti-gap-choice qti-gap-img source"},[l.createElementVNode("div",dO,[l.renderSlot(e.$slots,"default")],512)],8,hO)}const pO=D(uO,[["render",fO]]),mO={name:"QtiGap",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},matchGroup:{required:!1,type:String,default:""},required:{required:!1,type:String,default:"false"}},data(){return{id:null,isRequired:!1,inputWidthClass:"",isQtiValid:!0}},methods:{},created(){this.isRequired=this.required!=="false"},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},gO=["data-identifier","data-required","data-match-group"];function yO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("span",{ref:"gap","data-identifier":i.identifier,"data-required":n.isRequired,"data-match-max":"1","data-match-group":i.matchGroup,class:"gap-match-gap"},null,8,gO)}const wO=D(mO,[["render",yO]]),bO=new F,vO={name:"QtiHottext",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"}},data(){return{id:null,checked:"false",isRadio:!0,isDisabled:!1,isQtiValid:!0}},inheritAttrs:!0,methods:{handleClick(e){e.preventDefault(),!this.isDisabled&&(this.isRadio?this.triggerChecked(this.identifier,"true"):(this.toggleChecked(),this.triggerChecked(this.identifier,this.checked)))},handleKeydown(e){switch(e.code){case"Space":case"Enter":if(e.stopPropagation(),e.preventDefault(),this.isDisabled)return;this.toggleChecked(),this.triggerChecked(this.identifier,this.checked);break}},triggerChecked(e,t){const i=new CustomEvent("setChecked",{bubbles:!0,cancelable:!0,detail:{identifier:e,checked:t}});this.$refs.hottext.dispatchEvent(i)},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},setFocus(){this.$refs.hottext.focus()},setIsDisabled(e){this.isDisabled=e},initialize(){switch(this.$parent.cardinality){case"multiple":this.isRadio=!1,this.tabIndex=0;break;default:this.isRadio=!0,this.tabIndex=0;break}},createId(){if(this.$refs.hottext.hasAttribute("id")){this.id=this.$refs.hottext.getAttribute("id");return}this.id="hottext_"+bO.randomString(5,"a")+"_"+this.identifier,this.$refs.hottext.setAttribute("id",this.id)}},created(){this.initialize()},mounted(){if(this.isQtiValid)try{this.createId(),console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},EO=["data-identifier","aria-checked","tabindex"];function CO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("span",{ref:"hottext","data-identifier":i.identifier,"aria-checked":n.checked,tabindex:e.tabIndex,onClick:t[0]||(t[0]=(...a)=>r.handleClick&&r.handleClick(...a)),onKeydown:t[1]||(t[1]=(...a)=>r.handleKeydown&&r.handleKeydown(...a)),class:"qti-hottext"},[l.renderSlot(e.$slots,"default")],40,EO)}const TO=D(vO,[["render",CO]]),SO=new F,xO={name:"QtiHotspotChoice",props:{identifier:{required:!0,type:String},templateIdentifier:{required:!1,type:String},showHide:{required:!1,type:String,default:"show"},shape:{required:!0,type:String},coords:{required:!0,type:String},hotspotLabel:{required:!1,type:String,default:""},ariaLabel:{required:!1,type:String,default:""}},data(){return{shapeData:null,shapeColorProperties:null,checked:"false",isRadio:!0,isQtiValid:!0}},inheritAttrs:!0,methods:{getIdentifier(){return this.identifier},getShape(){return this.shape},getChecked(){return this.checked},setChecked(e){this.checked=e?"true":"false"},isChecked(){return this.checked==="true"},toggleChecked(){this.checked=this.checked==="true"?"false":"true"},getRole(){return this.isRadio?"radio":"checkbox"},getAriaLabel(){return this.ariaLabel.length>0?this.ariaLabel:this.hotspotLabel},getShapeColorProperties(){return this.shapeColorProperties},setShapeColorProperties(e){this.shapeColorProperties=e},getShapeData(){return this.shapeData},setShapeData(){const e=this.coords.split(",");switch(this.shape){case"circle":if(e.length!=3)return;this.shapeData=e;return;case"rect":if(e.length!==4)return;e[2]=parseInt(e[2])-parseInt(e[0]),e[3]=parseInt(e[3])-parseInt(e[1]),this.shapeData=e;return;case"poly":this.shapeData=this.computePolyShapeData(this.transformPolyCoords(e));return;case"ellipse":if(e.length!=4)return;this.shapeData=e;return;case"default":this.shapeData="";return}},transformPolyCoords(e){let t="";if(e.length%2!=0)return t;for(let i=0;i<e.length;i+=2)t+=`${e[i]},${e[i+1]}`,i+2<e.length&&(t+=" ");return t},computePolyShapeData(e){const t=e.indexOf(" ");return"M "+[e.slice(0,t),"L",e.slice(t)].join(" ")+" z"},getShapeElement(){let e=null;const t=this.getShapeData();if(t==null)return null;switch(this.getShape()){case"circle":e=document.createElementNS("http://www.w3.org/2000/svg","circle"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("r",t[2]);break;case"rect":e=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.setAttribute("x",t[0]),e.setAttribute("y",t[1]),e.setAttribute("width",t[2]),e.setAttribute("height",t[3]);break;case"poly":e=document.createElementNS("http://www.w3.org/2000/svg","path"),e.setAttribute("d",t);break;case"ellipse":e=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),e.setAttribute("cx",t[0]),e.setAttribute("cy",t[1]),e.setAttribute("rx",t[2]),e.setAttribute("ry",t[3]);break}return e!==null&&(e.setAttribute("class","qti3-player-hotspot-choice"),e.setAttribute("tabindex","0"),e.setAttribute("data-identifier",this.getIdentifier()),e.setAttribute("role",this.getRole()),e.setAttribute("aria-checked","false"),e.setAttribute("aria-label",this.getAriaLabel()),e.setAttribute("fill",`${this.shapeColorProperties.fillColor}`),e.setAttribute("fill-opacity",`${this.shapeColorProperties.fillOpacity}`),e.setAttribute("opacity",`${this.shapeColorProperties.unselectedOpacity}`),e.setAttribute("stroke",`${this.shapeColorProperties.strokeColor}`),e.setAttribute("stroke-width",`${this.shapeColorProperties.strokeWidth}`)),e},initialize(){switch(SO.validateShapeAttribute(this.shape),this.$parent.cardinality){case"multiple":this.isRadio=!1;break;default:this.isRadio=!0;break}this.setShapeData(),this.setShapeColorProperties(this.$parent.getShapeColorProperties())}},created(){try{this.initialize()}catch(e){if(this.isQtiValid=!1,e.name==="QtiValidationException")throw new c(e.message)}},mounted(){if(this.isQtiValid)try{console.log("["+this.$options.name+"][Identifier]",this.identifier)}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},IO={ref:"hotspotchoice",class:"qti-hotspot-choice"};function _O(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",IO,[l.renderSlot(e.$slots,"default")],512)}const VO=D(xO,[["render",_O]]),AO=new F,$O={name:"QtiInteractionModules",props:{primaryConfiguration:{required:!1,type:String,default:""},secondaryConfiguration:{required:!1,type:String,default:""}},data(){return{modules:[],isQtiValid:!0}},inheritAttrs:!0,methods:{getPrimaryConfiguration(){return this.primaryConfiguration},getSecondaryConfiguration(){return this.secondaryConfiguration},getModules(){return this.modules},validateChildren(){this.$slots.default&&this.$slots.default().forEach(e=>{if(AO.isValidSlot(e)){if(e.type.name==="QtiInteractionModule")return;throw new c('Node is not a qti-interaction-module: "'+e.type.name+'"')}})},processChildren(){this.$.subTree.children[0].children.forEach(t=>{t.type.name==="QtiInteractionModule"&&t.component!==null&&this.modules.push(t.component.proxy)})}},created(){try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.processChildren(),console.log("[PCI]["+this.$options.name+"][PrimaryCfg="+this.primaryConfiguration+"][SecondaryCfg="+this.secondaryConfiguration+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},LO={ref:"root",class:"qti-interaction-modules"};function MO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",LO,[l.renderSlot(e.$slots,"default")],512)}const RO=D($O,[["render",MO]]),NO={name:"QtiInteractionModule",props:{id:{required:!0,type:String},primaryPath:{required:!1,type:String,default:""},fallbackPath:{required:!1,type:String,default:""}},data(){return{isQtiValid:!0}},inheritAttrs:!0,methods:{getId(){return this.id},getPrimaryPath(){return this.primaryPath},getFallbackPath(){return this.fallbackPath}},mounted(){if(this.isQtiValid)try{console.log("[PCI]["+this.$options.name+"][Id="+this.id+"]","[Primary="+this.primaryPath+"]","[Fallback="+this.fallbackPath+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},kO={ref:"root",class:"qti-interaction-module"};function qO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",kO,null,512)}const OO=D(NO,[["render",qO]]),PO={name:"QtiInteractionMarkup",props:{},data(){return{markup:"",isQtiValid:!0}},inheritAttrs:!0,methods:{getMarkup(){return this.markup},setMarkup(e){this.markup=e}},mounted(){if(this.isQtiValid)try{this.setMarkup(this.$refs.root.innerHTML),console.log("[PCI]["+this.$options.name+"]")}catch(e){throw this.isQtiValid=!1,console.log("["+this.$options.name+"][ValidationError]",e.name,e.message),new c(e.message)}}},BO={ref:"root",class:"qti-interaction-markup"};function DO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",BO,[l.renderSlot(e.$slots,"default")],512)}const QO=D(PO,[["render",DO]]),qw=new F,ar=new ie,HO={name:"QtiTemplateVariable",props:{templateIdentifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.templateIdentifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return ar.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=qw.validateVariableIdentifierAttribute(M,this.getIdentifier());if(typeof e>"u")return this.setValue(ar.valueToPciJson(ar.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",{base:null}),this.setValue(ar.valueToPciJson(ar.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=ar.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiTemplateVariable]["+this.getIdentifier()+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{let e=qw.validateVariableIdentifierAttribute(M,this.getIdentifier());this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},UO={class:"qti-template-variable"};function FO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",UO)}const GO=D(HO,[["render",FO]]),Ow=new F,or=new ie,jO={name:"QtiContextVariable",props:{identifier:{type:String,required:!0}},data(){return{value:null,valueBaseType:null,valueCardinality:null,isQtiValid:!0}},methods:{getIdentifier(){return this.identifier},getValue(){return this.value},setValue(e){this.value=e},isNull(){return or.isNullValue(this.value)},getBaseType(){return this.valueBaseType},setBaseType(e){this.valueBaseType=e},getCardinality(){return this.valueCardinality},setCardinality(e){this.valueCardinality=e},validateChildren(){},evaluate(){try{let e=Ow.validateVariableIdentifierAttribute(M,this.identifier);if(typeof e>"u")return this.setValue(or.valueToPciJson(or.nullValue(),void 0,void 0)),this.getValue();if(e.value===null)return console.log("[QtiContextVariable]["+this.identifier+"] value:",{base:null}),this.setValue(or.valueToPciJson(or.nullValue(),this.getBaseType(),this.getCardinality())),this.getValue();const t=or.valueToPciJson(e.value,this.getBaseType(),this.getCardinality());return console.log("[QtiContextVariable]["+this.identifier+"] value:",t),this.setValue(t),this.getValue()}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):e.name==="QtiEvaluationException"?new B(e.message):new Error(e.message)}}},created(){try{let e=Ow.validateVariableIdentifierAttribute(M,this.identifier);this.valueBaseType=e.baseType,this.valueCardinality=e.cardinality}catch(e){throw this.isQtiValid=!1,e.name==="QtiValidationException"?new c(e.message):new Error(e.message)}},mounted(){if(this.isQtiValid)try{this.validateChildren()}catch(e){throw this.isQtiValid=!1,new c(e.message)}}},WO={class:"qti-context-variable"};function zO(e,t,i,s,n,r){return l.openBlock(),l.createElementBlock("div",WO)}const KO=D(jO,[["render",zO]]),Pw=new F,YO=new ie,XO={name:"QtiResponseProcessing",props:{template:{type:String,required:!1}},data(){return{responseRules:[],isQtiValid:!0,matchCorrectXml:`<qti-response-condition>
|
179
179
|
<qti-response-if>
|
180
180
|
<qti-match>
|
181
181
|
<qti-variable identifier="RESPONSE"/>
|