@gmb/bitmark-parser-generator 1.4.9 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generated/build-info.js.map +1 -1
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +77 -171
- package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generated/build-info.js.map +1 -1
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +77 -171
- package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
- package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function o(e,t){var r;const o=Object.freeze,i=Object.defineProperty,n=Object.assign,a={enumerable:!1},s=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))s.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of s){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>s.get(e))),y=g.map((e=>[e,s.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),i(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):s.get(`${e}`)}},a)),i(r,"fromValue",n({value:f},a)),i(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},a)),i(r,"setMetadata",n({value:function(e,t,r){const o=f(e);o&&p.set(o,t)}},a)),i(r,"getMetadata",n({value:function(e,t){return p.get(e)}},a)),i(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:s.get(`${g[e++]}`),done:!1}:{done:!0}}}},a)),i(r,"values",n({value:()=>d},a)),i(r,"keys",n({value:()=>g},a)),i(r,"entries",n({value:()=>y},a));let h=r;return(null==t?void 0:t.noFreeze)||(h=o(r),o(g),o(d),o(y)),h})(t)}r.r(t),r.d(t,{superenum:()=>i});const i=o;i.fromObject=o,i.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),o(r,t)}},390:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const a=r(6688),s=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=r(9677),f=r(7347),h=r(8681),m=r(2606),T=r(1353),b=r(6300),v=r(406),C=(0,a.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=C;t.BitmarkParserGenerator=class{constructor(){this.ast=new s.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new v.TextParser,this.textGenerator=new b.TextGenerator,this.jsonStringifyPrettify=(e,t,r)=>{const o=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==o?JSON.stringify(e,null,o):e}}version(){return d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new y.InfoBuilder;let o;const i=!t.outputFormat||t.outputFormat===h.InfoFormat.text,n=t.outputFormat===h.InfoFormat.json,a=t.type===f.InfoType.all,s=t.type===f.InfoType.deprecated,l=a||!s,u=a||s;if(t.type===f.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return m.Config.getBitType(t.bit).root===e.rootBitType}));o=i?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{var r;if(!t.bit)return!0;const o=m.Config.getBitType(t.bit);if(e.name===o.root)return!0;return!!(null===(r=e.aliases)||void 0===r?void 0:r.find((e=>e.name===o.alias)))}));o=i?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;o=JSON.stringify(o,null,e)}return o}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.outputFormat,s=a===C.bitmark,p=a===C.json,g=a===C.ast,y=c.BitmarkParserType.peggy;let f=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let h=this.ast.preprocessAst(f);const m=!!h;m||(h=this.jsonParser.toAst(f));const T=!!(null==h?void 0:h.bits),b=e=>n(this,void 0,void 0,(function*(){yield v(e),yield x(r)})),v=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:y})})),k=e=>n(this,void 0,void 0,(function*(){if(y===c.BitmarkParserType.peggy)if(h=this.bitmarkParser.toAst(e,{parserType:y}),o.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield e.generate(h)}else{const e=new u.JsonObjectGenerator(o),t=yield e.generate(h);r=this.jsonStringifyPrettify(t,i)}})),x=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),B=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),A=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}})),w=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),P=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),K=e=>n(this,void 0,void 0,(function*(){yield A(e)}));return!T&&!m?s?yield b(f):g?yield v(f):yield k(f):m?g?yield B(h):p?yield A(h):yield x(h):p?yield K(h):g?yield P(h):yield w(h),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.bitmarkParserType;let s=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let c=this.jsonParser.toAst(s);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:a});if(o.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(o);r=yield e.generate(t)}})),g=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}}));return!!!(null==c?void 0:c.bits)?yield p(s):yield g(c),r}))}createAst(e){let t,r=e;d.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let o=this.ast.preprocessAst(r);const i=!!o;i||(o=this.jsonParser.toAst(r));return t=!!!(null==o?void 0:o.bits)&&!i?this.bitmarkParser.toAst(r):o,t}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let o,i;const n=Object.assign({},t),a=Object.assign({},n.fileOptions),s=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:T.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(i=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=i;p||(t=this.jsonStringifyPrettify(i,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else o=p?i:this.jsonStringifyPrettify(i,s);return o}))}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.breakscape(i,{});if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.unbreakscape(i);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)if(t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n",r.aliases&&r.aliases.length>0)for(const e of r.aliases)t+=`|__ ${e.name} (since: ${e.since}`,e.deprecated&&(t+=`, deprecated: ${e.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const o=r(7087),i=r(549),n=r(3633);t.Ast=class{constructor(){(0,o.init)()}walk(e,t,r,o){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],o)}getRouteKey(e){return e.reduce(((t,r,o)=>(+r.key!==r.index&&(t+=`${r.key}`,o<e.length-1&&(t+="_")),t)),"")}printTree(e,t=i.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,o,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(n.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,o,i){const{enter:n,between:a,exit:s,leaf:l}=r,u=o[o.length-1].key,c=!this.isValue(e),p=o[o.length-1];if(c){if(n){if(!1===n(p,t,o,i))return}}else l&&l(p,t,o,i);if(c){const n=this.isArray(e),s=Object.keys(e);for(let l=0,c=s.length;l<c;l++){const g=s[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=o.slice();if(c.push(e),this.walkRecursive(f,p,r,c,i),!d){const r=s[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(a){if(!1===a(p,e,g,t,o,i))break}}}}}c&&s&&s(p,t,o,i)}getAstKey(e,t,r){let o=e;return r&&t&&(o=`${t}Value`),i.NodeType.fromKey(o)||`unknown(${o})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const o=r(8159),i=r(2606),n=r(5486),a=r(7646),s=r(672),l=r(994),u=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t=o.Breakscape.breakscape("true")),!1===t&&(t=o.Breakscape.breakscape("false")),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){if(null==t)return;const r=i.Config.getRawPropertiesConfig()[e],o=e=>{if(null!=e){switch(r.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=o(e[t])}else t=o(t);return a.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const o=r(8159),i=r(3518),n=r(208),a=r(1060),s=r(9779),l=r(1353),u=r(7646),c=r(4598),p=r(994),g=r(3589),d=r(671),y=r(1),f=r(2377);class h extends y.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,o={bits:t,errors:r};return g.ObjectUtils.removeUnwantedProperties(o),o}bit(e){var t;const{bitType:r,textFormat:o,resourceType:a,id:c,externalId:d,spaceId:y,padletId:h,jupyterId:m,jupyterExecutionCount:T,aiGenerated:b,releaseVersion:v,ageRange:C,lang:k,language:x,computerLanguage:B,target:A,tag:w,icon:P,iconTag:K,colorTag:_,flashcardSet:S,subtype:R,bookAlias:I,coverImage:O,publisher:E,publications:L,author:j,subject:G,date:F,location:V,theme:N,kind:M,action:D,thumbImage:U,focusX:$,focusY:q,duration:J,referenceProperty:H,deeplink:z,externalLink:W,externalLinkText:Y,videoCallLink:X,bot:Z,list:Q,textReference:ee,isTracked:te,isInfoOnly:re,labelTrue:oe,labelFalse:ie,content2Buy:ne,book:ae,quotedPerson:se,partialAnswer:le,reasonableNumOfChars:ue,maxCreatedBits:ce,title:pe,subtitle:ge,level:de,toc:ye,progress:fe,anchor:he,reference:me,referenceEnd:Te,item:be,lead:ve,hint:Ce,instruction:ke,isDefaultExample:xe,example:Be,imageSource:Ae,partner:we,markConfig:Pe,extraProperties:Ke,resources:_e,body:Se,sampleSolution:Re,footer:Ie,markup:Oe,parser:Ee}=e,Le=u.ArrayUtils.asArray(_e),je=this.cardNode(e),Ge=r.root===n.RootBitType.essay?this.toAstProperty(i.PropertyConfigKey.reasonableNumOfChars,ue):void 0,Fe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=l.TextFormat.fromValue(o))&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus,resourceType:s.ResourceTag.fromValue(a),id:this.toAstProperty(i.PropertyConfigKey.id,c),externalId:this.toAstProperty(i.PropertyConfigKey.externalId,d),spaceId:this.toAstProperty(i.PropertyConfigKey.spaceId,y),padletId:this.toAstProperty(i.PropertyConfigKey.padletId,h),jupyterId:this.toAstProperty(i.PropertyConfigKey.jupyterId,m),jupyterExecutionCount:this.toAstProperty(i.PropertyConfigKey.jupyterExecutionCount,T),aiGenerated:this.toAstProperty(i.PropertyConfigKey.aiGenerated,b),releaseVersion:this.toAstProperty(i.PropertyConfigKey.releaseVersion,v),book:ae,ageRange:this.toAstProperty(i.PropertyConfigKey.ageRange,C),lang:this.toAstProperty(i.PropertyConfigKey.lang,k),language:this.toAstProperty(i.PropertyConfigKey.language,x),computerLanguage:this.toAstProperty(i.PropertyConfigKey.computerLanguage,B),target:this.toAstProperty(i.PropertyConfigKey.target,A),tag:this.toAstProperty(i.PropertyConfigKey.tag,w),icon:this.toAstProperty(i.PropertyConfigKey.icon,P),iconTag:this.toAstProperty(i.PropertyConfigKey.iconTag,K),colorTag:this.toAstProperty(i.PropertyConfigKey.colorTag,_),flashcardSet:this.toAstProperty(i.PropertyConfigKey.flashcardSet,S),subtype:this.toAstProperty(i.PropertyConfigKey.subtype,R),bookAlias:this.toAstProperty(i.PropertyConfigKey.bookAlias,I),coverImage:this.toAstProperty(i.PropertyConfigKey.coverImage,O),publisher:this.toAstProperty(i.PropertyConfigKey.publisher,E),publications:this.toAstProperty(i.PropertyConfigKey.publications,L),author:this.toAstProperty(i.PropertyConfigKey.author,j),subject:this.toAstProperty(i.PropertyConfigKey.subject,G),date:this.toAstProperty(i.PropertyConfigKey.date,F),location:this.toAstProperty(i.PropertyConfigKey.location,V),theme:this.toAstProperty(i.PropertyConfigKey.theme,N),kind:this.toAstProperty(i.PropertyConfigKey.kind,M),action:this.toAstProperty(i.PropertyConfigKey.action,D),thumbImage:this.toAstProperty(i.PropertyConfigKey.thumbImage,U),focusX:this.toAstProperty(i.PropertyConfigKey.focusX,$),focusY:this.toAstProperty(i.PropertyConfigKey.focusY,q),deeplink:this.toAstProperty(i.PropertyConfigKey.deeplink,z),externalLink:this.toAstProperty(i.PropertyConfigKey.externalLink,W),externalLinkText:this.toAstProperty(i.PropertyConfigKey.externalLinkText,Y),videoCallLink:this.toAstProperty(i.PropertyConfigKey.videoCallLink,X),bot:this.toAstProperty(i.PropertyConfigKey.bot,Z),duration:this.toAstProperty(i.PropertyConfigKey.duration,J),referenceProperty:this.toAstProperty(i.PropertyConfigKey.property_reference,H),list:this.toAstProperty(i.PropertyConfigKey.list,Q),textReference:this.toAstProperty(i.PropertyConfigKey.textReference,ee),isTracked:this.toAstProperty(i.PropertyConfigKey.isTracked,te),isInfoOnly:this.toAstProperty(i.PropertyConfigKey.isInfoOnly,re),labelTrue:this.toAstProperty(i.PropertyConfigKey.labelTrue,oe),labelFalse:this.toAstProperty(i.PropertyConfigKey.labelFalse,ie),content2Buy:this.toAstProperty(i.PropertyConfigKey.content2Buy,ne),quotedPerson:this.toAstProperty(i.PropertyConfigKey.quotedPerson,se),partialAnswer:this.toAstProperty(i.PropertyConfigKey.partialAnswer,le),reasonableNumOfChars:Ge,maxCreatedBits:this.toAstProperty(i.PropertyConfigKey.maxCreatedBits,ce),title:pe,subtitle:ge,level:p.NumberUtils.asNumber(de),toc:this.toAstProperty(i.PropertyConfigKey.toc,ye),progress:this.toAstProperty(i.PropertyConfigKey.progress,fe),anchor:he,reference:me,referenceEnd:Te,markConfig:Pe,itemLead:this.itemLead(be,ve),hint:Ce,instruction:ke},this.toExample(xe,Be)),{imageSource:Ae,partner:we,resources:Le,body:Se,sampleSolution:u.ArrayUtils.asSingle(Re),cardNode:je,footer:Ie,markup:Oe,parser:Ee,extraProperties:this.parseExtraProperties(Ke)});return r.root===n.RootBitType.interview&&this.pushDownTree(void 0,void 0,je,"questions",i.PropertyConfigKey.reasonableNumOfChars,ue),this.pushExampleDownTree(Se,je,xe,Be),this.setDefaultBitValues(Fe),this.setIsExampleFlags(Fe),this.addVersionToParserInfo(Fe),g.ObjectUtils.removeUnwantedProperties(Fe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),f.NodeValidator.validateBit(Fe)}choice(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}response(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}botResponse(e){const{response:t,reaction:r,feedback:o,item:i,lead:n,hint:a}=e,s={response:t,reaction:r,feedback:o,itemLead:this.itemLead(i,n),hint:a};return g.ObjectUtils.removeUnwantedProperties(s,{ignoreEmptyString:["response","reaction","feedback"]}),s}quiz(e){const{choices:t,responses:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e;this.pushExampleDownTreeBoolean(s,l,!0,t),this.pushExampleDownTreeBoolean(s,l,!1,r);const u={itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:s||null!=l,choices:t,responses:r};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const n={forKeys:r||o.Breakscape.EMPTY_STRING,forValues:null!==(t=u.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return g.ObjectUtils.removeUnwantedProperties(n),n}pair(e){const{key:t,keyAudio:r,keyImage:o,values:i,item:n,lead:a,hint:s,instruction:l,isCaseSensitive:u,isDefaultExample:c,example:p}=e,d=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:o,itemLead:this.itemLead(n,a),hint:s,instruction:l},this.toExample(c,p)),{isCaseSensitive:null==u||u,values:i});return g.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}matrix(e){const{key:t,cells:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s}=e;let l=!1;for(const e of null!=r?r:[])s&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),l=!!e.isExample||l;const u={key:t,itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:l,cells:r};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}matrixCell(e){const{values:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:a,isDefaultExample:s,example:l}=e,u=Object.assign({values:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==a||a},this.toExample(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}question(e){const{question:t,partialAnswer:r,item:o,lead:i,hint:n,instruction:a,reasonableNumOfChars:s,sampleSolution:l,isDefaultExample:u,example:c}=e,p=Object.assign(Object.assign({itemLead:this.itemLead(o,i),question:t,partialAnswer:r,hint:n,instruction:a},this.toExample(u,c)),{reasonableNumOfChars:s,sampleSolution:l});return g.ObjectUtils.removeUnwantedProperties(p,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),p}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:a.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:s,isDefaultExample:l,example:u}=e,c={type:a.BodyBitType.gap,data:Object.assign({solutions:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==s||s},this.toExample(l,u))};return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:o}=e,i={mark:t,color:r,emphasis:o};return g.ObjectUtils.removeUnwantedProperties(i),i}mark(e){const{solution:t,mark:r,item:o,lead:i,hint:n,instruction:s,isDefaultExample:l,example:u}=e,c={type:a.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExample(l,u))};return g.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:l}=e,u={type:a.BodyBitType.select,data:{prefix:r,options:t,postfix:o,itemLead:this.itemLead(i,n),hint:s,instruction:l}};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}selectOption(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExample(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlight(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:l}=e,u={type:a.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:o,itemLead:this.itemLead(i,n),hint:s,instruction:l}};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlightText(e){const{text:t,isCorrect:r,isHighlighted:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({text:t,isCorrect:!!r,isHighlighted:!!o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExample(l,u));return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}flashcard(e){const{question:t,answer:r,alternativeAnswers:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExampleBoolean(l,u));return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}imageSource(e){const{url:t,mockupId:r,size:o,format:i,trim:n}=e,a={url:t,mockupId:r,size:o,format:i,trim:n};return g.ObjectUtils.removeUnwantedProperties(a,{ignoreFalse:["trim"]}),a}partner(e){const{name:t,avatarImage:r}=e,o={name:t,avatarImage:r};return g.ObjectUtils.removeUnwantedProperties(o),o}comment(e){const{text:t,location:r}=e,o={text:t,location:r};return g.ObjectUtils.removeUnwantedProperties(o),o}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:d,botResponses:y}=e;return(r||o||i||n||a||s||l||u||c||p||d||y)&&(t={questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:d,botResponses:y},g.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTree(e,t,r,o){if(r||o){if(t){if(this.pushExampleDownTreeString(r,o,t.pairs),this.pushExampleDownTreeBoolean(r,o,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,o,!0,t.choices),this.pushExampleDownTreeBoolean(r,o,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,o,!0,e.choices),this.pushExampleDownTreeBoolean(r,o,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,o,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,o,e)}}pushExampleDownTreeBoolean(e,t,r,...o){if((e||t)&&Array.isArray(o))for(const i of o)if(i){const o=Array.isArray(i)?i:[i];c.BitUtils.fillBooleanExample(o,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];c.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const o of r.bodyParts)if(o)switch(o.type){case a.BodyBitType.gap:{const r=o;c.BitUtils.fillStringExample([r.data],e,t,!1);break}case a.BodyBitType.mark:{const r=o;c.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case a.BodyBitType.select:{const r=o;c.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case a.BodyBitType.highlight:{const r=o;c.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,o,i,n){if(void 0!==n){if(r&&o){const e=r[o];if(Array.isArray(e))for(const t of e)null==t[i]&&(t[i]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[i]=n}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,o]of t)r[e]=u.ArrayUtils.asArray(o)||[o];return r}setIsExampleFlags(e){var t,r,o,i,n,s,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case a.BodyBitType.gap:case a.BodyBitType.mark:f(e.data);break;case a.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case a.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(o=m.matrix)&&void 0!==o?o:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(n=m.quizzes)&&void 0!==n?n:[]){let t=!1;for(const r of null!==(s=e.responses)&&void 0!==s?s:[])t=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType.alias){case n.AliasBitType.articleAi:case n.AliasBitType.noteAi:case n.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(i.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=h},8703:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const i=r(8159),n=r(9779),a=r(3589),s=r(169),l=r(1),u=r(2377);class c extends l.BaseBuilder{resource(e){var t;let r;const{type:a,value:s,format:l}=e,u=o(e,["type","value","format"]),c=Object.assign({type:a,value:null!=s?s:i.Breakscape.EMPTY_STRING,format:null!=l?l:i.Breakscape.EMPTY_STRING},u);switch(a){case n.ResourceTag.video:case n.ResourceTag.videoEmbed:case n.ResourceTag.videoLink:case n.ResourceTag.stillImageFilmEmbed:case n.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],o=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:n.ResourceTag.image,value:r});e&&o.push(e)}}c.thumbnails=[...null!==(t=c.thumbnails)&&void 0!==t?t:[],...o]}}switch(a){case n.ResourceTag.image:case n.ResourceTag.imagePortrait:case n.ResourceTag.imageLandscape:r=this.imageResource(c,a);break;case n.ResourceTag.imageLink:r=this.imageLinkResource(c);break;case n.ResourceTag.audio:r=this.audioResource(c);break;case n.ResourceTag.audioEmbed:r=this.audioEmbedResource(c);break;case n.ResourceTag.audioLink:r=this.audioLinkResource(c);break;case n.ResourceTag.video:r=this.videoResource(c);break;case n.ResourceTag.videoEmbed:r=this.videoEmbedResource(c);break;case n.ResourceTag.videoLink:r=this.videoLinkResource(c);break;case n.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(c);break;case n.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(c);break;case n.ResourceTag.article:r=this.articleResource(c);break;case n.ResourceTag.document:r=this.documentResource(c);break;case n.ResourceTag.documentEmbed:r=this.documentEmbedResource(c);break;case n.ResourceTag.documentLink:r=this.documentLinkResource(c);break;case n.ResourceTag.documentDownload:r=this.documentDownloadResource(c);break;case n.ResourceTag.appLink:r=this.appLinkResource(c);break;case n.ResourceTag.websiteLink:r=this.websiteLinkResource(c)}return r}imageResource(e,t){const{value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:n.ResourceTag.image,typeAlias:null!=t?t:n.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m};return a.ObjectUtils.removeUnwantedProperties(T),u.NodeValidator.validateResource(T)}imageLinkResource(e){const{value:t,src1x:r,src2x:o,src3x:i,src4x:l,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h}=e,m={type:n.ResourceTag.imageLink,typeAlias:n.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:o,src3x:i,src4x:l,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h};return a.ObjectUtils.removeUnwantedProperties(m),u.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audio,typeAlias:n.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioEmbed,typeAlias:n.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioLink,typeAlias:n.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.video,typeAlias:n.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoEmbed,typeAlias:n.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoLink,typeAlias:n.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmEmbed,typeAlias:n.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmLink,typeAlias:n.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.article,typeAlias:n.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.document,typeAlias:n.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentEmbed,typeAlias:n.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentLink,typeAlias:n.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentDownload,typeAlias:n.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:s}=e,l={type:n.ResourceTag.appLink,typeAlias:n.ResourceTag.appLink,value:t,license:r,copyright:o,showInIndex:i,caption:s};return a.ObjectUtils.removeUnwantedProperties(l),u.NodeValidator.validateResource(l)}websiteLinkResource(e){const{value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l}=e,c={type:n.ResourceTag.websiteLink,typeAlias:n.ResourceTag.websiteLink,value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}}t.ResourceBuilder=c},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const o=r(208),i=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===o.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!i.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,o=e.length;r<o;r++){const i=e[r];this._buffer.push(i),t&&r<o-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},8159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Breakscape=void 0;const o=r(3633),i=`${/([*`_!|:=])([\^]*)\1/.source}|${/^(\|)([\^]*)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([\^]*)([^\S\r\n]+)/.source}|${/^(•)([\^]*)(1|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([\^]*)([.@#▼►%!?+\-$_=&])/.source}|${/([\^]*)(])/.source}`,n=i.replace(/(\(\[\\\^\]\*\))/g,"\\^$1"),a=new RegExp(i,"gm"),s="$1$3$6$9$13^$2$1$4$5$7$8$10$11$12$14$15$16$17",l=new RegExp(n,"gm"),u=s.replace(/\^/g,""),c=new RegExp("^(\\||•|#)","gm");const p=new class{constructor(){this.EMPTY_STRING=""}breakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(a,s):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)&&(t[r]=i(n))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}unbreakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(l,u):e;if(Array.isArray(e)){const t=r.modifyArray?e:[];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)?t[r]=i(n):t[r]=n}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e.replace(c,"$1^"):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];o.StringUtils.isString(r)&&(e[t]=i(r))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}concatenate(e,t){return e+t}};t.Breakscape=p},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const o=r(429),i=r(7585),n=r(3059),a=r(5428),s=r(742),l=r(8360),u=r(3141),c=r(9036),p=r(6260),g=r(208);const d=new class{constructor(){this.bitTypeAliasMap=new Map,this.bitCache=new Map,this.comboResourcesCache=new Map,this.buildBitTypeAliasMap()}getBitType(e){const t=this.getAliasedBitType(e);return{alias:t,root:this.getRootBitType(t)}}getBitConfig(e){var t;let r=this.bitCache.get(e.alias);if(!r){const i=()=>{throw new Error(`No config found for bit: ALIAS:${e.alias}, ROOT:${e.root}`)},n=u.BITS[e.root];n||i();const a=e.root!==e.alias;let s;a&&n.aliases&&(s=n.aliases[e.alias]),a&&!s&&i();const{since:c,deprecated:p}=s||n,d=n.aliases?Object.keys(n.aliases).map((e=>g.AliasBitType.fromValue(e))):[],{tags:y,cardSet:f,bodyAllowed:h,bodyRequired:m,footerAllowed:T,footerRequired:b,resourceAttachmentAllowed:v,rootExampleType:C}=n,k=this.getAllResourcesTagsWithZeroCounts(),x=l.ConfigHydrator.hydrateTagsConfig(y),B=l.ConfigHydrator.hydrateCardSetConfig(f),A=null===(t=x.info)||void 0===t?void 0:t.comboResourceType,w=Object.assign({},x.tags);for(const[e,t]of Object.entries(k))w[e]||(w[e]=t);r=new o.BitConfig(c,e,d,w,B,p,h,m,T,b,v,C,A),this.bitCache.set(e.root,r)}return r}getRawPropertiesConfig(){return p.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const o=this.getBitConfig(e);if(!o)return;const i=o.cardSet;if(!i)return;t=Math.min(t,i.variants.length-1);const n=i.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let o={};const a=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===s.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===s.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const o=t.find((e=>e.tag===r));o&&e.set(r,o)}));const o=this.getComboResourceTagTypes(c);o&&o.length>0&&a.set(c,o)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,a=!!e&&e.has(r.tag);if(n){const e=new i.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);o[t]=e}else if(a){if(e){const i=e.get(r.tag);i&&(o[t]=i)}}else o[t]=r}else o=u}else o=u;return new n.ResourcesConfig(o,l.resourceAttachmentAllowed,t,a)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===s.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(c.GROUPS).filter((t=>t.type===a.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),l.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(c.GROUPS).filter((e=>e.type===a.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),l.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}buildBitTypeAliasMap(){for(const e of g.RootBitType.values())this.bitTypeAliasMap.set(e,e);for(const[e,t]of Object.entries(u.BITS))if(t.aliases)for(const r of Object.keys(t.aliases))this.bitTypeAliasMap.set(r,e)}getRootBitType(e){var t;return e&&null!==(t=this.bitTypeAliasMap.get(e))&&void 0!==t?t:g.RootBitType._error}getAliasedBitType(e){var t,r;return null!==(r=null!==(t=g.AliasBitType.fromValue(e))&&void 0!==t?t:g.RootBitType.fromValue(e))&&void 0!==r?r:g.RootBitType._error}};t.Config=d},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const o=r(2005),i=r(3585),n=r(6620),a=r(6956),s=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const o of e){let e;switch(o.type){case d.BitTagType.tag:e=this.hydrateTagConfig(o);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(o);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(o);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(o)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new o.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,a=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,s=T.TAGS[a];if(!s)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=s;let p;i&&(p=this.hydrateTagsConfig(i).tags);return{tags:{[a]:new n.MarkupTagConfig(a,u,null!=r?r:1,null!=o?o:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,s=h.PROPERTIES[n];if(!s)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=s;let T;i&&(T=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new a.PropertyTagConfig(n,u,null!=r?r:1,null!=o?o:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,a=m.RESOURCES[n];if(!a)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=a;let d;i&&(d=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new s.ResourceTagConfig(n,u,null!=r?r:1,null!=o?o:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:o}=e,i=u.GroupConfigKey.fromKey(o)||l.ConfigKey._unknown,n=f.GROUPS[i];if(!n)throw new Error(`No config found for group config key '${o}'`);const{tags:a}=n,s=this.hydrateTagsConfig(a).tags,c=Object.values(s);if(c.length>0){const o=c[0],i=o;i.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:o.maxCount,i.minCount=null!==(r=e.minCount)&&void 0!==r?r:o.minCount}return{tags:s,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:o,repeatCount:n}=e,a=this.hydrateTagsConfig(t);return new i.CardVariantConfig(a.tags,r,o,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(1595),s=r(742),l=r(208),u=r(1035),c=r(7028),p={[l.RootBitType._error]:{since:"1.3.0",tags:[],bodyAllowed:!0,aliases:{}},[l.RootBitType.appFlashcards]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appFlashcardsQuiz]:{since:"1.3.0"},[l.AliasBitType.appFlashcardsLearn]:{since:"1.3.0"}}},[l.RootBitType.appLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.RootBitType.article]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.statement]:{since:"1.3.0"},[l.AliasBitType.buttonCopyText]:{since:"1.4.3"}}},[l.RootBitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.appBitmarkFromEditor]:{since:"1.4.5"}}},[l.RootBitType.articleEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.articleLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.audio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.bitAlias]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor}],bodyAllowed:!0},[l.RootBitType.book]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon}],bodyAllowed:!0,aliases:{[l.AliasBitType.bookAcknowledgments]:{since:"1.3.0"},[l.AliasBitType.bookAddendum]:{since:"1.3.0"},[l.AliasBitType.bookAfterword]:{since:"1.3.0"},[l.AliasBitType.bookAppendix]:{since:"1.3.0"},[l.AliasBitType.bookArticle]:{since:"1.3.0"},[l.AliasBitType.bookAutherBio]:{since:"1.3.0"},[l.AliasBitType.bookBibliography]:{since:"1.3.0"},[l.AliasBitType.bookComingSoon]:{since:"1.3.0"},[l.AliasBitType.bookConclusion]:{since:"1.3.0"},[l.AliasBitType.bookCopyright]:{since:"1.3.0"},[l.AliasBitType.bookCopyrightPermissions]:{since:"1.3.0"},[l.AliasBitType.bookDedication]:{since:"1.3.0"},[l.AliasBitType.bookEndnotes]:{since:"1.3.0"},[l.AliasBitType.bookEpigraph]:{since:"1.3.0"},[l.AliasBitType.bookEpilogue]:{since:"1.3.0"},[l.AliasBitType.bookForword]:{since:"1.3.0"},[l.AliasBitType.bookFrontispiece]:{since:"1.3.0"},[l.AliasBitType.bookImprint]:{since:"1.3.0"},[l.AliasBitType.bookIncitingIncident]:{since:"1.3.0"},[l.AliasBitType.bookIntroduction]:{since:"1.3.0"},[l.AliasBitType.bookListOfContributors]:{since:"1.3.0"},[l.AliasBitType.bookNotes]:{since:"1.3.0"},[l.AliasBitType.bookPostscript]:{since:"1.3.0"},[l.AliasBitType.bookPreface]:{since:"1.3.0"},[l.AliasBitType.bookPrologue]:{since:"1.3.0"},[l.AliasBitType.bookReadMore]:{since:"1.3.0"},[l.AliasBitType.bookReferenceList]:{since:"1.3.0"},[l.AliasBitType.bookRequestForABookReview]:{since:"1.3.0"},[l.AliasBitType.bookSummary]:{since:"1.3.0"},[l.AliasBitType.bookTeaser]:{since:"1.3.0"},[l.AliasBitType.bookTitle]:{since:"1.3.0"}}},[l.RootBitType.bookAlias]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}],bodyAllowed:!0},[l.RootBitType.botActionResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.botActionSend]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.RootBitType.browserImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.card1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.question1]:{since:"1.3.0"},[l.AliasBitType.survey1]:{since:"1.3.0"},[l.AliasBitType.surveyAnonymous1]:{since:"1.3.0"}}},[l.RootBitType.chapter]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.RootBitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.cloze]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.clozeInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.clozeSolutionGrouped]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionCloze]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionCloze]:{since:"1.3.0"}}},[l.RootBitType.code]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCodeCell]:{since:"1.4.3"},[l.AliasBitType.appCodeEditor]:{since:"1.4.3"},[l.AliasBitType.appCodeIde]:{since:"1.4.3"},[l.AliasBitType.codeRuntime]:{since:"1.4.3"},[l.AliasBitType.consoleLog]:{since:"1.4.3"},[l.AliasBitType.output]:{since:"1.4.3"},[l.AliasBitType.stdout]:{since:"1.4.3"}}},[l.RootBitType.conversationLeft1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.conversationLeft1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationLeft1Thought]:{since:"1.3.0"},[l.AliasBitType.conversationRight1]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Thought]:{since:"1.3.0"}}},[l.RootBitType.document]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentDownload]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.essay]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.coachSelfReflectionEssay]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionEssay]:{since:"1.3.0"}}},[l.RootBitType.example]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appAiPrompt]:{since:"1.3.0"},[l.AliasBitType.aiPrompt]:{since:"1.3.0"},[l.AliasBitType.articleAi]:{since:"1.3.0"},[l.AliasBitType.articleAttachment]:{since:"1.3.0"},[l.AliasBitType.assignment]:{since:"1.3.0"},[l.AliasBitType.audioTranscript]:{since:"1.3.0"},[l.AliasBitType.bitmarkExample]:{since:"1.3.0"},[l.AliasBitType.blogArticle]:{since:"1.3.0"},[l.AliasBitType.bug]:{since:"1.3.0"},[l.AliasBitType.checklist]:{since:"1.3.0"},[l.AliasBitType.coachAudioTranscript]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionChecklist]:{since:"1.3.0"},[l.AliasBitType.coachHomeRules]:{since:"1.3.0"},[l.AliasBitType.coachVideoTranscript]:{since:"1.3.0"},[l.AliasBitType.correction]:{since:"1.3.0"},[l.AliasBitType.cookPreparation]:{since:"1.3.0"},[l.AliasBitType.cookStep]:{since:"1.3.0"},[l.AliasBitType.cookIngredients]:{since:"1.3.0"},[l.AliasBitType.cookRemark]:{since:"1.3.0"},[l.AliasBitType.cookVariation]:{since:"1.3.0"},[l.AliasBitType.cookInsert]:{since:"1.3.0"},[l.AliasBitType.cookArrangement]:{since:"1.3.0"},[l.AliasBitType.cookPracticeAdvise]:{since:"1.3.0"},[l.AliasBitType.cookPlate]:{since:"1.3.0"},[l.AliasBitType.cookRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookPersonalRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookSideDrink]:{since:"1.3.0"},[l.AliasBitType.cookSideDish]:{since:"1.3.0"},[l.AliasBitType.cookTimer]:{since:"1.3.0"},[l.AliasBitType.danger]:{since:"1.3.0"},[l.AliasBitType.details1]:{since:"1.3.0"},[l.AliasBitType.details]:{since:"1.3.0"},[l.AliasBitType.editorial]:{since:"1.3.0"},[l.AliasBitType.editorNote]:{since:"1.3.0"},[l.AliasBitType.featured]:{since:"1.3.0"},[l.AliasBitType.help]:{since:"1.3.0"},[l.AliasBitType.hint]:{since:"1.3.0"},[l.AliasBitType.info]:{since:"1.3.0"},[l.AliasBitType.langLearningOutcomes]:{since:"1.3.0"},[l.AliasBitType.langEnablingLanguageSkills]:{since:"1.3.0"},[l.AliasBitType.langLifeSkills]:{since:"1.3.0"},[l.AliasBitType.langEnglishAroundWorld]:{since:"1.3.0"},[l.AliasBitType.langGoodToKnow]:{since:"1.3.0"},[l.AliasBitType.langLearningGoal]:{since:"1.3.0"},[l.AliasBitType.langLearningStrategy]:{since:"1.3.0"},[l.AliasBitType.langLikeALocal]:{since:"1.3.0"},[l.AliasBitType.langMaterial]:{since:"1.3.0"},[l.AliasBitType.langUsefulPhrases]:{since:"1.3.0"},[l.AliasBitType.langLevelDown]:{since:"1.3.0"},[l.AliasBitType.langLevelUp]:{since:"1.3.0"},[l.AliasBitType.langExtraActivity]:{since:"1.3.0"},[l.AliasBitType.langVideoScript]:{since:"1.3.0"},[l.AliasBitType.langAudioScript]:{since:"1.3.0"},[l.AliasBitType.langVocabulary]:{since:"1.3.0"},[l.AliasBitType.langHomework]:{since:"1.3.0"},[l.AliasBitType.langTeacherNote]:{since:"1.3.0"},[l.AliasBitType.langTeacherPronunciation]:{since:"1.3.0"},[l.AliasBitType.message]:{since:"1.3.0"},[l.AliasBitType.newspaperArticle]:{since:"1.3.0"},[l.AliasBitType.note]:{since:"1.3.0"},[l.AliasBitType.noteAi]:{since:"1.3.0"},[l.AliasBitType.notebookArticle]:{since:"1.3.0"},[l.AliasBitType.preparationNote]:{since:"1.3.0"},[l.AliasBitType.releaseNotesSummary]:{since:"1.3.0"},[l.AliasBitType.remark]:{since:"1.3.0"},[l.AliasBitType.reviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewAuthorNote]:{since:"1.3.0"},[l.AliasBitType.reviewReviewerNote]:{since:"1.3.0"},[l.AliasBitType.reviewRequestForReviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewApprovedNote]:{since:"1.3.0"},[l.AliasBitType.selfAssessment]:{since:"1.3.0"},[l.AliasBitType.sideNote]:{since:"1.3.0"},[l.AliasBitType.summary]:{since:"1.3.0"},[l.AliasBitType.summaryAi]:{since:"1.3.0"},[l.AliasBitType.videoTranscript]:{since:"1.3.0"},[l.AliasBitType.warning]:{since:"1.3.0"},[l.AliasBitType.workbookArticle]:{since:"1.3.0"}}},[l.RootBitType.flashcard]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.flashcard1]:{since:"1.3.0"}}},[l.RootBitType.focusImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.highlightText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.image]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCreateBitsFromImage]:{since:"1.3.0"},[l.AliasBitType.appGetScreenshot]:{since:"1.3.0"},[l.AliasBitType.detailsImage]:{since:"1.3.0"},[l.AliasBitType.figure]:{since:"1.3.0",deprecated:"1.4.0"},[l.AliasBitType.imageBanner]:{since:"1.3.0"},[l.AliasBitType.imageFigure]:{since:"1.3.0"},[l.AliasBitType.imageLandscape]:{since:"1.3.0"},[l.AliasBitType.imageMood]:{since:"1.3.0"},[l.AliasBitType.imagePortrait]:{since:"1.3.0"},[l.AliasBitType.imagePrototype]:{since:"1.3.0"},[l.AliasBitType.imageScreenshot]:{since:"1.3.0"},[l.AliasBitType.imageStyled]:{since:"1.3.0"},[l.AliasBitType.imageSuperWide]:{since:"1.3.0"},[l.AliasBitType.imageZoom]:{since:"1.3.0"},[l.AliasBitType.langLifeSkillIcon]:{since:"1.3.0"},[l.AliasBitType.lifeSkillSticker]:{since:"1.3.0"},[l.AliasBitType.pageBanner]:{since:"1.4.3"},[l.AliasBitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0"}}},[l.RootBitType.imageLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.imageOnDevice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.RootBitType.imageResponsive]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.RootBitType.internalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.RootBitType.interview]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:o.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.interviewInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.botInterview]:{since:"1.3.0"}}},[l.RootBitType.learningPathBook]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.bookLink]:{since:"1.3.0"},[l.AliasBitType.bookLinkNext]:{since:"1.3.0"},[l.AliasBitType.bookLinkPrev]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomEvent]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomTraining]:{since:"1.3.0"},[l.AliasBitType.learningPathClosing]:{since:"1.3.0"},[l.AliasBitType.learningPathFeedback]:{since:"1.3.0"},[l.AliasBitType.learningPathLearningGoal]:{since:"1.3.0"},[l.AliasBitType.learningPathLti]:{since:"1.3.0"},[l.AliasBitType.learningPathSign]:{since:"1.3.0"},[l.AliasBitType.learningPathStep]:{since:"1.3.0"}}},[l.RootBitType.learningPathBotTraining]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bot}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathExternalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathVideoCall]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.mark]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_markConfig},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.match]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.matchAll]:{since:"1.3.0"},[l.AliasBitType.matchReverse]:{since:"1.3.0"},[l.AliasBitType.matchAllReverse]:{since:"1.3.0"},[l.AliasBitType.matchSolutionGrouped]:{since:"1.3.0"}}},[l.RootBitType.matchMatrix]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchMatrix,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchAudio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchAudioPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchPicture]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchImagePairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.multipleChoice1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0"}}},[l.RootBitType.multipleChoice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0"}}},[l.RootBitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0"}}},[l.RootBitType.page]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.pageBuyButton]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.photo]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.RootBitType.quote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.RootBitType.rating]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionRating]:{since:"1.3.0"}}},[l.RootBitType.releaseNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sampleSolution]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sequence]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.RootBitType.stillImageFilm]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.RootBitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.survey]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.toc]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.anchor]:{since:"1.3.0"},[l.AliasBitType.bitBookEnding]:{since:"1.3.0"},[l.AliasBitType.bitBookSummary]:{since:"1.3.0"},[l.AliasBitType.botActionAnnounce]:{since:"1.3.0"},[l.AliasBitType.botActionRatingNumber]:{since:"1.3.0"},[l.AliasBitType.botActionRemind]:{since:"1.3.0"},[l.AliasBitType.botActionSave]:{since:"1.3.0"},[l.AliasBitType.botActionTrueFalse]:{since:"1.3.0"},[l.AliasBitType.chapterSubjectMatter]:{since:"1.3.0"},[l.AliasBitType.chat]:{since:"1.3.0"},[l.AliasBitType.conclusion]:{since:"1.3.0"},[l.AliasBitType.documentUpload]:{since:"1.3.0"},[l.AliasBitType.footNote]:{since:"1.3.0"},[l.AliasBitType.groupBorn]:{since:"1.3.0"},[l.AliasBitType.groupDied]:{since:"1.3.0"},[l.AliasBitType.recordAudio]:{since:"1.3.0"},[l.AliasBitType.stickyNote]:{since:"1.3.0"},[l.AliasBitType.takePicture]:{since:"1.3.0"}}},[l.RootBitType.trueFalse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:s.BitTagType.tag,configKey:a.TagConfigKey.true},{type:s.BitTagType.tag,configKey:a.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.RootBitType.trueFalse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:o.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],bodyAllowed:!0},[l.RootBitType.vendorJupyterOutput]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.vendorJupyterCellCode]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellMarkdown]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellRaw]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterIpynb]:{since:"1.4.3"}}},[l.RootBitType.video]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLandscape]:{since:"1.3.0"},[l.AliasBitType.videoPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoEmbedLandscape]:{since:"1.3.0"},[l.AliasBitType.videoEmbedPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLinkLandscape]:{since:"1.3.0"},[l.AliasBitType.videoLinkPortrait]:{since:"1.3.0"}}},[l.RootBitType.websiteLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=p},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c={[o.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:s.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const o=r(177),i=r(5428),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c=r(9779),p={[o.GroupConfigKey.group_standardAllBits]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.anchor}]},[o.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:s.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:s.TagConfigKey.hint}]},[o.GroupConfigKey.group_standardExample]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[o.GroupConfigKey.group_standardTags]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},[o.GroupConfigKey.group_imageSource]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[o.GroupConfigKey.group_partner]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage}]}]},[o.GroupConfigKey.group_gap]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}]}]},[o.GroupConfigKey.group_trueFalse]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_markConfig]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[o.GroupConfigKey.group_mark]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_bookCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[o.GroupConfigKey.group_learningPathCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_reference,maxCount:2}]}]},[o.GroupConfigKey.group_resourceCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[o.GroupConfigKey.group_resourceImageCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt}]},[o.GroupConfigKey.group_resourceAudioCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[o.GroupConfigKey.group_resourceVideoCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[o.GroupConfigKey.group_resourceImage]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImagePortrait]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLandscape]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceAudio]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceVideo]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceArticle]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocument]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentDownload]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceAppLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceWebsiteLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilm]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[o.GroupConfigKey.group_resourceImageResponsive]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const o=r(3518),i=r(7204),n=r(5486),a=r(7953),s={[o.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.aiGenerated},[o.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.referenceProperty},[o.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.markConfig},[o.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isCaseSensitive]:{tag:a.PropertyTag.isCaseSensitive,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=s},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const o=r(6194),i=r(9431),n=r(9779),a={[o.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[o.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:i.ResourceJsonKey.imagePortrait},[o.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:i.ResourceJsonKey.imageLandscape},[o.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:i.ResourceJsonKey.imageEmbed},[o.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:i.ResourceJsonKey.imageLink},[o.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[o.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:i.ResourceJsonKey.audioEmbed},[o.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:i.ResourceJsonKey.audioLink},[o.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[o.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:i.ResourceJsonKey.videoEmbed},[o.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:i.ResourceJsonKey.videoLink},[o.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:i.ResourceJsonKey.stillImageFilmEmbed},[o.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:i.ResourceJsonKey.stillImageFilmLink},[o.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[o.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:i.ResourceJsonKey.articleEmbed},[o.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:i.ResourceJsonKey.articleLink},[o.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[o.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:i.ResourceJsonKey.documentEmbed},[o.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:i.ResourceJsonKey.documentLink},[o.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:i.ResourceJsonKey.documentDownload},[o.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:i.ResourceJsonKey.appLink},[o.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:i.ResourceJsonKey.websiteLink}};t.RESOURCES=a},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const o=r(1595),i=r(8739),n={[o.TagConfigKey.title]:{tag:i.Tag.title},[o.TagConfigKey.anchor]:{tag:i.Tag.anchor},[o.TagConfigKey.tag_reference]:{tag:i.Tag.reference},[o.TagConfigKey.property]:{tag:i.Tag.property},[o.TagConfigKey.itemLead]:{tag:i.Tag.itemLead},[o.TagConfigKey.instruction]:{tag:i.Tag.instruction},[o.TagConfigKey.hint]:{tag:i.Tag.hint},[o.TagConfigKey.true]:{tag:i.Tag.true},[o.TagConfigKey.false]:{tag:i.Tag.false},[o.TagConfigKey.sampleSolution]:{tag:i.Tag.sampleSolution},[o.TagConfigKey.gap]:{tag:i.Tag.gap},[o.TagConfigKey.tag_mark]:{tag:i.Tag.mark},[o.TagConfigKey.resource]:{tag:i.Tag.resource},[o.TagConfigKey.remark]:{tag:i.Tag.remark},[o.TagConfigKey.comment]:{tag:i.Tag.comment}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.9",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(6831),i=r(2892),n=r(7448);function a(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,a.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function s(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=a,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(a,Error),a.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=s("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+s("",i.column-1," ")+s("",p,"^")}else t+="\n at "+a}return t},a.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var s,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:pr,bit:function(){var e,t,r,o,i;e=Xt,t=[],r=Lr();for(;r!==l;)t.push(r),r=Lr();if((r=yr())!==l){for(o=[],i=Lr();i!==l;)o.push(i),i=Lr();Zt=e,e=tt(r)}else Xt=e,e=l;return e},cardContent:function(){var e,t,r;e=Xt,t=[],(r=Tr())===l&&(r=wr());for(;r!==l;)t.push(r),(r=Tr())===l&&(r=wr());return Zt=e,t=At(t),e=t}},p=pr,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",C="==",k="[@id",x="[",B="#",A="[▼",w="[►",P="[@",K="[%",_="[!",S="[?",R="[+",I="[-",O="[$",E="[_",L="[=",j="[&",G="::",F="||",V="^^",N="^",M="^]",D="id:",U="\n",$="\r\n",q="\r",J="\u2028",H="\u2029",z=/^[^\]]/,W=/^[^:\]]/,Y=/^[^&:\]]/,X=/^[ \t]/,Z=/^[^\n\r\u2028\u2029]/,Q=/^[ \t\n\r\u2028\u2029]/,ee=ir("[.",!1),te=nr(["]"],!0,!1),re=ir("]",!1),oe=ir(":",!1),ie=ir("&",!1),ne={type:"any"},ae=ir("====",!1),se=ir("~~~~",!1),le=ir("--",!1),ue=ir("++",!1),ce=ir("===",!1),pe=ir("==",!1),ge=ir("[@id",!1),de=ir("[",!1),ye=ir("#",!1),fe=ir("[▼",!1),he=ir("[►",!1),me=ir("[@",!1),Te=ir("[%",!1),be=ir("[!",!1),ve=ir("[?",!1),Ce=ir("[+",!1),ke=ir("[-",!1),xe=ir("[$",!1),Be=ir("[_",!1),Ae=ir("[=",!1),we=ir("[&",!1),Pe=ir("::",!1),Ke=ir("||",!1),_e=ir("^^",!1),Se=ir("^",!1),Re=ir("^]",!1),Ie=ir("id:",!1),Oe=nr([":","]"],!0,!1),Ee=nr(["&",":","]"],!0,!1),Le=(ar("Empty"),nr([" ","\t"],!1,!1)),je=ar("Anything"),Ge=ar("Character"),Fe=nr(["\n","\r","\u2028","\u2029"],!0,!1),Ve=ar("Line"),Ne=(ar("whitespace in line"),ar("Blank Line")),Me=ar("Line Terminator"),De=ir("\n",!1),Ue=ir("\r\n",!1),$e=ir("\r",!1),qe=ir("\u2028",!1),Je=ir("\u2029",!1),He=ar("Whitespace, then Line Terminator"),ze=ar("whitespace"),We=nr([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),Ye=function(e,t){return Dr.buildBits([e,...t])},Xe=function(e){return Mr.handleRawBit(e)},Ze=function(e){return e},Qe=function(e){return Mr.handleRawBit(e)},et=function(e){return e},tt=function(e){return e},rt=function(e,t){return Dr.buildBit(e,t)},ot=function(e){return Dr.invalidBit(e)},it=function(e,t){return Dr.buildBitHeader(e,t)},nt=function(e,t){return Dr.buildTextAndResourceType(e,t)},at=function(e){return Mr.handleTextFormat(e)},st=function(e){return Mr.handleResourceType(e)},lt=function(e){return Mr.handleBitContent(e)},ut=function(e){return Mr.handleTagChain(e)},ct=function(e){return e},pt=function(e){return Mr.handleBitTag(e)},gt=function(e){return{type:o.TypeKey.BodyChar,value:e}},dt=function(e){return Mr.handleCardSet(e[1].flat())},yt=function(){Mr.handleCardSetStart()},ft=function(){Mr.handleCardSetEnd()},ht=function(e){return Mr.handleCards(e)},mt=function(e){return Mr.handleCardLineOrDivider(e,2)},Tt=function(e){return Mr.handleCardLine(e)},bt=function(e){return Mr.handleCardSet(e[1].flat())},vt=function(){Mr.handleCardSetStart()},Ct=function(){Mr.handleCardSetEnd()},kt=function(e){return Mr.handleCards(e)},xt=function(e){return Mr.handleCardLineOrDivider(e,1)},Bt=function(e){return Mr.handleCardLine(e)},At=function(e){return Mr.handleCardContent(e)},wt=function(e){return{type:o.TypeKey.CardChar,value:e}},Pt=function(e){return Mr.handlePropertyTag("id",e)},Kt=function(e,t){return Mr.handleTag(o.TypeKey.Title,{level:e,title:t})},_t=function(e){return Mr.handleTag(o.TypeKey.Anchor,e)},St=function(e){return Mr.handleTag(o.TypeKey.Reference,e)},Rt=function(e,t){return Mr.handlePropertyTag(e,t)},It=function(e){return Mr.handleTag(o.TypeKey.ItemLead,e)},Ot=function(e){return Mr.handleTag(o.TypeKey.Instruction,e)},Et=function(e){return Mr.handleTag(o.TypeKey.Hint,e)},Lt=function(e){return Mr.handleTag(o.TypeKey.True,e)},jt=function(e){return Mr.handleTag(o.TypeKey.False,e)},Gt=function(e){return Mr.handleTag(o.TypeKey.SampleSolution,e)},Ft=function(e){return Mr.handleTag(o.TypeKey.Gap,e)},Vt=function(e){return Mr.handleTag(o.TypeKey.Mark,e)},Nt=function(e,t){return Mr.handleResourceTag(e,t)},Mt=function(e){return Mr.handleTag(o.TypeKey.BodyText,e)},Dt=function(e){return Mr.handleTag(o.TypeKey.Comment,e)},Ut=function(e){return e},$t=function(e){return e?e.trim():""},qt=function(e){return e?e.trim():null},Jt=function(e){return e?e.trim():""},Ht=function(){return!0},zt=function(e){return e},Wt=function(e){return e},Yt=function(e){return e},Xt=0,Zt=0,Qt=[{line:1,column:1}],er=0,tr=[],rr=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function or(){return t.substring(Zt,Xt)}function ir(e,t){return{type:"literal",text:e,ignoreCase:t}}function nr(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ar(e){return{type:"other",description:e}}function sr(e){var r,o=Qt[e];if(o)return o;for(r=e-1;!Qt[r];)r--;for(o={line:(o=Qt[r]).line,column:o.column};r<e;)10===t.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Qt[e]=o,o}function lr(e,t,r){var o=sr(e),i=sr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function ur(e){Xt<er||(Xt>er&&(er=Xt,tr=[]),tr.push(e))}function cr(e,t,r){return new a(a.buildMessage(e,t),e,t,r)}function pr(){return function(){var e,r,o,i;e=Xt,r=[],(o=Fr())===l&&(o=Pr());for(;o!==l;)r.push(o),(o=Fr())===l&&(o=Pr());return o=function(){var e,r,o,i;e=Xt,r=Xt,o=[],i=dr();for(;i!==l;)o.push(i),i=dr();return r=t.substring(r,Xt),Zt=e,r=Xe(r),e=r,e}(),i=function(){var e,t;e=[],t=gr();for(;t!==l;)e.push(t),t=gr();return e}(),Zt=e,e=Ye(o,i),e}()}function gr(){var e,r,o,i;for(e=Xt,r=[],o=Lr();o!==l;)r.push(o),o=Lr();return(o=jr())===l&&(o=null),i=function(){var e,r,o,i,n,a;if(e=Xt,r=Xt,o=Xt,i=function(){var e,r,o,i;e=Xt,t.substr(Xt,2)===g?(r=g,Xt+=2):(r=l,0===rr&&ur(ee));if(r!==l){for(o=[],z.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(te));i!==l;)o.push(i),z.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(te));93===t.charCodeAt(Xt)?(i=d,Xt++):(i=l,0===rr&&ur(re)),i!==l?(Zt=e,e=et(r)):(Xt=e,e=l)}else Xt=e,e=l;return e}(),i!==l){for(n=[],a=dr();a!==l;)n.push(a),a=dr();o=i=[i,n]}else Xt=o,o=l;r=o!==l?t.substring(r,Xt):o;r!==l&&(Zt=e,r=Qe(r));return e=r,e}(),i!==l?(Zt=e,e=Ze(i)):(Xt=e,e=l),e}function dr(){var e,t,r,o;if(e=Xt,(t=jr())!==l?(r=Xt,rr++,o=fr(),rr--,o===l?r=void 0:(Xt=r,r=l),r!==l?e=t=[t,r]:(Xt=e,e=l)):(Xt=e,e=l),e===l)if(e=[],(t=Or())!==l)for(;t!==l;)e.push(t),t=Or();else e=l;return e}function yr(){var e,r,o;return e=Xt,(r=fr())!==l?(o=function(){var e,t,r;e=Xt,t=[],r=kr(),r===l&&(r=Br())===l&&(r=Tr())===l&&(r=Cr());for(;r!==l;)t.push(r),(r=kr())===l&&(r=Br())===l&&(r=Tr())===l&&(r=Cr());return Zt=e,t=lt(t),e=t,e}(),Zt=e,e=rt(r,o)):(Xt=e,e=l),e===l&&(e=Xt,r=Xt,o=function(){var e,r;rr++,e=[],t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne));for(;r!==l;)e.push(r),t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne));rr--,r=l,0===rr&&ur(je);return e}(),r=t.substring(r,Xt),Zt=e,e=r=ot(r)),e}function fr(){var e,r,o,i,n;return e=Xt,t.substr(Xt,2)===g?(r=g,Xt+=2):(r=l,0===rr&&ur(ee)),r!==l?(o=Rr(),i=function(){var e,t,r;e=Xt,t=hr(),t===l&&(t=mr());t===l&&(t=null);r=hr(),r===l&&(r=mr());r===l&&(r=null);return Zt=e,e=nt(t,r),e}(),93===t.charCodeAt(Xt)?(n=d,Xt++):(n=l,0===rr&&ur(re)),n!==l?(Zt=e,e=it(o,i)):(Xt=e,e=l)):(Xt=e,e=l),e}function hr(){var e,r,o;return e=Xt,58===t.charCodeAt(Xt)?(r=y,Xt++):(r=l,0===rr&&ur(oe)),r!==l?(o=Rr(),Zt=e,e=at(o)):(Xt=e,e=l),e}function mr(){var e,r,o;return e=Xt,38===t.charCodeAt(Xt)?(r=f,Xt++):(r=l,0===rr&&ur(ie)),r!==l?(o=Rr(),Zt=e,e=st(o)):(Xt=e,e=l),e}function Tr(){var e,t,r,o,i;if(e=Xt,t=Xt,(r=vr())!==l){for(o=[],i=br();i!==l;)o.push(i),i=br();t=r=[r,o]}else Xt=t,t=l;return t!==l&&(Zt=e,t=ut(t)),e=t}function br(){var e,t;return e=Xt,(t=vr())!==l&&(Zt=e,t=ct(t)),e=t}function vr(){var e,r;return e=Xt,(r=Pr())===l&&(r=function(){var e,r,o,i,n,a,s,u;e=Xt,r=Xt,o=Xt,t.substr(Xt,2)===G?(i=G,Xt+=2):(i=l,0===rr&&ur(Pe));i!==l?(n=function(){var e,r,o,i,n,a;e=Xt,r=Xt,o=[],i=Xt,n=Xt,rr++,t.substr(Xt,2)===G?(a=G,Xt+=2):(a=l,0===rr&&ur(Pe));rr--,a===l?n=void 0:(Xt=n,n=l);n!==l&&(a=Or())!==l?i=n=[n,a]:(Xt=i,i=l);for(;i!==l;)o.push(i),i=Xt,n=Xt,rr++,t.substr(Xt,2)===G?(a=G,Xt+=2):(a=l,0===rr&&ur(Pe)),rr--,a===l?n=void 0:(Xt=n,n=l),n!==l&&(a=Or())!==l?i=n=[n,a]:(Xt=i,i=l);return r=t.substring(r,Xt),Zt=e,r=zt(r),e=r,e}(),t.substr(Xt,2)===G?(a=G,Xt+=2):(a=l,0===rr&&ur(Pe)),a!==l?(s=function(){var e,r,o,i,n,a;e=Xt,r=Xt,o=[],i=Xt,n=Xt,rr++,t.substr(Xt,2)===G?(a=G,Xt+=2):(a=l,0===rr&&ur(Pe));rr--,a===l?n=void 0:(Xt=n,n=l);n!==l?(t.length>Xt?(a=t.charAt(Xt),Xt++):(a=l,0===rr&&ur(ne)),a!==l?i=n=[n,a]:(Xt=i,i=l)):(Xt=i,i=l);for(;i!==l;)o.push(i),i=Xt,n=Xt,rr++,t.substr(Xt,2)===G?(a=G,Xt+=2):(a=l,0===rr&&ur(Pe)),rr--,a===l?n=void 0:(Xt=n,n=l),n!==l?(t.length>Xt?(a=t.charAt(Xt),Xt++):(a=l,0===rr&&ur(ne)),a!==l?i=n=[n,a]:(Xt=i,i=l)):(Xt=i,i=l);return r=t.substring(r,Xt),Zt=e,r=Wt(r),e=r,e}(),u=function(){var e,r,o;t.substr(Xt,2)===G?(e=G,Xt+=2):(e=l,0===rr&&ur(Pe));if(e===l){for(e=Xt,r=[],o=Fr();o!==l;)r.push(o),o=Fr();(o=Nr())!==l?e=r=[r,o]:(Xt=e,e=l)}return e}(),u!==l?o=i=[i,n,a,s,u]:(Xt=o,o=l)):(Xt=o,o=l)):(Xt=o,o=l);r=o!==l?t.substring(r,Xt):o;r!==l&&(Zt=e,r=Mt(r));return e=r,e}(),r===l&&(r=function(){var e,r,o,i;e=Xt,t.substr(Xt,4)===k?(r=k,Xt+=4):(r=l,0===rr&&ur(ge));r!==l&&(o=Ir())!==l?(i=function(){var e;93===t.charCodeAt(Xt)?(e=d,Xt++):(e=l,0===rr&&ur(re));return e}(),i!==l?(Zt=e,e=Pt(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Xt,t.substr(Xt,2)===P?(r=P,Xt+=2):(r=l,0===rr&&ur(me));r!==l&&(o=_r())!==l&&(i=Ir())!==l&&Sr()!==l?(Zt=e,e=Rt(o,i)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Xt,91===t.charCodeAt(Xt)?(r=x,Xt++):(r=l,0===rr&&ur(de));if(r!==l){if(o=[],35===t.charCodeAt(Xt)?(i=B,Xt++):(i=l,0===rr&&ur(ye)),i!==l)for(;i!==l;)o.push(i),35===t.charCodeAt(Xt)?(i=B,Xt++):(i=l,0===rr&&ur(ye));else o=l;o!==l?(i=Kr(),Sr()!==l?(Zt=e,e=Kt(o,i)):(Xt=e,e=l)):(Xt=e,e=l)}else Xt=e,e=l;return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===A?(r=A,Xt+=2):(r=l,0===rr&&ur(fe));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=_t(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===w?(r=w,Xt+=2):(r=l,0===rr&&ur(he));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=St(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===K?(r=K,Xt+=2):(r=l,0===rr&&ur(Te));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=It(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===_?(r=_,Xt+=2):(r=l,0===rr&&ur(be));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Ot(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===S?(r=S,Xt+=2):(r=l,0===rr&&ur(ve));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Et(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===E?(r=E,Xt+=2):(r=l,0===rr&&ur(Be));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Ft(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===L?(r=L,Xt+=2):(r=l,0===rr&&ur(Ae));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Vt(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===O?(r=O,Xt+=2):(r=l,0===rr&&ur(xe));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Gt(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===R?(r=R,Xt+=2):(r=l,0===rr&&ur(Ce));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=Lt(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Xt,t.substr(Xt,2)===I?(r=I,Xt+=2):(r=l,0===rr&&ur(ke));r!==l?(o=Kr(),Sr()!==l?(Zt=e,e=jt(o)):(Xt=e,e=l)):(Xt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Xt,t.substr(Xt,2)===j?(r=j,Xt+=2):(r=l,0===rr&&ur(we));r!==l&&(o=_r())!==l&&(i=Ir())!==l&&Sr()!==l?(Zt=e,e=Nt(o,i)):(Xt=e,e=l);return e}()))))))))))))))),r!==l&&(Zt=e,r=pt(r)),e=r}function Cr(){var e,r;return e=Xt,t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne)),r!==l&&(Zt=e,r=gt(r)),e=r}function kr(){var e,r,o,i,n;if(e=Xt,r=Xt,o=function(){var e,r,o,i,n,a;e=Xt,r=jr(),r!==l?(o=Xt,rr++,i=Xt,t.substr(Xt,4)===h?(n=h,Xt+=4):(n=l,0===rr&&ur(ae)),n!==l&&(a=Gr())!==l?i=n=[n,a]:(Xt=i,i=l),rr--,i!==l?(Xt=o,o=void 0):o=l,o!==l?(Zt=e,e=yt()):(Xt=e,e=l)):(Xt=e,e=l);return e}(),o!==l){for(i=[],n=xr();n!==l;)i.push(n),n=xr();n=function(){var e,r,o,i,n;e=Xt,r=Xt,t.substr(Xt,4)===m?(o=m,Xt+=4):(o=l,0===rr&&ur(se));o===l&&(o=null);i=Xt,rr++,n=Vr(),rr--,n!==l?(Xt=i,i=void 0):i=l;i!==l?r=o=[o,i]:(Xt=r,r=l);r!==l&&(Zt=e,r=ft());return e=r,e}(),n!==l?r=o=[o,i,n]:(Xt=r,r=l)}else Xt=r,r=l;return r!==l&&(Zt=e,r=dt(r)),e=r}function xr(){var e,r;return e=Xt,r=function(){var e,r,o,i;e=Xt,r=Xt,t.substr(Xt,4)===h?(o=h,Xt+=4):(o=l,0===rr&&ur(ae));o!==l?((i=Gr())===l&&(i=Vr()),i!==l?r=o=[o,i]:(Xt=r,r=l)):(Xt=r,r=l);r===l&&(r=Xt,t.substr(Xt,2)===T?(o=T,Xt+=2):(o=l,0===rr&&ur(le)),o!==l?((i=Gr())===l&&(i=Vr()),i!==l?r=o=[o,i]:(Xt=r,r=l)):(Xt=r,r=l),r===l&&(r=Xt,t.substr(Xt,2)===b?(o=b,Xt+=2):(o=l,0===rr&&ur(ue)),o!==l?((i=Gr())===l&&(i=Vr()),i!==l?r=o=[o,i]:(Xt=r,r=l)):(Xt=r,r=l),r===l&&(r=function(){var e,r,o,i,n,a;e=Xt,r=Xt,rr++,o=Xt,t.substr(Xt,4)===m?(i=m,Xt+=4):(i=l,0===rr&&ur(se));i!==l&&(n=Vr())!==l?o=i=[i,n]:(Xt=o,o=l);rr--,o===l?r=void 0:(Xt=r,r=l);if(r!==l){if(o=Xt,i=Xt,n=Er(),(a=jr())!==l?i=n=[n,a]:(Xt=i,i=l),i===l){if(i=Xt,n=[],(a=Or())!==l)for(;a!==l;)n.push(a),a=Or();else n=l;n!==l?(a=function(){var e,r;e=jr(),e===l&&(e=Xt,rr++,t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne)),rr--,r===l?e=void 0:(Xt=e,e=l));return e}(),a!==l?i=n=[n,a]:(Xt=i,i=l)):(Xt=i,i=l)}(o=i!==l?t.substring(o,Xt):i)!==l?(Zt=e,e=Tt(o)):(Xt=e,e=l)}else Xt=e,e=l;return e}())));r!==l&&(Zt=e,r=mt(r));return e=r,e}(),r!==l&&(Zt=e,r=ht(r)),e=r}function Br(){var e,r,o,i,n;if(e=Xt,r=Xt,o=function(){var e,r,o,i,n,a;e=Xt,r=jr(),r!==l?(o=Xt,rr++,i=Xt,t.substr(Xt,3)===v?(n=v,Xt+=3):(n=l,0===rr&&ur(ce)),n!==l&&(a=Gr())!==l?i=n=[n,a]:(Xt=i,i=l),rr--,i!==l?(Xt=o,o=void 0):o=l,o!==l?(Zt=e,e=vt()):(Xt=e,e=l)):(Xt=e,e=l);return e}(),o!==l){for(i=[],n=Ar();n!==l;)i.push(n),n=Ar();n=function(){var e,r,o,i,n;e=Xt,r=Xt,t.substr(Xt,3)===v?(o=v,Xt+=3):(o=l,0===rr&&ur(ce));o!==l?(i=Xt,rr++,n=Vr(),rr--,n!==l?(Xt=i,i=void 0):i=l,i!==l?r=o=[o,i]:(Xt=r,r=l)):(Xt=r,r=l);r!==l&&(Zt=e,r=Ct());return e=r,e}(),n!==l?r=o=[o,i,n]:(Xt=r,r=l)}else Xt=r,r=l;return r!==l&&(Zt=e,r=bt(r)),e=r}function Ar(){var e,r,o,i,n,a,s,u,c,p,g;if(e=Xt,r=Xt,rr++,o=Xt,t.substr(Xt,3)===v?(i=v,Xt+=3):(i=l,0===rr&&ur(ce)),i!==l){for(n=[],a=Fr();a!==l;)n.push(a),a=Fr();for(a=[],s=Xt,u=Xt,rr++,c=Xt,(p=jr())!==l?(t.substr(Xt,3)===v?(g=v,Xt+=3):(g=l,0===rr&&ur(ce)),g!==l?c=p=[p,g]:(Xt=c,c=l)):(Xt=c,c=l),rr--,c===l?u=void 0:(Xt=u,u=l),u!==l?(t.length>Xt?(c=t.charAt(Xt),Xt++):(c=l,0===rr&&ur(ne)),c!==l?s=u=[u,c]:(Xt=s,s=l)):(Xt=s,s=l);s!==l;)a.push(s),s=Xt,u=Xt,rr++,c=Xt,(p=jr())!==l?(t.substr(Xt,3)===v?(g=v,Xt+=3):(g=l,0===rr&&ur(ce)),g!==l?c=p=[p,g]:(Xt=c,c=l)):(Xt=c,c=l),rr--,c===l?u=void 0:(Xt=u,u=l),u!==l?(t.length>Xt?(c=t.charAt(Xt),Xt++):(c=l,0===rr&&ur(ne)),c!==l?s=u=[u,c]:(Xt=s,s=l)):(Xt=s,s=l);(s=Nr())!==l?o=i=[i,n,a,s]:(Xt=o,o=l)}else Xt=o,o=l;return rr--,o===l?r=void 0:(Xt=r,r=l),r!==l?(o=function(){var e,r,o,i;e=Xt,r=Xt,t.substr(Xt,3)===v?(o=v,Xt+=3):(o=l,0===rr&&ur(ce));o!==l&&(i=Gr())!==l?r=o=[o,i]:(Xt=r,r=l);r===l&&(r=Xt,t.substr(Xt,2)===C?(o=C,Xt+=2):(o=l,0===rr&&ur(pe)),o!==l&&(i=Gr())!==l?r=o=[o,i]:(Xt=r,r=l),r===l&&(r=Xt,t.substr(Xt,2)===T?(o=T,Xt+=2):(o=l,0===rr&&ur(le)),o!==l&&(i=Gr())!==l?r=o=[o,i]:(Xt=r,r=l),r===l&&(r=function(){var e,r,o,i,n;e=Xt,r=Xt,o=Xt,i=Er(),n=jr(),n!==l?o=i=[i,n]:(Xt=o,o=l);r=o!==l?t.substring(r,Xt):o;r!==l&&(Zt=e,r=Bt(r));return e=r,e}())));r!==l&&(Zt=e,r=xt(r));return e=r,e}(),o!==l?(Zt=e,e=kt(o)):(Xt=e,e=l)):(Xt=e,e=l),e}function wr(){var e,r;return e=Xt,t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne)),r!==l&&(Zt=e,r=wt(r)),e=r}function Pr(){var e,r,o,i;return e=Xt,t.substr(Xt,2)===F?(r=F,Xt+=2):(r=l,0===rr&&ur(Ke)),r!==l?(o=function(){var e,r,o,i,n,a;e=Xt,r=Xt,o=[],i=Xt,n=Xt,rr++,t.substr(Xt,2)===F?(a=F,Xt+=2):(a=l,0===rr&&ur(Ke));rr--,a===l?n=void 0:(Xt=n,n=l);n!==l?(t.length>Xt?(a=t.charAt(Xt),Xt++):(a=l,0===rr&&ur(ne)),a!==l?i=n=[n,a]:(Xt=i,i=l)):(Xt=i,i=l);for(;i!==l;)o.push(i),i=Xt,n=Xt,rr++,t.substr(Xt,2)===F?(a=F,Xt+=2):(a=l,0===rr&&ur(Ke)),rr--,a===l?n=void 0:(Xt=n,n=l),n!==l?(t.length>Xt?(a=t.charAt(Xt),Xt++):(a=l,0===rr&&ur(ne)),a!==l?i=n=[n,a]:(Xt=i,i=l)):(Xt=i,i=l);return r=t.substring(r,Xt),Zt=e,r=Yt(r),e=r,e}(),i=function(){var e,r,o;t.substr(Xt,2)===F?(e=F,Xt+=2):(e=l,0===rr&&ur(Ke));if(e===l){for(e=Xt,r=[],o=Fr();o!==l;)r.push(o),o=Fr();(o=Nr())!==l?e=r=[r,o]:(Xt=e,e=l)}return e}(),i!==l?(Zt=e,e=Dt(o)):(Xt=e,e=l)):(Xt=e,e=l),e}function Kr(){var e,r,o,i,n,a,s;if(e=Xt,r=Xt,o=[],i=Xt,t.substr(Xt,2)===V?(n=V,Xt+=2):(n=l,0===rr&&ur(_e)),n!==l){for(a=[],94===t.charCodeAt(Xt)?(s=N,Xt++):(s=l,0===rr&&ur(Se));s!==l;)a.push(s),94===t.charCodeAt(Xt)?(s=N,Xt++):(s=l,0===rr&&ur(Se));i=n=[n,a]}else Xt=i,i=l;for(i===l&&(t.substr(Xt,2)===M?(i=M,Xt+=2):(i=l,0===rr&&ur(Re)),i===l&&(z.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(te))));i!==l;){if(o.push(i),i=Xt,t.substr(Xt,2)===V?(n=V,Xt+=2):(n=l,0===rr&&ur(_e)),n!==l){for(a=[],94===t.charCodeAt(Xt)?(s=N,Xt++):(s=l,0===rr&&ur(Se));s!==l;)a.push(s),94===t.charCodeAt(Xt)?(s=N,Xt++):(s=l,0===rr&&ur(Se));i=n=[n,a]}else Xt=i,i=l;i===l&&(t.substr(Xt,2)===M?(i=M,Xt+=2):(i=l,0===rr&&ur(Re)),i===l&&(z.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(te))))}return r=t.substring(r,Xt),Zt=e,e=r=Ut(r)}function _r(){var e,r,o,i,n;if(e=Xt,r=Xt,rr++,t.substr(Xt,3)===D?(o=D,Xt+=3):(o=l,0===rr&&ur(Ie)),rr--,o===l?r=void 0:(Xt=r,r=l),r!==l){for(o=Xt,i=[],W.test(t.charAt(Xt))?(n=t.charAt(Xt),Xt++):(n=l,0===rr&&ur(Oe));n!==l;)i.push(n),W.test(t.charAt(Xt))?(n=t.charAt(Xt),Xt++):(n=l,0===rr&&ur(Oe));o=t.substring(o,Xt),Zt=e,e=$t(o)}else Xt=e,e=l;return e}function Sr(){var e,r,o;if(93===t.charCodeAt(Xt)?(e=d,Xt++):(e=l,0===rr&&ur(re)),e===l){for(e=Xt,r=[],o=Fr();o!==l;)r.push(o),o=Fr();(o=Nr())!==l?e=r=[r,o]:(Xt=e,e=l)}return e}function Rr(){var e,r,o,i;for(e=Xt,r=Xt,o=[],Y.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(Ee));i!==l;)o.push(i),Y.test(t.charAt(Xt))?(i=t.charAt(Xt),Xt++):(i=l,0===rr&&ur(Ee));return r=t.substring(r,Xt),Zt=e,e=r=qt(r)}function Ir(){var e,r,o;return e=Xt,58===t.charCodeAt(Xt)?(r=y,Xt++):(r=l,0===rr&&ur(oe)),r!==l?(o=Kr(),Zt=e,e=Jt(o)):(Xt=e,e=l),e===l&&(r="",Zt=e=Xt,e=r=Ht()),e}function Or(){var e;return rr++,Z.test(t.charAt(Xt))?(e=t.charAt(Xt),Xt++):(e=l,0===rr&&ur(Fe)),rr--,e===l&&(l,0===rr&&ur(Ge)),e}function Er(){var e,t;for(rr++,e=[],t=Or();t!==l;)e.push(t),t=Or();return rr--,t=l,0===rr&&ur(Ve),e}function Lr(){var e,r,o;for(rr++,e=Xt,r=[],X.test(t.charAt(Xt))?(o=t.charAt(Xt),Xt++):(o=l,0===rr&&ur(Le));o!==l;)r.push(o),X.test(t.charAt(Xt))?(o=t.charAt(Xt),Xt++):(o=l,0===rr&&ur(Le));return(o=jr())!==l?e=r=[r,o]:(Xt=e,e=l),rr--,e===l&&(r=l,0===rr&&ur(Ne)),e}function jr(){var e;return rr++,10===t.charCodeAt(Xt)?(e=U,Xt++):(e=l,0===rr&&ur(De)),e===l&&(t.substr(Xt,2)===$?(e=$,Xt+=2):(e=l,0===rr&&ur(Ue)),e===l&&(13===t.charCodeAt(Xt)?(e=q,Xt++):(e=l,0===rr&&ur($e)),e===l&&(8232===t.charCodeAt(Xt)?(e=J,Xt++):(e=l,0===rr&&ur(qe)),e===l&&(8233===t.charCodeAt(Xt)?(e=H,Xt++):(e=l,0===rr&&ur(Je)))))),rr--,e===l&&(l,0===rr&&ur(Me)),e}function Gr(){var e,r,o;for(rr++,e=Xt,r=[],X.test(t.charAt(Xt))?(o=t.charAt(Xt),Xt++):(o=l,0===rr&&ur(Le));o!==l;)r.push(o),X.test(t.charAt(Xt))?(o=t.charAt(Xt),Xt++):(o=l,0===rr&&ur(Le));return(o=jr())!==l?e=r=[r,o]:(Xt=e,e=l),rr--,e===l&&(r=l,0===rr&&ur(He)),e}function Fr(){var e;return rr++,Q.test(t.charAt(Xt))?(e=t.charAt(Xt),Xt++):(e=l,0===rr&&ur(We)),rr--,e===l&&(l,0===rr&&ur(ze)),e}function Vr(){var e,r;return(e=Gr())===l&&(e=Xt,rr++,t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne)),rr--,r===l?e=void 0:(Xt=e,e=l)),e}function Nr(){var e,r;return e=Xt,rr++,t.length>Xt?(r=t.charAt(Xt),Xt++):(r=l,0===rr&&ur(ne)),rr--,r===l?e=void 0:(Xt=e,e=l),e}const Mr=new i.BitmarkPegParserHelper({parse:e,parserText:or,parserLocation:Ur}),Dr=new n.BitmarkPegParserProcessor({parse:e,parserText:or,parserLocation:Ur});function Ur(){const e=lr(Zt,Xt);return e?(delete e.source,e):e}function lr(e,t,r){var o=sr(e),i=sr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((s=p())!==l&&Xt===t.length)return s;throw s!==l&&Xt<t.length&&ur({type:"end"}),cr(tr,er<t.length?t.charAt(er):null,er<t.length?lr(er,er+1):lr(er,er))}},4764:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(8159);function i(e){let t=e||"";return t=o.Breakscape.unbreakscape(t),t}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):u(e,{startRule:"bitmarkPlusString"})}function a(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):u(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function l(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function u(e,t){var r,o={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Go,bitmarkPlus:function(){var e,t;_o++,e=Ao,t=ni(),e,t=Yr(t),e=t,_o--,t=o,0===_o&&Lo(je);return e},bitmarkMinusMinus:function(){var e,t;_o++,e=Ao,t=di(),e,t=ho(t),e=t,_o--,t=o,0===_o&&Lo($t);return e},bitmarkPlusString:function(){var e;_o++,e=ni(),_o--,o,0===_o&&Lo(at);return e},bitmarkMinusMinusString:di},c=Go,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",C="•1 ",k="•+ ",x="•- ",B="\t",A="image",w=" ",P="#",K="@",_="width",S="height",R="=",I="𝑓",O="link:",E="var:",L="code:",j="color:",G="bold",F="italic",V="light",N="highlight",M="strike",D="sub",U="super",$="ins",q="del",J="aqua",H="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",oe="maroon",ie="navy",ne="olive",ae="orange",se="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Ce="\r\n",ke="\r",xe="\u2028",Be="\u2029",Ae="http",we="s",Pe="://",Ke="mailto:",_e="~",Se="^",Re="'",Ie=/^[ \t]/,Oe=/^[0-9]/,Ee=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Io("StyledText"),Ge=So("|",!1),Fe=So(":",!1),Ve=So("### ",!1),Ne=So("## ",!1),Me=So("# ",!1),De=So("code",!1),Ue=Ro([" ","\t"],!1,!1),$e=So("bitmark++",!1),qe=So("bitmark--",!1),Je=So("JavaScript",!1),He=So("• ",!1),ze=So("•1 ",!1),We=So("•+ ",!1),Ye=So("•- ",!1),Xe={type:"any"},Ze=So("\t",!1),Qe=So("image",!1),et=So(" ",!1),tt=So("#",!1),rt=So("@",!1),ot=Ro([["0","9"]],!1,!1),it=So("width",!1),nt=So("height",!1),at=Io("StyledString"),st=So("=",!1),lt=So("𝑓",!1),ut=So("link:",!1),ct=So("var:",!1),pt=So("code:",!1),gt=So("color:",!1),dt=So("bold",!1),yt=So("italic",!1),ft=So("light",!1),ht=So("highlight",!1),mt=So("strike",!1),Tt=So("sub",!1),bt=So("super",!1),vt=So("ins",!1),Ct=So("del",!1),kt=So("aqua",!1),xt=So("black",!1),Bt=So("blue",!1),At=So("pink",!1),wt=So("fuchsia",!1),Pt=So("lightgrey",!1),Kt=So("gray",!1),_t=So("darkgray",!1),St=So("green",!1),Rt=So("lime",!1),It=So("magenta",!1),Ot=So("maroon",!1),Et=So("navy",!1),Lt=So("olive",!1),jt=So("orange",!1),Gt=So("purple",!1),Ft=So("red",!1),Vt=So("silver",!1),Nt=So("teal",!1),Mt=So("violet",!1),Dt=So("white",!1),Ut=So("yellow",!1),$t=Io("MinimalStyledText"),qt=Io("MinimalStyledString"),Jt=So("*",!1),Ht=So("_",!1),zt=So("`",!1),Wt=So("!",!1),Yt=So("[!",!1),Xt=So("]",!1),Zt=Io("Line Terminator"),Qt=So("\n",!1),er=So("\r\n",!1),tr=So("\r",!1),rr=So("\u2028",!1),or=So("\u2029",!1),ir=(Io("whitespace in line"),Io("space"),Io("language tag separator"),Io("white space, separator"),Ro(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(Ro(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),So("http",!1)),ar=So("s",!1),sr=So("://",!1),lr=So("mailto:",!1),ur=Ro([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=So("~",!1),pr=So("^",!1),gr=So("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:a(t),attrs:{level:e.length-1}}},vr=function(e){return e},Cr=function(e,t){return Object.assign(Object.assign({},e),{content:t})},kr=function(){return{type:"codeBlock",language:""}},xr=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},Br=function(e){return[{type:"text",text:i(e.trim())}]},Ar=function(e){return e},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Pr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},_r=function(){return{type:"bulletList"}},Sr=function(){return{type:"orderedList"}},Rr=function(){return{type:"taskList"}},Ir=function(e,t,r,o){return o},Or=function(e,t,r,o){let i="bulletList";"•1 "==e&&(i="orderedList"),"•+ "!=e&&"•- "!=e||(i="taskList");let a=[{type:"paragraph",attrs:{},content:n((t+r.join("")).trim())}];if(o&&o[0]&&o[0].parent){let e={type:o[0].parent,attrs:{start:1},content:o,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),a.push(e)}let s="listItem",l={};if("taskList"==i){s="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:s,content:a,parent:i,attrs:l}},Er=function(e){return e},Lr=function(e){return e.join("")===Ii},jr=function(e){return e.length>Ii.length},Gr=function(e){Ri.push(Ii),Ii=e.join("")},Fr=function(){return Ii=Ri.pop(),!0},Vr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Mr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Dr=function(e){return e},Ur=function(e,t,r){const o=Object.assign({},...r);let i=o.captionAlign||"left";delete o.captionAlign;let n=o.alt||null;delete o.alt;let a=o.caption||null;delete o.caption;let s=o.align||"center";return delete o.align,{type:e,attrs:Object.assign({textAlign:i,src:t,alt:n,title:a,class:s},o)}},$r=function(e){return e},qr=function(e){return{comment:e}},Jr=function(e,t){return{[e]:parseInt(t)}},Hr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:i(e),type:"text"}},eo=function(e){return{index:+e,type:"bit"}},to=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ro=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},oo=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},io=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},no=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ao=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},so=function(e){return e},lo=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},uo=function(e){return{type:"var",attrs:{name:e.trim()}}},co=function(){return{type:"code",attrs:{language:"plain text"}}},po=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},go=function(e){return{type:"color",attrs:{color:e}}},yo=function(e){return{type:e}},fo=function(e){return{type:"comment",comment:e}},ho=function(e){return[{type:"paragraph",content:e,attrs:{}}]},mo=function(e,t){return e?[e,...t.flat()]:t.flat()},To=function(e){return{text:i(e),type:"text"}},bo=function(e){return{index:+e,type:"bit"}},vo=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Co=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},ko=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},xo=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},Bo=function(e,t){return{pr:e,t}},Ao=0,wo=[{line:1,column:1}],Po=0,Ko=[],_o=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function So(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ro(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Io(e){return{type:"other",description:e}}function Oo(t){var r,o=wo[t];if(o)return o;for(r=t-1;!wo[r];)r--;for(o={line:(o=wo[r]).line,column:o.column};r<t;)10===e.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return wo[t]=o,o}function Eo(e,t,r){var o=Oo(e),i=Oo(t),n={source:l,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&l&&"function"==typeof l.offset&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Lo(e){Ao<Po||(Ao>Po&&(Po=Ao,Ko=[]),Ko.push(e))}function jo(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function Go(){var e,t;if(_o++,e=[],(t=Fo())!==o)for(;t!==o;)e.push(t),t=Fo();else e=o;return e===o&&(e=function(){var e,t;return e=Ao,t="",e,t=Tr(),e=t,e}()),_o--,e===o&&(t=o,0===_o&&Lo(je)),e}function Fo(){var t,r;return t=Ao,r=function(){var t,r,i,n,a;if(t=Ao,r=Mo(),r!==o){for(i=Ao,n=[],a=Ki();a!==o;)n.push(a),a=Ki();i=e.substring(i,Ao),(n=_i())!==o?((a=Pi())===o&&(a=null),t,t=br(r,i)):(Ao=t,t=o)}else Ao=t,t=o;return t}(),r!==o&&(t,r=dr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r,i;if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=qo(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=_r());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=wr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o){if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Jo(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Sr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=Pr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o)if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Ho(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Rr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=Kr(t,r)):(Ao=e,e=o)}else Ao=e,e=o}return e}(),r!==o&&(t,r=yr(r)),(t=r)===o&&(t=Ao,(r=ri())!==o&&(t,r=fr(r)),(t=r)===o&&(t=Ao,r=function(){var t,r,i;t=Ao,r=Uo(),r!==o?(i=function(){var t,r,i,n;t=Ao,r=Ao,i=[],n=$o();for(;n!==o;)i.push(n),n=$o();return r=e.substring(r,Ao),t,r=Br(r),t=r,t}(),t,t=Cr(r,i)):(Ao=t,t=o);return t}(),r!==o&&(t,r=hr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Vo(),_o--,r===o?t=void 0:(Ao=t,t=o);t!==o&&(r=Zo())!==o?(e,e=Vr(r)):(Ao=e,e=o);e===o&&(e=Ao,(t=ei())!==o&&(r=Zo())!==o?(e,e=Nr(r)):(Ao=e,e=o),e===o&&(e=Ao,(t=ei())!==o?(e,e=Mr(r="")):(Ao=e,e=o)));return e}(),r!==o&&(t,r=mr(r)),t=r)))),t}function Vo(){var e;return(e=Mo())===o&&(e=zo())===o&&(e=ri())===o&&(e=Uo())===o&&(e=ei()),e}function No(){var t;return 124===e.charCodeAt(Ao)?(t=p,Ao++):(t=o,0===_o&&Lo(Ge)),t}function Mo(){var t;return e.substr(Ao,4)===d?(t=d,Ao+=4):(t=o,0===_o&&Lo(Ve)),t===o&&(e.substr(Ao,3)===y?(t=y,Ao+=3):(t=o,0===_o&&Lo(Ne)),t===o&&(e.substr(Ao,2)===f?(t=f,Ao+=2):(t=o,0===_o&&Lo(Me)))),t}function Do(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,4)===h?(t=h,Ao+=4):(t=o,0===_o&&Lo(De)),t}(),r!==o?(t,t=vr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function Uo(){var t,r,i,n,a,s,l;if(t=Ao,Do()!==o){for(r=Ao,i=Ao,n=[],Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(Ue));a!==o;)n.push(a),Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(Ue));(a=_i())!==o?i=n=[n,a]:(Ao=i,i=o),(r=i!==o?e.substring(r,Ao):i)!==o?(t,t=kr()):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,Do()!==o)if(58===e.charCodeAt(Ao)?(r=g,Ao++):(r=o,0===_o&&Lo(Fe)),r!==o)if(i=function(){var t,r,i;e.substr(Ao,9)===m?(t=m,Ao+=9):(t=o,0===_o&&Lo($e));if(t===o&&(e.substr(Ao,9)===T?(t=T,Ao+=9):(t=o,0===_o&&Lo(qe)),t===o&&(e.substr(Ao,10)===b?(t=b,Ao+=10):(t=o,0===_o&&Lo(Je)),t===o))){if(t=Ao,r=[],(i=Ki())!==o)for(;i!==o;)r.push(i),i=Ki();else r=o;(t=r!==o?e.substring(t,Ao):r)===o&&(t="")}return t}(),i!==o){for(n=Ao,a=Ao,s=[],Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Ue));l!==o;)s.push(l),Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Ue));(l=_i())!==o?a=s=[s,l]:(Ao=a,a=o),(n=a!==o?e.substring(n,Ao):a)!==o?(t,t=xr(i)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function $o(){var t,r,i,n,a,s;if(t=Ao,r=Ao,_o++,i=Vo(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Ki())!==o)for(;s!==o;)a.push(s),s=Ki();else a=o;a!==o&&(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?(t,t=Ar(i)):(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=Pi()),t}function qo(){var t;return e.substr(Ao,2)===v?(t=v,Ao+=2):(t=o,0===_o&&Lo(He)),t}function Jo(){var t;return e.substr(Ao,3)===C?(t=C,Ao+=3):(t=o,0===_o&&Lo(ze)),t}function Ho(){var t;return e.substr(Ao,3)===k?(t=k,Ao+=3):(t=o,0===_o&&Lo(We)),t===o&&(e.substr(Ao,3)===x?(t=x,Ao+=3):(t=o,0===_o&&Lo(Ye))),t}function zo(){var e;return(e=qo())===o&&(e=Jo())===o&&(e=Ho()),e}function Wo(){var t,r,i,n,a,s,l,u;if(t=Ao,Xo()!==o)if((r=zo())!==o){for(i=Ao,n=Ao,a=[],s=Ao,l=Ao,_o++,u=Pi(),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Pi(),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);for((s=Pi())===o&&(s=null),n=a=[a,s],i=e.substring(i,Ao),n=[],a=Yo();a!==o;)n.push(a),a=Yo();if(a=Ao,s=function(){var t,r,i,n;t=Ao,_o++,r=Ao,i=[],9===e.charCodeAt(Ao)?(n=B,Ao++):(n=o,0===_o&&Lo(Ze));if(n!==o)for(;n!==o;)i.push(n),9===e.charCodeAt(Ao)?(n=B,Ao++):(n=o,0===_o&&Lo(Ze));else i=o;i!==o?(Ao,(n=(n=jr(i))?void 0:o)!==o?(r,r=Gr(i)):(Ao=r,r=o)):(Ao=r,r=o);_o--,r!==o?(Ao=t,t=void 0):t=o;return t}(),s!==o){for(l=[],u=Wo();u!==o;)l.push(u),u=Wo();u=function(){var e;Ao,e=Fr(),e=e?void 0:o;return e}(),u!==o?(a,a=Ir(r,i,n,l)):(Ao=a,a=o)}else Ao=a,a=o;a===o&&(a=null),t,t=Or(r,i,n,a)}else Ao=t,t=o;else Ao=t,t=o;return t}function Yo(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,r=Ao,_o++,i=function(){var t,r,i;t=Ao,r=[],Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===_o&&Lo(Ue));for(;i!==o;)r.push(i),Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===_o&&Lo(Ue));i=Pi(),i!==o?t=r=[r,i]:(Ao=t,t=o);return t}(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o)if((i=Xo())!==o)if(n=Ao,_o++,a=zo(),_o--,a===o?n=void 0:(Ao=n,n=o),n!==o){if(a=Ao,s=Ao,l=[],u=Ao,c=Ao,_o++,p=Pi(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=Pi(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;l!==o&&(u=_i())!==o?s=l=[l,u]:(Ao=s,s=o),(a=s!==o?e.substring(a,Ao):s)!==o?(t,t=Er(a)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function Xo(){var t,r,i;for(t=Ao,r=[],9===e.charCodeAt(Ao)?(i=B,Ao++):(i=o,0===_o&&Lo(Ze));i!==o;)r.push(i),9===e.charCodeAt(Ao)?(i=B,Ao++):(i=o,0===_o&&Lo(Ze));return Ao,(i=(i=Lr(r))?void 0:o)!==o?t=r=[r,i]:(Ao=t,t=o),t}function Zo(){var t,r,i;if(t=Ao,r=[],(i=Qo())!==o)for(;i!==o;)r.push(i),i=Qo();else r=o;return t=r!==o?e.substring(t,Ao):r}function Qo(){var t,r,i,n,a,s;if(t=Ao,r=Ao,_o++,i=Vo(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Ki())!==o)for(;s!==o;)a.push(s),s=Ki();else a=o;a!==o&&(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?t=r=[r,i]:(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=Pi()),t}function ei(){var t,r,i,n,a,s;if(t=Ao,(r=No())!==o){for(i=Ao,n=Ao,a=[],Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===_o&&Lo(Ue));s!==o;)a.push(s),Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===_o&&Lo(Ue));(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?((n=Pi())===o&&(n=null),t=r=[r,i,n]):(Ao=t,t=o)}else Ao=t,t=o;return t}function ti(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,5)===A?(t=A,Ao+=5):(t=o,0===_o&&Lo(Qe)),t}(),r!==o?(t,t=Dr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function ri(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,(r=ti())!==o)if(58===e.charCodeAt(Ao)?(i=g,Ao++):(i=o,0===_o&&Lo(Fe)),i!==o)if(32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),a=function(){var t,r,i,n,a,s,l,u,c;t=Ao,r=Ao,e.substr(Ao,4)===Ae?(i=Ae,Ao+=4):(i=o,0===_o&&Lo(nr));if(i!==o)if(115===e.charCodeAt(Ao)?(n=we,Ao++):(n=o,0===_o&&Lo(ar)),n===o&&(n=null),e.substr(Ao,3)===Pe?(a=Pe,Ao+=3):(a=o,0===_o&&Lo(sr)),a!==o){for(s=[],l=Ao,u=Ao,_o++,c=No(),_o--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=Si())!==o?l=u=[u,c]:(Ao=l,l=o);l!==o;)s.push(l),l=Ao,u=Ao,_o++,c=No(),_o--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=Si())!==o?l=u=[u,c]:(Ao=l,l=o);r=i=[i,n,a,s]}else Ao=r,r=o;else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r;return t}(),a!==o)if(No()!==o){for(s=function(){var e,t,r;e=Ao,t=[],r=oi();for(;r!==o;)t.push(r),r=oi();return e,t=$r(t),e=t,e}(),l=Ao,u=Ao,c=[],Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Ue));p!==o;)c.push(p),Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Ue));(p=_i())!==o?u=c=[c,p]:(Ao=u,u=o),(l=u!==o?e.substring(l,Ao):u)!==o?((u=Pi())===o&&(u=null),t,t=Ur(r,a,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function oi(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,35===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===_o&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=qr(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));if(s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Oe.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Oe.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;(s=l!==o?e.substring(s,Ao):l)!==o&&(l=No())!==o?(t,t=Jr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));for(s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=Hr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===_o&&Lo(Fe))),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===_o&&Lo(Fe))),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);if(i=e.substring(i,Ao),58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=zr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=Wr(i)):(Ao=t,t=o)}}}}return t}function ii(){var t;return e.substr(Ao,5)===_?(t=_,Ao+=5):(t=o,0===_o&&Lo(it)),t===o&&(e.substr(Ao,6)===S?(t=S,Ao+=6):(t=o,0===_o&&Lo(nt))),t}function ni(){var e,t,r,i;for(e=Ao,(t=ai())===o&&(t=null),r=[],(i=ci())===o&&(i=ai());i!==o;)r.push(i),(i=ci())===o&&(i=ai());return e,e=Xr(t,r)}function ai(){var t,r,i,n,a,s,l;if(t=Ao,(r=Pi())!==o&&(t,r=Zr()),(t=r)===o){if(t=Ao,r=Ao,i=[],n=Ao,(a=pi())===o&&(a=null),s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o)),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=pi())===o&&(a=null),s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=Qr(r)),t=r}return t}function si(){var t;return 61===e.charCodeAt(Ao)?(t=R,Ao++):(t=o,0===_o&&Lo(st)),t}function li(){var t;return e.substr(Ao,2)===I?(t=I,Ao+=2):(t=o,0===_o&&Lo(lt)),t}function ui(){var e,t,r;return e=Ao,(t=si())!==o&&(r=si())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ci(){var t,r,i,n,a,s,l,u,c,g;if(t=Ao,(r=xi())!==o){if(i=Ao,n=[],Oe.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(ot)),a!==o)for(;a!==o;)n.push(a),Oe.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(ot));else n=o;(i=n!==o?e.substring(i,Ao):n)!==o&&(n=Bi())!==o?(t,t=eo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ui())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=ui())!==o?(l=function(){var t,r,i,n;t=Ao,124===e.charCodeAt(Ao)?(r=p,Ao++):(r=o,0===_o&&Lo(Ge));if(r!==o){for(i=[],n=gi();n!==o;)i.push(n),n=gi();t,t=so(i)}else Ao=t,t=o;return t}(),l===o&&(l=null),t,t=to(n,l)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=bi())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=bi())!==o?(t,t=ro(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=vi())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=vi())!==o?(t,t=oo(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=Ci())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=Ci())!==o?(t,t=io(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ki())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=ki())!==o?(t,t=no(n)):(Ao=t,t=o)}else Ao=t,t=o;t===o&&(t=Ao,r=function(){var t,r,i,n,a,s,l;t=Ao,r=Ao,i=Ao,e.substr(Ao,4)===Ae?(n=Ae,Ao+=4):(n=o,0===_o&&Lo(nr));n!==o?(115===e.charCodeAt(Ao)?(a=we,Ao++):(a=o,0===_o&&Lo(ar)),a===o&&(a=null),e.substr(Ao,3)===Pe?(s=Pe,Ao+=3):(s=o,0===_o&&Lo(sr)),s!==o?i=n=[n,a,s]:(Ao=i,i=o)):(Ao=i,i=o);i===o&&(e.substr(Ao,7)===Ke?(i=Ke,Ao+=7):(i=o,0===_o&&Lo(lr)));r=i!==o?e.substring(r,Ao):i;if(r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),t,t=Bo(r,i)}else Ao=t,t=o;return t}(),r!==o&&(t,r=ao(r)),t=r)}}}}}return t}function pi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=ui())!==o){if(n=[],(a=si())!==o)for(;a!==o;)n.push(a),a=si();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,i=function(){var e,t,r;return e=Ao,(t=li())!==o&&(r=li())!==o?e=t=[t,r]:(Ao=e,e=o),e}(),i!==o){if(n=[],(a=li())!==o)for(;a!==o;)n.push(a),a=li();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function gi(){var t,r,i,n,a,s,l;if(t=Ao,e.substr(Ao,5)===O?(r=O,Ao+=5):(r=o,0===_o&&Lo(ut)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=lo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,e.substr(Ao,4)===E?(r=E,Ao+=4):(r=o,0===_o&&Lo(ct)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=uo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,4)===h?(r=h,Ao+=4):(r=o,0===_o&&Lo(De)),r!==o&&(i=No())!==o?(t,t=co()):(Ao=t,t=o),t===o)){if(t=Ao,e.substr(Ao,5)===L?(r=L,Ao+=5):(r=o,0===_o&&Lo(pt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=po(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,6)===j?(r=j,Ao+=6):(r=o,0===_o&&Lo(gt)),r!==o?(i=function(){var t;e.substr(Ao,4)===J?(t=J,Ao+=4):(t=o,0===_o&&Lo(kt));t===o&&(e.substr(Ao,5)===H?(t=H,Ao+=5):(t=o,0===_o&&Lo(xt)),t===o&&(e.substr(Ao,4)===z?(t=z,Ao+=4):(t=o,0===_o&&Lo(Bt)),t===o&&(e.substr(Ao,4)===W?(t=W,Ao+=4):(t=o,0===_o&&Lo(At)),t===o&&(e.substr(Ao,7)===Y?(t=Y,Ao+=7):(t=o,0===_o&&Lo(wt)),t===o&&(e.substr(Ao,9)===X?(t=X,Ao+=9):(t=o,0===_o&&Lo(Pt)),t===o&&(e.substr(Ao,4)===Z?(t=Z,Ao+=4):(t=o,0===_o&&Lo(Kt)),t===o&&(e.substr(Ao,8)===Q?(t=Q,Ao+=8):(t=o,0===_o&&Lo(_t)),t===o&&(e.substr(Ao,5)===ee?(t=ee,Ao+=5):(t=o,0===_o&&Lo(St)),t===o&&(e.substr(Ao,4)===te?(t=te,Ao+=4):(t=o,0===_o&&Lo(Rt)),t===o&&(e.substr(Ao,7)===re?(t=re,Ao+=7):(t=o,0===_o&&Lo(It)),t===o&&(e.substr(Ao,6)===oe?(t=oe,Ao+=6):(t=o,0===_o&&Lo(Ot)),t===o&&(e.substr(Ao,4)===ie?(t=ie,Ao+=4):(t=o,0===_o&&Lo(Et)),t===o&&(e.substr(Ao,5)===ne?(t=ne,Ao+=5):(t=o,0===_o&&Lo(Lt)),t===o&&(e.substr(Ao,6)===ae?(t=ae,Ao+=6):(t=o,0===_o&&Lo(jt)),t===o&&(e.substr(Ao,6)===se?(t=se,Ao+=6):(t=o,0===_o&&Lo(Gt)),t===o&&(e.substr(Ao,3)===le?(t=le,Ao+=3):(t=o,0===_o&&Lo(Ft)),t===o&&(e.substr(Ao,6)===ue?(t=ue,Ao+=6):(t=o,0===_o&&Lo(Vt)),t===o&&(e.substr(Ao,4)===ce?(t=ce,Ao+=4):(t=o,0===_o&&Lo(Nt)),t===o&&(e.substr(Ao,6)===pe?(t=pe,Ao+=6):(t=o,0===_o&&Lo(Mt)),t===o&&(e.substr(Ao,5)===ge?(t=ge,Ao+=5):(t=o,0===_o&&Lo(Dt)),t===o&&(e.substr(Ao,6)===de?(t=de,Ao+=6):(t=o,0===_o&&Lo(Ut)))))))))))))))))))))));return t}(),i!==o&&(n=No())!==o?(t,t=go(i)):(Ao=t,t=o)):(Ao=t,t=o),t===o&&(t=Ao,r=function(){var t;e.substr(Ao,4)===G?(t=G,Ao+=4):(t=o,0===_o&&Lo(dt));t===o&&(e.substr(Ao,6)===F?(t=F,Ao+=6):(t=o,0===_o&&Lo(yt)),t===o&&(e.substr(Ao,5)===V?(t=V,Ao+=5):(t=o,0===_o&&Lo(ft)),t===o&&(e.substr(Ao,9)===N?(t=N,Ao+=9):(t=o,0===_o&&Lo(ht)),t===o&&(e.substr(Ao,6)===M?(t=M,Ao+=6):(t=o,0===_o&&Lo(mt)),t===o&&(e.substr(Ao,3)===D?(t=D,Ao+=3):(t=o,0===_o&&Lo(Tt)),t===o&&(e.substr(Ao,5)===U?(t=U,Ao+=5):(t=o,0===_o&&Lo(bt)),t===o&&(e.substr(Ao,3)===$?(t=$,Ao+=3):(t=o,0===_o&&Lo(vt)),t===o&&(e.substr(Ao,3)===q?(t=q,Ao+=3):(t=o,0===_o&&Lo(Ct))))))))));return t}(),r!==o&&(i=No())!==o?(t,t=yo(r)):(Ao=t,t=o),t===o)))if(t=Ao,35===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===_o&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=fo(i)):(Ao=t,t=o)}else Ao=t,t=o}}return t}function di(){var e,t,r,i;for(_o++,e=Ao,(t=yi())===o&&(t=null),r=[],(i=Ai())===o&&(i=yi());i!==o;)r.push(i),(i=Ai())===o&&(i=yi());return e,e=mo(t,r),_o--,t=o,0===_o&&Lo(qt),e}function yi(){var t,r,i,n,a,s,l;if(t=Ao,r=Ao,i=[],n=Ao,(a=wi())===o&&(a=null),s=Ao,_o++,l=Ai(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=wi())===o&&(a=null),s=Ao,_o++,l=Ai(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o);else i=o;return(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=To(r)),(t=r)===o&&(t=Pi()),t}function fi(){var t;return 42===e.charCodeAt(Ao)?(t=ye,Ao++):(t=o,0===_o&&Lo(Jt)),t}function hi(){var t;return 95===e.charCodeAt(Ao)?(t=fe,Ao++):(t=o,0===_o&&Lo(Ht)),t}function mi(){var t;return 96===e.charCodeAt(Ao)?(t=he,Ao++):(t=o,0===_o&&Lo(zt)),t}function Ti(){var t;return 33===e.charCodeAt(Ao)?(t=me,Ao++):(t=o,0===_o&&Lo(Wt)),t}function bi(){var e,t,r;return e=Ao,(t=fi())!==o&&(r=fi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function vi(){var e,t,r;return e=Ao,(t=hi())!==o&&(r=hi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function Ci(){var e,t,r;return e=Ao,(t=mi())!==o&&(r=mi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ki(){var e,t,r;return e=Ao,(t=Ti())!==o&&(r=Ti())!==o?e=t=[t,r]:(Ao=e,e=o),e}function xi(){var t;return e.substr(Ao,2)===Te?(t=Te,Ao+=2):(t=o,0===_o&&Lo(Yt)),t}function Bi(){var t;return 93===e.charCodeAt(Ao)?(t=be,Ao++):(t=o,0===_o&&Lo(Xt)),t}function Ai(){var t,r,i,n,a,s,l,u,c;if(t=Ao,xi()!==o){if(r=Ao,i=[],Oe.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===_o&&Lo(ot)),n!==o)for(;n!==o;)i.push(n),Oe.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===_o&&Lo(ot));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(i=Bi())!==o?(t,t=bo(r)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,bi()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=bi())!==o?(t,t=vo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,vi()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=vi())!==o?(t,t=Co(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,Ci()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=Ci())!==o?(t,t=ko(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,ki()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=ki())!==o?(t,t=xo(i)):(Ao=t,t=o)}else Ao=t,t=o}}}return t}function wi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=bi())!==o){if(n=[],(a=fi())!==o)for(;a!==o;)n.push(a),a=fi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=vi())!==o){if(n=[],(a=hi())!==o)for(;a!==o;)n.push(a),a=hi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function Pi(){var t;return _o++,10===e.charCodeAt(Ao)?(t=ve,Ao++):(t=o,0===_o&&Lo(Qt)),t===o&&(e.substr(Ao,2)===Ce?(t=Ce,Ao+=2):(t=o,0===_o&&Lo(er)),t===o&&(13===e.charCodeAt(Ao)?(t=ke,Ao++):(t=o,0===_o&&Lo(tr)),t===o&&(8232===e.charCodeAt(Ao)?(t=xe,Ao++):(t=o,0===_o&&Lo(rr)),t===o&&(8233===e.charCodeAt(Ao)?(t=Be,Ao++):(t=o,0===_o&&Lo(or)))))),_o--,t===o&&(o,0===_o&&Lo(Zt)),t}function Ki(){var t;return Ee.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===_o&&Lo(ir)),t}function _i(){var t,r;return(t=Pi())===o&&(t=Ao,_o++,e.length>Ao?(r=e.charAt(Ao),Ao++):(r=o,0===_o&&Lo(Xe)),_o--,r===o?t=void 0:(Ao=t,t=o)),t}function Si(){var t;return Le.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===_o&&Lo(ur)),t===o&&(126===e.charCodeAt(Ao)?(t=_e,Ao++):(t=o,0===_o&&Lo(cr)),t===o&&(94===e.charCodeAt(Ao)?(t=Se,Ao++):(t=o,0===_o&&Lo(pr)),t===o&&(39===e.charCodeAt(Ao)?(t=Re,Ao++):(t=o,0===_o&&Lo(gr))))),t}var Ri=[],Ii="";if(e=e.trimStart(),(r=c())!==o&&Ao===e.length)return r;throw r!==o&&Ao<e.length&&Lo({type:"end"}),jo(Ko,Po<e.length?e.charAt(Po):null,Po<e.length?Eo(Po,Po+1):Eo(Po,Po))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var s=this.location.end,u=l("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===s.line?s.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+l("",i.column-1," ")+l("",p,"^")}else t+="\n at "+a}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=u},297:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const i=r(8256),n=r(2606),a=r(549),s=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,a.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,o,i){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){const o=e.value,i=n.Config.getBitConfig(o.bitType),a=n.Config.getBitResourcesConfig(o.bitType,o.resourceType);if(this.writeOPD(),this.writeString(o.bitType.alias),o.textFormat){this.isWriteTextFormat(o.textFormat)&&(this.writeColon(),this.writeString(o.textFormat))}let s;if(i.resourceAttachmentAllowed&&o.resources&&o.resources.length>0){const e=a.comboResourceTagTypesMap;if(a.comboResourceTagTypesMap.size>0)for(const t of e.keys())s=t;else s=o.resources[0].type}s&&(this.writeAmpersand(),this.writeString(s)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,o,i){const n=[a.NodeType.bitType,a.NodeType.textFormat,a.NodeType.level,a.NodeType.progress,a.NodeType.toc,a.NodeType.referenceEnd,a.NodeType.labelFalse];e.value.book&&n.push(a.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const i=null==t?void 0:t.value;i&&(""!=o&&this.writeProperty(g.PropertyTag.labelTrue,o,!0),i.labelFalse&&""!=i.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,i.labelFalse,!0))}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:i,mockupId:n,size:s,format:l,trim:u}=o;this.writeProperty("imageSource",i,!0),i&&(n&&this.writeProperty("mockupId",n,!0),s&&this.writeProperty("size",s,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o;this.writeProperty("partner",i,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.markConfig)return;const{mark:i,color:n,emphasis:s}=o;i&&(this.writeProperty("mark",i,!0),n&&this.writeProperty("color",n,!0),s&&this.writeProperty("emphasis",s,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",e.value)}enter_itemLead(e,t,r){const o=e.value;o&&(o.item||o.lead)&&(this.writeOPC(),this.writeString(o.item||""),this.writeCL(),o.lead&&(this.writeOPC(),this.writeString(o.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const o=e.value;o&&0===o.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&(this.writeOPE(),this.writeString(i),this.writeCL())}leaf_mark(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&this.writeProperty("mark",i,!0)}enter_optionsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_textsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,o,i){this.isRootBitType1(i)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,o,i){r.key===a.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===a.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===a.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===a.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,o,i){this.isRootBitType(i,s.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_choices(e,t,r,o,i){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_responses(e,t,r,o,i){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,o,i){r.key!==a.NodeType.choices&&r.key!==a.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,o,i){}enter_keyAudio(e,t,r){const o=e.value;this.writeResource(o)}enter_keyImage(e,t,r){const o=e.value;this.writeResource(o)}enter_matrix(e,t,r){}between_matrix(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,o,i){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,o,i){r.key===a.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,o,i){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const o=e.value;o&&this.write(o)}between_resources(e,t,r,o,i){this.writeNL()}enter_resourcesValue(e,t,r){const o=e.value;this.writeResource(o)}enter_posterImage(e,t,r){const o=e.value;o&&o.value&&this.writeProperty("posterImage",o.value)}enter_thumbnails(e,t,r){const o=e.value;if(Array.isArray(o)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<o.length&&t!==e.length;t++){const r=o[t],i=e[t];this.writeProperty(i,r.value,!0)}}}leaf_title(e,t,r){const o=e.value,i=(null==t?void 0:t.value).level||1;if(i&&o){this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_subtitle(e,t,r){const o=e.value;if(o){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_book(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(this.writeProperty("book",e.value),o.reference&&(this.writeOPRANGLE(),this.writeString(o.reference),this.writeCL(),o.referenceEnd&&(this.writeOPRANGLE(),this.writeString(o.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(o.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const o=e.value;o&&(this.writeOPQ(),this.writeString(o),this.writeCL())}leaf_instruction(e,t,r){const o=e.value;o&&(this.writeOPB(),this.writeString(o),this.writeCL())}leaf_example(e,t,r){var o,i;const n=e.value,a=null!==(o=null==t?void 0:t.value.isExample)&&void 0!==o&&o,s=null!==(i=null==t?void 0:t.value.isDefaultExample)&&void 0!==i&&i;a&&(s?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),this.writeCL()))}leaf_bodyText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_footerText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_isCaseSensitive(e,t,r){this.writeProperty("isCaseSensitive",e.value,!0,!1,!0)}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==a.NodeType.questionsValue&&(null==t?void 0:t.key)!==a.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const o=e.value;this.writeProperty("caption",o)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==a.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{null!=e.value&&(null==t?void 0:t.key)===a.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},this[o]=this[o].bind(this)}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,o,i){let n,a=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)if(void 0!==t){if(o&&!1===t)continue;if(i&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),a=!0}}a||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(y.TextFormat.fromValue(e)===y.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,s.RootBitType.trueFalse1)||this.isRootBitType(e,s.RootBitType.multipleChoice1)||this.isRootBitType(e,s.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const i=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.BitmarkGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const n=r(8256),a=r(8159),s=r(2606),l=r(549),u=r(208),c=r(8791),p=r(1060),g=r(7028),d=r(7204),y=r(7953),f=r(9779),h=r(1353),m=r(406),T=r(7646),b=r(672),v=r(3633),C=r(169),k={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new m.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=c.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:c.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},k),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===c.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,l.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var o,i,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const l=s.Config.getBitConfig(a.bitType),c=!!l.rootExampleType,p=l.rootExampleType===g.ExampleType.boolean;if(c){let e;p?(e=!0,a.bitType.root===u.RootBitType.trueFalse1&&void 0!==(null===(i=null===(o=a.cardNode)||void 0===o?void 0:o.statement)||void 0===i?void 0:i.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:p});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{url:i,mockupId:n,size:a,format:s,trim:u}=o,c={};this.addProperty(c,"url",null!=i?i:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=s?s:null,!0),this.addProperty(c,"trim",b.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o,a={};if(this.addProperty(a,"name",null!=i?i:"",!0),n){const e=this.parseResourceToJson(n);e&&e.type===f.ResourceTag.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.markConfig)return;const{mark:i,color:n,emphasis:a}=o,s={};this.addProperty(s,"mark",null!=i?i:"unknown",!0),n&&this.addProperty(s,"color",null!=n?n:"",!0),a&&this.addProperty(s,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(s)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===l.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const o=e.value,{item:i,lead:n}=o;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(null!=i&&(this.bitJson.item=this.toTextAstOrString(i,h.TextFormat.bitmarkMinusMinus)),null!=n&&(this.bitJson.lead=this.toTextAstOrString(n,h.TextFormat.bitmarkMinusMinus)))}enter_extraProperties(e,t,r){const o=e.value;if(!this.options.excludeUnknownProperties&&o)for(const[e,t]of Object.entries(o)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const o=e.value,i=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",l=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const u=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text){const e=t.data.bodyText;s=a.Breakscape.concatenate(s,e)}else{const{legacyPlaceholderKey:e,placeholderKey:t}=u(l);s=a.Breakscape.concatenate(s,i?e:t),l++}}this.bitJson.body=this.toTextAstOrString(s,n);const c=this.bitJson.body;l=0;for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:a}=u(l);switch(t.type){case p.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case p.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case p.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case p.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(i?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[a]=n):this.replacePlaceholderWithBodyBit(c,n,l)),l++}return!1}enter_elements(e,t,r){const o=e.value;o&&o.length>0&&(this.bitJson.elements=a.Breakscape.unbreakscape(o))}enter_flashcards(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",answer:null!==(i=a.Breakscape.unbreakscape(e.answer))&&void 0!==i?i:"",alternativeAnswers:null!==(n=a.Breakscape.unbreakscape(e.alternativeAnswers))&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,c.push(t)}c.length>0&&(this.bitJson.cards=c)}enter_statement(e,t,r){var o,i;const n=e.value;(null==t?void 0:t.key)===l.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(o=a.Breakscape.unbreakscape(n.text))&&void 0!==o?o:"",this.bitJson.isCorrect=null!==(i=n.isCorrect)&&void 0!==i&&i)}enter_statements(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(i=e.itemLead)||void 0===i?void 0:i.item)&&delete t.item,null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.statements=u)}enter_choices(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.choices=u)}enter_responses(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_quizzes(e,t,r){var o,i,n,s,l,u,c,p;const g=e.value,d=[];if(g)for(const e of g){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(r.text))&&void 0!==o?o:"",isCorrect:null!==(i=r.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const o=Object.assign(Object.assign({response:null!==(s=a.Breakscape.unbreakscape(t.text))&&void 0!==s?s:"",isCorrect:null!==(l=t.isCorrect)&&void 0!==l&&l},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete o.lead,r.push(o)}const g=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(c=e.isExample)&&void 0!==c&&c,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(p=e.itemLead)||void 0===p?void 0:p.lead)&&delete g.lead,d.push(g)}d.length>0&&(this.bitJson.quizzes=d)}enter_heading(e,t,r){var o,i;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const l={forKeys:null!==(o=a.Breakscape.unbreakscape(n.forKeys))&&void 0!==o?o:""};Array.isArray(n.forValues)?n.forValues.length>1?l.forValues=a.Breakscape.unbreakscape(n.forValues):1===n.forValues.length?l.forValues=a.Breakscape.unbreakscape(n.forValues[0]):l.forValues=a.Breakscape.unbreakscape(n.forValues):l.forValues=null!==(i=a.Breakscape.unbreakscape(n.forValues))&&void 0!==i?i:"",this.bitJson.heading=l}enter_pairs(e,t,r){var o,i,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(o=a.Breakscape.unbreakscape(e.key))&&void 0!==o?o:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(i=a.Breakscape.unbreakscape(e.values))&&void 0!==i?i:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var o,i,n,s,l,u;const c=e.value,p=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],s=Object.assign(Object.assign(Object.assign({values:null!==(o=a.Breakscape.unbreakscape(r.values))&&void 0!==o?o:[]},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(i=r.isCaseSensitive)||void 0===i||i}),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(n=r.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=a.Breakscape.unbreakscape(e.key))&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var o,i,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",partialAnswer:null!==(i=a.Breakscape.unbreakscape(T.ArrayUtils.asSingle(e.partialAnswer)))&&void 0!==i?i:"",sampleSolution:null!==(n=a.Breakscape.unbreakscape(e.sampleSolution))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.response))&&void 0!==o?o:"",reaction:null!==(i=a.Breakscape.unbreakscape(e.reaction))&&void 0!==i?i:"",feedback:null!==(n=a.Breakscape.unbreakscape(e.feedback))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,c.push(t)}c.length>0&&(this.bitJson.responses=c)}enter_resources(e,t,r){var o;const i=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!i||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=i.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),i=null!==(o=null==e?void 0:e.jsonKey)&&void 0!==o?o:t.typeAlias,n=this.parseResourceToJson(t);if(n)for(const[e,t]of Object.entries(n))"type"!==e&&(r[i]=t)}}l=r}else i.length>=1&&(l=this.parseResourceToJson(i[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_level(e,t,r){var o;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(o=e.value)&&void 0!==o?o:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus))}leaf_instruction(e,t,r){const o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus))}leaf_footerText(e,t,r){const o=e.value;this.bitJson.footer=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus)}leaf_markup(e,t,r){const o=e.value;o&&(this.bitWrapperJson.bitmark=o)}enter_parser(e,t,r){const o=e.value;if(o){const{version:e,excessResources:r,warnings:n,errors:a}=o,s=i(o,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},s),{warnings:n,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===y.PropertyTag.example)continue;if(t===y.PropertyTag.imageSource)continue;if(t===y.PropertyTag.partner)continue;if(t===d.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{var i;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const a=null!==(i=r.jsonKey)&&void 0!==i?i:r.tag;this.addProperty(this.bitJson,a,n,r.single)},this[o]=this[o].bind(this)}}createGapJson(e){var t;const r=e.data,o=r.solutions&&r.solutions.length>0?r.solutions[0]:"",i=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:o,isBoolean:!1})),{solutions:a.Breakscape.unbreakscape(r.solutions)});return i.lead||delete i.lead,i}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:a.Breakscape.unbreakscape(t.solution),mark:a.Breakscape.unbreakscape(t.mark)},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,o,i;const n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(e.text),isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,s.push(r)}const l=Object.assign(Object.assign({type:"select",prefix:null!==(r=a.Breakscape.unbreakscape(n.prefix))&&void 0!==r?r:"",postfix:null!==(o=a.Breakscape.unbreakscape(n.postfix))&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(i=n.isExample)&&void 0!==i&&i,options:s});return l.lead||delete l.lead,l}createHighlightJson(e){var t,r,o,i,n;const s=e.data,l=[];for(const e of s.texts){const o=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(e.text),isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));o.item||delete o.item,o.lead||delete o.lead,o.hint||delete o.hint,l.push(o)}const u=Object.assign(Object.assign({type:"highlight",prefix:null!==(o=a.Breakscape.unbreakscape(s.prefix))&&void 0!==o?o:"",postfix:null!==(i=a.Breakscape.unbreakscape(s.postfix))&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:l});return u.lead||delete u.lead,u}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case f.ResourceTag.image:t={type:f.ResourceTag.image,image:this.addImageResource(e)};break;case f.ResourceTag.imageLink:t={type:f.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e)};break;case f.ResourceTag.audio:t={type:f.ResourceTag.audio,audio:this.addAudioResource(e)};break;case f.ResourceTag.audioEmbed:t={type:f.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case f.ResourceTag.audioLink:t={type:f.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e)};break;case f.ResourceTag.video:t={type:f.ResourceTag.video,video:this.addVideoResource(e)};break;case f.ResourceTag.videoEmbed:t={type:f.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case f.ResourceTag.videoLink:t={type:f.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e)};break;case f.ResourceTag.stillImageFilmEmbed:t={type:f.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case f.ResourceTag.stillImageFilmLink:t={type:f.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case f.ResourceTag.article:t={type:f.ResourceTag.article,article:this.addArticleResource(e)};break;case f.ResourceTag.document:t={type:f.ResourceTag.document,document:this.addDocumentResource(e)};break;case f.ResourceTag.documentEmbed:t={type:f.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case f.ResourceTag.documentLink:t={type:f.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case f.ResourceTag.documentDownload:t={type:f.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case f.ResourceTag.appLink:t={type:f.ResourceTag.appLink,appLink:this.addAppLinkResource(e)};break;case f.ResourceTag.websiteLink:t={type:f.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,o;const i={};if(v.StringUtils.isString(e)){const t=e;e={type:f.ResourceTag.image,typeAlias:f.ResourceTag.image,value:t,format:C.UrlUtils.fileExtensionFromUrl(t),provider:C.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(i.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(i.src=a.Breakscape.unbreakscape(e.value)),null!=e.src1x&&(i.src1x=a.Breakscape.unbreakscape(e.src1x)),null!=e.src2x&&(i.src2x=a.Breakscape.unbreakscape(e.src2x)),null!=e.src3x&&(i.src3x=a.Breakscape.unbreakscape(e.src3x)),null!=e.src4x&&(i.src4x=a.Breakscape.unbreakscape(e.src4x)),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=a.Breakscape.unbreakscape(e.alt))&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addImageLinkResource(e){var t,r,o;const i={};if(v.StringUtils.isString(e)){const t=e;e={type:f.ResourceTag.imageLink,typeAlias:f.ResourceTag.imageLink,value:t,format:C.UrlUtils.fileExtensionFromUrl(t),provider:C.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(i.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(i.url=a.Breakscape.unbreakscape(e.value)),null!=e.src1x&&(i.src1x=a.Breakscape.unbreakscape(e.src1x)),null!=e.src2x&&(i.src2x=a.Breakscape.unbreakscape(e.src2x)),null!=e.src3x&&(i.src3x=a.Breakscape.unbreakscape(e.src3x)),null!=e.src4x&&(i.src4x=a.Breakscape.unbreakscape(e.src4x)),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=a.Breakscape.unbreakscape(e.alt))&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addAudioResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.src=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.src=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.src=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.src=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addArticleResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.body=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),null!=e.siteName&&(t.siteName=a.Breakscape.unbreakscape(e.siteName)),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var o,i,n,s,l,u,c,p;return r?(null!=e.license&&(t.license=null!==(o=a.Breakscape.unbreakscape(e.license))&&void 0!==o?o:""),null!=e.copyright&&(t.copyright=null!==(i=a.Breakscape.unbreakscape(e.copyright))&&void 0!==i?i:""),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.showInIndex&&(t.showInIndex=null!==(n=e.showInIndex)&&void 0!==n&&n),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(s=e.caption)&&void 0!==s?s:"",h.TextFormat.bitmarkMinusMinus))):(t.license=null!==(l=a.Breakscape.unbreakscape(e.license))&&void 0!==l?l:"",t.copyright=null!==(u=a.Breakscape.unbreakscape(e.copyright))&&void 0!==u?u:"",null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),t.showInIndex=null!==(c=e.showInIndex)&&void 0!==c&&c,t.caption=this.toTextAstOrString(null!==(p=e.caption)&&void 0!==p?p:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)),t}toItemLeadHintInstruction(e){var t,r,o,i,n,s;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),lead:this.toTextAstOrString(null!==(i=null===(o=e.itemLead)||void 0===o?void 0:o.lead)&&void 0!==i?i:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),hint:this.toTextAstOrString(null!==(n=e.hint)&&void 0!==n?n:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),instruction:this.toTextAstOrString(null!==(s=e.instruction)&&void 0!==s?s:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)}}toExample(e,t){const{isExample:r,example:o,isDefaultExample:i}=e,{defaultExample:n,isBoolean:a}=t;if(!r)return{isExample:!1,example:null};let s;return s=i?a?b.BooleanUtils.toBoolean(n):this.toTextAstOrString(n,h.TextFormat.bitmarkMinusMinus):a?b.BooleanUtils.toBoolean(o):this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus),{isExample:!0,example:s}}addProperty(e,t,r,o){if(void 0!==r){let i;Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(r=a.Breakscape.unbreakscape(r),i=Array.isArray(r)&&o&&r.length>=1?r[r.length-1]:r),e[t]=i}}getBitType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){var t;for(const r of e)if(r.key===l.NodeType.bitsValue){const e=r.value;return null!==(t=h.TextFormat.fromValue(null==e?void 0:e.textFormat))&&void 0!==t?t:h.TextFormat.bitmarkMinusMinus}return h.TextFormat.bitmarkMinusMinus}getResourceType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}toTextAstOrString(e,t){if(this.options.textAsPlainText||t===h.TextFormat.text)return a.Breakscape.unbreakscape(e);return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const o=(e,i,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(o(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return i[n]=t,!0;if(e.content){if(o(e.content,e,"content"))return!0}}return!1};o(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,partialAnswer:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case u.RootBitType._error:break;case u.RootBitType.article:case u.RootBitType.sampleSolution:case u.RootBitType.page:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==u.AliasBitType.articleAi&&t.alias!==u.AliasBitType.noteAi&&t.alias!==u.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case u.RootBitType.cloze:case u.RootBitType.multipleChoice1:case u.RootBitType.multipleResponse1:case u.RootBitType.multipleChoiceText:case u.RootBitType.highlightText:case u.RootBitType.clozeAndMultipleChoiceText:case u.RootBitType.sequence:case u.RootBitType.mark:case u.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.multipleChoice:case u.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case u.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case u.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case u.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.learningPathBook:case u.RootBitType.learningPathExternalLink:case u.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.pageBuyButton:null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.lang&&delete e.lang,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const i=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const i=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const i=r(8256),n=r(8159),a=r(549),s=r(8791),l=r(1353),u=r(1888),c=r(2610),p={debugGenerationInline:!1},g={[u.TextMarkType.bold]:"**",[u.TextMarkType.light]:"``",[u.TextMarkType.italic]:"__",[u.TextMarkType.highlight]:"!!"},d=new RegExp(/(\n|\r\n)/,"g"),y=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.textFormat=l.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},p),t),this.bitmarkVersion,s.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return o(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:l.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,a.NodeType.textAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){return this.handleEnterNode(e.value)}between_textAstValue(e,t,r,o,i){return this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){return this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){return this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){return this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case c.TextNodeType.paragraph:this.writeParagraph(e);break;case c.TextNodeType.hardBreak:this.writeHardBreak(e);break;case c.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case c.TextNodeType.heading:this.writeHeading(e);break;case c.TextNodeType.section:this.writeSection(e);break;case c.TextNodeType.listItem:case c.TextNodeType.taskItem:this.writeBullet(e);break;case c.TextNodeType.image:this.writeImage(e);break;case c.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case c.TextNodeType.gap:case c.TextNodeType.select:case c.TextNodeType.highlight:return this.writeBodyBit(e),!1}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case c.TextNodeType.text:this.writeMarks(e,!1);break;case c.TextNodeType.paragraph:this.textFormat!==l.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case c.TextNodeType.heading:case c.TextNodeType.section:case c.TextNodeType.image:this.writeNL(),this.writeNL();break;case c.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===c.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===u.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;this.inCodeBlock;let t=e.text;if(t=n.Breakscape.breakscape(t),this.currentIndent>1){const e=this.getIndentationString();t=t.replace(d,`$1${e}`)}this.write(t)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=n.Breakscape.breakscape(e.text);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(d,`$1${e}`)}return t.replace(y,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks){const r=1===e.marks.length,o=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:return r?g[t.type]:"==";case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:case u.TextMarkType.comment:return"==";case u.TextMarkType.link:}return e}),void 0);if(null!=o&&(this.writeMarkTextWrapper(o),!t)){let t=!1;for(const o of e.marks)switch(o.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0);break;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0;break;case u.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(o),t=!0;case u.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let o="";const i=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+i;e++)o+="#";o+=" ",this.write(o)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let o=this.getIndentationString();if(e.parent===c.TextNodeType.bulletList)o+="• ";else if(e.parent===c.TextNodeType.orderedList)o+="•1 ";else if(e.parent===c.TextNodeType.taskList){o+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}o&&this.write(o)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,o]of Object.entries(t))switch(e){case"textAlign":"left"!==o&&(r+=`@captionAlign:${o}|`);break;case"title":o&&(r+=`@caption:${o}|`);break;case"class":"center"!==o&&o&&(r+=`@align:${o}|`);break;case"comment":o&&(r+=`#${o}|`);break;case"alt":case"width":case"height":default:o&&(r+=`@${e}:${o}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,o]of Object.entries(e.attrs))("language"===r&&"plain text"!==o||"color"===r)&&(t=`${t}:${o}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},9677:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoBuilder=void 0;const o=r(2606),i=r(208);t.InfoBuilder=class{getSupportedBits(e){var t,r;const n=null===(t=null==e?void 0:e.includeNonDeprecated)||void 0===t||t,a=null!==(r=null==e?void 0:e.includeDeprecated)&&void 0!==r&&r,s=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),l=o.Config.getBitConfig(r),u=this.getSupportedBitAliases(t,e);(u.length>0||n&&!l.deprecated||a&&l.deprecated)&&s.push({name:t,since:l.since,deprecated:l.deprecated,aliases:u})}return s}getSupportedBitConfigs(){const e=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),n=o.Config.getBitConfig(r);e.push(n)}return e}getSupportedBitAliases(e,t){var r,n;const a=null===(r=null==t?void 0:t.includeNonDeprecated)||void 0===r||r,s=null!==(n=null==t?void 0:t.includeDeprecated)&&void 0!==n&&n,l=[];for(const t of i.AliasBitType.values()){const r=o.Config.getBitType(t);if(r.root===e){const e=o.Config.getBitConfig(r);(a&&!e.deprecated||s&&e.deprecated)&&l.push({name:r.alias,since:e.since,deprecated:e.deprecated})}}return l}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const o=r(1022),i=r(671);r(2606);let n=!1;t.init=function(){n||((0,i.initEnv)(o.buildInfo.name,o.buildInfo.version),n=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",flashcards:"flashcards",flashcardsValue:"flashcardsValue",answer:"answer",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=o},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,o,i,n,a,s,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=o,this.minCount=i,this.chain=n,this.jsonKey=a,this.astKey=s,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const o=r(1035);t.BitConfig=class{constructor(e,t,r,o,i,n,a,s,l,u,c,p,g){this.tags={},this.since=e,this.rootBitType=t.root,this.aliases=r,this.tags=o,this.cardSet=i,this.deprecated=n,this.bodyAllowed=a,this.bodyRequired=s,this.footerAllowed=l,this.footerRequired=u,this.resourceAttachmentAllowed=c,this.rootExampleType=p,this.comboResourceType=g}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.rootBitType}`;this.aliases.length>0&&(r+="\n\n[Aliases]",r+=`\n${this.aliases.join(", ")}`);const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&i.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===o.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",o=0,i=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${o}, Variant ${i}]`,r+=`\n${n.toString(t)}`,i++;o++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,o){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=o}toString(e){const t=Object.assign({},e);let r="";const o=[];this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),null!=this.repeatCount&&o.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a){super(o.BitTagType.tag,e,t,r,i,n,void 0,void 0,a),this.type=o.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s,l,u,c,p){super(o.BitTagType.property,e,t,r,i,n,a,s,p),this.type=o.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s){super(o.BitTagType.resource,e,t,r,i,n,a,void 0,s),this.type=o.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,o){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=o}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const o=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses"});t.CardSetConfigKey=o},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const o=r(6688),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=(0,o.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},s.tagConfigKeys),n.propertyConfigKeys),a.resourceConfigKeys),i.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[s.tagConfigKeys,n.propertyConfigKeys,a.resourceConfigKeys,i.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const o=r(6688),i={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=i;const n=(0,o.superenum)(i);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const o=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=o},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const o=r(6688),i={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"};t.propertyConfigKeys=i;const n=(0,o.superenum)(i);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const o=r(6688),i={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=i;const n=(0,o.superenum)(i);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const o=r(6688),i={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource",remark:"remark",comment:"comment"};t.tagConfigKeys=i;const n=(0,o.superenum)(i);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const o=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=o},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AliasBitType=t.RootBitType=void 0;const o=r(6688),i=(0,o.superenum)({_error:"_error",appBitmarkFromJavascript:"app-bitmark-from-javascript",appFlashcards:"app-flashcards",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",bookAlias:"book-alias",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",page:"page",pageBuyButton:"page-buy-button",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",vendorJupyterOutput:"vendor-jupyter-output",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=i;const n=(0,o.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",buttonCopyText:"button-copy-text",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",detailsImage:"details-image",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageMood:"image-mood",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageScreenshot:"image-screenshot",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",lifeSkillSticker:"life-skill-sticker",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",output:"output",pageBanner:"page-banner",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stdout:"stdout",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=n},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const o=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=o},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const o=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=o;const i=o.v3;t.DEFAULT_BITMARK_VERSION=i},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const o=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=o},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const o=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=o},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const o=(0,r(6688).superenum)({infinity:"infinity"});t.Count=o},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=o},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const o=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",markConfig:"markConfig"});t.PropertyAstKey=o},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=o},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const o=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",sampleSolution:"sampleSolution",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"});t.PropertyTag=o},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const o=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=o},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=o},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&",remark:"::",comment:"||"});t.Tag=o},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const o=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=o},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const o=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=o},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const o=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=o},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const o=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=o},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const o=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=o},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const o=r(2434),i=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return(0,i.parse)(e)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4369).parse;t.parse=o},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const o=r(8565),i=r(3633),n=r(7542),a=r(6831);r(2606);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const o=e.trim();if(this.debugPrint("RAW BIT",o),!o)return;const i=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},a=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",i)});return a.value&&(a.value.markup=o),a}handleTextFormat(e){return{type:a.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:a.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:a.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:a.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},o={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:o,parser:i}=e;if(!t||t!==a.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:s,cardVariantIndex:l,value:u}=o;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[s];p||(p={variants:[]},c.sides[s]=p);p.variants[l]?p.variants[l].value+=u:p.variants[l]={value:u,parser:i}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==i.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};o.cards.push(r);for(const o of t.sides){const t={variants:[]};r.sides.push(t);for(const r of o.variants){let o={line:1,column:1,offset:0};if(r.parser.location){o=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,i=1;o.offset+=t,o.line+=i}let i=this.parse(r.value,{startRule:"cardContent",grammarSource:new n.PeggyGrammarLocation("card-content",o)});i=this.reduceToArrayOfTypes(i),this.debugPrint("parsedCardContent",i),t.variants.push({parser:e,content:i})}}}}return{type:a.TypeKey.CardSet,value:o,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,i=!1,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===o.CardSetVersion.v1?(r=e===a.CARD_DIVIDER_V1,i=e===a.CARD_SIDE_DIVIDER_V1,n=e===a.CARD_VARIANT_DIVIDER_V1):(r=e===a.CARD_DIVIDER_V2,i=e===a.CARD_SIDE_DIVIDER_V2,n=e===a.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,a.TypeKey.Card)?e:{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,o,i,n,s;const l=[];let u,c;for(const p of e)switch(p.type){case a.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:a.TypeKey.BodyText,value:null!==(o=p.value)&&void 0!==o?o:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case a.TypeKey.CardChar:if(c){const e=`${null!==(i=c.value)&&void 0!==i?i:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:a.TypeKey.CardText,value:null!==(s=p.value)&&void 0!==s?s:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(p)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!a.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,o,i)=>{if(null==o)return e;const{type:n,value:a}=o;if(Array.isArray(o)){const r=this.reduceToArrayOfTypes(o,t);e.push(...r)}else{if(!this.isType(o,t))return e;if(r&&Array.isArray(a)){const r=this.reduceToArrayOfTypes(a,t);e.push(...r)}else n&&e.push(o)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(8386),g=r(1182),d=r(6934),y=r(8081),f=r(9577),h=r(2786),m=r(857),T=r(3287),b=r(3130),v=r(5516),C=r(1838),k=r(4177),x=r(6831),B=new i.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this),state:{}}}buildBits(e){var t;const r=[];let o=[];for(const i of e){if(!i)continue;const e=i.value;e?r.push(e):o=o.concat(null!==(t=i.errors)&&void 0!==t?t:[])}return B.bitmark({bits:r,errors:o.length>0?o:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const l=r.root===s.RootBitType.trueFalse1,u=r.root===s.RootBitType.multipleChoice1,c=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=p.BitmarkPegParserValidator.validateBitTags(this.context,r,n,t);const d=a.Config.getBitConfig(r),y=this.bitContentProcessor(r,x.BitContentLevel.Bit,d.tags,t),{body:f,footer:h,cardSet:m,title:T,statement:b,statements:k,choices:A,responses:w,resources:P,comments:K}=y,_=o(y,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",_),this.debugPrint("BIT BODY",f),this.debugPrint("BIT FOOTER",h);const S=(0,C.buildTitles)(this.context,r,T),R=(0,g.buildCards)(this.context,r,m,b,k,A,w),I=(0,v.buildResources)(this.context,r,n,P);(K||R.comments)&&(this.parser.comments=[],K&&this.parser.comments.push(...K),R.comments&&this.parser.comments.push(...R.comments));const O=this.buildBitLevelWarnings(),E=this.buildBitLevelErrors();O&&(this.parser.warnings=O),E&&(this.parser.errors=E);return{value:B.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:i,resourceType:n},S),{statement:l?b:void 0,choices:u?A:void 0,responses:c?w:void 0}),_),{resources:I}),R),{body:f,footer:h,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:B.bit({bitType:a.Config.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const o=a.Config.getBitType(e);return o.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:o,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:c.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:c.TextFormat.bitmarkMinusMinus},o=e=>{var t;e&&(e.type===x.TypeKey.TextFormat?(r.textFormat=c.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${c.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:c.TextFormat.bitmarkMinusMinus):(r.resourceType=u.ResourceTag.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return o(e),o(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,o){const i={};if(!o)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let a=!1,s=!1,l=!1;const u=[];let c=n.Breakscape.EMPTY_STRING,g=n.Breakscape.EMPTY_STRING,A=n.Breakscape.EMPTY_STRING;const w=t===x.BitContentLevel.Chain,P=()=>{if(c){c=p.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,c);const r=B.bodyText({text:c});u.push(r)}c=n.Breakscape.EMPTY_STRING};return o.forEach(((o,p)=>{const{type:B,value:K}=o;switch(B){case x.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.ItemLead:(0,h.itemLeadTagContentProcessor)(this.context,e,t,r,o,i,a),a=!0;break;case x.TypeKey.Instruction:case x.TypeKey.Hint:case x.TypeKey.Anchor:case x.TypeKey.SampleSolution:(0,y.defaultTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Reference:(0,b.referenceTagContentProcessor)(this.context,e,t,r,o,i,s),s=!0;break;case x.TypeKey.Title:(0,C.titleTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Property:(0,T.propertyContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Gap:w||P(),(0,f.gapChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.Mark:w||P(),(0,m.markChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.True:case x.TypeKey.False:w||P(),(0,k.trueFalseChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.Resource:(0,v.resourceContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.CardSet:i.cardSet=K,l=!0;break;case x.TypeKey.BodyText:l?g=n.Breakscape.concatenate(g,K):c=n.Breakscape.concatenate(c,K);break;case x.TypeKey.CardText:A=n.Breakscape.concatenate(A,K)}})),P(),i.body=u.length>0?B.body({bodyParts:this.trimBodyParts(u)}):void 0,p.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),g=g.trim(),g&&(g=p.BitmarkPegParserValidator.checkFooter(this.context,e,t,g),g&&(i.footer=B.footerText({text:g}))),A=A.trim(),A&&(i.cardBody=A),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let o=[];for(const i of e)t.includes(i.type)&&(o.length>0&&r.push(o),o=[]),o.push(i);return o.length>0&&r.push(o),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.push(r);else{const r=o.data.bodyText.trimStart();r&&(t=!0,o.data.bodyText=r,e.push(o))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.unshift(r);else{const r=o.data.bodyText.trimEnd();r&&(t=!0,o.data.bodyText=r,e.unshift(o))}return e}),[]),r}addWarning(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalWarnings.push(a)}addError(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalErrors.push(a)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const o=r(6688),i=r(8739);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const n=(0,o.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:i.Tag.title,Anchor:i.Tag.anchor,Reference:i.Tag.reference,ItemLead:i.Tag.itemLead,Instruction:i.Tag.instruction,Hint:i.Tag.hint,True:i.Tag.true,False:i.Tag.false,Gap:i.Tag.gap,Mark:i.Tag.mark,SampleSolution:i.Tag.sampleSolution,Comment:i.Tag.comment,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const a=(0,o.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=a},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const o=r(2606),i=r(742),n=r(1035),a=r(6831),s=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],l=["==\n","---\n","--\n"],u=["\n==","\n---","\n--"];const c=new class{validateBitTags(e,t,r,i){if(!i)return[];const n=o.Config.getBitConfig(t),{tags:s,cardSet:l}=n,u=o.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},s),u.tags);return this.validateTagChainsRecursive(e,t,a.BitContentLevel.Bit,i,c,l)}checkBody(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{bodyAllowed:a}=n;return i.bodyParts.length>0&&!a&&e.addWarning(`Bit '${t.alias}' should not have a body.`),i}checkBodyPart(e,t,r,o){return o?(this.checkBodyForCommonPotentialMistakes(e,r,t,o),o):o}checkFooter(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{footerAllowed:a}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),a||e.addWarning(`Bit '${t.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,n,a,s){if(!i)return i;const l=o.Config.getBitConfig(t);if(!l.cardSet)return i;const u=this.getVariantConfig(l.cardSet.variants,a,s);if(!u)return i;const{bodyAllowed:c}=u;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),c||e.addWarning(`Bit '${t.alias}' should not have a card body at card:${n+1}, side:${a+1}, variant:${s+1}.`),i}validateTagChainsRecursive(e,t,r,o,i,s){if(!o)return[];const l=[...o],u=this.convertTagsToTypeKeyMap(e,r,t,i),c=(e,t,r)=>{u.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};c(a.TypeKey.Comment,n.Count.infinity,0),r===a.BitContentLevel.Bit?(s&&c(a.TypeKey.CardSet,1,0),c(a.TypeKey.TextFormat,1,0),c(a.TypeKey.BodyText,n.Count.infinity,0)):r===a.BitContentLevel.Card&&c(a.TypeKey.CardText,n.Count.infinity,0);for(let o=0;o<l.length;o++){const i=l[o];if(!i)continue;const{type:n,key:c}=i,p=a.TypeKey.fromValue(n);if(!p)continue;let g=p;p!==a.TypeKey.Property&&p!==a.TypeKey.Resource||(g=`${p}:${c}`);const d=u.get(g),y=this.validateSingleTag(e,t,r,i,p,d,s);if(y||l.splice(o,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,a.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==a.TypeKey.Resource&&(l.splice(o+1,0,...y.chain),y.chain=void 0)}for(const t of u.values()){const{minCount:r,_seenCount:o}=t;if(null!=r&&o<r){const o=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(o)}}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,o,i,n,s){const{type:l,key:u}=o,c=n?this.getTagSignature(n):this.getUnknownTagSignature(l,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,i){case a.TypeKey.Property:{const{content:i,warning:a}=this.validatePropertyTag(e,r,t,n,o);g=i,d=a;break}case a.TypeKey.Resource:{const{content:i,warning:a}=this.validateResourceTag(e,r,t,n,o);g=i,d=a;break}case a.TypeKey.CardSet:{const{content:r,warning:i}=this.validateCardSet(e,t,n,o,s);g=r,d=i;break}default:{const{content:i,warning:a}=this.validateStandardTag(e,r,t,n,o);g=i,d=a}}else switch(i){case a.TypeKey.Property:d={extraProperty:!0},g=o;break;case a.TypeKey.Resource:d={excessResource:!0},g=o;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,o,t)}return n&&(n._previous=o),g}validateStandardTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validatePropertyTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateResourceTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateCardSet(e,t,r,o,i){if(!i||!i.variants||0===i.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=o,s=n;let l,u=0,c=0;for(const r of s.cards){u=0;for(const o of r.sides){c=0;for(const r of o.variants){const n=r.content;let s;const p=this.getVariantConfig(i.variants,u,c);p?s=this.validateTagChainsRecursive(e,t,a.BitContentLevel.Card,n,p.tags):l={unexpectedCardSideVariant:!0},s&&s.length>0?o.variants[c]={parser:r.parser,content:s}:o.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:o,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,o){if(o){for(const t of s)o.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)o.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of u)o.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,o){const n=new Map;for(const e of Object.values(o)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===i.BitTagType.tag,isProperty:e.type===i.BitTagType.property,isResource:e.type===i.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${a.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${a.TypeKey.Resource}:${e.tag}`,t);else{const r=a.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let o;if(0===e.length)return;const i=e[Math.min(t,e.length-1)],a=i.length-1;if(r>a){if(o=i[a],o.repeatCount!==n.Count.infinity)return}else o=i[r];return o}getTagSignature(e){switch(e._type){case i.BitTagType.tag:return`[${e._tag}]`;case i.BitTagType.property:return`[@${e._tag}]`;case i.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case a.TypeKey.Property:return`[@${t}]`;case a.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=c},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const o=r(3633),i=r(6831);t.bookChainContentProcessor=function(e,t,r,n,a,s){if(r===i.BitContentLevel.Chain);else{const r=function(e,t,r,n,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",a);const s=e.bitContentProcessor(t,i.BitContentLevel.Chain,n,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:l,referenceEnd:u}=s,c=o.StringUtils.trimmedString(a.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,a);s.book=r.book,s.reference=r.reference,s.referenceEnd=r.referenceEnd}}},1182:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(2574),l=r(208),u=r(9779),c=r(8386),p=r(6831),g=new i.Builder;t.buildCards=function(e,t,r,i,d,y,f){var h;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let m={};const T=function(e,t,r){const o={cards:[],comments:[]};if(!r)return o;let i=0,n=0,s=0;for(const l of r.cards){const r={no:i++,sides:[]};o.cards.push(r);for(const i of l.sides){const l={no:n++,variants:[]};r.sides.push(l);for(const u of i.variants){const{parser:i,content:g}=u,d={parser:i,no:s++};l.variants.push(d);const y=a.Config.getTagsConfigForCardSet(t,n,s),f=e.bitContentProcessor(t,p.BitContentLevel.Card,y,g);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",f),f.cardBody=c.BitmarkPegParserValidator.checkCardBody(e,t,p.BitContentLevel.Card,f.cardBody,r.no,l.no,d.no),d.data=f,f.comments&&o.comments.push(...f.comments)}s=0}n=0}return o}(e,t,r);switch(null===(h=a.Config.getBitConfig(t).cardSet)||void 0===h?void 0:h.configKey){case s.CardSetConfigKey._flashcards:m=function(e,t,r){const i=[];let a,s,u=n.Breakscape.EMPTY_STRING,c=[],p=0,d=0,y={};const f=t.alias===l.AliasBitType.flashcard1;for(const l of r.cards){u=n.Breakscape.EMPTY_STRING,a=void 0,c=[],d=0,y={};for(const e of l.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,i=o(e,["cardBody"]);y=Object.assign(Object.assign({},y),i),0===d?(s=t,u=null!=r?r:n.Breakscape.EMPTY_STRING):1===d?a=null!=r?r:n.Breakscape.EMPTY_STRING:c.push(null!=r?r:n.Breakscape.EMPTY_STRING),d++}if(0!==p&&f){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${u}'`,s);break}i.push(g.flashcard(Object.assign({question:u,answer:a,alternativeAnswers:c.length>0?c:void 0},y))),p++}return{flashcards:i.length>0?i:void 0}}(e,t,T);break;case s.CardSetConfigKey._elements:m=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;i.push(null!==(o=t.cardBody)&&void 0!==o?o:n.Breakscape.EMPTY_STRING)}return{elements:i.length>0?i:void 0}}(0,0,T);break;case s.CardSetConfigKey._statements:m=function(e,t,r,i,n){const a=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,i=o(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=g.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),i));a.push(t)}}i&&a.push(i);Array.isArray(n)&&n.length>0&&a.push(...n);return{statements:a.length>0?a:void 0}}(0,0,T,i,d);break;case s.CardSetConfigKey._quiz:m=function(e,t,r,i,a){const s=[],u=t.root===l.RootBitType.multipleChoice,c=t.root===l.RootBitType.multipleResponse;if(!u&&!c)return{};let p,d=!1;for(const e of r.cards){d=!1,p=n.Breakscape.EMPTY_STRING;for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:i}=t,n=o(t,["isDefaultExample","example"]);if(d=!0===r||d,p=i||p,n.trueFalse&&n.trueFalse.length>0){const e=[],t=c?g.response:g.choice;for(const r of n.trueFalse){const{isDefaultExample:i,example:n}=r,a=o(r,["isDefaultExample","example"]),s=i||d,l=n||p,u=t(Object.assign(Object.assign({},a),{isDefaultExample:s,example:l}));e.push(u)}c?n.responses=e:n.choices=e}const a=g.quiz(Object.assign(Object.assign({},n),{isDefaultExample:d,example:p}));s.push(a)}}if(u&&Array.isArray(i)&&i.length>0){const e=g.quiz({choices:i});s.push(e)}if(c&&Array.isArray(a)&&a.length>0){const e=g.quiz({responses:a});s.push(e)}return{quizzes:s.length>0?s:void 0}}(0,t,T,y,f);break;case s.CardSetConfigKey._questions:m=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=g.question(Object.assign({question:null!==(o=t.cardBody)&&void 0!==o?o:n.Breakscape.EMPTY_STRING},t));i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,T);break;case s.CardSetConfigKey._matchPairs:m=function(e,t,r){let i,a=0;const s=[];let l;const c=[];let p,d,y,f,h,m=[],T={},b=!1,v=!1;for(const e of r.cards){l=void 0,p=void 0,m=[],d=void 0,y=void 0,a=0,T={},v=!1,h=n.Breakscape.EMPTY_STRING;for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:i,resources:s,isDefaultExample:g,example:C}=t,k=o(t,["cardBody","title","resources","isDefaultExample","example"]);v=!0===g||v,h=C||h;const x=i&&i[1];if(0===a)if(null!=x)l=x,b=!0===g||b,f=C||f;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===u.ResourceTag.audio?d=e:e.type===u.ResourceTag.image&&(y=e)}else p=r;else if(null!=x)c.push(x),b=!0===g||b,f=C||f;else if(null==i){const e=null!=r?r:n.Breakscape.EMPTY_STRING;m.push(e),!b&&!v||h||(h=e)}T=Object.assign(Object.assign({},T),k)}a++}if(null!=l)i=g.heading({forKeys:l,forValues:c});else{v&&(f=void 0);const e=v||b,t=h||f,r=g.pair(Object.assign(Object.assign({key:null!=p?p:n.Breakscape.EMPTY_STRING,keyAudio:d,keyImage:y,values:m},T),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:i,pairs:s.length>0?s:void 0}}(0,0,T);break;case s.CardSetConfigKey._matchMatrix:m=function(e,t,r){let i,a,s=0;const l=[];let u;const c=[];let p,d,y,f,h,m=[],T=[],b={},v=!1,C=!1,k=!1;for(const e of r.cards){a=void 0,u=void 0,m=[],T=[],s=0,C=!1,d=n.Breakscape.EMPTY_STRING,f=void 0;for(const t of e.sides){T=[],b={},k=!1,y=n.Breakscape.EMPTY_STRING,h=void 0;for(const e of t.variants){const t=e.data,{title:r,cardBody:i,isDefaultExample:c,example:g,isCaseSensitive:m}=t,x=o(t,["title","cardBody","isDefaultExample","example","isCaseSensitive"]);k=!0===c||k,y=g||y,Object.assign(b,x);const B=r&&r[1];if(0===s)null!=B?(a=B,v=!0===c||v,p=g||p):(u=i,C=!0===c||C,d=g||d,f=null!=m?m:f);else if(null!=B)l.push(B),v=!0===c||v,p=g||p;else if(null==t.title){const e=null!=i?i:n.Breakscape.EMPTY_STRING;T.push(e),!v&&!k||y||(y=e),h=null!=m?m:f}}if(s>0){k&&(d=p=void 0),C&&(p=void 0);const e=k||C||v,t=y||d||p,r=g.matrixCell(Object.assign(Object.assign({values:T},b),{isDefaultExample:e,example:t,isCaseSensitive:h}));m.push(r)}s++}if(null!=a)i=g.heading({forKeys:a,forValues:l});else{const e=g.matrix({key:null!=u?u:n.Breakscape.EMPTY_STRING,cells:m});c.push(e)}}return{heading:i,matrix:c.length>0?c:void 0}}(0,0,T);break;case s.CardSetConfigKey._botActionResponses:m=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:a,cardBody:s}=t,l=o(t,["instruction","reaction","cardBody"]),u=g.botResponse(Object.assign({response:null!=r?r:n.Breakscape.EMPTY_STRING,reaction:null!=a?a:n.Breakscape.EMPTY_STRING,feedback:null!=s?s:n.Breakscape.EMPTY_STRING},l));i.push(u)}return{botResponses:i.length>0?i:void 0}}(0,0,T)}return m.comments=T.comments.length>0?T.comments:void 0,m}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const o=r(3633);t.clozeTagContentProcessor=function(e,t,r,i,n,a){const{value:s}=n,l=a.solutions;if(l&&o.StringUtils.isString(s)){const e=o.StringUtils.trimmedString(s);l.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const o=r(9046),i=r(3633),n=new o.Builder;t.commentTagContentProcessor=function(e,t,r,o,a,s){if(!s.comments)return;const{value:l}=a,u=i.StringUtils.isString(l)?l:"",c=n.comment({text:u,location:a.parser.location});s.comments.push(c)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.defaultTagContentProcessor=function(e,t,r,n,a,s){const{type:l,value:u}=a,c=o.StringUtils.trimmedString(u);switch(l){case i.TypeKey.Instruction:s.instruction=c;break;case i.TypeKey.Hint:s.hint=c;break;case i.TypeKey.Anchor:s.anchor=c;break;case i.TypeKey.Reference:s.reference=c;break;case i.TypeKey.SampleSolution:s.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",a)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const o=r(208),i=r(672);function n(e,t,r,o,i){!0===o?(i.isDefaultExample=!0,i.example=void 0):i.example=o}t.exampleTagContentProcessor=function(e,t,r,a,s){const{value:l}=a,u=l;switch(t.root){case o.RootBitType.cloze:case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:!function(e,t,r,a,s){var l,u;let c;Array.isArray(s.trueFalse)&&s.trueFalse.length>0&&(c=null!==(l=s.trueFalse[s.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===a?(c.isDefaultExample=!0,c.example=void 0):i.BooleanUtils.isBooleanString(a)?c.example=a:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(s.solutions)&&s.solutions.length>0)s.example=!0===a?null!==(u=s.solutions[s.solutions.length-1])&&void 0!==u?u:void 0:a;else switch(t.root){default:case o.RootBitType.cloze:n(e,t,r,a,s);break;case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:!function(e,t,r,o,n){!0===o?(n.isDefaultExample=!0,n.example=void 0):i.BooleanUtils.isBooleanString(o)?n.example=o:(n.isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,a,s);break;case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:s.isDefaultExample=!0,s.example=void 0,!0!==a&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,t,a,u,s);break;case o.RootBitType.mark:!function(e,t,r,o,i){i.isDefaultExample=!0,i.example=void 0,!0!==o&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,a,u,s);break;default:n(e,t,a,u,s)}}},9577:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(4471),s=r(6831),l=new i.Builder;t.gapChainContentProcessor=function(e,t,r,i,u,c,p){if(r===s.BitContentLevel.Chain)(0,a.clozeTagContentProcessor)(e,t,r,i,u,c);else{const r=function(e,t,r,i,a){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",a);const c=n.Config.getTagConfigForTag(i,a.type),p=[a,...null!==(u=a.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=o(g,["solutions"]),f=l.gap(Object.assign({solutions:null!=d?d:[]},y));return f}(e,t,0,i,u);r&&p.push(r)}}},8664:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.imageSourceChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(3633),l=r(6831),u=new i.Builder;t.imageSourceChainContentProcessor=function(e,t,r,i,c,p){r===l.BitContentLevel.Chain?function(e,t,r,o,i,n){const{value:a}=i,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,c,p):function(e,t,r,i,s,c){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:p}=s,g=a.Config.getTagConfigForTag(i,p),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,i,[s]),y=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==g?void 0:g.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",y);const{imageSourceUrl:f}=d,{mockupId:h}=y,m=o(y,["mockupId"]);f||e.addWarning("[@imageSource] is missing the image url",s);h||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const T=u.imageSource(Object.assign({url:null!=f?f:n.Breakscape.EMPTY_STRING,mockupId:null!=h?h:n.Breakscape.EMPTY_STRING},m));c.imageSource=T}(e,t,0,i,c,p)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const o=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.lead=u:a.item=u}},857:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(7646),l=r(3298),u=r(6831),c=new i.Builder;t.markChainContentProcessor=function(e,t,r,i,p,g,d){if(r===u.BitContentLevel.Chain)(0,l.markTagContentProcessor)(e,u.BitContentLevel.Chain,t,p,g);else{const r=function(e,t,r,i,l){var p;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",l);const g=a.Config.getTagConfigForTag(i,l.type),d=e.bitContentProcessor(t,u.BitContentLevel.Chain,i,[l]),y=e.bitContentProcessor(t,u.BitContentLevel.Chain,null==g?void 0:g.chain,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",y);const{solution:f}=d,{mark:h}=y,m=o(y,["mark"]),T=c.mark(Object.assign({solution:null!=f?f:n.Breakscape.EMPTY_STRING,mark:null!==(p=s.ArrayUtils.asSingle(h))&&void 0!==p?p:n.Breakscape.EMPTY_STRING},m));return T}(e,t,0,i,p);r&&d.push(r)}}},2595:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(3633),s=r(6831),l=new i.Builder;t.markConfigChainContentProcessor=function(e,t,r,i,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(i,g),f=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=o(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=a.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const o=r(3633);t.markTagContentProcessor=function(e,t,r,i,n){const{value:a}=i;o.StringUtils.isString(a)&&(n.solution=a)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const o=r(9046),i=r(9779),n=r(3633),a=r(6831),s=new o.Builder;t.partnerChainContentProcessor=function(e,t,r,o,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,a.BitContentLevel.Chain,o,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const o=[];if(t)for(const e of t.reverse())r||i.ResourceTag.image!==e.type?o.push(e):r=e;o.length>0&&(e.parser.excessResources=o,e.addWarning(`${o.length} excess resource(s) present in the [@parter] chain.`));return r}(e,p),y=s.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const o=r(2606),i=r(3518),n=r(5486),a=r(672),s=r(994),l=r(3633),u=r(4185),c=r(4787),p=r(8664),g=r(2595),d=r(8326),y=r(6831);t.propertyContentProcessor=function(e,t,r,f,h,m){const{key:T,value:b}=h,v=r===y.BitContentLevel.Chain,C=o.Config.getTagConfigForTag(f,T),k=C?C.configKey:void 0;if(C){if(k===i.PropertyConfigKey.example)return void(0,c.exampleTagContentProcessor)(e,t,r,h,m);if(k===i.PropertyConfigKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,C.chain,h,m);if(k===i.PropertyConfigKey.imageSource)return void(0,p.imageSourceChainContentProcessor)(e,t,r,f,h,m);if(k===i.PropertyConfigKey.book)return void(0,u.bookChainContentProcessor)(e,t,r,C.chain,h,m);if(k===i.PropertyConfigKey.markConfig&&!v)return void(0,g.markConfigChainContentProcessor)(e,t,r,f,h,m)}const x=(e,t,r,o)=>{if(r=(e=>{if(null!=e){if(o)switch(o.format){case n.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return s.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return a.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!a.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==o?void 0:o.astKey)&&(t=o.astKey),null==o?void 0:o.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t];e[t]=[...o,r]}else e[t]=[r]};x(C?m:m.extraProperties,T,b,C)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const o=r(3633);t.referenceTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.referenceEnd=u:a.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const o=r(8703),i=r(2606),n=r(1035),a=r(9779),s=r(6831),l=new o.ResourceBuilder;t.buildResources=function(e,t,r,o){var s,l;const u=[],c=[],p=a.ResourceTag.fromValue(r),g=i.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(o)for(const e of o.reverse()){let t=null!==(s=y.get(e.typeAlias))&&void 0!==s?s:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,o,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=a.ResourceTag.fromValue(p);if(f){const r=i.Config.getTagConfigForTag(o,p),n=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==r?void 0:r.chain,d),a=l.resource(Object.assign({type:f,value:g},n));a&&y.push(a)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const o=r(208),i=r(3633);t.titleTagContentProcessor=function(e,t,r,o,n,a){const{value:s}=n,l=a.title;if(!l)return;const u=s,c=i.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var i,n;switch(r=null!=r?r:[],t.root){case o.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case o.RootBitType.book:default:return{title:null!==(i=r[1])&&void 0!==i?i:void 0,subtitle:null!==(n=r[2])&&void 0!==n?n:void 0}}}},4177:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const i=r(9046),n=r(208),a=r(8660),s=r(6831),l=new i.Builder;t.trueFalseChainContentProcessor=function(e,t,r,i,u,c,p){r===s.BitContentLevel.Chain?(0,a.trueFalseTagContentProcessor)(e,s.BitContentLevel.Chain,t,u,c):function(e,t,r,i,a,u,c){var p;const g=[a,...null!==(p=a.chain)&&void 0!==p?p:[]],d=u.statements,y=u.choices,f=u.responses;if(!(d&&y&&f&&c))return;if(t.root===n.RootBitType.trueFalse1)u.statement=function(e,t,r,i){if(t.root!==n.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const a=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:u}=a,c=o(a,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",c);let p;u&&u.length>0&&(p=l.statement(Object.assign(Object.assign({},u[0]),c)));return p}(e,t,i,g);else if(t.root===n.RootBitType.trueFalse||t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1||t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1){const r=function(e,t,r,i){const a=t.root===n.RootBitType.trueFalse,u=t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1,c=t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1;if(!a&&!u&&!c)return{};const p=[],g=[],d=[],y=e.splitBitContent(i,[s.TypeKey.True,s.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",y);for(const i of y){const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:y}=n,f=o(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),a){if(y&&y.length>0){const e=l.statement(Object.assign(Object.assign({},y[0]),f));p.push(e)}}else if(u){if(y&&y.length>0){const e=l.choice(Object.assign(Object.assign({},y[0]),f));g.push(e)}}else if(c&&y&&y.length>0){const e=l.response(Object.assign(Object.assign({},y[0]),f));d.push(e)}}const f={};a?f.statements=p:u?f.choices=g:c&&(f.responses=d);return f}(e,t,i,g);r.statements&&d.push(...r.statements),r.choices&&y.push(...r.choices),r.responses&&f.push(...r.responses)}else if(t.root===n.RootBitType.highlightText){const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=l.highlight(Object.assign({texts:c},u));return p}(e,t,i,g);r&&c.push(r)}else{const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.selectOption(e));const p=l.select(Object.assign({options:c},u));return p}(e,t,i,g);r&&c.push(r)}}(e,t,0,i,u,c,p)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,n,a){const{type:s,value:l}=n,u=a.trueFalse;if(!u)return;const c=o.StringUtils.trimmedString(l);u.push({text:c,isCorrect:s===i.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const o=r(9046),i=r(8703),n=r(8159),a=r(2606),s=r(6300),l=r(208),u=r(1060),c=r(9779),p=r(1353),g=r(3633),d=r(406),y=new o.Builder,f=new i.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator,this.textParser=new d.TextParser}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,o=this.bitToAst(t);o&&r.push(o)}const o=r.length>0?{bits:r}:{};return y.bitmark(o)}preprocessJson(e){const t=[];if(g.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return a.Config.getBitType(t.type).root!==l.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:o,id:i,externalId:n,spaceId:s,padletId:l,jupyterId:u,jupyterExecutionCount:c,AIGenerated:g,releaseVersion:d,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:k,colorTag:x,flashcardSet:B,subtype:A,bookAlias:w,coverImage:P,publisher:K,publications:_,author:S,date:R,location:I,theme:O,kind:E,action:L,thumbImage:j,focusX:G,focusY:F,duration:V,deeplink:N,externalLink:M,externalLinkText:D,videoCallLink:U,bot:$,list:q,textReference:J,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:re,subtitle:oe,level:ie,toc:ne,progress:ae,anchor:se,reference:le,referenceEnd:ue,item:ce,lead:pe,hint:ge,instruction:de,example:ye,imageSource:fe,partner:he,marks:me,resource:Te,body:be,sampleSolution:ve,elements:Ce,statement:ke,isCorrect:xe,cards:Be,statements:Ae,responses:we,quizzes:Pe,heading:Ke,pairs:_e,matrix:Se,choices:Re,questions:Ie,footer:Oe,placeholders:Ee}=e,Le=a.Config.getBitType(r),je=null!==(t=p.TextFormat.fromValue(o))&&void 0!==t?t:p.TextFormat.bitmarkMinusMinus,Ge=this.getResourceType(Te),Fe=this.resourceBitToAst(Te),Ve=this.bodyToAst(be,je,Ee),Ne=this.imageSourceBitToAst(fe),Me=this.partnerBitToAst(he),De=this.markConfigBitToAst(me),Ue=this.flashcardBitsToAst(Be),$e=this.statementBitsToAst(ke,xe,Ae,ye),qe=this.responseBitsToAst(Le,we),Je=this.quizBitsToAst(Le,Pe),He=this.headingBitToAst(Ke),ze=this.pairBitsToAst(_e),We=this.matrixBitsToAst(Se),Ye=this.choiceBitsToAst(Re),Xe=this.questionBitsToAst(Ie),Ze=this.botResponseBitsToAst(Le,we),Qe=this.footerToAst(Oe,je),{reference:et,referenceProperty:tt}=this.referenceToAst(le);return y.bit(Object.assign(Object.assign(Object.assign({bitType:Le,textFormat:o,resourceType:Ge,id:this.parseText(i),externalId:this.parseText(n),spaceId:this.parseText(s),padletId:this.parseText(l),jupyterId:this.parseText(u),jupyterExecutionCount:c,aiGenerated:g,releaseVersion:this.parseText(d),ageRange:f,lang:this.parseText(h),language:this.parseText(m),computerLanguage:this.parseText(T),target:this.parseText(b),tag:this.parseText(v),icon:this.parseText(C),iconTag:this.parseText(k),colorTag:this.parseText(x),flashcardSet:this.parseText(B),subtype:this.parseText(A),bookAlias:this.parseText(w),coverImage:this.parseText(P),publisher:this.parseText(K),publications:this.parseText(_),author:this.parseText(S),date:this.parseText(R),location:this.parseText(I),theme:this.parseText(O),kind:this.parseText(E),action:this.parseText(L),duration:this.parseText(V),referenceProperty:this.parseText(tt),thumbImage:this.parseText(j),focusX:G,focusY:F,deeplink:this.parseText(N),externalLink:this.parseText(M),externalLinkText:this.parseText(D),videoCallLink:this.parseText(U),bot:this.parseText($),list:this.parseText(q),textReference:this.parseText(J),isTracked:H,isInfoOnly:z,labelTrue:this.parseText(W),labelFalse:this.parseText(Y),content2Buy:this.parseText(X),quotedPerson:this.parseText(Z),reasonableNumOfChars:Q,maxCreatedBits:ee,book:this.parseText(te),title:this.parseText(re),subtitle:this.parseText(oe),level:ie,toc:ne,progress:ae,anchor:this.parseText(se),reference:this.parseText(et),referenceEnd:this.parseText(ue)},this.parseItemLeadHintInstruction(ce,pe,ge,de)),this.parseExample(ye)),{imageSource:Ne,partner:Me,markConfig:De,resources:Fe,body:Ve,sampleSolution:this.parseText(ve),elements:this.parseText(Ce),flashcards:Ue,statements:$e,responses:qe,quizzes:Je,heading:He,pairs:ze,matrix:We,choices:Ye,questions:Xe,botResponses:Ze,footer:Qe}))}imageSourceBitToAst(e){var t,r;let o;if(e){const{url:i,mockupId:a,format:s,size:l,trim:u}=e;o=y.imageSource({url:null!==(t=this.parseText(i))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mockupId:null!==(r=this.parseText(a))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,format:this.parseText(s),size:l,trim:u})}return o}partnerBitToAst(e){var t;let r;if(e){const o=this.resourceDataToAst(c.ResourceTag.image,e.avatarImage);r=y.partner({name:null!==(t=this.parseText(e.name))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,avatarImage:o})}return r}markConfigBitToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{mark:e,color:i,emphasis:a}=o,s=y.markConfig({mark:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,color:this.parseText(i),emphasis:this.parseText(a)});r.push(s)}if(0!==r.length)return r}flashcardBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,answer:i,alternativeAnswers:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.flashcard(Object.assign(Object.assign({question:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,answer:this.parseText(i),alternativeAnswers:this.parseText(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}if(0!==r.length)return r}statementBitsToAst(e,t,r,o){var i,a;const s=[];if(e){const r=y.statement(Object.assign({text:null!==(i=this.parseText(e))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,isCorrect:null!=t&&t},this.parseExample(o)));s.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:o,lead:i,hint:l,instruction:u,example:c}=e,p=y.statement(Object.assign(Object.assign({text:null!==(a=this.parseText(t))&&void 0!==a?a:n.Breakscape.EMPTY_STRING,isCorrect:r},this.parseItemLeadHintInstruction(o,i,l,u)),this.parseExample(c)));s.push(p)}if(0!==s.length)return s}choiceBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{choice:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.choice(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}if(0!==r.length)return r}responseBitsToAst(e,t){var r;const o=[];if(e.root!==l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=e,p=y.response(Object.assign(Object.assign({text:null!==(r=this.parseText(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));o.push(p)}if(0!==o.length)return o}}selectOptionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.selectOption(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}return r}highlightTextBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,isHighlighted:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.highlightText(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i,isHighlighted:a},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}return r}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const o of t){const{item:t,lead:i,hint:n,instruction:a,choices:s,responses:l}=o,u=this.choiceBitsToAst(s),c=this.responseBitsToAst(e,l),p=y.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,i,n,a)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){var t,r;let o;return e&&(o=y.heading({forKeys:null!==(t=this.parseText(e.forKeys))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,forValues:null!==(r=this.parseText(e.forValues))&&void 0!==r?r:[]})),o}pairBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{key:e,keyAudio:i,keyImage:n,values:a,item:s,lead:l,hint:u,instruction:p,example:g,isCaseSensitive:d}=o,f=this.resourceDataToAst(c.ResourceTag.audio,i),h=this.resourceDataToAst(c.ResourceTag.image,n),m=y.pair(Object.assign(Object.assign(Object.assign({key:this.parseText(e),keyAudio:f,keyImage:h,values:null!==(t=this.parseText(a))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,l,u,p)),this.parseExample(g)),{isCaseSensitive:d}));r.push(m)}if(0!==r.length)return r}matrixBitsToAst(e){var t,r;const o=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:a,item:s,lead:l,hint:u,instruction:c,example:p}=i,g=y.matrix(Object.assign(Object.assign({key:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,cells:null!==(r=this.matrixCellsToAst(a))&&void 0!==r?r:[]},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));o.push(g)}if(0!==o.length)return o}matrixCellsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{values:e,item:i,lead:n,hint:a,instruction:s,isCaseSensitive:l,example:u}=o,c=y.matrixCell(Object.assign(Object.assign(Object.assign({values:null!==(t=this.parseText(e))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(i,n,a,s)),{isCaseSensitive:l}),this.parseExample(u)));r.push(c)}if(0!==r.length)return r}questionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,partialAnswer:i,sampleSolution:a,item:s,lead:l,hint:u,instruction:c,example:p,reasonableNumOfChars:g}=o,d=y.question(Object.assign(Object.assign(Object.assign({question:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,partialAnswer:this.parseText(i),sampleSolution:this.parseText(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)),{reasonableNumOfChars:g}));r.push(d)}if(0!==r.length)return r}botResponseBitsToAst(e,t){var r,o,i;const a=[];if(e.root===l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:s,feedback:l,item:u,lead:c,hint:p}=e,g=y.botResponse({response:null!==(r=this.parseText(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,reaction:null!==(o=this.parseText(s))&&void 0!==o?o:n.Breakscape.EMPTY_STRING,feedback:null!==(i=this.parseText(l))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,item:this.parseText(u),lead:this.parseText(c),hint:this.parseText(p)});a.push(g)}if(0!==a.length)return a}}getResourceType(e){if(e){return c.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const o=null!==(t=c.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:c.ResourceTag.unknown;let i;if(e.type===c.ResourceTag.imageResponsive){const t=e,o=this.resourceDataToAst(c.ResourceTag.imagePortrait,t.imagePortrait),i=this.resourceDataToAst(c.ResourceTag.imageLandscape,t.imageLandscape);o&&r.push(o),i&&r.push(i)}else if(e.type===c.ResourceTag.stillImageFilm){const t=e,o=this.resourceDataToAst(c.ResourceTag.image,t.image),i=this.resourceDataToAst(c.ResourceTag.audio,t.audio);o&&r.push(o),i&&r.push(i)}else{if(i=e[o],!i)return;const t=this.resourceDataToAst(e.type,i);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,o;let i;if(t){if(!t)return;const n=g.StringUtils.isString(t)?t:void 0,a=t.url||t.src||t.href||t.app||t.body||n,s=this.resourceDataToAst(c.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(c.ResourceTag.image,e))):void 0;i=f.resource({type:e,value:this.parseText(a),format:this.parseText(t.format),src1x:this.parseText(t.src1x),src2x:this.parseText(t.src2x),src3x:this.parseText(t.src3x),src4x:this.parseText(t.src4x),caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(o=t.height)&&void 0!==o?o:void 0,alt:this.parseText(t.alt),duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:s,thumbnails:l,siteName:this.parseText(t.siteName),license:this.parseText(t.license),copyright:this.parseText(t.copyright),showInIndex:t.showInIndex})}return i}bodyToAst(e,t,r){let o,i;const n={};if(Array.isArray(e)?(i=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):i=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(i){const e=[],t=g.StringUtils.splitPlaceholders(i,Object.keys(n));for(let r=0,o=t.length;r<o;r++){const o=t[r];if(n[o])e.push(n[o]);else{const t=this.bodyTextToAst(o);e.push(t)}}o=y.body({bodyParts:e})}return o}bodyTextToAst(e){var t;return y.bodyText({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING})}bodyBitToAst(e){switch(e.type){case u.BodyBitType.gap:return this.gapBitToAst(e);case u.BodyBitType.mark:return this.markBitToAst(e);case u.BodyBitType.select:return this.selectBitToAst(e);case u.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return y.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){var t;const{item:r,lead:o,hint:i,instruction:n,example:a,isCaseSensitive:s,solutions:l}=e;return y.gap(Object.assign(Object.assign(Object.assign({solutions:null!==(t=this.parseText(l))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(r,o,i,n)),this.parseExample(a)),{isCaseSensitive:s}))}markBitToAst(e){var t;const{solution:r,mark:o,item:i,lead:a,hint:s,instruction:l,example:u}=e;return y.mark(Object.assign(Object.assign({solution:null!==(t=this.parseText(r))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mark:this.parseText(o)},this.parseItemLeadHintInstruction(i,a,s,l)),this.parseExample(u)))}selectBitToAst(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.selectOptionBitsToAst(t);return y.select(Object.assign(Object.assign({options:u,prefix:this.parseText(r),postfix:this.parseText(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.highlightTextBitsToAst(t);return y.highlight(Object.assign(Object.assign({texts:u,prefix:this.parseText(r),postfix:this.parseText(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}parseItemLeadHintInstruction(e,t,r,o){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(o)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(this.textParser.isAst(e)){return this.textGenerator.generateSync(e,t)}if(Array.isArray(e)){const r=[];for(let o=0,i=e.length;o<i;o++){const i=e[o];if(this.textParser.isAst(i)){const e=this.textGenerator.generateSync(i,t);r[o]=e}else r[o]=n.Breakscape.breakscape(i)}return r}return n.Breakscape.breakscape(e)}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const o=r(1353),i=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(i.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){if(Array.isArray(e))return e;const r=e,i=Object.assign({},t);i.textFormat||(i.textFormat=o.TextFormat.bitmarkMinusMinus);const a=i.textFormat===o.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(null!=r?r:"",{startRule:a})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4764).parse;t.parse=o},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const o=r(672);const i=new class{fillStringExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const i of e)if(!i.isExample&&(t?(i.isDefaultExample=!0,i.isExample=!0):(i.isDefaultExample=!1,i.example=r),o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!i||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=o.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=i},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},3589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,o=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||null==o&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||!1===o&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||""===o&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(o)&&0===o.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(o)&&0===Object.keys(o).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let o=r[t];if(Array.isArray(o)){if(0===o.length)return;o=o[o.length-1]}return o}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}splitPlaceholders(e,t){let r=[e];const o=(e,t)=>{const r=[];for(const o of e){const e=o.split(t);for(let o=0,i=e.length;o<i;o++){const n=e[o],a=o===i-1;r.push(n),a||r.push(t)}}return r};for(const e of t)r=o(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const o=e.split("\n");return o.length>0?o[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const o=e.length,i=o-t;let n,a=0;for(;a<i;){let o;const i=a+t,s=e.indexOf("\n",a);if(s>-1&&s>a&&s<i){o=s-a,n=e.substr(a,o),a=a+o+1,r.push(n);continue}const l=e.lastIndexOf(" ",i);let u=0;l>-1&&l!=a-1?(o=l-a,o>0&&(u=a+o+1)):(o=t,u=a+t),n=e.substr(a,o),a=u,r.push(n.trim())}return a<o&&(n=e.substr(a),r.push(n)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const o=r(2164),i=r(7619),n=r(306),a=r(9870);const s=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,a.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===o.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?o.Environment.node:o.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):n.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,i.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):n.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",o="",i="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?o=n:2===e?a=n:3===e&&(i=n)}return{full:e,major:r,minor:o,patch:a,build:i}}};t.env=s;const l=s.init.bind(s);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const o=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=o},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const o=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=o},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const o=r(2164),i=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:o.Environment.unknown,os:i.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let o="";for(let e=0,i=t.length;e<i;e++){const i=t[e];let n=!1;for(let e=0;e<=9;e++)if(i.startsWith(`${e}`)){n=!0;break}n?r.versions[o]=i.replace("_","."):r.keys.add(i),o=i}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),a=t.keys.has("chromium"),s=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return s&&!n&&!a?(e.browser=o.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=o.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=o.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=i.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var i=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return i.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return i.Output}});var n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var a=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return a.ResourceBuilder}});var s=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return s.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return f.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return f.AliasBitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var C=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return C.CardSetVersion}});var k=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return k.InfoType}});var x=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return x.InfoFormat}});(0,t.init)()})(),o})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function o(e,t){var r;const o=Object.freeze,i=Object.defineProperty,n=Object.assign,a={enumerable:!1},s=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))s.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of s){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>s.get(e))),y=g.map((e=>[e,s.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),i(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):s.get(`${e}`)}},a)),i(r,"fromValue",n({value:f},a)),i(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},a)),i(r,"setMetadata",n({value:function(e,t,r){const o=f(e);o&&p.set(o,t)}},a)),i(r,"getMetadata",n({value:function(e,t){return p.get(e)}},a)),i(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:s.get(`${g[e++]}`),done:!1}:{done:!0}}}},a)),i(r,"values",n({value:()=>d},a)),i(r,"keys",n({value:()=>g},a)),i(r,"entries",n({value:()=>y},a));let h=r;return(null==t?void 0:t.noFreeze)||(h=o(r),o(g),o(d),o(y)),h})(t)}r.r(t),r.d(t,{superenum:()=>i});const i=o;i.fromObject=o,i.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),o(r,t)}},390:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const a=r(6688),s=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=r(9677),f=r(7347),h=r(8681),m=r(2606),T=r(1353),b=r(6300),v=r(406),C=(0,a.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=C;t.BitmarkParserGenerator=class{constructor(){this.ast=new s.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new v.TextParser,this.textGenerator=new b.TextGenerator,this.jsonStringifyPrettify=(e,t,r)=>{const o=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==o?JSON.stringify(e,null,o):e}}version(){return d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new y.InfoBuilder;let o;const i=!t.outputFormat||t.outputFormat===h.InfoFormat.text,n=t.outputFormat===h.InfoFormat.json,a=t.type===f.InfoType.all,s=t.type===f.InfoType.deprecated,l=a||!s,u=a||s;if(t.type===f.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return m.Config.getBitType(t.bit).root===e.rootBitType}));o=i?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{var r;if(!t.bit)return!0;const o=m.Config.getBitType(t.bit);if(e.name===o.root)return!0;return!!(null===(r=e.aliases)||void 0===r?void 0:r.find((e=>e.name===o.alias)))}));o=i?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;o=JSON.stringify(o,null,e)}return o}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.outputFormat,s=a===C.bitmark,p=a===C.json,g=a===C.ast,y=c.BitmarkParserType.peggy;let f=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let h=this.ast.preprocessAst(f);const m=!!h;m||(h=this.jsonParser.toAst(f));const T=!!(null==h?void 0:h.bits),b=e=>n(this,void 0,void 0,(function*(){yield v(e),yield x(r)})),v=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:y})})),k=e=>n(this,void 0,void 0,(function*(){if(y===c.BitmarkParserType.peggy)if(h=this.bitmarkParser.toAst(e,{parserType:y}),o.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield e.generate(h)}else{const e=new u.JsonObjectGenerator(o),t=yield e.generate(h);r=this.jsonStringifyPrettify(t,i)}})),x=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),B=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),A=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}})),w=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),P=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),K=e=>n(this,void 0,void 0,(function*(){yield A(e)}));return!T&&!m?s?yield b(f):g?yield v(f):yield k(f):m?g?yield B(h):p?yield A(h):yield x(h):p?yield K(h):g?yield P(h):yield w(h),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.bitmarkParserType;let s=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let c=this.jsonParser.toAst(s);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:a});if(o.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(o);r=yield e.generate(t)}})),g=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}}));return!!!(null==c?void 0:c.bits)?yield p(s):yield g(c),r}))}createAst(e){let t,r=e;d.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let o=this.ast.preprocessAst(r);const i=!!o;i||(o=this.jsonParser.toAst(r));return t=!!!(null==o?void 0:o.bits)&&!i?this.bitmarkParser.toAst(r):o,t}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let o,i;const n=Object.assign({},t),a=Object.assign({},n.fileOptions),s=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:T.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(i=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=i;p||(t=this.jsonStringifyPrettify(i,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else o=p?i:this.jsonStringifyPrettify(i,s);return o}))}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.breakscape(i,{});if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.unbreakscape(i);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)if(t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n",r.aliases&&r.aliases.length>0)for(const e of r.aliases)t+=`|__ ${e.name} (since: ${e.since}`,e.deprecated&&(t+=`, deprecated: ${e.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const o=r(7087),i=r(549),n=r(3633);t.Ast=class{constructor(){(0,o.init)()}walk(e,t,r,o){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],o)}getRouteKey(e){return e.reduce(((t,r,o)=>(+r.key!==r.index&&(t+=`${r.key}`,o<e.length-1&&(t+="_")),t)),"")}printTree(e,t=i.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,o,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(n.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,o,i){const{enter:n,between:a,exit:s,leaf:l}=r,u=o[o.length-1].key,c=!this.isValue(e),p=o[o.length-1];if(c){if(n){if(!1===n(p,t,o,i))return}}else l&&l(p,t,o,i);if(c){const n=this.isArray(e),s=Object.keys(e);for(let l=0,c=s.length;l<c;l++){const g=s[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=o.slice();if(c.push(e),this.walkRecursive(f,p,r,c,i),!d){const r=s[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(a){if(!1===a(p,e,g,t,o,i))break}}}}}c&&s&&s(p,t,o,i)}getAstKey(e,t,r){let o=e;return r&&t&&(o=`${t}Value`),i.NodeType.fromKey(o)||`unknown(${o})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const o=r(8159),i=r(2606),n=r(5486),a=r(7646),s=r(672),l=r(994),u=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t=o.Breakscape.breakscape("true")),!1===t&&(t=o.Breakscape.breakscape("false")),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){if(null==t)return;const r=i.Config.getRawPropertiesConfig()[e],o=e=>{if(null!=e){switch(r.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=o(e[t])}else t=o(t);return a.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const o=r(8159),i=r(3518),n=r(208),a=r(1060),s=r(9779),l=r(1353),u=r(7646),c=r(4598),p=r(994),g=r(3589),d=r(671),y=r(1),f=r(2377);class h extends y.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,o={bits:t,errors:r};return g.ObjectUtils.removeUnwantedProperties(o),o}bit(e){var t;const{bitType:r,textFormat:o,resourceType:a,id:c,externalId:d,spaceId:y,padletId:h,jupyterId:m,jupyterExecutionCount:T,aiGenerated:b,releaseVersion:v,ageRange:C,lang:k,language:x,computerLanguage:B,target:A,tag:w,icon:P,iconTag:K,colorTag:_,flashcardSet:S,subtype:R,bookAlias:I,coverImage:O,publisher:E,publications:L,author:j,subject:G,date:F,location:V,theme:N,kind:M,action:D,thumbImage:U,focusX:$,focusY:q,duration:J,referenceProperty:H,deeplink:z,externalLink:W,externalLinkText:Y,videoCallLink:X,bot:Z,list:Q,textReference:ee,isTracked:te,isInfoOnly:re,labelTrue:oe,labelFalse:ie,content2Buy:ne,book:ae,quotedPerson:se,partialAnswer:le,reasonableNumOfChars:ue,maxCreatedBits:ce,title:pe,subtitle:ge,level:de,toc:ye,progress:fe,anchor:he,reference:me,referenceEnd:Te,item:be,lead:ve,hint:Ce,instruction:ke,isDefaultExample:xe,example:Be,imageSource:Ae,partner:we,markConfig:Pe,extraProperties:Ke,resources:_e,body:Se,sampleSolution:Re,footer:Ie,markup:Oe,parser:Ee}=e,Le=u.ArrayUtils.asArray(_e),je=this.cardNode(e),Ge=r.root===n.RootBitType.essay?this.toAstProperty(i.PropertyConfigKey.reasonableNumOfChars,ue):void 0,Fe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=l.TextFormat.fromValue(o))&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus,resourceType:s.ResourceTag.fromValue(a),id:this.toAstProperty(i.PropertyConfigKey.id,c),externalId:this.toAstProperty(i.PropertyConfigKey.externalId,d),spaceId:this.toAstProperty(i.PropertyConfigKey.spaceId,y),padletId:this.toAstProperty(i.PropertyConfigKey.padletId,h),jupyterId:this.toAstProperty(i.PropertyConfigKey.jupyterId,m),jupyterExecutionCount:this.toAstProperty(i.PropertyConfigKey.jupyterExecutionCount,T),aiGenerated:this.toAstProperty(i.PropertyConfigKey.aiGenerated,b),releaseVersion:this.toAstProperty(i.PropertyConfigKey.releaseVersion,v),book:ae,ageRange:this.toAstProperty(i.PropertyConfigKey.ageRange,C),lang:this.toAstProperty(i.PropertyConfigKey.lang,k),language:this.toAstProperty(i.PropertyConfigKey.language,x),computerLanguage:this.toAstProperty(i.PropertyConfigKey.computerLanguage,B),target:this.toAstProperty(i.PropertyConfigKey.target,A),tag:this.toAstProperty(i.PropertyConfigKey.tag,w),icon:this.toAstProperty(i.PropertyConfigKey.icon,P),iconTag:this.toAstProperty(i.PropertyConfigKey.iconTag,K),colorTag:this.toAstProperty(i.PropertyConfigKey.colorTag,_),flashcardSet:this.toAstProperty(i.PropertyConfigKey.flashcardSet,S),subtype:this.toAstProperty(i.PropertyConfigKey.subtype,R),bookAlias:this.toAstProperty(i.PropertyConfigKey.bookAlias,I),coverImage:this.toAstProperty(i.PropertyConfigKey.coverImage,O),publisher:this.toAstProperty(i.PropertyConfigKey.publisher,E),publications:this.toAstProperty(i.PropertyConfigKey.publications,L),author:this.toAstProperty(i.PropertyConfigKey.author,j),subject:this.toAstProperty(i.PropertyConfigKey.subject,G),date:this.toAstProperty(i.PropertyConfigKey.date,F),location:this.toAstProperty(i.PropertyConfigKey.location,V),theme:this.toAstProperty(i.PropertyConfigKey.theme,N),kind:this.toAstProperty(i.PropertyConfigKey.kind,M),action:this.toAstProperty(i.PropertyConfigKey.action,D),thumbImage:this.toAstProperty(i.PropertyConfigKey.thumbImage,U),focusX:this.toAstProperty(i.PropertyConfigKey.focusX,$),focusY:this.toAstProperty(i.PropertyConfigKey.focusY,q),deeplink:this.toAstProperty(i.PropertyConfigKey.deeplink,z),externalLink:this.toAstProperty(i.PropertyConfigKey.externalLink,W),externalLinkText:this.toAstProperty(i.PropertyConfigKey.externalLinkText,Y),videoCallLink:this.toAstProperty(i.PropertyConfigKey.videoCallLink,X),bot:this.toAstProperty(i.PropertyConfigKey.bot,Z),duration:this.toAstProperty(i.PropertyConfigKey.duration,J),referenceProperty:this.toAstProperty(i.PropertyConfigKey.property_reference,H),list:this.toAstProperty(i.PropertyConfigKey.list,Q),textReference:this.toAstProperty(i.PropertyConfigKey.textReference,ee),isTracked:this.toAstProperty(i.PropertyConfigKey.isTracked,te),isInfoOnly:this.toAstProperty(i.PropertyConfigKey.isInfoOnly,re),labelTrue:this.toAstProperty(i.PropertyConfigKey.labelTrue,oe),labelFalse:this.toAstProperty(i.PropertyConfigKey.labelFalse,ie),content2Buy:this.toAstProperty(i.PropertyConfigKey.content2Buy,ne),quotedPerson:this.toAstProperty(i.PropertyConfigKey.quotedPerson,se),partialAnswer:this.toAstProperty(i.PropertyConfigKey.partialAnswer,le),reasonableNumOfChars:Ge,maxCreatedBits:this.toAstProperty(i.PropertyConfigKey.maxCreatedBits,ce),title:pe,subtitle:ge,level:p.NumberUtils.asNumber(de),toc:this.toAstProperty(i.PropertyConfigKey.toc,ye),progress:this.toAstProperty(i.PropertyConfigKey.progress,fe),anchor:he,reference:me,referenceEnd:Te,markConfig:Pe,itemLead:this.itemLead(be,ve),hint:Ce,instruction:ke},this.toExample(xe,Be)),{imageSource:Ae,partner:we,resources:Le,body:Se,sampleSolution:u.ArrayUtils.asSingle(Re),cardNode:je,footer:Ie,markup:Oe,parser:Ee,extraProperties:this.parseExtraProperties(Ke)});return r.root===n.RootBitType.interview&&this.pushDownTree(void 0,void 0,je,"questions",i.PropertyConfigKey.reasonableNumOfChars,ue),this.pushExampleDownTree(Se,je,xe,Be),this.setDefaultBitValues(Fe),this.setIsExampleFlags(Fe),this.addVersionToParserInfo(Fe),g.ObjectUtils.removeUnwantedProperties(Fe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),f.NodeValidator.validateBit(Fe)}choice(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}response(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}botResponse(e){const{response:t,reaction:r,feedback:o,item:i,lead:n,hint:a}=e,s={response:t,reaction:r,feedback:o,itemLead:this.itemLead(i,n),hint:a};return g.ObjectUtils.removeUnwantedProperties(s,{ignoreEmptyString:["response","reaction","feedback"]}),s}quiz(e){const{choices:t,responses:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e;this.pushExampleDownTreeBoolean(s,l,!0,t),this.pushExampleDownTreeBoolean(s,l,!1,r);const u={itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:s||null!=l,choices:t,responses:r};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const n={forKeys:r||o.Breakscape.EMPTY_STRING,forValues:null!==(t=u.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return g.ObjectUtils.removeUnwantedProperties(n),n}pair(e){const{key:t,keyAudio:r,keyImage:o,values:i,item:n,lead:a,hint:s,instruction:l,isCaseSensitive:u,isDefaultExample:c,example:p}=e,d=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:o,itemLead:this.itemLead(n,a),hint:s,instruction:l},this.toExample(c,p)),{isCaseSensitive:null==u||u,values:i});return g.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}matrix(e){const{key:t,cells:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s}=e;let l=!1;for(const e of null!=r?r:[])s&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),l=!!e.isExample||l;const u={key:t,itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:l,cells:r};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}matrixCell(e){const{values:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:a,isDefaultExample:s,example:l}=e,u=Object.assign({values:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==a||a},this.toExample(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}question(e){const{question:t,partialAnswer:r,item:o,lead:i,hint:n,instruction:a,reasonableNumOfChars:s,sampleSolution:l,isDefaultExample:u,example:c}=e,p=Object.assign(Object.assign({itemLead:this.itemLead(o,i),question:t,partialAnswer:r,hint:n,instruction:a},this.toExample(u,c)),{reasonableNumOfChars:s,sampleSolution:l});return g.ObjectUtils.removeUnwantedProperties(p,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),p}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:a.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:s,isDefaultExample:l,example:u}=e,c={type:a.BodyBitType.gap,data:Object.assign({solutions:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==s||s},this.toExample(l,u))};return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:o}=e,i={mark:t,color:r,emphasis:o};return g.ObjectUtils.removeUnwantedProperties(i),i}mark(e){const{solution:t,mark:r,item:o,lead:i,hint:n,instruction:s,isDefaultExample:l,example:u}=e,c={type:a.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExample(l,u))};return g.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:l}=e,u={type:a.BodyBitType.select,data:{prefix:r,options:t,postfix:o,itemLead:this.itemLead(i,n),hint:s,instruction:l}};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}selectOption(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExample(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlight(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:l}=e,u={type:a.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:o,itemLead:this.itemLead(i,n),hint:s,instruction:l}};return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlightText(e){const{text:t,isCorrect:r,isHighlighted:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({text:t,isCorrect:!!r,isHighlighted:!!o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExample(l,u));return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}flashcard(e){const{question:t,answer:r,alternativeAnswers:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExampleBoolean(l,u));return g.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return g.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}imageSource(e){const{url:t,mockupId:r,size:o,format:i,trim:n}=e,a={url:t,mockupId:r,size:o,format:i,trim:n};return g.ObjectUtils.removeUnwantedProperties(a,{ignoreFalse:["trim"]}),a}partner(e){const{name:t,avatarImage:r}=e,o={name:t,avatarImage:r};return g.ObjectUtils.removeUnwantedProperties(o),o}comment(e){const{text:t,location:r}=e,o={text:t,location:r};return g.ObjectUtils.removeUnwantedProperties(o),o}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:d,botResponses:y}=e;return(r||o||i||n||a||s||l||u||c||p||d||y)&&(t={questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:d,botResponses:y},g.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTree(e,t,r,o){if(r||o){if(t){if(this.pushExampleDownTreeString(r,o,t.pairs),this.pushExampleDownTreeBoolean(r,o,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,o,!0,t.choices),this.pushExampleDownTreeBoolean(r,o,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,o,!0,e.choices),this.pushExampleDownTreeBoolean(r,o,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,o,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,o,e)}}pushExampleDownTreeBoolean(e,t,r,...o){if((e||t)&&Array.isArray(o))for(const i of o)if(i){const o=Array.isArray(i)?i:[i];c.BitUtils.fillBooleanExample(o,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];c.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const o of r.bodyParts)if(o)switch(o.type){case a.BodyBitType.gap:{const r=o;c.BitUtils.fillStringExample([r.data],e,t,!1);break}case a.BodyBitType.mark:{const r=o;c.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case a.BodyBitType.select:{const r=o;c.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case a.BodyBitType.highlight:{const r=o;c.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,o,i,n){if(void 0!==n){if(r&&o){const e=r[o];if(Array.isArray(e))for(const t of e)null==t[i]&&(t[i]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[i]=n}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,o]of t)r[e]=u.ArrayUtils.asArray(o)||[o];return r}setIsExampleFlags(e){var t,r,o,i,n,s,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case a.BodyBitType.gap:case a.BodyBitType.mark:f(e.data);break;case a.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case a.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(o=m.matrix)&&void 0!==o?o:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(n=m.quizzes)&&void 0!==n?n:[]){let t=!1;for(const r of null!==(s=e.responses)&&void 0!==s?s:[])t=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType.alias){case n.AliasBitType.articleAi:case n.AliasBitType.noteAi:case n.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(i.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=h},8703:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const i=r(8159),n=r(9779),a=r(3589),s=r(169),l=r(1),u=r(2377);class c extends l.BaseBuilder{resource(e){var t;let r;const{type:a,value:s,format:l}=e,u=o(e,["type","value","format"]),c=Object.assign({type:a,value:null!=s?s:i.Breakscape.EMPTY_STRING,format:null!=l?l:i.Breakscape.EMPTY_STRING},u);switch(a){case n.ResourceTag.video:case n.ResourceTag.videoEmbed:case n.ResourceTag.videoLink:case n.ResourceTag.stillImageFilmEmbed:case n.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],o=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:n.ResourceTag.image,value:r});e&&o.push(e)}}c.thumbnails=[...null!==(t=c.thumbnails)&&void 0!==t?t:[],...o]}}switch(a){case n.ResourceTag.image:case n.ResourceTag.imagePortrait:case n.ResourceTag.imageLandscape:r=this.imageResource(c,a);break;case n.ResourceTag.imageLink:r=this.imageLinkResource(c);break;case n.ResourceTag.audio:r=this.audioResource(c);break;case n.ResourceTag.audioEmbed:r=this.audioEmbedResource(c);break;case n.ResourceTag.audioLink:r=this.audioLinkResource(c);break;case n.ResourceTag.video:r=this.videoResource(c);break;case n.ResourceTag.videoEmbed:r=this.videoEmbedResource(c);break;case n.ResourceTag.videoLink:r=this.videoLinkResource(c);break;case n.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(c);break;case n.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(c);break;case n.ResourceTag.article:r=this.articleResource(c);break;case n.ResourceTag.document:r=this.documentResource(c);break;case n.ResourceTag.documentEmbed:r=this.documentEmbedResource(c);break;case n.ResourceTag.documentLink:r=this.documentLinkResource(c);break;case n.ResourceTag.documentDownload:r=this.documentDownloadResource(c);break;case n.ResourceTag.appLink:r=this.appLinkResource(c);break;case n.ResourceTag.websiteLink:r=this.websiteLinkResource(c)}return r}imageResource(e,t){const{value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:n.ResourceTag.image,typeAlias:null!=t?t:n.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m};return a.ObjectUtils.removeUnwantedProperties(T),u.NodeValidator.validateResource(T)}imageLinkResource(e){const{value:t,src1x:r,src2x:o,src3x:i,src4x:l,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h}=e,m={type:n.ResourceTag.imageLink,typeAlias:n.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:o,src3x:i,src4x:l,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h};return a.ObjectUtils.removeUnwantedProperties(m),u.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audio,typeAlias:n.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioEmbed,typeAlias:n.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioLink,typeAlias:n.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.video,typeAlias:n.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoEmbed,typeAlias:n.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoLink,typeAlias:n.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmEmbed,typeAlias:n.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmLink,typeAlias:n.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.article,typeAlias:n.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.document,typeAlias:n.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentEmbed,typeAlias:n.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentLink,typeAlias:n.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentDownload,typeAlias:n.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:s}=e,l={type:n.ResourceTag.appLink,typeAlias:n.ResourceTag.appLink,value:t,license:r,copyright:o,showInIndex:i,caption:s};return a.ObjectUtils.removeUnwantedProperties(l),u.NodeValidator.validateResource(l)}websiteLinkResource(e){const{value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l}=e,c={type:n.ResourceTag.websiteLink,typeAlias:n.ResourceTag.websiteLink,value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}}t.ResourceBuilder=c},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const o=r(208),i=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===o.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!i.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,o=e.length;r<o;r++){const i=e[r];this._buffer.push(i),t&&r<o-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},8159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Breakscape=void 0;const o=r(3633),i=`${/([*`_!|:=])([\^]*)\1/.source}|${/^(\|)([\^]*)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([\^]*)([^\S\r\n]+)/.source}|${/^(•)([\^]*)(1|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([\^]*)([.@#▼►%!?+\-$_=&])/.source}|${/([\^]*)(])/.source}`,n=i.replace(/(\(\[\\\^\]\*\))/g,"\\^$1"),a=new RegExp(i,"gm"),s="$1$3$6$9$13^$2$1$4$5$7$8$10$11$12$14$15$16$17",l=new RegExp(n,"gm"),u=s.replace(/\^/g,""),c=new RegExp("^(\\||•|#)","gm");const p=new class{constructor(){this.EMPTY_STRING=""}breakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(a,s):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)&&(t[r]=i(n))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}unbreakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(l,u):e;if(Array.isArray(e)){const t=r.modifyArray?e:[];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)?t[r]=i(n):t[r]=n}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e.replace(c,"$1^"):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];o.StringUtils.isString(r)&&(e[t]=i(r))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}concatenate(e,t){return e+t}};t.Breakscape=p},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const o=r(429),i=r(7585),n=r(3059),a=r(5428),s=r(742),l=r(8360),u=r(3141),c=r(9036),p=r(6260),g=r(208);const d=new class{constructor(){this.bitTypeAliasMap=new Map,this.bitCache=new Map,this.comboResourcesCache=new Map,this.buildBitTypeAliasMap()}getBitType(e){const t=this.getAliasedBitType(e);return{alias:t,root:this.getRootBitType(t)}}getBitConfig(e){var t;let r=this.bitCache.get(e.alias);if(!r){const i=()=>{throw new Error(`No config found for bit: ALIAS:${e.alias}, ROOT:${e.root}`)},n=u.BITS[e.root];n||i();const a=e.root!==e.alias;let s;a&&n.aliases&&(s=n.aliases[e.alias]),a&&!s&&i();const{since:c,deprecated:p}=s||n,d=n.aliases?Object.keys(n.aliases).map((e=>g.AliasBitType.fromValue(e))):[],{tags:y,cardSet:f,bodyAllowed:h,bodyRequired:m,footerAllowed:T,footerRequired:b,resourceAttachmentAllowed:v,rootExampleType:C}=n,k=this.getAllResourcesTagsWithZeroCounts(),x=l.ConfigHydrator.hydrateTagsConfig(y),B=l.ConfigHydrator.hydrateCardSetConfig(f),A=null===(t=x.info)||void 0===t?void 0:t.comboResourceType,w=Object.assign({},x.tags);for(const[e,t]of Object.entries(k))w[e]||(w[e]=t);r=new o.BitConfig(c,e,d,w,B,p,h,m,T,b,v,C,A),this.bitCache.set(e.root,r)}return r}getRawPropertiesConfig(){return p.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const o=this.getBitConfig(e);if(!o)return;const i=o.cardSet;if(!i)return;t=Math.min(t,i.variants.length-1);const n=i.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let o={};const a=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===s.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===s.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const o=t.find((e=>e.tag===r));o&&e.set(r,o)}));const o=this.getComboResourceTagTypes(c);o&&o.length>0&&a.set(c,o)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,a=!!e&&e.has(r.tag);if(n){const e=new i.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);o[t]=e}else if(a){if(e){const i=e.get(r.tag);i&&(o[t]=i)}}else o[t]=r}else o=u}else o=u;return new n.ResourcesConfig(o,l.resourceAttachmentAllowed,t,a)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===s.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(c.GROUPS).filter((t=>t.type===a.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),l.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(c.GROUPS).filter((e=>e.type===a.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),l.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}buildBitTypeAliasMap(){for(const e of g.RootBitType.values())this.bitTypeAliasMap.set(e,e);for(const[e,t]of Object.entries(u.BITS))if(t.aliases)for(const r of Object.keys(t.aliases))this.bitTypeAliasMap.set(r,e)}getRootBitType(e){var t;return e&&null!==(t=this.bitTypeAliasMap.get(e))&&void 0!==t?t:g.RootBitType._error}getAliasedBitType(e){var t,r;return null!==(r=null!==(t=g.AliasBitType.fromValue(e))&&void 0!==t?t:g.RootBitType.fromValue(e))&&void 0!==r?r:g.RootBitType._error}};t.Config=d},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const o=r(2005),i=r(3585),n=r(6620),a=r(6956),s=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const o of e){let e;switch(o.type){case d.BitTagType.tag:e=this.hydrateTagConfig(o);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(o);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(o);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(o)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new o.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,a=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,s=T.TAGS[a];if(!s)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=s;let p;i&&(p=this.hydrateTagsConfig(i).tags);return{tags:{[a]:new n.MarkupTagConfig(a,u,null!=r?r:1,null!=o?o:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,s=h.PROPERTIES[n];if(!s)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=s;let T;i&&(T=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new a.PropertyTagConfig(n,u,null!=r?r:1,null!=o?o:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,a=m.RESOURCES[n];if(!a)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=a;let d;i&&(d=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new s.ResourceTagConfig(n,u,null!=r?r:1,null!=o?o:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:o}=e,i=u.GroupConfigKey.fromKey(o)||l.ConfigKey._unknown,n=f.GROUPS[i];if(!n)throw new Error(`No config found for group config key '${o}'`);const{tags:a}=n,s=this.hydrateTagsConfig(a).tags,c=Object.values(s);if(c.length>0){const o=c[0],i=o;i.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:o.maxCount,i.minCount=null!==(r=e.minCount)&&void 0!==r?r:o.minCount}return{tags:s,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:o,repeatCount:n}=e,a=this.hydrateTagsConfig(t);return new i.CardVariantConfig(a.tags,r,o,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(1595),s=r(742),l=r(208),u=r(1035),c=r(7028),p={[l.RootBitType._error]:{since:"1.3.0",tags:[],bodyAllowed:!0,aliases:{}},[l.RootBitType.appFlashcards]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appFlashcardsQuiz]:{since:"1.3.0"},[l.AliasBitType.appFlashcardsLearn]:{since:"1.3.0"}}},[l.RootBitType.appLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.RootBitType.article]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.statement]:{since:"1.3.0"},[l.AliasBitType.buttonCopyText]:{since:"1.4.3"}}},[l.RootBitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.appBitmarkFromEditor]:{since:"1.4.5"}}},[l.RootBitType.articleEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.articleLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.audio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.bitAlias]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor}],bodyAllowed:!0},[l.RootBitType.book]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon}],bodyAllowed:!0,aliases:{[l.AliasBitType.bookAcknowledgments]:{since:"1.3.0"},[l.AliasBitType.bookAddendum]:{since:"1.3.0"},[l.AliasBitType.bookAfterword]:{since:"1.3.0"},[l.AliasBitType.bookAppendix]:{since:"1.3.0"},[l.AliasBitType.bookArticle]:{since:"1.3.0"},[l.AliasBitType.bookAutherBio]:{since:"1.3.0"},[l.AliasBitType.bookBibliography]:{since:"1.3.0"},[l.AliasBitType.bookComingSoon]:{since:"1.3.0"},[l.AliasBitType.bookConclusion]:{since:"1.3.0"},[l.AliasBitType.bookCopyright]:{since:"1.3.0"},[l.AliasBitType.bookCopyrightPermissions]:{since:"1.3.0"},[l.AliasBitType.bookDedication]:{since:"1.3.0"},[l.AliasBitType.bookEndnotes]:{since:"1.3.0"},[l.AliasBitType.bookEpigraph]:{since:"1.3.0"},[l.AliasBitType.bookEpilogue]:{since:"1.3.0"},[l.AliasBitType.bookForword]:{since:"1.3.0"},[l.AliasBitType.bookFrontispiece]:{since:"1.3.0"},[l.AliasBitType.bookImprint]:{since:"1.3.0"},[l.AliasBitType.bookIncitingIncident]:{since:"1.3.0"},[l.AliasBitType.bookIntroduction]:{since:"1.3.0"},[l.AliasBitType.bookListOfContributors]:{since:"1.3.0"},[l.AliasBitType.bookNotes]:{since:"1.3.0"},[l.AliasBitType.bookPostscript]:{since:"1.3.0"},[l.AliasBitType.bookPreface]:{since:"1.3.0"},[l.AliasBitType.bookPrologue]:{since:"1.3.0"},[l.AliasBitType.bookReadMore]:{since:"1.3.0"},[l.AliasBitType.bookReferenceList]:{since:"1.3.0"},[l.AliasBitType.bookRequestForABookReview]:{since:"1.3.0"},[l.AliasBitType.bookSummary]:{since:"1.3.0"},[l.AliasBitType.bookTeaser]:{since:"1.3.0"},[l.AliasBitType.bookTitle]:{since:"1.3.0"}}},[l.RootBitType.bookAlias]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}],bodyAllowed:!0},[l.RootBitType.botActionResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.botActionSend]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.RootBitType.browserImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.card1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.question1]:{since:"1.3.0"},[l.AliasBitType.survey1]:{since:"1.3.0"},[l.AliasBitType.surveyAnonymous1]:{since:"1.3.0"}}},[l.RootBitType.chapter]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.RootBitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.cloze]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.clozeInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.clozeSolutionGrouped]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionCloze]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionCloze]:{since:"1.3.0"}}},[l.RootBitType.code]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCodeCell]:{since:"1.4.3"},[l.AliasBitType.appCodeEditor]:{since:"1.4.3"},[l.AliasBitType.appCodeIde]:{since:"1.4.3"},[l.AliasBitType.codeRuntime]:{since:"1.4.3"},[l.AliasBitType.consoleLog]:{since:"1.4.3"},[l.AliasBitType.output]:{since:"1.4.3"},[l.AliasBitType.stdout]:{since:"1.4.3"}}},[l.RootBitType.conversationLeft1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.conversationLeft1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationLeft1Thought]:{since:"1.3.0"},[l.AliasBitType.conversationRight1]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Thought]:{since:"1.3.0"}}},[l.RootBitType.document]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentDownload]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.essay]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.coachSelfReflectionEssay]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionEssay]:{since:"1.3.0"}}},[l.RootBitType.example]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appAiPrompt]:{since:"1.3.0"},[l.AliasBitType.aiPrompt]:{since:"1.3.0"},[l.AliasBitType.articleAi]:{since:"1.3.0"},[l.AliasBitType.articleAttachment]:{since:"1.3.0"},[l.AliasBitType.assignment]:{since:"1.3.0"},[l.AliasBitType.audioTranscript]:{since:"1.3.0"},[l.AliasBitType.bitmarkExample]:{since:"1.3.0"},[l.AliasBitType.blogArticle]:{since:"1.3.0"},[l.AliasBitType.bug]:{since:"1.3.0"},[l.AliasBitType.checklist]:{since:"1.3.0"},[l.AliasBitType.coachAudioTranscript]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionChecklist]:{since:"1.3.0"},[l.AliasBitType.coachHomeRules]:{since:"1.3.0"},[l.AliasBitType.coachVideoTranscript]:{since:"1.3.0"},[l.AliasBitType.correction]:{since:"1.3.0"},[l.AliasBitType.cookPreparation]:{since:"1.3.0"},[l.AliasBitType.cookStep]:{since:"1.3.0"},[l.AliasBitType.cookIngredients]:{since:"1.3.0"},[l.AliasBitType.cookRemark]:{since:"1.3.0"},[l.AliasBitType.cookVariation]:{since:"1.3.0"},[l.AliasBitType.cookInsert]:{since:"1.3.0"},[l.AliasBitType.cookArrangement]:{since:"1.3.0"},[l.AliasBitType.cookPracticeAdvise]:{since:"1.3.0"},[l.AliasBitType.cookPlate]:{since:"1.3.0"},[l.AliasBitType.cookRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookPersonalRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookSideDrink]:{since:"1.3.0"},[l.AliasBitType.cookSideDish]:{since:"1.3.0"},[l.AliasBitType.cookTimer]:{since:"1.3.0"},[l.AliasBitType.danger]:{since:"1.3.0"},[l.AliasBitType.details1]:{since:"1.3.0"},[l.AliasBitType.details]:{since:"1.3.0"},[l.AliasBitType.editorial]:{since:"1.3.0"},[l.AliasBitType.editorNote]:{since:"1.3.0"},[l.AliasBitType.featured]:{since:"1.3.0"},[l.AliasBitType.help]:{since:"1.3.0"},[l.AliasBitType.hint]:{since:"1.3.0"},[l.AliasBitType.info]:{since:"1.3.0"},[l.AliasBitType.langLearningOutcomes]:{since:"1.3.0"},[l.AliasBitType.langEnablingLanguageSkills]:{since:"1.3.0"},[l.AliasBitType.langLifeSkills]:{since:"1.3.0"},[l.AliasBitType.langEnglishAroundWorld]:{since:"1.3.0"},[l.AliasBitType.langGoodToKnow]:{since:"1.3.0"},[l.AliasBitType.langLearningGoal]:{since:"1.3.0"},[l.AliasBitType.langLearningStrategy]:{since:"1.3.0"},[l.AliasBitType.langLikeALocal]:{since:"1.3.0"},[l.AliasBitType.langMaterial]:{since:"1.3.0"},[l.AliasBitType.langUsefulPhrases]:{since:"1.3.0"},[l.AliasBitType.langLevelDown]:{since:"1.3.0"},[l.AliasBitType.langLevelUp]:{since:"1.3.0"},[l.AliasBitType.langExtraActivity]:{since:"1.3.0"},[l.AliasBitType.langVideoScript]:{since:"1.3.0"},[l.AliasBitType.langAudioScript]:{since:"1.3.0"},[l.AliasBitType.langVocabulary]:{since:"1.3.0"},[l.AliasBitType.langHomework]:{since:"1.3.0"},[l.AliasBitType.langTeacherNote]:{since:"1.3.0"},[l.AliasBitType.langTeacherPronunciation]:{since:"1.3.0"},[l.AliasBitType.message]:{since:"1.3.0"},[l.AliasBitType.newspaperArticle]:{since:"1.3.0"},[l.AliasBitType.note]:{since:"1.3.0"},[l.AliasBitType.noteAi]:{since:"1.3.0"},[l.AliasBitType.notebookArticle]:{since:"1.3.0"},[l.AliasBitType.preparationNote]:{since:"1.3.0"},[l.AliasBitType.releaseNotesSummary]:{since:"1.3.0"},[l.AliasBitType.remark]:{since:"1.3.0"},[l.AliasBitType.reviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewAuthorNote]:{since:"1.3.0"},[l.AliasBitType.reviewReviewerNote]:{since:"1.3.0"},[l.AliasBitType.reviewRequestForReviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewApprovedNote]:{since:"1.3.0"},[l.AliasBitType.selfAssessment]:{since:"1.3.0"},[l.AliasBitType.sideNote]:{since:"1.3.0"},[l.AliasBitType.summary]:{since:"1.3.0"},[l.AliasBitType.summaryAi]:{since:"1.3.0"},[l.AliasBitType.videoTranscript]:{since:"1.3.0"},[l.AliasBitType.warning]:{since:"1.3.0"},[l.AliasBitType.workbookArticle]:{since:"1.3.0"}}},[l.RootBitType.flashcard]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.flashcard1]:{since:"1.3.0"}}},[l.RootBitType.focusImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.highlightText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.image]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCreateBitsFromImage]:{since:"1.3.0"},[l.AliasBitType.appGetScreenshot]:{since:"1.3.0"},[l.AliasBitType.detailsImage]:{since:"1.3.0"},[l.AliasBitType.figure]:{since:"1.3.0",deprecated:"1.4.0"},[l.AliasBitType.imageBanner]:{since:"1.3.0"},[l.AliasBitType.imageFigure]:{since:"1.3.0"},[l.AliasBitType.imageLandscape]:{since:"1.3.0"},[l.AliasBitType.imageMood]:{since:"1.3.0"},[l.AliasBitType.imagePortrait]:{since:"1.3.0"},[l.AliasBitType.imagePrototype]:{since:"1.3.0"},[l.AliasBitType.imageScreenshot]:{since:"1.3.0"},[l.AliasBitType.imageStyled]:{since:"1.3.0"},[l.AliasBitType.imageSuperWide]:{since:"1.3.0"},[l.AliasBitType.imageZoom]:{since:"1.3.0"},[l.AliasBitType.langLifeSkillIcon]:{since:"1.3.0"},[l.AliasBitType.lifeSkillSticker]:{since:"1.3.0"},[l.AliasBitType.pageBanner]:{since:"1.4.3"},[l.AliasBitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0"}}},[l.RootBitType.imageLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.imageOnDevice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.RootBitType.imageResponsive]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.RootBitType.internalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.RootBitType.interview]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:o.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.interviewInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.botInterview]:{since:"1.3.0"}}},[l.RootBitType.learningPathBook]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.bookLink]:{since:"1.3.0"},[l.AliasBitType.bookLinkNext]:{since:"1.3.0"},[l.AliasBitType.bookLinkPrev]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomEvent]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomTraining]:{since:"1.3.0"},[l.AliasBitType.learningPathClosing]:{since:"1.3.0"},[l.AliasBitType.learningPathFeedback]:{since:"1.3.0"},[l.AliasBitType.learningPathLearningGoal]:{since:"1.3.0"},[l.AliasBitType.learningPathLti]:{since:"1.3.0"},[l.AliasBitType.learningPathSign]:{since:"1.3.0"},[l.AliasBitType.learningPathStep]:{since:"1.3.0"}}},[l.RootBitType.learningPathBotTraining]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bot}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathExternalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathVideoCall]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.mark]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_markConfig},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.match]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.matchAll]:{since:"1.3.0"},[l.AliasBitType.matchReverse]:{since:"1.3.0"},[l.AliasBitType.matchAllReverse]:{since:"1.3.0"},[l.AliasBitType.matchSolutionGrouped]:{since:"1.3.0"}}},[l.RootBitType.matchMatrix]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchMatrix,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchAudio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchAudioPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchPicture]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchImagePairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.multipleChoice1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0"}}},[l.RootBitType.multipleChoice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0"}}},[l.RootBitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0"}}},[l.RootBitType.page]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.pageBuyButton]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.photo]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.RootBitType.quote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.RootBitType.rating]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionRating]:{since:"1.3.0"}}},[l.RootBitType.releaseNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sampleSolution]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sequence]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.RootBitType.stillImageFilm]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.RootBitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.survey]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.toc]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.anchor]:{since:"1.3.0"},[l.AliasBitType.bitBookEnding]:{since:"1.3.0"},[l.AliasBitType.bitBookSummary]:{since:"1.3.0"},[l.AliasBitType.botActionAnnounce]:{since:"1.3.0"},[l.AliasBitType.botActionRatingNumber]:{since:"1.3.0"},[l.AliasBitType.botActionRemind]:{since:"1.3.0"},[l.AliasBitType.botActionSave]:{since:"1.3.0"},[l.AliasBitType.botActionTrueFalse]:{since:"1.3.0"},[l.AliasBitType.chapterSubjectMatter]:{since:"1.3.0"},[l.AliasBitType.chat]:{since:"1.3.0"},[l.AliasBitType.conclusion]:{since:"1.3.0"},[l.AliasBitType.documentUpload]:{since:"1.3.0"},[l.AliasBitType.footNote]:{since:"1.3.0"},[l.AliasBitType.groupBorn]:{since:"1.3.0"},[l.AliasBitType.groupDied]:{since:"1.3.0"},[l.AliasBitType.recordAudio]:{since:"1.3.0"},[l.AliasBitType.stickyNote]:{since:"1.3.0"},[l.AliasBitType.takePicture]:{since:"1.3.0"}}},[l.RootBitType.trueFalse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:s.BitTagType.tag,configKey:a.TagConfigKey.true},{type:s.BitTagType.tag,configKey:a.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.RootBitType.trueFalse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:o.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],bodyAllowed:!0},[l.RootBitType.vendorJupyterOutput]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.vendorJupyterCellCode]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellMarkdown]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellRaw]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterIpynb]:{since:"1.4.3"}}},[l.RootBitType.video]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLandscape]:{since:"1.3.0"},[l.AliasBitType.videoPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoEmbedLandscape]:{since:"1.3.0"},[l.AliasBitType.videoEmbedPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLinkLandscape]:{since:"1.3.0"},[l.AliasBitType.videoLinkPortrait]:{since:"1.3.0"}}},[l.RootBitType.websiteLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=p},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c={[o.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:s.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const o=r(177),i=r(5428),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c=r(9779),p={[o.GroupConfigKey.group_standardAllBits]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.anchor}]},[o.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:s.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:s.TagConfigKey.hint}]},[o.GroupConfigKey.group_standardExample]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[o.GroupConfigKey.group_standardTags]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},[o.GroupConfigKey.group_imageSource]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[o.GroupConfigKey.group_partner]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage}]}]},[o.GroupConfigKey.group_gap]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}]}]},[o.GroupConfigKey.group_trueFalse]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_markConfig]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[o.GroupConfigKey.group_mark]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_bookCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[o.GroupConfigKey.group_learningPathCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_reference,maxCount:2}]}]},[o.GroupConfigKey.group_resourceCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[o.GroupConfigKey.group_resourceImageCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt}]},[o.GroupConfigKey.group_resourceAudioCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[o.GroupConfigKey.group_resourceVideoCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[o.GroupConfigKey.group_resourceImage]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImagePortrait]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLandscape]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceAudio]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceVideo]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceArticle]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocument]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentDownload]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceAppLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceWebsiteLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilm]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[o.GroupConfigKey.group_resourceImageResponsive]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const o=r(3518),i=r(7204),n=r(5486),a=r(7953),s={[o.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.aiGenerated},[o.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.referenceProperty},[o.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.markConfig},[o.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isCaseSensitive]:{tag:a.PropertyTag.isCaseSensitive,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=s},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const o=r(6194),i=r(9431),n=r(9779),a={[o.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[o.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:i.ResourceJsonKey.imagePortrait},[o.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:i.ResourceJsonKey.imageLandscape},[o.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:i.ResourceJsonKey.imageEmbed},[o.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:i.ResourceJsonKey.imageLink},[o.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[o.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:i.ResourceJsonKey.audioEmbed},[o.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:i.ResourceJsonKey.audioLink},[o.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[o.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:i.ResourceJsonKey.videoEmbed},[o.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:i.ResourceJsonKey.videoLink},[o.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:i.ResourceJsonKey.stillImageFilmEmbed},[o.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:i.ResourceJsonKey.stillImageFilmLink},[o.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[o.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:i.ResourceJsonKey.articleEmbed},[o.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:i.ResourceJsonKey.articleLink},[o.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[o.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:i.ResourceJsonKey.documentEmbed},[o.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:i.ResourceJsonKey.documentLink},[o.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:i.ResourceJsonKey.documentDownload},[o.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:i.ResourceJsonKey.appLink},[o.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:i.ResourceJsonKey.websiteLink}};t.RESOURCES=a},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const o=r(1595),i=r(8739),n={[o.TagConfigKey.title]:{tag:i.Tag.title},[o.TagConfigKey.anchor]:{tag:i.Tag.anchor},[o.TagConfigKey.tag_reference]:{tag:i.Tag.reference},[o.TagConfigKey.property]:{tag:i.Tag.property},[o.TagConfigKey.itemLead]:{tag:i.Tag.itemLead},[o.TagConfigKey.instruction]:{tag:i.Tag.instruction},[o.TagConfigKey.hint]:{tag:i.Tag.hint},[o.TagConfigKey.true]:{tag:i.Tag.true},[o.TagConfigKey.false]:{tag:i.Tag.false},[o.TagConfigKey.sampleSolution]:{tag:i.Tag.sampleSolution},[o.TagConfigKey.gap]:{tag:i.Tag.gap},[o.TagConfigKey.tag_mark]:{tag:i.Tag.mark},[o.TagConfigKey.resource]:{tag:i.Tag.resource},[o.TagConfigKey.remark]:{tag:i.Tag.remark},[o.TagConfigKey.comment]:{tag:i.Tag.comment}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.10",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(6831),i=r(2892),n=r(7448);function a(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,a.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function s(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=a,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(a,Error),a.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=s("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+s("",i.column-1," ")+s("",p,"^")}else t+="\n at "+a}return t},a.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var s,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:sr,bit:function(){var e,t,r,o,i;e=Ht,t=[],r=Rr();for(;r!==l;)t.push(r),r=Rr();if((r=cr())!==l){for(o=[],i=Rr();i!==l;)o.push(i),i=Rr();zt=e,e=Xe(r)}else Ht=e,e=l;return e},cardContent:function(){var e,t,r;e=Ht,t=[],(r=yr())===l&&(r=kr());for(;r!==l;)t.push(r),(r=yr())===l&&(r=kr());return zt=e,t=Ct(t),e=t}},p=sr,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",C="==",k="[@id",x="[",B="#",A="[▼",w="[►",P="[@",K="[%",_="[!",S="[?",R="[+",I="[-",O="[$",E="[_",L="[=",j="[&",G="::",F="||",V="^]",N="id:",M="\n",D="\r\n",U="\r",$="\u2028",q="\u2029",J=/^[^\]]/,H=/^[^:\]]/,z=/^[^&:\]]/,W=/^[ \t]/,Y=/^[^\n\r\u2028\u2029]/,X=/^[ \t\n\r\u2028\u2029]/,Z=er("[.",!1),Q=tr(["]"],!0,!1),ee=er("]",!1),te=er(":",!1),re=er("&",!1),oe={type:"any"},ie=er("====",!1),ne=er("~~~~",!1),ae=er("--",!1),se=er("++",!1),le=er("===",!1),ue=er("==",!1),ce=er("[@id",!1),pe=er("[",!1),ge=er("#",!1),de=er("[▼",!1),ye=er("[►",!1),fe=er("[@",!1),he=er("[%",!1),me=er("[!",!1),Te=er("[?",!1),be=er("[+",!1),ve=er("[-",!1),Ce=er("[$",!1),ke=er("[_",!1),xe=er("[=",!1),Be=er("[&",!1),Ae=er("::",!1),we=er("||",!1),Pe=er("^]",!1),Ke=er("id:",!1),_e=tr([":","]"],!0,!1),Se=tr(["&",":","]"],!0,!1),Re=(rr("Empty"),tr([" ","\t"],!1,!1)),Ie=rr("Anything"),Oe=rr("Character"),Ee=tr(["\n","\r","\u2028","\u2029"],!0,!1),Le=rr("Line"),je=(rr("whitespace in line"),rr("Blank Line")),Ge=rr("Line Terminator"),Fe=er("\n",!1),Ve=er("\r\n",!1),Ne=er("\r",!1),Me=er("\u2028",!1),De=er("\u2029",!1),Ue=rr("Whitespace, then Line Terminator"),$e=rr("whitespace"),qe=tr([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),Je=function(e,t){return Fr.buildBits([e,...t])},He=function(e){return Gr.handleRawBit(e)},ze=function(e){return e},We=function(e){return Gr.handleRawBit(e)},Ye=function(e){return e},Xe=function(e){return e},Ze=function(e,t){return Fr.buildBit(e,t)},Qe=function(e){return Fr.invalidBit(e)},et=function(e,t){return Fr.buildBitHeader(e,t)},tt=function(e,t){return Fr.buildTextAndResourceType(e,t)},rt=function(e){return Gr.handleTextFormat(e)},ot=function(e){return Gr.handleResourceType(e)},it=function(e){return Gr.handleBitContent(e)},nt=function(e){return Gr.handleTagChain(e)},at=function(e){return e},st=function(e){return Gr.handleBitTag(e)},lt=function(e){return{type:o.TypeKey.BodyChar,value:e}},ut=function(e){return Gr.handleCardSet(e[1].flat())},ct=function(){Gr.handleCardSetStart()},pt=function(){Gr.handleCardSetEnd()},gt=function(e){return Gr.handleCards(e)},dt=function(e){return Gr.handleCardLineOrDivider(e,2)},yt=function(e){return Gr.handleCardLine(e)},ft=function(e){return Gr.handleCardSet(e[1].flat())},ht=function(){Gr.handleCardSetStart()},mt=function(){Gr.handleCardSetEnd()},Tt=function(e){return Gr.handleCards(e)},bt=function(e){return Gr.handleCardLineOrDivider(e,1)},vt=function(e){return Gr.handleCardLine(e)},Ct=function(e){return Gr.handleCardContent(e)},kt=function(e){return{type:o.TypeKey.CardChar,value:e}},xt=function(e){return Gr.handlePropertyTag("id",e)},Bt=function(e,t){return Gr.handleTag(o.TypeKey.Title,{level:e,title:t})},At=function(e){return Gr.handleTag(o.TypeKey.Anchor,e)},wt=function(e){return Gr.handleTag(o.TypeKey.Reference,e)},Pt=function(e,t){return Gr.handlePropertyTag(e,t)},Kt=function(e){return Gr.handleTag(o.TypeKey.ItemLead,e)},_t=function(e){return Gr.handleTag(o.TypeKey.Instruction,e)},St=function(e){return Gr.handleTag(o.TypeKey.Hint,e)},Rt=function(e){return Gr.handleTag(o.TypeKey.True,e)},It=function(e){return Gr.handleTag(o.TypeKey.False,e)},Ot=function(e){return Gr.handleTag(o.TypeKey.SampleSolution,e)},Et=function(e){return Gr.handleTag(o.TypeKey.Gap,e)},Lt=function(e){return Gr.handleTag(o.TypeKey.Mark,e)},jt=function(e,t){return Gr.handleResourceTag(e,t)},Gt=function(e){return Gr.handleTag(o.TypeKey.BodyText,e)},Ft=function(e){return Gr.handleTag(o.TypeKey.Comment,e)},Vt=function(e){return e},Nt=function(e){return e?e.trim():""},Mt=function(e){return e?e.trim():null},Dt=function(e){return e?e.trim():""},Ut=function(){return!0},$t=function(e){return e},qt=function(e){return e},Jt=function(e){return e},Ht=0,zt=0,Wt=[{line:1,column:1}],Yt=0,Xt=[],Zt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function Qt(){return t.substring(zt,Ht)}function er(e,t){return{type:"literal",text:e,ignoreCase:t}}function tr(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function rr(e){return{type:"other",description:e}}function or(e){var r,o=Wt[e];if(o)return o;for(r=e-1;!Wt[r];)r--;for(o={line:(o=Wt[r]).line,column:o.column};r<e;)10===t.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Wt[e]=o,o}function ir(e,t,r){var o=or(e),i=or(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function nr(e){Ht<Yt||(Ht>Yt&&(Yt=Ht,Xt=[]),Xt.push(e))}function ar(e,t,r){return new a(a.buildMessage(e,t),e,t,r)}function sr(){return function(){var e,r,o,i;e=Ht,r=[],(o=Er())===l&&(o=xr());for(;o!==l;)r.push(o),(o=Er())===l&&(o=xr());return o=function(){var e,r,o,i;e=Ht,r=Ht,o=[],i=ur();for(;i!==l;)o.push(i),i=ur();return r=t.substring(r,Ht),zt=e,r=He(r),e=r,e}(),i=function(){var e,t;e=[],t=lr();for(;t!==l;)e.push(t),t=lr();return e}(),zt=e,e=Je(o,i),e}()}function lr(){var e,r,o,i;for(e=Ht,r=[],o=Rr();o!==l;)r.push(o),o=Rr();return(o=Ir())===l&&(o=null),i=function(){var e,r,o,i,n,a;if(e=Ht,r=Ht,o=Ht,i=function(){var e,r,o,i;e=Ht,t.substr(Ht,2)===g?(r=g,Ht+=2):(r=l,0===Zt&&nr(Z));if(r!==l){for(o=[],J.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Q));i!==l;)o.push(i),J.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Q));93===t.charCodeAt(Ht)?(i=d,Ht++):(i=l,0===Zt&&nr(ee)),i!==l?(zt=e,e=Ye(r)):(Ht=e,e=l)}else Ht=e,e=l;return e}(),i!==l){for(n=[],a=ur();a!==l;)n.push(a),a=ur();o=i=[i,n]}else Ht=o,o=l;r=o!==l?t.substring(r,Ht):o;r!==l&&(zt=e,r=We(r));return e=r,e}(),i!==l?(zt=e,e=ze(i)):(Ht=e,e=l),e}function ur(){var e,t,r,o;if(e=Ht,(t=Ir())!==l?(r=Ht,Zt++,o=pr(),Zt--,o===l?r=void 0:(Ht=r,r=l),r!==l?e=t=[t,r]:(Ht=e,e=l)):(Ht=e,e=l),e===l)if(e=[],(t=_r())!==l)for(;t!==l;)e.push(t),t=_r();else e=l;return e}function cr(){var e,r,o;return e=Ht,(r=pr())!==l?(o=function(){var e,t,r;e=Ht,t=[],r=Tr(),r===l&&(r=vr())===l&&(r=yr())===l&&(r=mr());for(;r!==l;)t.push(r),(r=Tr())===l&&(r=vr())===l&&(r=yr())===l&&(r=mr());return zt=e,t=it(t),e=t,e}(),zt=e,e=Ze(r,o)):(Ht=e,e=l),e===l&&(e=Ht,r=Ht,o=function(){var e,r;Zt++,e=[],t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe));for(;r!==l;)e.push(r),t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe));Zt--,r=l,0===Zt&&nr(Ie);return e}(),r=t.substring(r,Ht),zt=e,e=r=Qe(r)),e}function pr(){var e,r,o,i,n;return e=Ht,t.substr(Ht,2)===g?(r=g,Ht+=2):(r=l,0===Zt&&nr(Z)),r!==l?(o=Pr(),i=function(){var e,t,r;e=Ht,t=gr(),t===l&&(t=dr());t===l&&(t=null);r=gr(),r===l&&(r=dr());r===l&&(r=null);return zt=e,e=tt(t,r),e}(),93===t.charCodeAt(Ht)?(n=d,Ht++):(n=l,0===Zt&&nr(ee)),n!==l?(zt=e,e=et(o,i)):(Ht=e,e=l)):(Ht=e,e=l),e}function gr(){var e,r,o;return e=Ht,58===t.charCodeAt(Ht)?(r=y,Ht++):(r=l,0===Zt&&nr(te)),r!==l?(o=Pr(),zt=e,e=rt(o)):(Ht=e,e=l),e}function dr(){var e,r,o;return e=Ht,38===t.charCodeAt(Ht)?(r=f,Ht++):(r=l,0===Zt&&nr(re)),r!==l?(o=Pr(),zt=e,e=ot(o)):(Ht=e,e=l),e}function yr(){var e,t,r,o,i;if(e=Ht,t=Ht,(r=hr())!==l){for(o=[],i=fr();i!==l;)o.push(i),i=fr();t=r=[r,o]}else Ht=t,t=l;return t!==l&&(zt=e,t=nt(t)),e=t}function fr(){var e,t;return e=Ht,(t=hr())!==l&&(zt=e,t=at(t)),e=t}function hr(){var e,r;return e=Ht,(r=xr())===l&&(r=function(){var e,r,o,i,n,a,s,u;e=Ht,r=Ht,o=Ht,t.substr(Ht,2)===G?(i=G,Ht+=2):(i=l,0===Zt&&nr(Ae));i!==l?(n=function(){var e,r,o,i,n,a;e=Ht,r=Ht,o=[],i=Ht,n=Ht,Zt++,t.substr(Ht,2)===G?(a=G,Ht+=2):(a=l,0===Zt&&nr(Ae));Zt--,a===l?n=void 0:(Ht=n,n=l);n!==l&&(a=_r())!==l?i=n=[n,a]:(Ht=i,i=l);for(;i!==l;)o.push(i),i=Ht,n=Ht,Zt++,t.substr(Ht,2)===G?(a=G,Ht+=2):(a=l,0===Zt&&nr(Ae)),Zt--,a===l?n=void 0:(Ht=n,n=l),n!==l&&(a=_r())!==l?i=n=[n,a]:(Ht=i,i=l);return r=t.substring(r,Ht),zt=e,r=$t(r),e=r,e}(),t.substr(Ht,2)===G?(a=G,Ht+=2):(a=l,0===Zt&&nr(Ae)),a!==l?(s=function(){var e,r,o,i,n,a;e=Ht,r=Ht,o=[],i=Ht,n=Ht,Zt++,t.substr(Ht,2)===G?(a=G,Ht+=2):(a=l,0===Zt&&nr(Ae));Zt--,a===l?n=void 0:(Ht=n,n=l);n!==l?(t.length>Ht?(a=t.charAt(Ht),Ht++):(a=l,0===Zt&&nr(oe)),a!==l?i=n=[n,a]:(Ht=i,i=l)):(Ht=i,i=l);for(;i!==l;)o.push(i),i=Ht,n=Ht,Zt++,t.substr(Ht,2)===G?(a=G,Ht+=2):(a=l,0===Zt&&nr(Ae)),Zt--,a===l?n=void 0:(Ht=n,n=l),n!==l?(t.length>Ht?(a=t.charAt(Ht),Ht++):(a=l,0===Zt&&nr(oe)),a!==l?i=n=[n,a]:(Ht=i,i=l)):(Ht=i,i=l);return r=t.substring(r,Ht),zt=e,r=qt(r),e=r,e}(),u=function(){var e,r,o;t.substr(Ht,2)===G?(e=G,Ht+=2):(e=l,0===Zt&&nr(Ae));if(e===l){for(e=Ht,r=[],o=Er();o!==l;)r.push(o),o=Er();(o=jr())!==l?e=r=[r,o]:(Ht=e,e=l)}return e}(),u!==l?o=i=[i,n,a,s,u]:(Ht=o,o=l)):(Ht=o,o=l)):(Ht=o,o=l);r=o!==l?t.substring(r,Ht):o;r!==l&&(zt=e,r=Gt(r));return e=r,e}(),r===l&&(r=function(){var e,r,o,i;e=Ht,t.substr(Ht,4)===k?(r=k,Ht+=4):(r=l,0===Zt&&nr(ce));r!==l&&(o=Kr())!==l?(i=function(){var e;93===t.charCodeAt(Ht)?(e=d,Ht++):(e=l,0===Zt&&nr(ee));return e}(),i!==l?(zt=e,e=xt(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Ht,t.substr(Ht,2)===P?(r=P,Ht+=2):(r=l,0===Zt&&nr(fe));r!==l&&(o=Ar())!==l&&(i=Kr())!==l&&wr()!==l?(zt=e,e=Pt(o,i)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Ht,91===t.charCodeAt(Ht)?(r=x,Ht++):(r=l,0===Zt&&nr(pe));if(r!==l){if(o=[],35===t.charCodeAt(Ht)?(i=B,Ht++):(i=l,0===Zt&&nr(ge)),i!==l)for(;i!==l;)o.push(i),35===t.charCodeAt(Ht)?(i=B,Ht++):(i=l,0===Zt&&nr(ge));else o=l;o!==l?(i=Br(),wr()!==l?(zt=e,e=Bt(o,i)):(Ht=e,e=l)):(Ht=e,e=l)}else Ht=e,e=l;return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===A?(r=A,Ht+=2):(r=l,0===Zt&&nr(de));r!==l?(o=Br(),wr()!==l?(zt=e,e=At(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===w?(r=w,Ht+=2):(r=l,0===Zt&&nr(ye));r!==l?(o=Br(),wr()!==l?(zt=e,e=wt(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===K?(r=K,Ht+=2):(r=l,0===Zt&&nr(he));r!==l?(o=Br(),wr()!==l?(zt=e,e=Kt(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===_?(r=_,Ht+=2):(r=l,0===Zt&&nr(me));r!==l?(o=Br(),wr()!==l?(zt=e,e=_t(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===S?(r=S,Ht+=2):(r=l,0===Zt&&nr(Te));r!==l?(o=Br(),wr()!==l?(zt=e,e=St(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===E?(r=E,Ht+=2):(r=l,0===Zt&&nr(ke));r!==l?(o=Br(),wr()!==l?(zt=e,e=Et(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===L?(r=L,Ht+=2):(r=l,0===Zt&&nr(xe));r!==l?(o=Br(),wr()!==l?(zt=e,e=Lt(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===O?(r=O,Ht+=2):(r=l,0===Zt&&nr(Ce));r!==l?(o=Br(),wr()!==l?(zt=e,e=Ot(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===R?(r=R,Ht+=2):(r=l,0===Zt&&nr(be));r!==l?(o=Br(),wr()!==l?(zt=e,e=Rt(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Ht,t.substr(Ht,2)===I?(r=I,Ht+=2):(r=l,0===Zt&&nr(ve));r!==l?(o=Br(),wr()!==l?(zt=e,e=It(o)):(Ht=e,e=l)):(Ht=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Ht,t.substr(Ht,2)===j?(r=j,Ht+=2):(r=l,0===Zt&&nr(Be));r!==l&&(o=Ar())!==l&&(i=Kr())!==l&&wr()!==l?(zt=e,e=jt(o,i)):(Ht=e,e=l);return e}()))))))))))))))),r!==l&&(zt=e,r=st(r)),e=r}function mr(){var e,r;return e=Ht,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe)),r!==l&&(zt=e,r=lt(r)),e=r}function Tr(){var e,r,o,i,n;if(e=Ht,r=Ht,o=function(){var e,r,o,i,n,a;e=Ht,r=Ir(),r!==l?(o=Ht,Zt++,i=Ht,t.substr(Ht,4)===h?(n=h,Ht+=4):(n=l,0===Zt&&nr(ie)),n!==l&&(a=Or())!==l?i=n=[n,a]:(Ht=i,i=l),Zt--,i!==l?(Ht=o,o=void 0):o=l,o!==l?(zt=e,e=ct()):(Ht=e,e=l)):(Ht=e,e=l);return e}(),o!==l){for(i=[],n=br();n!==l;)i.push(n),n=br();n=function(){var e,r,o,i,n;e=Ht,r=Ht,t.substr(Ht,4)===m?(o=m,Ht+=4):(o=l,0===Zt&&nr(ne));o===l&&(o=null);i=Ht,Zt++,n=Lr(),Zt--,n!==l?(Ht=i,i=void 0):i=l;i!==l?r=o=[o,i]:(Ht=r,r=l);r!==l&&(zt=e,r=pt());return e=r,e}(),n!==l?r=o=[o,i,n]:(Ht=r,r=l)}else Ht=r,r=l;return r!==l&&(zt=e,r=ut(r)),e=r}function br(){var e,r;return e=Ht,r=function(){var e,r,o,i;e=Ht,r=Ht,t.substr(Ht,4)===h?(o=h,Ht+=4):(o=l,0===Zt&&nr(ie));o!==l?((i=Or())===l&&(i=Lr()),i!==l?r=o=[o,i]:(Ht=r,r=l)):(Ht=r,r=l);r===l&&(r=Ht,t.substr(Ht,2)===T?(o=T,Ht+=2):(o=l,0===Zt&&nr(ae)),o!==l?((i=Or())===l&&(i=Lr()),i!==l?r=o=[o,i]:(Ht=r,r=l)):(Ht=r,r=l),r===l&&(r=Ht,t.substr(Ht,2)===b?(o=b,Ht+=2):(o=l,0===Zt&&nr(se)),o!==l?((i=Or())===l&&(i=Lr()),i!==l?r=o=[o,i]:(Ht=r,r=l)):(Ht=r,r=l),r===l&&(r=function(){var e,r,o,i,n,a;e=Ht,r=Ht,Zt++,o=Ht,t.substr(Ht,4)===m?(i=m,Ht+=4):(i=l,0===Zt&&nr(ne));i!==l&&(n=Lr())!==l?o=i=[i,n]:(Ht=o,o=l);Zt--,o===l?r=void 0:(Ht=r,r=l);if(r!==l){if(o=Ht,i=Ht,n=Sr(),(a=Ir())!==l?i=n=[n,a]:(Ht=i,i=l),i===l){if(i=Ht,n=[],(a=_r())!==l)for(;a!==l;)n.push(a),a=_r();else n=l;n!==l?(a=function(){var e,r;e=Ir(),e===l&&(e=Ht,Zt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe)),Zt--,r===l?e=void 0:(Ht=e,e=l));return e}(),a!==l?i=n=[n,a]:(Ht=i,i=l)):(Ht=i,i=l)}(o=i!==l?t.substring(o,Ht):i)!==l?(zt=e,e=yt(o)):(Ht=e,e=l)}else Ht=e,e=l;return e}())));r!==l&&(zt=e,r=dt(r));return e=r,e}(),r!==l&&(zt=e,r=gt(r)),e=r}function vr(){var e,r,o,i,n;if(e=Ht,r=Ht,o=function(){var e,r,o,i,n,a;e=Ht,r=Ir(),r!==l?(o=Ht,Zt++,i=Ht,t.substr(Ht,3)===v?(n=v,Ht+=3):(n=l,0===Zt&&nr(le)),n!==l&&(a=Or())!==l?i=n=[n,a]:(Ht=i,i=l),Zt--,i!==l?(Ht=o,o=void 0):o=l,o!==l?(zt=e,e=ht()):(Ht=e,e=l)):(Ht=e,e=l);return e}(),o!==l){for(i=[],n=Cr();n!==l;)i.push(n),n=Cr();n=function(){var e,r,o,i,n;e=Ht,r=Ht,t.substr(Ht,3)===v?(o=v,Ht+=3):(o=l,0===Zt&&nr(le));o!==l?(i=Ht,Zt++,n=Lr(),Zt--,n!==l?(Ht=i,i=void 0):i=l,i!==l?r=o=[o,i]:(Ht=r,r=l)):(Ht=r,r=l);r!==l&&(zt=e,r=mt());return e=r,e}(),n!==l?r=o=[o,i,n]:(Ht=r,r=l)}else Ht=r,r=l;return r!==l&&(zt=e,r=ft(r)),e=r}function Cr(){var e,r,o,i,n,a,s,u,c,p,g;if(e=Ht,r=Ht,Zt++,o=Ht,t.substr(Ht,3)===v?(i=v,Ht+=3):(i=l,0===Zt&&nr(le)),i!==l){for(n=[],a=Er();a!==l;)n.push(a),a=Er();for(a=[],s=Ht,u=Ht,Zt++,c=Ht,(p=Ir())!==l?(t.substr(Ht,3)===v?(g=v,Ht+=3):(g=l,0===Zt&&nr(le)),g!==l?c=p=[p,g]:(Ht=c,c=l)):(Ht=c,c=l),Zt--,c===l?u=void 0:(Ht=u,u=l),u!==l?(t.length>Ht?(c=t.charAt(Ht),Ht++):(c=l,0===Zt&&nr(oe)),c!==l?s=u=[u,c]:(Ht=s,s=l)):(Ht=s,s=l);s!==l;)a.push(s),s=Ht,u=Ht,Zt++,c=Ht,(p=Ir())!==l?(t.substr(Ht,3)===v?(g=v,Ht+=3):(g=l,0===Zt&&nr(le)),g!==l?c=p=[p,g]:(Ht=c,c=l)):(Ht=c,c=l),Zt--,c===l?u=void 0:(Ht=u,u=l),u!==l?(t.length>Ht?(c=t.charAt(Ht),Ht++):(c=l,0===Zt&&nr(oe)),c!==l?s=u=[u,c]:(Ht=s,s=l)):(Ht=s,s=l);(s=jr())!==l?o=i=[i,n,a,s]:(Ht=o,o=l)}else Ht=o,o=l;return Zt--,o===l?r=void 0:(Ht=r,r=l),r!==l?(o=function(){var e,r,o,i;e=Ht,r=Ht,t.substr(Ht,3)===v?(o=v,Ht+=3):(o=l,0===Zt&&nr(le));o!==l&&(i=Or())!==l?r=o=[o,i]:(Ht=r,r=l);r===l&&(r=Ht,t.substr(Ht,2)===C?(o=C,Ht+=2):(o=l,0===Zt&&nr(ue)),o!==l&&(i=Or())!==l?r=o=[o,i]:(Ht=r,r=l),r===l&&(r=Ht,t.substr(Ht,2)===T?(o=T,Ht+=2):(o=l,0===Zt&&nr(ae)),o!==l&&(i=Or())!==l?r=o=[o,i]:(Ht=r,r=l),r===l&&(r=function(){var e,r,o,i,n;e=Ht,r=Ht,o=Ht,i=Sr(),n=Ir(),n!==l?o=i=[i,n]:(Ht=o,o=l);r=o!==l?t.substring(r,Ht):o;r!==l&&(zt=e,r=vt(r));return e=r,e}())));r!==l&&(zt=e,r=bt(r));return e=r,e}(),o!==l?(zt=e,e=Tt(o)):(Ht=e,e=l)):(Ht=e,e=l),e}function kr(){var e,r;return e=Ht,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe)),r!==l&&(zt=e,r=kt(r)),e=r}function xr(){var e,r,o,i;return e=Ht,t.substr(Ht,2)===F?(r=F,Ht+=2):(r=l,0===Zt&&nr(we)),r!==l?(o=function(){var e,r,o,i,n,a;e=Ht,r=Ht,o=[],i=Ht,n=Ht,Zt++,t.substr(Ht,2)===F?(a=F,Ht+=2):(a=l,0===Zt&&nr(we));Zt--,a===l?n=void 0:(Ht=n,n=l);n!==l?(t.length>Ht?(a=t.charAt(Ht),Ht++):(a=l,0===Zt&&nr(oe)),a!==l?i=n=[n,a]:(Ht=i,i=l)):(Ht=i,i=l);for(;i!==l;)o.push(i),i=Ht,n=Ht,Zt++,t.substr(Ht,2)===F?(a=F,Ht+=2):(a=l,0===Zt&&nr(we)),Zt--,a===l?n=void 0:(Ht=n,n=l),n!==l?(t.length>Ht?(a=t.charAt(Ht),Ht++):(a=l,0===Zt&&nr(oe)),a!==l?i=n=[n,a]:(Ht=i,i=l)):(Ht=i,i=l);return r=t.substring(r,Ht),zt=e,r=Jt(r),e=r,e}(),i=function(){var e,r,o;t.substr(Ht,2)===F?(e=F,Ht+=2):(e=l,0===Zt&&nr(we));if(e===l){for(e=Ht,r=[],o=Er();o!==l;)r.push(o),o=Er();(o=jr())!==l?e=r=[r,o]:(Ht=e,e=l)}return e}(),i!==l?(zt=e,e=Ft(o)):(Ht=e,e=l)):(Ht=e,e=l),e}function Br(){var e,r,o,i;for(e=Ht,r=Ht,o=[],t.substr(Ht,2)===V?(i=V,Ht+=2):(i=l,0===Zt&&nr(Pe)),i===l&&(J.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Q)));i!==l;)o.push(i),t.substr(Ht,2)===V?(i=V,Ht+=2):(i=l,0===Zt&&nr(Pe)),i===l&&(J.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Q)));return r=t.substring(r,Ht),zt=e,e=r=Vt(r)}function Ar(){var e,r,o,i,n;if(e=Ht,r=Ht,Zt++,t.substr(Ht,3)===N?(o=N,Ht+=3):(o=l,0===Zt&&nr(Ke)),Zt--,o===l?r=void 0:(Ht=r,r=l),r!==l){for(o=Ht,i=[],H.test(t.charAt(Ht))?(n=t.charAt(Ht),Ht++):(n=l,0===Zt&&nr(_e));n!==l;)i.push(n),H.test(t.charAt(Ht))?(n=t.charAt(Ht),Ht++):(n=l,0===Zt&&nr(_e));o=t.substring(o,Ht),zt=e,e=Nt(o)}else Ht=e,e=l;return e}function wr(){var e,r,o;if(93===t.charCodeAt(Ht)?(e=d,Ht++):(e=l,0===Zt&&nr(ee)),e===l){for(e=Ht,r=[],o=Er();o!==l;)r.push(o),o=Er();(o=jr())!==l?e=r=[r,o]:(Ht=e,e=l)}return e}function Pr(){var e,r,o,i;for(e=Ht,r=Ht,o=[],z.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Se));i!==l;)o.push(i),z.test(t.charAt(Ht))?(i=t.charAt(Ht),Ht++):(i=l,0===Zt&&nr(Se));return r=t.substring(r,Ht),zt=e,e=r=Mt(r)}function Kr(){var e,r,o;return e=Ht,58===t.charCodeAt(Ht)?(r=y,Ht++):(r=l,0===Zt&&nr(te)),r!==l?(o=Br(),zt=e,e=Dt(o)):(Ht=e,e=l),e===l&&(r="",zt=e=Ht,e=r=Ut()),e}function _r(){var e;return Zt++,Y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=l,0===Zt&&nr(Ee)),Zt--,e===l&&(l,0===Zt&&nr(Oe)),e}function Sr(){var e,t;for(Zt++,e=[],t=_r();t!==l;)e.push(t),t=_r();return Zt--,t=l,0===Zt&&nr(Le),e}function Rr(){var e,r,o;for(Zt++,e=Ht,r=[],W.test(t.charAt(Ht))?(o=t.charAt(Ht),Ht++):(o=l,0===Zt&&nr(Re));o!==l;)r.push(o),W.test(t.charAt(Ht))?(o=t.charAt(Ht),Ht++):(o=l,0===Zt&&nr(Re));return(o=Ir())!==l?e=r=[r,o]:(Ht=e,e=l),Zt--,e===l&&(r=l,0===Zt&&nr(je)),e}function Ir(){var e;return Zt++,10===t.charCodeAt(Ht)?(e=M,Ht++):(e=l,0===Zt&&nr(Fe)),e===l&&(t.substr(Ht,2)===D?(e=D,Ht+=2):(e=l,0===Zt&&nr(Ve)),e===l&&(13===t.charCodeAt(Ht)?(e=U,Ht++):(e=l,0===Zt&&nr(Ne)),e===l&&(8232===t.charCodeAt(Ht)?(e=$,Ht++):(e=l,0===Zt&&nr(Me)),e===l&&(8233===t.charCodeAt(Ht)?(e=q,Ht++):(e=l,0===Zt&&nr(De)))))),Zt--,e===l&&(l,0===Zt&&nr(Ge)),e}function Or(){var e,r,o;for(Zt++,e=Ht,r=[],W.test(t.charAt(Ht))?(o=t.charAt(Ht),Ht++):(o=l,0===Zt&&nr(Re));o!==l;)r.push(o),W.test(t.charAt(Ht))?(o=t.charAt(Ht),Ht++):(o=l,0===Zt&&nr(Re));return(o=Ir())!==l?e=r=[r,o]:(Ht=e,e=l),Zt--,e===l&&(r=l,0===Zt&&nr(Ue)),e}function Er(){var e;return Zt++,X.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=l,0===Zt&&nr(qe)),Zt--,e===l&&(l,0===Zt&&nr($e)),e}function Lr(){var e,r;return(e=Or())===l&&(e=Ht,Zt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe)),Zt--,r===l?e=void 0:(Ht=e,e=l)),e}function jr(){var e,r;return e=Ht,Zt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=l,0===Zt&&nr(oe)),Zt--,r===l?e=void 0:(Ht=e,e=l),e}const Gr=new i.BitmarkPegParserHelper({parse:e,parserText:Qt,parserLocation:Vr}),Fr=new n.BitmarkPegParserProcessor({parse:e,parserText:Qt,parserLocation:Vr});function Vr(){const e=ir(zt,Ht);return e?(delete e.source,e):e}function ir(e,t,r){var o=or(e),i=or(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((s=p())!==l&&Ht===t.length)return s;throw s!==l&&Ht<t.length&&nr({type:"end"}),ar(Xt,Yt<t.length?t.charAt(Yt):null,Yt<t.length?ir(Yt,Yt+1):ir(Yt,Yt))}},4764:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(8159);function i(e){let t=e||"";return t=o.Breakscape.unbreakscape(t),t}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):u(e,{startRule:"bitmarkPlusString"})}function a(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):u(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function l(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function u(e,t){var r,o={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Go,bitmarkPlus:function(){var e,t;_o++,e=Ao,t=ni(),e,t=Yr(t),e=t,_o--,t=o,0===_o&&Lo(je);return e},bitmarkMinusMinus:function(){var e,t;_o++,e=Ao,t=di(),e,t=ho(t),e=t,_o--,t=o,0===_o&&Lo($t);return e},bitmarkPlusString:function(){var e;_o++,e=ni(),_o--,o,0===_o&&Lo(at);return e},bitmarkMinusMinusString:di},c=Go,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",C="•1 ",k="•+ ",x="•- ",B="\t",A="image",w=" ",P="#",K="@",_="width",S="height",R="=",I="𝑓",O="link:",E="var:",L="code:",j="color:",G="bold",F="italic",V="light",N="highlight",M="strike",D="sub",U="super",$="ins",q="del",J="aqua",H="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",oe="maroon",ie="navy",ne="olive",ae="orange",se="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Ce="\r\n",ke="\r",xe="\u2028",Be="\u2029",Ae="http",we="s",Pe="://",Ke="mailto:",_e="~",Se="^",Re="'",Ie=/^[ \t]/,Oe=/^[0-9]/,Ee=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Io("StyledText"),Ge=So("|",!1),Fe=So(":",!1),Ve=So("### ",!1),Ne=So("## ",!1),Me=So("# ",!1),De=So("code",!1),Ue=Ro([" ","\t"],!1,!1),$e=So("bitmark++",!1),qe=So("bitmark--",!1),Je=So("JavaScript",!1),He=So("• ",!1),ze=So("•1 ",!1),We=So("•+ ",!1),Ye=So("•- ",!1),Xe={type:"any"},Ze=So("\t",!1),Qe=So("image",!1),et=So(" ",!1),tt=So("#",!1),rt=So("@",!1),ot=Ro([["0","9"]],!1,!1),it=So("width",!1),nt=So("height",!1),at=Io("StyledString"),st=So("=",!1),lt=So("𝑓",!1),ut=So("link:",!1),ct=So("var:",!1),pt=So("code:",!1),gt=So("color:",!1),dt=So("bold",!1),yt=So("italic",!1),ft=So("light",!1),ht=So("highlight",!1),mt=So("strike",!1),Tt=So("sub",!1),bt=So("super",!1),vt=So("ins",!1),Ct=So("del",!1),kt=So("aqua",!1),xt=So("black",!1),Bt=So("blue",!1),At=So("pink",!1),wt=So("fuchsia",!1),Pt=So("lightgrey",!1),Kt=So("gray",!1),_t=So("darkgray",!1),St=So("green",!1),Rt=So("lime",!1),It=So("magenta",!1),Ot=So("maroon",!1),Et=So("navy",!1),Lt=So("olive",!1),jt=So("orange",!1),Gt=So("purple",!1),Ft=So("red",!1),Vt=So("silver",!1),Nt=So("teal",!1),Mt=So("violet",!1),Dt=So("white",!1),Ut=So("yellow",!1),$t=Io("MinimalStyledText"),qt=Io("MinimalStyledString"),Jt=So("*",!1),Ht=So("_",!1),zt=So("`",!1),Wt=So("!",!1),Yt=So("[!",!1),Xt=So("]",!1),Zt=Io("Line Terminator"),Qt=So("\n",!1),er=So("\r\n",!1),tr=So("\r",!1),rr=So("\u2028",!1),or=So("\u2029",!1),ir=(Io("whitespace in line"),Io("space"),Io("language tag separator"),Io("white space, separator"),Ro(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(Ro(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),So("http",!1)),ar=So("s",!1),sr=So("://",!1),lr=So("mailto:",!1),ur=Ro([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=So("~",!1),pr=So("^",!1),gr=So("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:a(t),attrs:{level:e.length-1}}},vr=function(e){return e},Cr=function(e,t){return Object.assign(Object.assign({},e),{content:t})},kr=function(){return{type:"codeBlock",language:""}},xr=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},Br=function(e){return[{type:"text",text:i(e.trim())}]},Ar=function(e){return e},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Pr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},_r=function(){return{type:"bulletList"}},Sr=function(){return{type:"orderedList"}},Rr=function(){return{type:"taskList"}},Ir=function(e,t,r,o){return o},Or=function(e,t,r,o){let i="bulletList";"•1 "==e&&(i="orderedList"),"•+ "!=e&&"•- "!=e||(i="taskList");let a=[{type:"paragraph",attrs:{},content:n((t+r.join("")).trim())}];if(o&&o[0]&&o[0].parent){let e={type:o[0].parent,attrs:{start:1},content:o,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),a.push(e)}let s="listItem",l={};if("taskList"==i){s="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:s,content:a,parent:i,attrs:l}},Er=function(e){return e},Lr=function(e){return e.join("")===Ii},jr=function(e){return e.length>Ii.length},Gr=function(e){Ri.push(Ii),Ii=e.join("")},Fr=function(){return Ii=Ri.pop(),!0},Vr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Mr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Dr=function(e){return e},Ur=function(e,t,r){const o=Object.assign({},...r);let i=o.captionAlign||"left";delete o.captionAlign;let n=o.alt||null;delete o.alt;let a=o.caption||null;delete o.caption;let s=o.align||"center";return delete o.align,{type:e,attrs:Object.assign({textAlign:i,src:t,alt:n,title:a,class:s},o)}},$r=function(e){return e},qr=function(e){return{comment:e}},Jr=function(e,t){return{[e]:parseInt(t)}},Hr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:i(e),type:"text"}},eo=function(e){return{index:+e,type:"bit"}},to=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ro=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},oo=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},io=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},no=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ao=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},so=function(e){return e},lo=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},uo=function(e){return{type:"var",attrs:{name:e.trim()}}},co=function(){return{type:"code",attrs:{language:"plain text"}}},po=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},go=function(e){return{type:"color",attrs:{color:e}}},yo=function(e){return{type:e}},fo=function(e){return{type:"comment",comment:e}},ho=function(e){return[{type:"paragraph",content:e,attrs:{}}]},mo=function(e,t){return e?[e,...t.flat()]:t.flat()},To=function(e){return{text:i(e),type:"text"}},bo=function(e){return{index:+e,type:"bit"}},vo=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Co=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},ko=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},xo=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},Bo=function(e,t){return{pr:e,t}},Ao=0,wo=[{line:1,column:1}],Po=0,Ko=[],_o=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function So(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ro(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Io(e){return{type:"other",description:e}}function Oo(t){var r,o=wo[t];if(o)return o;for(r=t-1;!wo[r];)r--;for(o={line:(o=wo[r]).line,column:o.column};r<t;)10===e.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return wo[t]=o,o}function Eo(e,t,r){var o=Oo(e),i=Oo(t),n={source:l,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&l&&"function"==typeof l.offset&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Lo(e){Ao<Po||(Ao>Po&&(Po=Ao,Ko=[]),Ko.push(e))}function jo(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function Go(){var e,t;if(_o++,e=[],(t=Fo())!==o)for(;t!==o;)e.push(t),t=Fo();else e=o;return e===o&&(e=function(){var e,t;return e=Ao,t="",e,t=Tr(),e=t,e}()),_o--,e===o&&(t=o,0===_o&&Lo(je)),e}function Fo(){var t,r;return t=Ao,r=function(){var t,r,i,n,a;if(t=Ao,r=Mo(),r!==o){for(i=Ao,n=[],a=Ki();a!==o;)n.push(a),a=Ki();i=e.substring(i,Ao),(n=_i())!==o?((a=Pi())===o&&(a=null),t,t=br(r,i)):(Ao=t,t=o)}else Ao=t,t=o;return t}(),r!==o&&(t,r=dr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r,i;if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=qo(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=_r());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=wr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o){if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Jo(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Sr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=Pr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o)if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Ho(),_o--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Rr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=Pi())===o&&(i=null),e,e=Kr(t,r)):(Ao=e,e=o)}else Ao=e,e=o}return e}(),r!==o&&(t,r=yr(r)),(t=r)===o&&(t=Ao,(r=ri())!==o&&(t,r=fr(r)),(t=r)===o&&(t=Ao,r=function(){var t,r,i;t=Ao,r=Uo(),r!==o?(i=function(){var t,r,i,n;t=Ao,r=Ao,i=[],n=$o();for(;n!==o;)i.push(n),n=$o();return r=e.substring(r,Ao),t,r=Br(r),t=r,t}(),t,t=Cr(r,i)):(Ao=t,t=o);return t}(),r!==o&&(t,r=hr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r;e=Ao,t=Ao,_o++,r=Vo(),_o--,r===o?t=void 0:(Ao=t,t=o);t!==o&&(r=Zo())!==o?(e,e=Vr(r)):(Ao=e,e=o);e===o&&(e=Ao,(t=ei())!==o&&(r=Zo())!==o?(e,e=Nr(r)):(Ao=e,e=o),e===o&&(e=Ao,(t=ei())!==o?(e,e=Mr(r="")):(Ao=e,e=o)));return e}(),r!==o&&(t,r=mr(r)),t=r)))),t}function Vo(){var e;return(e=Mo())===o&&(e=zo())===o&&(e=ri())===o&&(e=Uo())===o&&(e=ei()),e}function No(){var t;return 124===e.charCodeAt(Ao)?(t=p,Ao++):(t=o,0===_o&&Lo(Ge)),t}function Mo(){var t;return e.substr(Ao,4)===d?(t=d,Ao+=4):(t=o,0===_o&&Lo(Ve)),t===o&&(e.substr(Ao,3)===y?(t=y,Ao+=3):(t=o,0===_o&&Lo(Ne)),t===o&&(e.substr(Ao,2)===f?(t=f,Ao+=2):(t=o,0===_o&&Lo(Me)))),t}function Do(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,4)===h?(t=h,Ao+=4):(t=o,0===_o&&Lo(De)),t}(),r!==o?(t,t=vr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function Uo(){var t,r,i,n,a,s,l;if(t=Ao,Do()!==o){for(r=Ao,i=Ao,n=[],Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(Ue));a!==o;)n.push(a),Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(Ue));(a=_i())!==o?i=n=[n,a]:(Ao=i,i=o),(r=i!==o?e.substring(r,Ao):i)!==o?(t,t=kr()):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,Do()!==o)if(58===e.charCodeAt(Ao)?(r=g,Ao++):(r=o,0===_o&&Lo(Fe)),r!==o)if(i=function(){var t,r,i;e.substr(Ao,9)===m?(t=m,Ao+=9):(t=o,0===_o&&Lo($e));if(t===o&&(e.substr(Ao,9)===T?(t=T,Ao+=9):(t=o,0===_o&&Lo(qe)),t===o&&(e.substr(Ao,10)===b?(t=b,Ao+=10):(t=o,0===_o&&Lo(Je)),t===o))){if(t=Ao,r=[],(i=Ki())!==o)for(;i!==o;)r.push(i),i=Ki();else r=o;(t=r!==o?e.substring(t,Ao):r)===o&&(t="")}return t}(),i!==o){for(n=Ao,a=Ao,s=[],Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Ue));l!==o;)s.push(l),Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Ue));(l=_i())!==o?a=s=[s,l]:(Ao=a,a=o),(n=a!==o?e.substring(n,Ao):a)!==o?(t,t=xr(i)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function $o(){var t,r,i,n,a,s;if(t=Ao,r=Ao,_o++,i=Vo(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Ki())!==o)for(;s!==o;)a.push(s),s=Ki();else a=o;a!==o&&(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?(t,t=Ar(i)):(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=Pi()),t}function qo(){var t;return e.substr(Ao,2)===v?(t=v,Ao+=2):(t=o,0===_o&&Lo(He)),t}function Jo(){var t;return e.substr(Ao,3)===C?(t=C,Ao+=3):(t=o,0===_o&&Lo(ze)),t}function Ho(){var t;return e.substr(Ao,3)===k?(t=k,Ao+=3):(t=o,0===_o&&Lo(We)),t===o&&(e.substr(Ao,3)===x?(t=x,Ao+=3):(t=o,0===_o&&Lo(Ye))),t}function zo(){var e;return(e=qo())===o&&(e=Jo())===o&&(e=Ho()),e}function Wo(){var t,r,i,n,a,s,l,u;if(t=Ao,Xo()!==o)if((r=zo())!==o){for(i=Ao,n=Ao,a=[],s=Ao,l=Ao,_o++,u=Pi(),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Pi(),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);for((s=Pi())===o&&(s=null),n=a=[a,s],i=e.substring(i,Ao),n=[],a=Yo();a!==o;)n.push(a),a=Yo();if(a=Ao,s=function(){var t,r,i,n;t=Ao,_o++,r=Ao,i=[],9===e.charCodeAt(Ao)?(n=B,Ao++):(n=o,0===_o&&Lo(Ze));if(n!==o)for(;n!==o;)i.push(n),9===e.charCodeAt(Ao)?(n=B,Ao++):(n=o,0===_o&&Lo(Ze));else i=o;i!==o?(Ao,(n=(n=jr(i))?void 0:o)!==o?(r,r=Gr(i)):(Ao=r,r=o)):(Ao=r,r=o);_o--,r!==o?(Ao=t,t=void 0):t=o;return t}(),s!==o){for(l=[],u=Wo();u!==o;)l.push(u),u=Wo();u=function(){var e;Ao,e=Fr(),e=e?void 0:o;return e}(),u!==o?(a,a=Ir(r,i,n,l)):(Ao=a,a=o)}else Ao=a,a=o;a===o&&(a=null),t,t=Or(r,i,n,a)}else Ao=t,t=o;else Ao=t,t=o;return t}function Yo(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,r=Ao,_o++,i=function(){var t,r,i;t=Ao,r=[],Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===_o&&Lo(Ue));for(;i!==o;)r.push(i),Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===_o&&Lo(Ue));i=Pi(),i!==o?t=r=[r,i]:(Ao=t,t=o);return t}(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o)if((i=Xo())!==o)if(n=Ao,_o++,a=zo(),_o--,a===o?n=void 0:(Ao=n,n=o),n!==o){if(a=Ao,s=Ao,l=[],u=Ao,c=Ao,_o++,p=Pi(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=Pi(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;l!==o&&(u=_i())!==o?s=l=[l,u]:(Ao=s,s=o),(a=s!==o?e.substring(a,Ao):s)!==o?(t,t=Er(a)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function Xo(){var t,r,i;for(t=Ao,r=[],9===e.charCodeAt(Ao)?(i=B,Ao++):(i=o,0===_o&&Lo(Ze));i!==o;)r.push(i),9===e.charCodeAt(Ao)?(i=B,Ao++):(i=o,0===_o&&Lo(Ze));return Ao,(i=(i=Lr(r))?void 0:o)!==o?t=r=[r,i]:(Ao=t,t=o),t}function Zo(){var t,r,i;if(t=Ao,r=[],(i=Qo())!==o)for(;i!==o;)r.push(i),i=Qo();else r=o;return t=r!==o?e.substring(t,Ao):r}function Qo(){var t,r,i,n,a,s;if(t=Ao,r=Ao,_o++,i=Vo(),_o--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Ki())!==o)for(;s!==o;)a.push(s),s=Ki();else a=o;a!==o&&(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?t=r=[r,i]:(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=Pi()),t}function ei(){var t,r,i,n,a,s;if(t=Ao,(r=No())!==o){for(i=Ao,n=Ao,a=[],Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===_o&&Lo(Ue));s!==o;)a.push(s),Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===_o&&Lo(Ue));(s=_i())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?((n=Pi())===o&&(n=null),t=r=[r,i,n]):(Ao=t,t=o)}else Ao=t,t=o;return t}function ti(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,5)===A?(t=A,Ao+=5):(t=o,0===_o&&Lo(Qe)),t}(),r!==o?(t,t=Dr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function ri(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,(r=ti())!==o)if(58===e.charCodeAt(Ao)?(i=g,Ao++):(i=o,0===_o&&Lo(Fe)),i!==o)if(32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),a=function(){var t,r,i,n,a,s,l,u,c;t=Ao,r=Ao,e.substr(Ao,4)===Ae?(i=Ae,Ao+=4):(i=o,0===_o&&Lo(nr));if(i!==o)if(115===e.charCodeAt(Ao)?(n=we,Ao++):(n=o,0===_o&&Lo(ar)),n===o&&(n=null),e.substr(Ao,3)===Pe?(a=Pe,Ao+=3):(a=o,0===_o&&Lo(sr)),a!==o){for(s=[],l=Ao,u=Ao,_o++,c=No(),_o--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=Si())!==o?l=u=[u,c]:(Ao=l,l=o);l!==o;)s.push(l),l=Ao,u=Ao,_o++,c=No(),_o--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=Si())!==o?l=u=[u,c]:(Ao=l,l=o);r=i=[i,n,a,s]}else Ao=r,r=o;else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r;return t}(),a!==o)if(No()!==o){for(s=function(){var e,t,r;e=Ao,t=[],r=oi();for(;r!==o;)t.push(r),r=oi();return e,t=$r(t),e=t,e}(),l=Ao,u=Ao,c=[],Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Ue));p!==o;)c.push(p),Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(Ue));(p=_i())!==o?u=c=[c,p]:(Ao=u,u=o),(l=u!==o?e.substring(l,Ao):u)!==o?((u=Pi())===o&&(u=null),t,t=Ur(r,a,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function oi(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,35===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===_o&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=qr(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));if(s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Oe.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Oe.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===_o&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;(s=l!==o?e.substring(s,Ao):l)!==o&&(l=No())!==o?(t,t=Jr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=w,Ao++):(s=o,0===_o&&Lo(et));for(s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=Hr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===_o&&Lo(Fe))),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===_o&&Lo(Fe))),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);if(i=e.substring(i,Ao),58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===_o&&Lo(Fe)),n!==o){for(32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),s=Ao,l=[],u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,_o++,p=No(),_o--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=zr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=K,Ao++):(r=o,0===_o&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=Wr(i)):(Ao=t,t=o)}}}}return t}function ii(){var t;return e.substr(Ao,5)===_?(t=_,Ao+=5):(t=o,0===_o&&Lo(it)),t===o&&(e.substr(Ao,6)===S?(t=S,Ao+=6):(t=o,0===_o&&Lo(nt))),t}function ni(){var e,t,r,i;for(e=Ao,(t=ai())===o&&(t=null),r=[],(i=ci())===o&&(i=ai());i!==o;)r.push(i),(i=ci())===o&&(i=ai());return e,e=Xr(t,r)}function ai(){var t,r,i,n,a,s,l;if(t=Ao,(r=Pi())!==o&&(t,r=Zr()),(t=r)===o){if(t=Ao,r=Ao,i=[],n=Ao,(a=pi())===o&&(a=null),s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o)),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=pi())===o&&(a=null),s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,_o++,l=ci(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=Qr(r)),t=r}return t}function si(){var t;return 61===e.charCodeAt(Ao)?(t=R,Ao++):(t=o,0===_o&&Lo(st)),t}function li(){var t;return e.substr(Ao,2)===I?(t=I,Ao+=2):(t=o,0===_o&&Lo(lt)),t}function ui(){var e,t,r;return e=Ao,(t=si())!==o&&(r=si())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ci(){var t,r,i,n,a,s,l,u,c,g;if(t=Ao,(r=xi())!==o){if(i=Ao,n=[],Oe.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(ot)),a!==o)for(;a!==o;)n.push(a),Oe.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===_o&&Lo(ot));else n=o;(i=n!==o?e.substring(i,Ao):n)!==o&&(n=Bi())!==o?(t,t=eo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ui())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=ui())!==o?(l=function(){var t,r,i,n;t=Ao,124===e.charCodeAt(Ao)?(r=p,Ao++):(r=o,0===_o&&Lo(Ge));if(r!==o){for(i=[],n=gi();n!==o;)i.push(n),n=gi();t,t=so(i)}else Ao=t,t=o;return t}(),l===o&&(l=null),t,t=to(n,l)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=bi())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=bi())!==o?(t,t=ro(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=vi())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=vi())!==o?(t,t=oo(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=Ci())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=Ci())!==o?(t,t=io(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ki())!==o){for(32===e.charCodeAt(Ao)?(i=w,Ao++):(i=o,0===_o&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,_o++,u=Ao,32===e.charCodeAt(Ao)?(c=w,Ao++):(c=o,0===_o&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),_o--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===_o&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=w,Ao++):(a=o,0===_o&&Lo(et)),a===o&&(a=null),(s=ki())!==o?(t,t=no(n)):(Ao=t,t=o)}else Ao=t,t=o;t===o&&(t=Ao,r=function(){var t,r,i,n,a,s,l;t=Ao,r=Ao,i=Ao,e.substr(Ao,4)===Ae?(n=Ae,Ao+=4):(n=o,0===_o&&Lo(nr));n!==o?(115===e.charCodeAt(Ao)?(a=we,Ao++):(a=o,0===_o&&Lo(ar)),a===o&&(a=null),e.substr(Ao,3)===Pe?(s=Pe,Ao+=3):(s=o,0===_o&&Lo(sr)),s!==o?i=n=[n,a,s]:(Ao=i,i=o)):(Ao=i,i=o);i===o&&(e.substr(Ao,7)===Ke?(i=Ke,Ao+=7):(i=o,0===_o&&Lo(lr)));r=i!==o?e.substring(r,Ao):i;if(r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),t,t=Bo(r,i)}else Ao=t,t=o;return t}(),r!==o&&(t,r=ao(r)),t=r)}}}}}return t}function pi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=ui())!==o){if(n=[],(a=si())!==o)for(;a!==o;)n.push(a),a=si();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,i=function(){var e,t,r;return e=Ao,(t=li())!==o&&(r=li())!==o?e=t=[t,r]:(Ao=e,e=o),e}(),i!==o){if(n=[],(a=li())!==o)for(;a!==o;)n.push(a),a=li();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function gi(){var t,r,i,n,a,s,l;if(t=Ao,e.substr(Ao,5)===O?(r=O,Ao+=5):(r=o,0===_o&&Lo(ut)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=lo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,e.substr(Ao,4)===E?(r=E,Ao+=4):(r=o,0===_o&&Lo(ct)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=uo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,4)===h?(r=h,Ao+=4):(r=o,0===_o&&Lo(De)),r!==o&&(i=No())!==o?(t,t=co()):(Ao=t,t=o),t===o)){if(t=Ao,e.substr(Ao,5)===L?(r=L,Ao+=5):(r=o,0===_o&&Lo(pt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=po(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,6)===j?(r=j,Ao+=6):(r=o,0===_o&&Lo(gt)),r!==o?(i=function(){var t;e.substr(Ao,4)===J?(t=J,Ao+=4):(t=o,0===_o&&Lo(kt));t===o&&(e.substr(Ao,5)===H?(t=H,Ao+=5):(t=o,0===_o&&Lo(xt)),t===o&&(e.substr(Ao,4)===z?(t=z,Ao+=4):(t=o,0===_o&&Lo(Bt)),t===o&&(e.substr(Ao,4)===W?(t=W,Ao+=4):(t=o,0===_o&&Lo(At)),t===o&&(e.substr(Ao,7)===Y?(t=Y,Ao+=7):(t=o,0===_o&&Lo(wt)),t===o&&(e.substr(Ao,9)===X?(t=X,Ao+=9):(t=o,0===_o&&Lo(Pt)),t===o&&(e.substr(Ao,4)===Z?(t=Z,Ao+=4):(t=o,0===_o&&Lo(Kt)),t===o&&(e.substr(Ao,8)===Q?(t=Q,Ao+=8):(t=o,0===_o&&Lo(_t)),t===o&&(e.substr(Ao,5)===ee?(t=ee,Ao+=5):(t=o,0===_o&&Lo(St)),t===o&&(e.substr(Ao,4)===te?(t=te,Ao+=4):(t=o,0===_o&&Lo(Rt)),t===o&&(e.substr(Ao,7)===re?(t=re,Ao+=7):(t=o,0===_o&&Lo(It)),t===o&&(e.substr(Ao,6)===oe?(t=oe,Ao+=6):(t=o,0===_o&&Lo(Ot)),t===o&&(e.substr(Ao,4)===ie?(t=ie,Ao+=4):(t=o,0===_o&&Lo(Et)),t===o&&(e.substr(Ao,5)===ne?(t=ne,Ao+=5):(t=o,0===_o&&Lo(Lt)),t===o&&(e.substr(Ao,6)===ae?(t=ae,Ao+=6):(t=o,0===_o&&Lo(jt)),t===o&&(e.substr(Ao,6)===se?(t=se,Ao+=6):(t=o,0===_o&&Lo(Gt)),t===o&&(e.substr(Ao,3)===le?(t=le,Ao+=3):(t=o,0===_o&&Lo(Ft)),t===o&&(e.substr(Ao,6)===ue?(t=ue,Ao+=6):(t=o,0===_o&&Lo(Vt)),t===o&&(e.substr(Ao,4)===ce?(t=ce,Ao+=4):(t=o,0===_o&&Lo(Nt)),t===o&&(e.substr(Ao,6)===pe?(t=pe,Ao+=6):(t=o,0===_o&&Lo(Mt)),t===o&&(e.substr(Ao,5)===ge?(t=ge,Ao+=5):(t=o,0===_o&&Lo(Dt)),t===o&&(e.substr(Ao,6)===de?(t=de,Ao+=6):(t=o,0===_o&&Lo(Ut)))))))))))))))))))))));return t}(),i!==o&&(n=No())!==o?(t,t=go(i)):(Ao=t,t=o)):(Ao=t,t=o),t===o&&(t=Ao,r=function(){var t;e.substr(Ao,4)===G?(t=G,Ao+=4):(t=o,0===_o&&Lo(dt));t===o&&(e.substr(Ao,6)===F?(t=F,Ao+=6):(t=o,0===_o&&Lo(yt)),t===o&&(e.substr(Ao,5)===V?(t=V,Ao+=5):(t=o,0===_o&&Lo(ft)),t===o&&(e.substr(Ao,9)===N?(t=N,Ao+=9):(t=o,0===_o&&Lo(ht)),t===o&&(e.substr(Ao,6)===M?(t=M,Ao+=6):(t=o,0===_o&&Lo(mt)),t===o&&(e.substr(Ao,3)===D?(t=D,Ao+=3):(t=o,0===_o&&Lo(Tt)),t===o&&(e.substr(Ao,5)===U?(t=U,Ao+=5):(t=o,0===_o&&Lo(bt)),t===o&&(e.substr(Ao,3)===$?(t=$,Ao+=3):(t=o,0===_o&&Lo(vt)),t===o&&(e.substr(Ao,3)===q?(t=q,Ao+=3):(t=o,0===_o&&Lo(Ct))))))))));return t}(),r!==o&&(i=No())!==o?(t,t=yo(r)):(Ao=t,t=o),t===o)))if(t=Ao,35===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===_o&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=No(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=fo(i)):(Ao=t,t=o)}else Ao=t,t=o}}return t}function di(){var e,t,r,i;for(_o++,e=Ao,(t=yi())===o&&(t=null),r=[],(i=Ai())===o&&(i=yi());i!==o;)r.push(i),(i=Ai())===o&&(i=yi());return e,e=mo(t,r),_o--,t=o,0===_o&&Lo(qt),e}function yi(){var t,r,i,n,a,s,l;if(t=Ao,r=Ao,i=[],n=Ao,(a=wi())===o&&(a=null),s=Ao,_o++,l=Ai(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=wi())===o&&(a=null),s=Ao,_o++,l=Ai(),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o);else i=o;return(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=To(r)),(t=r)===o&&(t=Pi()),t}function fi(){var t;return 42===e.charCodeAt(Ao)?(t=ye,Ao++):(t=o,0===_o&&Lo(Jt)),t}function hi(){var t;return 95===e.charCodeAt(Ao)?(t=fe,Ao++):(t=o,0===_o&&Lo(Ht)),t}function mi(){var t;return 96===e.charCodeAt(Ao)?(t=he,Ao++):(t=o,0===_o&&Lo(zt)),t}function Ti(){var t;return 33===e.charCodeAt(Ao)?(t=me,Ao++):(t=o,0===_o&&Lo(Wt)),t}function bi(){var e,t,r;return e=Ao,(t=fi())!==o&&(r=fi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function vi(){var e,t,r;return e=Ao,(t=hi())!==o&&(r=hi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function Ci(){var e,t,r;return e=Ao,(t=mi())!==o&&(r=mi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ki(){var e,t,r;return e=Ao,(t=Ti())!==o&&(r=Ti())!==o?e=t=[t,r]:(Ao=e,e=o),e}function xi(){var t;return e.substr(Ao,2)===Te?(t=Te,Ao+=2):(t=o,0===_o&&Lo(Yt)),t}function Bi(){var t;return 93===e.charCodeAt(Ao)?(t=be,Ao++):(t=o,0===_o&&Lo(Xt)),t}function Ai(){var t,r,i,n,a,s,l,u,c;if(t=Ao,xi()!==o){if(r=Ao,i=[],Oe.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===_o&&Lo(ot)),n!==o)for(;n!==o;)i.push(n),Oe.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===_o&&Lo(ot));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(i=Bi())!==o?(t,t=bo(r)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,bi()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=bi())!==o?(t,t=vo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,vi()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=vi())!==o?(t,t=Co(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,Ci()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=Ci())!==o?(t,t=ko(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,ki()!==o){for(32===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===_o&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,_o++,l=Ao,32===e.charCodeAt(Ao)?(u=w,Ao++):(u=o,0===_o&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),_o--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===_o&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=w,Ao++):(n=o,0===_o&&Lo(et)),n===o&&(n=null),(a=ki())!==o?(t,t=xo(i)):(Ao=t,t=o)}else Ao=t,t=o}}}return t}function wi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=bi())!==o){if(n=[],(a=fi())!==o)for(;a!==o;)n.push(a),a=fi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=vi())!==o){if(n=[],(a=hi())!==o)for(;a!==o;)n.push(a),a=hi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function Pi(){var t;return _o++,10===e.charCodeAt(Ao)?(t=ve,Ao++):(t=o,0===_o&&Lo(Qt)),t===o&&(e.substr(Ao,2)===Ce?(t=Ce,Ao+=2):(t=o,0===_o&&Lo(er)),t===o&&(13===e.charCodeAt(Ao)?(t=ke,Ao++):(t=o,0===_o&&Lo(tr)),t===o&&(8232===e.charCodeAt(Ao)?(t=xe,Ao++):(t=o,0===_o&&Lo(rr)),t===o&&(8233===e.charCodeAt(Ao)?(t=Be,Ao++):(t=o,0===_o&&Lo(or)))))),_o--,t===o&&(o,0===_o&&Lo(Zt)),t}function Ki(){var t;return Ee.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===_o&&Lo(ir)),t}function _i(){var t,r;return(t=Pi())===o&&(t=Ao,_o++,e.length>Ao?(r=e.charAt(Ao),Ao++):(r=o,0===_o&&Lo(Xe)),_o--,r===o?t=void 0:(Ao=t,t=o)),t}function Si(){var t;return Le.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===_o&&Lo(ur)),t===o&&(126===e.charCodeAt(Ao)?(t=_e,Ao++):(t=o,0===_o&&Lo(cr)),t===o&&(94===e.charCodeAt(Ao)?(t=Se,Ao++):(t=o,0===_o&&Lo(pr)),t===o&&(39===e.charCodeAt(Ao)?(t=Re,Ao++):(t=o,0===_o&&Lo(gr))))),t}var Ri=[],Ii="";if(e=e.trimStart(),(r=c())!==o&&Ao===e.length)return r;throw r!==o&&Ao<e.length&&Lo({type:"end"}),jo(Ko,Po<e.length?e.charAt(Po):null,Po<e.length?Eo(Po,Po+1):Eo(Po,Po))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var s=this.location.end,u=l("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===s.line?s.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+l("",i.column-1," ")+l("",p,"^")}else t+="\n at "+a}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=u},297:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const i=r(8256),n=r(2606),a=r(549),s=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,a.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,o,i){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){const o=e.value,i=n.Config.getBitConfig(o.bitType),a=n.Config.getBitResourcesConfig(o.bitType,o.resourceType);if(this.writeOPD(),this.writeString(o.bitType.alias),o.textFormat){this.isWriteTextFormat(o.textFormat)&&(this.writeColon(),this.writeString(o.textFormat))}let s;if(i.resourceAttachmentAllowed&&o.resources&&o.resources.length>0){const e=a.comboResourceTagTypesMap;if(a.comboResourceTagTypesMap.size>0)for(const t of e.keys())s=t;else s=o.resources[0].type}s&&(this.writeAmpersand(),this.writeString(s)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,o,i){const n=[a.NodeType.bitType,a.NodeType.textFormat,a.NodeType.level,a.NodeType.progress,a.NodeType.toc,a.NodeType.referenceEnd,a.NodeType.labelFalse];e.value.book&&n.push(a.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const i=null==t?void 0:t.value;i&&(""!=o&&this.writeProperty(g.PropertyTag.labelTrue,o,!0),i.labelFalse&&""!=i.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,i.labelFalse,!0))}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:i,mockupId:n,size:s,format:l,trim:u}=o;this.writeProperty("imageSource",i,!0),i&&(n&&this.writeProperty("mockupId",n,!0),s&&this.writeProperty("size",s,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o;this.writeProperty("partner",i,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.markConfig)return;const{mark:i,color:n,emphasis:s}=o;i&&(this.writeProperty("mark",i,!0),n&&this.writeProperty("color",n,!0),s&&this.writeProperty("emphasis",s,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",e.value)}enter_itemLead(e,t,r){const o=e.value;o&&(o.item||o.lead)&&(this.writeOPC(),this.writeString(o.item||""),this.writeCL(),o.lead&&(this.writeOPC(),this.writeString(o.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const o=e.value;o&&0===o.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&(this.writeOPE(),this.writeString(i),this.writeCL())}leaf_mark(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&this.writeProperty("mark",i,!0)}enter_optionsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_textsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,o,i){this.isRootBitType1(i)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,o,i){r.key===a.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===a.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===a.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===a.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,o,i){this.isRootBitType(i,s.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_choices(e,t,r,o,i){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_responses(e,t,r,o,i){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,o,i){r.key!==a.NodeType.choices&&r.key!==a.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,o,i){}enter_keyAudio(e,t,r){const o=e.value;this.writeResource(o)}enter_keyImage(e,t,r){const o=e.value;this.writeResource(o)}enter_matrix(e,t,r){}between_matrix(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,o,i){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,o,i){r.key===a.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,o,i){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const o=e.value;o&&this.write(o)}between_resources(e,t,r,o,i){this.writeNL()}enter_resourcesValue(e,t,r){const o=e.value;this.writeResource(o)}enter_posterImage(e,t,r){const o=e.value;o&&o.value&&this.writeProperty("posterImage",o.value)}enter_thumbnails(e,t,r){const o=e.value;if(Array.isArray(o)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<o.length&&t!==e.length;t++){const r=o[t],i=e[t];this.writeProperty(i,r.value,!0)}}}leaf_title(e,t,r){const o=e.value,i=(null==t?void 0:t.value).level||1;if(i&&o){this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_subtitle(e,t,r){const o=e.value;if(o){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_book(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(this.writeProperty("book",e.value),o.reference&&(this.writeOPRANGLE(),this.writeString(o.reference),this.writeCL(),o.referenceEnd&&(this.writeOPRANGLE(),this.writeString(o.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(o.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const o=e.value;o&&(this.writeOPQ(),this.writeString(o),this.writeCL())}leaf_instruction(e,t,r){const o=e.value;o&&(this.writeOPB(),this.writeString(o),this.writeCL())}leaf_example(e,t,r){var o,i;const n=e.value,a=null!==(o=null==t?void 0:t.value.isExample)&&void 0!==o&&o,s=null!==(i=null==t?void 0:t.value.isDefaultExample)&&void 0!==i&&i;a&&(s?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),this.writeCL()))}leaf_bodyText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_footerText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_isCaseSensitive(e,t,r){this.writeProperty("isCaseSensitive",e.value,!0,!1,!0)}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==a.NodeType.questionsValue&&(null==t?void 0:t.key)!==a.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const o=e.value;this.writeProperty("caption",o)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==a.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{null!=e.value&&(null==t?void 0:t.key)===a.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},this[o]=this[o].bind(this)}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,o,i){let n,a=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)if(void 0!==t){if(o&&!1===t)continue;if(i&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),a=!0}}a||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(y.TextFormat.fromValue(e)===y.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,s.RootBitType.trueFalse1)||this.isRootBitType(e,s.RootBitType.multipleChoice1)||this.isRootBitType(e,s.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const i=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.BitmarkGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const n=r(8256),a=r(8159),s=r(2606),l=r(549),u=r(208),c=r(8791),p=r(1060),g=r(7028),d=r(7204),y=r(7953),f=r(9779),h=r(1353),m=r(406),T=r(7646),b=r(672),v=r(3633),C=r(169),k={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new m.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=c.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:c.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},k),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===c.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,l.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var o,i,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const l=s.Config.getBitConfig(a.bitType),c=!!l.rootExampleType,p=l.rootExampleType===g.ExampleType.boolean;if(c){let e;p?(e=!0,a.bitType.root===u.RootBitType.trueFalse1&&void 0!==(null===(i=null===(o=a.cardNode)||void 0===o?void 0:o.statement)||void 0===i?void 0:i.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:p});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{url:i,mockupId:n,size:a,format:s,trim:u}=o,c={};this.addProperty(c,"url",null!=i?i:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=s?s:null,!0),this.addProperty(c,"trim",b.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o,a={};if(this.addProperty(a,"name",null!=i?i:"",!0),n){const e=this.parseResourceToJson(n);e&&e.type===f.ResourceTag.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.markConfig)return;const{mark:i,color:n,emphasis:a}=o,s={};this.addProperty(s,"mark",null!=i?i:"unknown",!0),n&&this.addProperty(s,"color",null!=n?n:"",!0),a&&this.addProperty(s,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(s)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===l.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const o=e.value,{item:i,lead:n}=o;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(null!=i&&(this.bitJson.item=this.toTextAstOrString(i,h.TextFormat.bitmarkMinusMinus)),null!=n&&(this.bitJson.lead=this.toTextAstOrString(n,h.TextFormat.bitmarkMinusMinus)))}enter_extraProperties(e,t,r){const o=e.value;if(!this.options.excludeUnknownProperties&&o)for(const[e,t]of Object.entries(o)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const o=e.value,i=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",l=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const u=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text){const e=t.data.bodyText;s=a.Breakscape.concatenate(s,e)}else{const{legacyPlaceholderKey:e,placeholderKey:t}=u(l);s=a.Breakscape.concatenate(s,i?e:t),l++}}this.bitJson.body=this.toTextAstOrString(s,n);const c=this.bitJson.body;l=0;for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:a}=u(l);switch(t.type){case p.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case p.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case p.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case p.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(i?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[a]=n):this.replacePlaceholderWithBodyBit(c,n,l)),l++}return!1}enter_elements(e,t,r){const o=e.value;o&&o.length>0&&(this.bitJson.elements=a.Breakscape.unbreakscape(o))}enter_flashcards(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",answer:null!==(i=a.Breakscape.unbreakscape(e.answer))&&void 0!==i?i:"",alternativeAnswers:null!==(n=a.Breakscape.unbreakscape(e.alternativeAnswers))&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,c.push(t)}c.length>0&&(this.bitJson.cards=c)}enter_statement(e,t,r){var o,i;const n=e.value;(null==t?void 0:t.key)===l.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(o=a.Breakscape.unbreakscape(n.text))&&void 0!==o?o:"",this.bitJson.isCorrect=null!==(i=n.isCorrect)&&void 0!==i&&i)}enter_statements(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(i=e.itemLead)||void 0===i?void 0:i.item)&&delete t.item,null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.statements=u)}enter_choices(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.choices=u)}enter_responses(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_quizzes(e,t,r){var o,i,n,s,l,u,c,p;const g=e.value,d=[];if(g)for(const e of g){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(r.text))&&void 0!==o?o:"",isCorrect:null!==(i=r.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const o=Object.assign(Object.assign({response:null!==(s=a.Breakscape.unbreakscape(t.text))&&void 0!==s?s:"",isCorrect:null!==(l=t.isCorrect)&&void 0!==l&&l},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete o.lead,r.push(o)}const g=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(c=e.isExample)&&void 0!==c&&c,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(p=e.itemLead)||void 0===p?void 0:p.lead)&&delete g.lead,d.push(g)}d.length>0&&(this.bitJson.quizzes=d)}enter_heading(e,t,r){var o,i;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const l={forKeys:null!==(o=a.Breakscape.unbreakscape(n.forKeys))&&void 0!==o?o:""};Array.isArray(n.forValues)?n.forValues.length>1?l.forValues=a.Breakscape.unbreakscape(n.forValues):1===n.forValues.length?l.forValues=a.Breakscape.unbreakscape(n.forValues[0]):l.forValues=a.Breakscape.unbreakscape(n.forValues):l.forValues=null!==(i=a.Breakscape.unbreakscape(n.forValues))&&void 0!==i?i:"",this.bitJson.heading=l}enter_pairs(e,t,r){var o,i,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(o=a.Breakscape.unbreakscape(e.key))&&void 0!==o?o:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(i=a.Breakscape.unbreakscape(e.values))&&void 0!==i?i:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var o,i,n,s,l,u;const c=e.value,p=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],s=Object.assign(Object.assign(Object.assign({values:null!==(o=a.Breakscape.unbreakscape(r.values))&&void 0!==o?o:[]},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(i=r.isCaseSensitive)||void 0===i||i}),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(n=r.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=a.Breakscape.unbreakscape(e.key))&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var o,i,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",partialAnswer:null!==(i=a.Breakscape.unbreakscape(T.ArrayUtils.asSingle(e.partialAnswer)))&&void 0!==i?i:"",sampleSolution:null!==(n=a.Breakscape.unbreakscape(e.sampleSolution))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.response))&&void 0!==o?o:"",reaction:null!==(i=a.Breakscape.unbreakscape(e.reaction))&&void 0!==i?i:"",feedback:null!==(n=a.Breakscape.unbreakscape(e.feedback))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,c.push(t)}c.length>0&&(this.bitJson.responses=c)}enter_resources(e,t,r){var o;const i=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!i||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=i.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),i=null!==(o=null==e?void 0:e.jsonKey)&&void 0!==o?o:t.typeAlias,n=this.parseResourceToJson(t);if(n)for(const[e,t]of Object.entries(n))"type"!==e&&(r[i]=t)}}l=r}else i.length>=1&&(l=this.parseResourceToJson(i[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_level(e,t,r){var o;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(o=e.value)&&void 0!==o?o:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus))}leaf_instruction(e,t,r){const o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus))}leaf_footerText(e,t,r){const o=e.value;this.bitJson.footer=this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus)}leaf_markup(e,t,r){const o=e.value;o&&(this.bitWrapperJson.bitmark=o)}enter_parser(e,t,r){const o=e.value;if(o){const{version:e,excessResources:r,warnings:n,errors:a}=o,s=i(o,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},s),{warnings:n,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===y.PropertyTag.example)continue;if(t===y.PropertyTag.imageSource)continue;if(t===y.PropertyTag.partner)continue;if(t===d.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{var i;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const a=null!==(i=r.jsonKey)&&void 0!==i?i:r.tag;this.addProperty(this.bitJson,a,n,r.single)},this[o]=this[o].bind(this)}}createGapJson(e){var t;const r=e.data,o=r.solutions&&r.solutions.length>0?r.solutions[0]:"",i=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:o,isBoolean:!1})),{solutions:a.Breakscape.unbreakscape(r.solutions)});return i.lead||delete i.lead,i}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:a.Breakscape.unbreakscape(t.solution),mark:a.Breakscape.unbreakscape(t.mark)},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,o,i;const n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(e.text),isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,s.push(r)}const l=Object.assign(Object.assign({type:"select",prefix:null!==(r=a.Breakscape.unbreakscape(n.prefix))&&void 0!==r?r:"",postfix:null!==(o=a.Breakscape.unbreakscape(n.postfix))&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(i=n.isExample)&&void 0!==i&&i,options:s});return l.lead||delete l.lead,l}createHighlightJson(e){var t,r,o,i,n;const s=e.data,l=[];for(const e of s.texts){const o=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(e.text),isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));o.item||delete o.item,o.lead||delete o.lead,o.hint||delete o.hint,l.push(o)}const u=Object.assign(Object.assign({type:"highlight",prefix:null!==(o=a.Breakscape.unbreakscape(s.prefix))&&void 0!==o?o:"",postfix:null!==(i=a.Breakscape.unbreakscape(s.postfix))&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:l});return u.lead||delete u.lead,u}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case f.ResourceTag.image:t={type:f.ResourceTag.image,image:this.addImageResource(e)};break;case f.ResourceTag.imageLink:t={type:f.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e)};break;case f.ResourceTag.audio:t={type:f.ResourceTag.audio,audio:this.addAudioResource(e)};break;case f.ResourceTag.audioEmbed:t={type:f.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case f.ResourceTag.audioLink:t={type:f.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e)};break;case f.ResourceTag.video:t={type:f.ResourceTag.video,video:this.addVideoResource(e)};break;case f.ResourceTag.videoEmbed:t={type:f.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case f.ResourceTag.videoLink:t={type:f.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e)};break;case f.ResourceTag.stillImageFilmEmbed:t={type:f.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case f.ResourceTag.stillImageFilmLink:t={type:f.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case f.ResourceTag.article:t={type:f.ResourceTag.article,article:this.addArticleResource(e)};break;case f.ResourceTag.document:t={type:f.ResourceTag.document,document:this.addDocumentResource(e)};break;case f.ResourceTag.documentEmbed:t={type:f.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case f.ResourceTag.documentLink:t={type:f.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case f.ResourceTag.documentDownload:t={type:f.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case f.ResourceTag.appLink:t={type:f.ResourceTag.appLink,appLink:this.addAppLinkResource(e)};break;case f.ResourceTag.websiteLink:t={type:f.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,o;const i={};if(v.StringUtils.isString(e)){const t=e;e={type:f.ResourceTag.image,typeAlias:f.ResourceTag.image,value:t,format:C.UrlUtils.fileExtensionFromUrl(t),provider:C.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(i.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(i.src=a.Breakscape.unbreakscape(e.value)),null!=e.src1x&&(i.src1x=a.Breakscape.unbreakscape(e.src1x)),null!=e.src2x&&(i.src2x=a.Breakscape.unbreakscape(e.src2x)),null!=e.src3x&&(i.src3x=a.Breakscape.unbreakscape(e.src3x)),null!=e.src4x&&(i.src4x=a.Breakscape.unbreakscape(e.src4x)),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=a.Breakscape.unbreakscape(e.alt))&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addImageLinkResource(e){var t,r,o;const i={};if(v.StringUtils.isString(e)){const t=e;e={type:f.ResourceTag.imageLink,typeAlias:f.ResourceTag.imageLink,value:t,format:C.UrlUtils.fileExtensionFromUrl(t),provider:C.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(i.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(i.url=a.Breakscape.unbreakscape(e.value)),null!=e.src1x&&(i.src1x=a.Breakscape.unbreakscape(e.src1x)),null!=e.src2x&&(i.src2x=a.Breakscape.unbreakscape(e.src2x)),null!=e.src3x&&(i.src3x=a.Breakscape.unbreakscape(e.src3x)),null!=e.src4x&&(i.src4x=a.Breakscape.unbreakscape(e.src4x)),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=a.Breakscape.unbreakscape(e.alt))&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addAudioResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.src=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.src=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.src=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.src=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(o.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(o.url=a.Breakscape.unbreakscape(e.value)),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=a.Breakscape.unbreakscape(e.alt)),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addArticleResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.body=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=a.Breakscape.unbreakscape(e.format)),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=a.Breakscape.unbreakscape(e.value)),null!=e.siteName&&(t.siteName=a.Breakscape.unbreakscape(e.siteName)),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var o,i,n,s,l,u,c,p;return r?(null!=e.license&&(t.license=null!==(o=a.Breakscape.unbreakscape(e.license))&&void 0!==o?o:""),null!=e.copyright&&(t.copyright=null!==(i=a.Breakscape.unbreakscape(e.copyright))&&void 0!==i?i:""),null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),null!=e.showInIndex&&(t.showInIndex=null!==(n=e.showInIndex)&&void 0!==n&&n),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(s=e.caption)&&void 0!==s?s:"",h.TextFormat.bitmarkMinusMinus))):(t.license=null!==(l=a.Breakscape.unbreakscape(e.license))&&void 0!==l?l:"",t.copyright=null!==(u=a.Breakscape.unbreakscape(e.copyright))&&void 0!==u?u:"",null!=e.provider&&(t.provider=a.Breakscape.unbreakscape(e.provider)),t.showInIndex=null!==(c=e.showInIndex)&&void 0!==c&&c,t.caption=this.toTextAstOrString(null!==(p=e.caption)&&void 0!==p?p:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)),t}toItemLeadHintInstruction(e){var t,r,o,i,n,s;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),lead:this.toTextAstOrString(null!==(i=null===(o=e.itemLead)||void 0===o?void 0:o.lead)&&void 0!==i?i:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),hint:this.toTextAstOrString(null!==(n=e.hint)&&void 0!==n?n:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),instruction:this.toTextAstOrString(null!==(s=e.instruction)&&void 0!==s?s:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)}}toExample(e,t){const{isExample:r,example:o,isDefaultExample:i}=e,{defaultExample:n,isBoolean:a}=t;if(!r)return{isExample:!1,example:null};let s;return s=i?a?b.BooleanUtils.toBoolean(n):this.toTextAstOrString(n,h.TextFormat.bitmarkMinusMinus):a?b.BooleanUtils.toBoolean(o):this.toTextAstOrString(o,h.TextFormat.bitmarkMinusMinus),{isExample:!0,example:s}}addProperty(e,t,r,o){if(void 0!==r){let i;Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(r=a.Breakscape.unbreakscape(r),i=Array.isArray(r)&&o&&r.length>=1?r[r.length-1]:r),e[t]=i}}getBitType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){var t;for(const r of e)if(r.key===l.NodeType.bitsValue){const e=r.value;return null!==(t=h.TextFormat.fromValue(null==e?void 0:e.textFormat))&&void 0!==t?t:h.TextFormat.bitmarkMinusMinus}return h.TextFormat.bitmarkMinusMinus}getResourceType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}toTextAstOrString(e,t){if(this.options.textAsPlainText||t===h.TextFormat.text)return a.Breakscape.unbreakscape(e);return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const o=(e,i,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(o(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return i[n]=t,!0;if(e.content){if(o(e.content,e,"content"))return!0}}return!1};o(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,partialAnswer:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case u.RootBitType._error:break;case u.RootBitType.article:case u.RootBitType.sampleSolution:case u.RootBitType.page:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==u.AliasBitType.articleAi&&t.alias!==u.AliasBitType.noteAi&&t.alias!==u.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case u.RootBitType.cloze:case u.RootBitType.multipleChoice1:case u.RootBitType.multipleResponse1:case u.RootBitType.multipleChoiceText:case u.RootBitType.highlightText:case u.RootBitType.clozeAndMultipleChoiceText:case u.RootBitType.sequence:case u.RootBitType.mark:case u.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.multipleChoice:case u.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case u.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case u.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case u.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.learningPathBook:case u.RootBitType.learningPathExternalLink:case u.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.pageBuyButton:null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.lang&&delete e.lang,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const i=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const i=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const i=r(8256),n=r(8159),a=r(549),s=r(8791),l=r(1353),u=r(1888),c=r(2610),p={debugGenerationInline:!1},g={[u.TextMarkType.bold]:"**",[u.TextMarkType.light]:"``",[u.TextMarkType.italic]:"__",[u.TextMarkType.highlight]:"!!"},d=new RegExp(/(\n|\r\n)/,"g"),y=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.textFormat=l.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},p),t),this.bitmarkVersion,s.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return o(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:l.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,a.NodeType.textAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){return this.handleEnterNode(e.value)}between_textAstValue(e,t,r,o,i){return this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){return this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){return this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){return this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case c.TextNodeType.paragraph:this.writeParagraph(e);break;case c.TextNodeType.hardBreak:this.writeHardBreak(e);break;case c.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case c.TextNodeType.heading:this.writeHeading(e);break;case c.TextNodeType.section:this.writeSection(e);break;case c.TextNodeType.listItem:case c.TextNodeType.taskItem:this.writeBullet(e);break;case c.TextNodeType.image:this.writeImage(e);break;case c.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case c.TextNodeType.gap:case c.TextNodeType.select:case c.TextNodeType.highlight:return this.writeBodyBit(e),!1}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case c.TextNodeType.text:this.writeMarks(e,!1);break;case c.TextNodeType.paragraph:this.textFormat!==l.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case c.TextNodeType.heading:case c.TextNodeType.section:case c.TextNodeType.image:this.writeNL(),this.writeNL();break;case c.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===c.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===u.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;this.inCodeBlock;let t=e.text;if(t=n.Breakscape.breakscape(t),this.currentIndent>1){const e=this.getIndentationString();t=t.replace(d,`$1${e}`)}this.write(t)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=n.Breakscape.breakscape(e.text);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(d,`$1${e}`)}return t.replace(y,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks){const r=1===e.marks.length,o=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:return r?g[t.type]:"==";case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:case u.TextMarkType.comment:return"==";case u.TextMarkType.link:}return e}),void 0);if(null!=o&&(this.writeMarkTextWrapper(o),!t)){let t=!1;for(const o of e.marks)switch(o.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0);break;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0;break;case u.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(o),t=!0;case u.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let o="";const i=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+i;e++)o+="#";o+=" ",this.write(o)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let o=this.getIndentationString();if(e.parent===c.TextNodeType.bulletList)o+="• ";else if(e.parent===c.TextNodeType.orderedList)o+="•1 ";else if(e.parent===c.TextNodeType.taskList){o+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}o&&this.write(o)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,o]of Object.entries(t))switch(e){case"textAlign":"left"!==o&&(r+=`@captionAlign:${o}|`);break;case"title":o&&(r+=`@caption:${o}|`);break;case"class":"center"!==o&&o&&(r+=`@align:${o}|`);break;case"comment":o&&(r+=`#${o}|`);break;case"alt":case"width":case"height":default:o&&(r+=`@${e}:${o}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,o]of Object.entries(e.attrs))("language"===r&&"plain text"!==o||"color"===r)&&(t=`${t}:${o}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},9677:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoBuilder=void 0;const o=r(2606),i=r(208);t.InfoBuilder=class{getSupportedBits(e){var t,r;const n=null===(t=null==e?void 0:e.includeNonDeprecated)||void 0===t||t,a=null!==(r=null==e?void 0:e.includeDeprecated)&&void 0!==r&&r,s=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),l=o.Config.getBitConfig(r),u=this.getSupportedBitAliases(t,e);(u.length>0||n&&!l.deprecated||a&&l.deprecated)&&s.push({name:t,since:l.since,deprecated:l.deprecated,aliases:u})}return s}getSupportedBitConfigs(){const e=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),n=o.Config.getBitConfig(r);e.push(n)}return e}getSupportedBitAliases(e,t){var r,n;const a=null===(r=null==t?void 0:t.includeNonDeprecated)||void 0===r||r,s=null!==(n=null==t?void 0:t.includeDeprecated)&&void 0!==n&&n,l=[];for(const t of i.AliasBitType.values()){const r=o.Config.getBitType(t);if(r.root===e){const e=o.Config.getBitConfig(r);(a&&!e.deprecated||s&&e.deprecated)&&l.push({name:r.alias,since:e.since,deprecated:e.deprecated})}}return l}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const o=r(1022),i=r(671);r(2606);let n=!1;t.init=function(){n||((0,i.initEnv)(o.buildInfo.name,o.buildInfo.version),n=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",flashcards:"flashcards",flashcardsValue:"flashcardsValue",answer:"answer",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=o},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,o,i,n,a,s,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=o,this.minCount=i,this.chain=n,this.jsonKey=a,this.astKey=s,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const o=r(1035);t.BitConfig=class{constructor(e,t,r,o,i,n,a,s,l,u,c,p,g){this.tags={},this.since=e,this.rootBitType=t.root,this.aliases=r,this.tags=o,this.cardSet=i,this.deprecated=n,this.bodyAllowed=a,this.bodyRequired=s,this.footerAllowed=l,this.footerRequired=u,this.resourceAttachmentAllowed=c,this.rootExampleType=p,this.comboResourceType=g}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.rootBitType}`;this.aliases.length>0&&(r+="\n\n[Aliases]",r+=`\n${this.aliases.join(", ")}`);const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&i.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===o.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",o=0,i=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${o}, Variant ${i}]`,r+=`\n${n.toString(t)}`,i++;o++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,o){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=o}toString(e){const t=Object.assign({},e);let r="";const o=[];this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),null!=this.repeatCount&&o.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a){super(o.BitTagType.tag,e,t,r,i,n,void 0,void 0,a),this.type=o.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s,l,u,c,p){super(o.BitTagType.property,e,t,r,i,n,a,s,p),this.type=o.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s){super(o.BitTagType.resource,e,t,r,i,n,a,void 0,s),this.type=o.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,o){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=o}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const o=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses"});t.CardSetConfigKey=o},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const o=r(6688),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=(0,o.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},s.tagConfigKeys),n.propertyConfigKeys),a.resourceConfigKeys),i.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[s.tagConfigKeys,n.propertyConfigKeys,a.resourceConfigKeys,i.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const o=r(6688),i={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=i;const n=(0,o.superenum)(i);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const o=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=o},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const o=r(6688),i={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"};t.propertyConfigKeys=i;const n=(0,o.superenum)(i);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const o=r(6688),i={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=i;const n=(0,o.superenum)(i);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const o=r(6688),i={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource",remark:"remark",comment:"comment"};t.tagConfigKeys=i;const n=(0,o.superenum)(i);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const o=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=o},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AliasBitType=t.RootBitType=void 0;const o=r(6688),i=(0,o.superenum)({_error:"_error",appBitmarkFromJavascript:"app-bitmark-from-javascript",appFlashcards:"app-flashcards",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",bookAlias:"book-alias",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",page:"page",pageBuyButton:"page-buy-button",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",vendorJupyterOutput:"vendor-jupyter-output",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=i;const n=(0,o.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",buttonCopyText:"button-copy-text",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",detailsImage:"details-image",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageMood:"image-mood",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageScreenshot:"image-screenshot",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",lifeSkillSticker:"life-skill-sticker",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",output:"output",pageBanner:"page-banner",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stdout:"stdout",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=n},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const o=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=o},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const o=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=o;const i=o.v3;t.DEFAULT_BITMARK_VERSION=i},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const o=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=o},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const o=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=o},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const o=(0,r(6688).superenum)({infinity:"infinity"});t.Count=o},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=o},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const o=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",markConfig:"markConfig"});t.PropertyAstKey=o},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=o},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const o=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",sampleSolution:"sampleSolution",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"});t.PropertyTag=o},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const o=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=o},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=o},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&",remark:"::",comment:"||"});t.Tag=o},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const o=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=o},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const o=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=o},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const o=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=o},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const o=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=o},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const o=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=o},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const o=r(2434),i=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return(0,i.parse)(e)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4369).parse;t.parse=o},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const o=r(8565),i=r(3633),n=r(7542),a=r(6831);r(2606);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const o=e.trim();if(this.debugPrint("RAW BIT",o),!o)return;const i=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},a=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",i)});return a.value&&(a.value.markup=o),a}handleTextFormat(e){return{type:a.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:a.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:a.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:a.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},o={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:o,parser:i}=e;if(!t||t!==a.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:s,cardVariantIndex:l,value:u}=o;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[s];p||(p={variants:[]},c.sides[s]=p);p.variants[l]?p.variants[l].value+=u:p.variants[l]={value:u,parser:i}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==i.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};o.cards.push(r);for(const o of t.sides){const t={variants:[]};r.sides.push(t);for(const r of o.variants){let o={line:1,column:1,offset:0};if(r.parser.location){o=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,i=1;o.offset+=t,o.line+=i}let i=this.parse(r.value,{startRule:"cardContent",grammarSource:new n.PeggyGrammarLocation("card-content",o)});i=this.reduceToArrayOfTypes(i),this.debugPrint("parsedCardContent",i),t.variants.push({parser:e,content:i})}}}}return{type:a.TypeKey.CardSet,value:o,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,i=!1,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===o.CardSetVersion.v1?(r=e===a.CARD_DIVIDER_V1,i=e===a.CARD_SIDE_DIVIDER_V1,n=e===a.CARD_VARIANT_DIVIDER_V1):(r=e===a.CARD_DIVIDER_V2,i=e===a.CARD_SIDE_DIVIDER_V2,n=e===a.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,a.TypeKey.Card)?e:{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,o,i,n,s;const l=[];let u,c;for(const p of e)switch(p.type){case a.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:a.TypeKey.BodyText,value:null!==(o=p.value)&&void 0!==o?o:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case a.TypeKey.CardChar:if(c){const e=`${null!==(i=c.value)&&void 0!==i?i:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:a.TypeKey.CardText,value:null!==(s=p.value)&&void 0!==s?s:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(p)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!a.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,o,i)=>{if(null==o)return e;const{type:n,value:a}=o;if(Array.isArray(o)){const r=this.reduceToArrayOfTypes(o,t);e.push(...r)}else{if(!this.isType(o,t))return e;if(r&&Array.isArray(a)){const r=this.reduceToArrayOfTypes(a,t);e.push(...r)}else n&&e.push(o)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(8386),g=r(1182),d=r(6934),y=r(8081),f=r(9577),h=r(2786),m=r(857),T=r(3287),b=r(3130),v=r(5516),C=r(1838),k=r(4177),x=r(6831),B=new i.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this),state:{}}}buildBits(e){var t;const r=[];let o=[];for(const i of e){if(!i)continue;const e=i.value;e?r.push(e):o=o.concat(null!==(t=i.errors)&&void 0!==t?t:[])}return B.bitmark({bits:r,errors:o.length>0?o:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const l=r.root===s.RootBitType.trueFalse1,u=r.root===s.RootBitType.multipleChoice1,c=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=p.BitmarkPegParserValidator.validateBitTags(this.context,r,n,t);const d=a.Config.getBitConfig(r),y=this.bitContentProcessor(r,x.BitContentLevel.Bit,d.tags,t),{body:f,footer:h,cardSet:m,title:T,statement:b,statements:k,choices:A,responses:w,resources:P,comments:K}=y,_=o(y,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",_),this.debugPrint("BIT BODY",f),this.debugPrint("BIT FOOTER",h);const S=(0,C.buildTitles)(this.context,r,T),R=(0,g.buildCards)(this.context,r,m,b,k,A,w),I=(0,v.buildResources)(this.context,r,n,P);(K||R.comments)&&(this.parser.comments=[],K&&this.parser.comments.push(...K),R.comments&&this.parser.comments.push(...R.comments));const O=this.buildBitLevelWarnings(),E=this.buildBitLevelErrors();O&&(this.parser.warnings=O),E&&(this.parser.errors=E);return{value:B.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:i,resourceType:n},S),{statement:l?b:void 0,choices:u?A:void 0,responses:c?w:void 0}),_),{resources:I}),R),{body:f,footer:h,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:B.bit({bitType:a.Config.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const o=a.Config.getBitType(e);return o.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:o,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:c.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:c.TextFormat.bitmarkMinusMinus},o=e=>{var t;e&&(e.type===x.TypeKey.TextFormat?(r.textFormat=c.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${c.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:c.TextFormat.bitmarkMinusMinus):(r.resourceType=u.ResourceTag.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return o(e),o(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,o){const i={};if(!o)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let a=!1,s=!1,l=!1;const u=[];let c=n.Breakscape.EMPTY_STRING,g=n.Breakscape.EMPTY_STRING,A=n.Breakscape.EMPTY_STRING;const w=t===x.BitContentLevel.Chain,P=()=>{if(c){c=p.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,c);const r=B.bodyText({text:c});u.push(r)}c=n.Breakscape.EMPTY_STRING};return o.forEach(((o,p)=>{const{type:B,value:K}=o;switch(B){case x.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.ItemLead:(0,h.itemLeadTagContentProcessor)(this.context,e,t,r,o,i,a),a=!0;break;case x.TypeKey.Instruction:case x.TypeKey.Hint:case x.TypeKey.Anchor:case x.TypeKey.SampleSolution:(0,y.defaultTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Reference:(0,b.referenceTagContentProcessor)(this.context,e,t,r,o,i,s),s=!0;break;case x.TypeKey.Title:(0,C.titleTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Property:(0,T.propertyContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Gap:w||P(),(0,f.gapChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.Mark:w||P(),(0,m.markChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.True:case x.TypeKey.False:w||P(),(0,k.trueFalseChainContentProcessor)(this.context,e,t,r,o,i,u);break;case x.TypeKey.Resource:(0,v.resourceContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.CardSet:i.cardSet=K,l=!0;break;case x.TypeKey.BodyText:l?g=n.Breakscape.concatenate(g,K):c=n.Breakscape.concatenate(c,K);break;case x.TypeKey.CardText:A=n.Breakscape.concatenate(A,K)}})),P(),i.body=u.length>0?B.body({bodyParts:this.trimBodyParts(u)}):void 0,p.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),g=g.trim(),g&&(g=p.BitmarkPegParserValidator.checkFooter(this.context,e,t,g),g&&(i.footer=B.footerText({text:g}))),A=A.trim(),A&&(i.cardBody=A),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let o=[];for(const i of e)t.includes(i.type)&&(o.length>0&&r.push(o),o=[]),o.push(i);return o.length>0&&r.push(o),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.push(r);else{const r=o.data.bodyText.trimStart();r&&(t=!0,o.data.bodyText=r,e.push(o))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.unshift(r);else{const r=o.data.bodyText.trimEnd();r&&(t=!0,o.data.bodyText=r,e.unshift(o))}return e}),[]),r}addWarning(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalWarnings.push(a)}addError(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalErrors.push(a)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const o=r(6688),i=r(8739);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const n=(0,o.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:i.Tag.title,Anchor:i.Tag.anchor,Reference:i.Tag.reference,ItemLead:i.Tag.itemLead,Instruction:i.Tag.instruction,Hint:i.Tag.hint,True:i.Tag.true,False:i.Tag.false,Gap:i.Tag.gap,Mark:i.Tag.mark,SampleSolution:i.Tag.sampleSolution,Comment:i.Tag.comment,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const a=(0,o.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=a},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const o=r(2606),i=r(742),n=r(1035),a=r(6831),s=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],l=["==\n","---\n","--\n"],u=["\n==","\n---","\n--"];const c=new class{validateBitTags(e,t,r,i){if(!i)return[];const n=o.Config.getBitConfig(t),{tags:s,cardSet:l}=n,u=o.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},s),u.tags);return this.validateTagChainsRecursive(e,t,a.BitContentLevel.Bit,i,c,l)}checkBody(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{bodyAllowed:a}=n;return i.bodyParts.length>0&&!a&&e.addWarning(`Bit '${t.alias}' should not have a body.`),i}checkBodyPart(e,t,r,o){return o?(this.checkBodyForCommonPotentialMistakes(e,r,t,o),o):o}checkFooter(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{footerAllowed:a}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),a||e.addWarning(`Bit '${t.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,n,a,s){if(!i)return i;const l=o.Config.getBitConfig(t);if(!l.cardSet)return i;const u=this.getVariantConfig(l.cardSet.variants,a,s);if(!u)return i;const{bodyAllowed:c}=u;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),c||e.addWarning(`Bit '${t.alias}' should not have a card body at card:${n+1}, side:${a+1}, variant:${s+1}.`),i}validateTagChainsRecursive(e,t,r,o,i,s){if(!o)return[];const l=[...o],u=this.convertTagsToTypeKeyMap(e,r,t,i),c=(e,t,r)=>{u.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};c(a.TypeKey.Comment,n.Count.infinity,0),r===a.BitContentLevel.Bit?(s&&c(a.TypeKey.CardSet,1,0),c(a.TypeKey.TextFormat,1,0),c(a.TypeKey.BodyText,n.Count.infinity,0)):r===a.BitContentLevel.Card&&c(a.TypeKey.CardText,n.Count.infinity,0);for(let o=0;o<l.length;o++){const i=l[o];if(!i)continue;const{type:n,key:c}=i,p=a.TypeKey.fromValue(n);if(!p)continue;let g=p;p!==a.TypeKey.Property&&p!==a.TypeKey.Resource||(g=`${p}:${c}`);const d=u.get(g),y=this.validateSingleTag(e,t,r,i,p,d,s);if(y||l.splice(o,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,a.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==a.TypeKey.Resource&&(l.splice(o+1,0,...y.chain),y.chain=void 0)}for(const t of u.values()){const{minCount:r,_seenCount:o}=t;if(null!=r&&o<r){const o=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(o)}}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,o,i,n,s){const{type:l,key:u}=o,c=n?this.getTagSignature(n):this.getUnknownTagSignature(l,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,i){case a.TypeKey.Property:{const{content:i,warning:a}=this.validatePropertyTag(e,r,t,n,o);g=i,d=a;break}case a.TypeKey.Resource:{const{content:i,warning:a}=this.validateResourceTag(e,r,t,n,o);g=i,d=a;break}case a.TypeKey.CardSet:{const{content:r,warning:i}=this.validateCardSet(e,t,n,o,s);g=r,d=i;break}default:{const{content:i,warning:a}=this.validateStandardTag(e,r,t,n,o);g=i,d=a}}else switch(i){case a.TypeKey.Property:d={extraProperty:!0},g=o;break;case a.TypeKey.Resource:d={excessResource:!0},g=o;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,o,t)}return n&&(n._previous=o),g}validateStandardTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validatePropertyTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateResourceTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateCardSet(e,t,r,o,i){if(!i||!i.variants||0===i.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=o,s=n;let l,u=0,c=0;for(const r of s.cards){u=0;for(const o of r.sides){c=0;for(const r of o.variants){const n=r.content;let s;const p=this.getVariantConfig(i.variants,u,c);p?s=this.validateTagChainsRecursive(e,t,a.BitContentLevel.Card,n,p.tags):l={unexpectedCardSideVariant:!0},s&&s.length>0?o.variants[c]={parser:r.parser,content:s}:o.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:o,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,o){if(o){for(const t of s)o.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)o.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of u)o.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,o){const n=new Map;for(const e of Object.values(o)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===i.BitTagType.tag,isProperty:e.type===i.BitTagType.property,isResource:e.type===i.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${a.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${a.TypeKey.Resource}:${e.tag}`,t);else{const r=a.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let o;if(0===e.length)return;const i=e[Math.min(t,e.length-1)],a=i.length-1;if(r>a){if(o=i[a],o.repeatCount!==n.Count.infinity)return}else o=i[r];return o}getTagSignature(e){switch(e._type){case i.BitTagType.tag:return`[${e._tag}]`;case i.BitTagType.property:return`[@${e._tag}]`;case i.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case a.TypeKey.Property:return`[@${t}]`;case a.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=c},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const o=r(3633),i=r(6831);t.bookChainContentProcessor=function(e,t,r,n,a,s){if(r===i.BitContentLevel.Chain);else{const r=function(e,t,r,n,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",a);const s=e.bitContentProcessor(t,i.BitContentLevel.Chain,n,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:l,referenceEnd:u}=s,c=o.StringUtils.trimmedString(a.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,a);s.book=r.book,s.reference=r.reference,s.referenceEnd=r.referenceEnd}}},1182:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(2574),l=r(208),u=r(9779),c=r(8386),p=r(6831),g=new i.Builder;t.buildCards=function(e,t,r,i,d,y,f){var h;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let m={};const T=function(e,t,r){const o={cards:[],comments:[]};if(!r)return o;let i=0,n=0,s=0;for(const l of r.cards){const r={no:i++,sides:[]};o.cards.push(r);for(const i of l.sides){const l={no:n++,variants:[]};r.sides.push(l);for(const u of i.variants){const{parser:i,content:g}=u,d={parser:i,no:s++};l.variants.push(d);const y=a.Config.getTagsConfigForCardSet(t,n,s),f=e.bitContentProcessor(t,p.BitContentLevel.Card,y,g);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",f),f.cardBody=c.BitmarkPegParserValidator.checkCardBody(e,t,p.BitContentLevel.Card,f.cardBody,r.no,l.no,d.no),d.data=f,f.comments&&o.comments.push(...f.comments)}s=0}n=0}return o}(e,t,r);switch(null===(h=a.Config.getBitConfig(t).cardSet)||void 0===h?void 0:h.configKey){case s.CardSetConfigKey._flashcards:m=function(e,t,r){const i=[];let a,s,u=n.Breakscape.EMPTY_STRING,c=[],p=0,d=0,y={};const f=t.alias===l.AliasBitType.flashcard1;for(const l of r.cards){u=n.Breakscape.EMPTY_STRING,a=void 0,c=[],d=0,y={};for(const e of l.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,i=o(e,["cardBody"]);y=Object.assign(Object.assign({},y),i),0===d?(s=t,u=null!=r?r:n.Breakscape.EMPTY_STRING):1===d?a=null!=r?r:n.Breakscape.EMPTY_STRING:c.push(null!=r?r:n.Breakscape.EMPTY_STRING),d++}if(0!==p&&f){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${u}'`,s);break}i.push(g.flashcard(Object.assign({question:u,answer:a,alternativeAnswers:c.length>0?c:void 0},y))),p++}return{flashcards:i.length>0?i:void 0}}(e,t,T);break;case s.CardSetConfigKey._elements:m=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;i.push(null!==(o=t.cardBody)&&void 0!==o?o:n.Breakscape.EMPTY_STRING)}return{elements:i.length>0?i:void 0}}(0,0,T);break;case s.CardSetConfigKey._statements:m=function(e,t,r,i,n){const a=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,i=o(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=g.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),i));a.push(t)}}i&&a.push(i);Array.isArray(n)&&n.length>0&&a.push(...n);return{statements:a.length>0?a:void 0}}(0,0,T,i,d);break;case s.CardSetConfigKey._quiz:m=function(e,t,r,i,a){const s=[],u=t.root===l.RootBitType.multipleChoice,c=t.root===l.RootBitType.multipleResponse;if(!u&&!c)return{};let p,d=!1;for(const e of r.cards){d=!1,p=n.Breakscape.EMPTY_STRING;for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:i}=t,n=o(t,["isDefaultExample","example"]);if(d=!0===r||d,p=i||p,n.trueFalse&&n.trueFalse.length>0){const e=[],t=c?g.response:g.choice;for(const r of n.trueFalse){const{isDefaultExample:i,example:n}=r,a=o(r,["isDefaultExample","example"]),s=i||d,l=n||p,u=t(Object.assign(Object.assign({},a),{isDefaultExample:s,example:l}));e.push(u)}c?n.responses=e:n.choices=e}const a=g.quiz(Object.assign(Object.assign({},n),{isDefaultExample:d,example:p}));s.push(a)}}if(u&&Array.isArray(i)&&i.length>0){const e=g.quiz({choices:i});s.push(e)}if(c&&Array.isArray(a)&&a.length>0){const e=g.quiz({responses:a});s.push(e)}return{quizzes:s.length>0?s:void 0}}(0,t,T,y,f);break;case s.CardSetConfigKey._questions:m=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=g.question(Object.assign({question:null!==(o=t.cardBody)&&void 0!==o?o:n.Breakscape.EMPTY_STRING},t));i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,T);break;case s.CardSetConfigKey._matchPairs:m=function(e,t,r){let i,a=0;const s=[];let l;const c=[];let p,d,y,f,h,m=[],T={},b=!1,v=!1;for(const e of r.cards){l=void 0,p=void 0,m=[],d=void 0,y=void 0,a=0,T={},v=!1,h=n.Breakscape.EMPTY_STRING;for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:i,resources:s,isDefaultExample:g,example:C}=t,k=o(t,["cardBody","title","resources","isDefaultExample","example"]);v=!0===g||v,h=C||h;const x=i&&i[1];if(0===a)if(null!=x)l=x,b=!0===g||b,f=C||f;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===u.ResourceTag.audio?d=e:e.type===u.ResourceTag.image&&(y=e)}else p=r;else if(null!=x)c.push(x),b=!0===g||b,f=C||f;else if(null==i){const e=null!=r?r:n.Breakscape.EMPTY_STRING;m.push(e),!b&&!v||h||(h=e)}T=Object.assign(Object.assign({},T),k)}a++}if(null!=l)i=g.heading({forKeys:l,forValues:c});else{v&&(f=void 0);const e=v||b,t=h||f,r=g.pair(Object.assign(Object.assign({key:null!=p?p:n.Breakscape.EMPTY_STRING,keyAudio:d,keyImage:y,values:m},T),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:i,pairs:s.length>0?s:void 0}}(0,0,T);break;case s.CardSetConfigKey._matchMatrix:m=function(e,t,r){let i,a,s=0;const l=[];let u;const c=[];let p,d,y,f,h,m=[],T=[],b={},v=!1,C=!1,k=!1;for(const e of r.cards){a=void 0,u=void 0,m=[],T=[],s=0,C=!1,d=n.Breakscape.EMPTY_STRING,f=void 0;for(const t of e.sides){T=[],b={},k=!1,y=n.Breakscape.EMPTY_STRING,h=void 0;for(const e of t.variants){const t=e.data,{title:r,cardBody:i,isDefaultExample:c,example:g,isCaseSensitive:m}=t,x=o(t,["title","cardBody","isDefaultExample","example","isCaseSensitive"]);k=!0===c||k,y=g||y,Object.assign(b,x);const B=r&&r[1];if(0===s)null!=B?(a=B,v=!0===c||v,p=g||p):(u=i,C=!0===c||C,d=g||d,f=null!=m?m:f);else if(null!=B)l.push(B),v=!0===c||v,p=g||p;else if(null==t.title){const e=null!=i?i:n.Breakscape.EMPTY_STRING;T.push(e),!v&&!k||y||(y=e),h=null!=m?m:f}}if(s>0){k&&(d=p=void 0),C&&(p=void 0);const e=k||C||v,t=y||d||p,r=g.matrixCell(Object.assign(Object.assign({values:T},b),{isDefaultExample:e,example:t,isCaseSensitive:h}));m.push(r)}s++}if(null!=a)i=g.heading({forKeys:a,forValues:l});else{const e=g.matrix({key:null!=u?u:n.Breakscape.EMPTY_STRING,cells:m});c.push(e)}}return{heading:i,matrix:c.length>0?c:void 0}}(0,0,T);break;case s.CardSetConfigKey._botActionResponses:m=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:a,cardBody:s}=t,l=o(t,["instruction","reaction","cardBody"]),u=g.botResponse(Object.assign({response:null!=r?r:n.Breakscape.EMPTY_STRING,reaction:null!=a?a:n.Breakscape.EMPTY_STRING,feedback:null!=s?s:n.Breakscape.EMPTY_STRING},l));i.push(u)}return{botResponses:i.length>0?i:void 0}}(0,0,T)}return m.comments=T.comments.length>0?T.comments:void 0,m}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const o=r(3633);t.clozeTagContentProcessor=function(e,t,r,i,n,a){const{value:s}=n,l=a.solutions;if(l&&o.StringUtils.isString(s)){const e=o.StringUtils.trimmedString(s);l.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const o=r(9046),i=r(3633),n=new o.Builder;t.commentTagContentProcessor=function(e,t,r,o,a,s){if(!s.comments)return;const{value:l}=a,u=i.StringUtils.isString(l)?l:"",c=n.comment({text:u,location:a.parser.location});s.comments.push(c)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.defaultTagContentProcessor=function(e,t,r,n,a,s){const{type:l,value:u}=a,c=o.StringUtils.trimmedString(u);switch(l){case i.TypeKey.Instruction:s.instruction=c;break;case i.TypeKey.Hint:s.hint=c;break;case i.TypeKey.Anchor:s.anchor=c;break;case i.TypeKey.Reference:s.reference=c;break;case i.TypeKey.SampleSolution:s.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",a)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const o=r(208),i=r(672);function n(e,t,r,o,i){!0===o?(i.isDefaultExample=!0,i.example=void 0):i.example=o}t.exampleTagContentProcessor=function(e,t,r,a,s){const{value:l}=a,u=l;switch(t.root){case o.RootBitType.cloze:case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:!function(e,t,r,a,s){var l,u;let c;Array.isArray(s.trueFalse)&&s.trueFalse.length>0&&(c=null!==(l=s.trueFalse[s.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===a?(c.isDefaultExample=!0,c.example=void 0):i.BooleanUtils.isBooleanString(a)?c.example=a:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(s.solutions)&&s.solutions.length>0)s.example=!0===a?null!==(u=s.solutions[s.solutions.length-1])&&void 0!==u?u:void 0:a;else switch(t.root){default:case o.RootBitType.cloze:n(e,t,r,a,s);break;case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:!function(e,t,r,o,n){!0===o?(n.isDefaultExample=!0,n.example=void 0):i.BooleanUtils.isBooleanString(o)?n.example=o:(n.isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,a,s);break;case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:s.isDefaultExample=!0,s.example=void 0,!0!==a&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,t,a,u,s);break;case o.RootBitType.mark:!function(e,t,r,o,i){i.isDefaultExample=!0,i.example=void 0,!0!==o&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,a,u,s);break;default:n(e,t,a,u,s)}}},9577:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(4471),s=r(6831),l=new i.Builder;t.gapChainContentProcessor=function(e,t,r,i,u,c,p){if(r===s.BitContentLevel.Chain)(0,a.clozeTagContentProcessor)(e,t,r,i,u,c);else{const r=function(e,t,r,i,a){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",a);const c=n.Config.getTagConfigForTag(i,a.type),p=[a,...null!==(u=a.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=o(g,["solutions"]),f=l.gap(Object.assign({solutions:null!=d?d:[]},y));return f}(e,t,0,i,u);r&&p.push(r)}}},8664:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.imageSourceChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(3633),l=r(6831),u=new i.Builder;t.imageSourceChainContentProcessor=function(e,t,r,i,c,p){r===l.BitContentLevel.Chain?function(e,t,r,o,i,n){const{value:a}=i,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,c,p):function(e,t,r,i,s,c){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:p}=s,g=a.Config.getTagConfigForTag(i,p),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,i,[s]),y=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==g?void 0:g.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",y);const{imageSourceUrl:f}=d,{mockupId:h}=y,m=o(y,["mockupId"]);f||e.addWarning("[@imageSource] is missing the image url",s);h||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const T=u.imageSource(Object.assign({url:null!=f?f:n.Breakscape.EMPTY_STRING,mockupId:null!=h?h:n.Breakscape.EMPTY_STRING},m));c.imageSource=T}(e,t,0,i,c,p)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const o=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.lead=u:a.item=u}},857:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(7646),l=r(3298),u=r(6831),c=new i.Builder;t.markChainContentProcessor=function(e,t,r,i,p,g,d){if(r===u.BitContentLevel.Chain)(0,l.markTagContentProcessor)(e,u.BitContentLevel.Chain,t,p,g);else{const r=function(e,t,r,i,l){var p;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",l);const g=a.Config.getTagConfigForTag(i,l.type),d=e.bitContentProcessor(t,u.BitContentLevel.Chain,i,[l]),y=e.bitContentProcessor(t,u.BitContentLevel.Chain,null==g?void 0:g.chain,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",y);const{solution:f}=d,{mark:h}=y,m=o(y,["mark"]),T=c.mark(Object.assign({solution:null!=f?f:n.Breakscape.EMPTY_STRING,mark:null!==(p=s.ArrayUtils.asSingle(h))&&void 0!==p?p:n.Breakscape.EMPTY_STRING},m));return T}(e,t,0,i,p);r&&d.push(r)}}},2595:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(3633),s=r(6831),l=new i.Builder;t.markConfigChainContentProcessor=function(e,t,r,i,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(i,g),f=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=o(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=a.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const o=r(3633);t.markTagContentProcessor=function(e,t,r,i,n){const{value:a}=i;o.StringUtils.isString(a)&&(n.solution=a)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const o=r(9046),i=r(9779),n=r(3633),a=r(6831),s=new o.Builder;t.partnerChainContentProcessor=function(e,t,r,o,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,a.BitContentLevel.Chain,o,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const o=[];if(t)for(const e of t.reverse())r||i.ResourceTag.image!==e.type?o.push(e):r=e;o.length>0&&(e.parser.excessResources=o,e.addWarning(`${o.length} excess resource(s) present in the [@parter] chain.`));return r}(e,p),y=s.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const o=r(2606),i=r(3518),n=r(5486),a=r(672),s=r(994),l=r(3633),u=r(4185),c=r(4787),p=r(8664),g=r(2595),d=r(8326),y=r(6831);t.propertyContentProcessor=function(e,t,r,f,h,m){const{key:T,value:b}=h,v=r===y.BitContentLevel.Chain,C=o.Config.getTagConfigForTag(f,T),k=C?C.configKey:void 0;if(C){if(k===i.PropertyConfigKey.example)return void(0,c.exampleTagContentProcessor)(e,t,r,h,m);if(k===i.PropertyConfigKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,C.chain,h,m);if(k===i.PropertyConfigKey.imageSource)return void(0,p.imageSourceChainContentProcessor)(e,t,r,f,h,m);if(k===i.PropertyConfigKey.book)return void(0,u.bookChainContentProcessor)(e,t,r,C.chain,h,m);if(k===i.PropertyConfigKey.markConfig&&!v)return void(0,g.markConfigChainContentProcessor)(e,t,r,f,h,m)}const x=(e,t,r,o)=>{if(r=(e=>{if(null!=e){if(o)switch(o.format){case n.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return s.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return a.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!a.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==o?void 0:o.astKey)&&(t=o.astKey),null==o?void 0:o.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t];e[t]=[...o,r]}else e[t]=[r]};x(C?m:m.extraProperties,T,b,C)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const o=r(3633);t.referenceTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.referenceEnd=u:a.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const o=r(8703),i=r(2606),n=r(1035),a=r(9779),s=r(6831),l=new o.ResourceBuilder;t.buildResources=function(e,t,r,o){var s,l;const u=[],c=[],p=a.ResourceTag.fromValue(r),g=i.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(o)for(const e of o.reverse()){let t=null!==(s=y.get(e.typeAlias))&&void 0!==s?s:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,o,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=a.ResourceTag.fromValue(p);if(f){const r=i.Config.getTagConfigForTag(o,p),n=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==r?void 0:r.chain,d),a=l.resource(Object.assign({type:f,value:g},n));a&&y.push(a)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const o=r(208),i=r(3633);t.titleTagContentProcessor=function(e,t,r,o,n,a){const{value:s}=n,l=a.title;if(!l)return;const u=s,c=i.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var i,n;switch(r=null!=r?r:[],t.root){case o.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case o.RootBitType.book:default:return{title:null!==(i=r[1])&&void 0!==i?i:void 0,subtitle:null!==(n=r[2])&&void 0!==n?n:void 0}}}},4177:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const i=r(9046),n=r(208),a=r(8660),s=r(6831),l=new i.Builder;t.trueFalseChainContentProcessor=function(e,t,r,i,u,c,p){r===s.BitContentLevel.Chain?(0,a.trueFalseTagContentProcessor)(e,s.BitContentLevel.Chain,t,u,c):function(e,t,r,i,a,u,c){var p;const g=[a,...null!==(p=a.chain)&&void 0!==p?p:[]],d=u.statements,y=u.choices,f=u.responses;if(!(d&&y&&f&&c))return;if(t.root===n.RootBitType.trueFalse1)u.statement=function(e,t,r,i){if(t.root!==n.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const a=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:u}=a,c=o(a,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",c);let p;u&&u.length>0&&(p=l.statement(Object.assign(Object.assign({},u[0]),c)));return p}(e,t,i,g);else if(t.root===n.RootBitType.trueFalse||t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1||t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1){const r=function(e,t,r,i){const a=t.root===n.RootBitType.trueFalse,u=t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1,c=t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1;if(!a&&!u&&!c)return{};const p=[],g=[],d=[],y=e.splitBitContent(i,[s.TypeKey.True,s.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",y);for(const i of y){const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:y}=n,f=o(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),a){if(y&&y.length>0){const e=l.statement(Object.assign(Object.assign({},y[0]),f));p.push(e)}}else if(u){if(y&&y.length>0){const e=l.choice(Object.assign(Object.assign({},y[0]),f));g.push(e)}}else if(c&&y&&y.length>0){const e=l.response(Object.assign(Object.assign({},y[0]),f));d.push(e)}}const f={};a?f.statements=p:u?f.choices=g:c&&(f.responses=d);return f}(e,t,i,g);r.statements&&d.push(...r.statements),r.choices&&y.push(...r.choices),r.responses&&f.push(...r.responses)}else if(t.root===n.RootBitType.highlightText){const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=l.highlight(Object.assign({texts:c},u));return p}(e,t,i,g);r&&c.push(r)}else{const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.selectOption(e));const p=l.select(Object.assign({options:c},u));return p}(e,t,i,g);r&&c.push(r)}}(e,t,0,i,u,c,p)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,n,a){const{type:s,value:l}=n,u=a.trueFalse;if(!u)return;const c=o.StringUtils.trimmedString(l);u.push({text:c,isCorrect:s===i.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const o=r(9046),i=r(8703),n=r(8159),a=r(2606),s=r(6300),l=r(208),u=r(1060),c=r(9779),p=r(1353),g=r(3633),d=r(406),y=new o.Builder,f=new i.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator,this.textParser=new d.TextParser}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,o=this.bitToAst(t);o&&r.push(o)}const o=r.length>0?{bits:r}:{};return y.bitmark(o)}preprocessJson(e){const t=[];if(g.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return a.Config.getBitType(t.type).root!==l.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:o,id:i,externalId:n,spaceId:s,padletId:l,jupyterId:u,jupyterExecutionCount:c,AIGenerated:g,releaseVersion:d,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:k,colorTag:x,flashcardSet:B,subtype:A,bookAlias:w,coverImage:P,publisher:K,publications:_,author:S,date:R,location:I,theme:O,kind:E,action:L,thumbImage:j,focusX:G,focusY:F,duration:V,deeplink:N,externalLink:M,externalLinkText:D,videoCallLink:U,bot:$,list:q,textReference:J,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:re,subtitle:oe,level:ie,toc:ne,progress:ae,anchor:se,reference:le,referenceEnd:ue,item:ce,lead:pe,hint:ge,instruction:de,example:ye,imageSource:fe,partner:he,marks:me,resource:Te,body:be,sampleSolution:ve,elements:Ce,statement:ke,isCorrect:xe,cards:Be,statements:Ae,responses:we,quizzes:Pe,heading:Ke,pairs:_e,matrix:Se,choices:Re,questions:Ie,footer:Oe,placeholders:Ee}=e,Le=a.Config.getBitType(r),je=null!==(t=p.TextFormat.fromValue(o))&&void 0!==t?t:p.TextFormat.bitmarkMinusMinus,Ge=this.getResourceType(Te),Fe=this.resourceBitToAst(Te),Ve=this.bodyToAst(be,je,Ee),Ne=this.imageSourceBitToAst(fe),Me=this.partnerBitToAst(he),De=this.markConfigBitToAst(me),Ue=this.flashcardBitsToAst(Be),$e=this.statementBitsToAst(ke,xe,Ae,ye),qe=this.responseBitsToAst(Le,we),Je=this.quizBitsToAst(Le,Pe),He=this.headingBitToAst(Ke),ze=this.pairBitsToAst(_e),We=this.matrixBitsToAst(Se),Ye=this.choiceBitsToAst(Re),Xe=this.questionBitsToAst(Ie),Ze=this.botResponseBitsToAst(Le,we),Qe=this.footerToAst(Oe,je),{reference:et,referenceProperty:tt}=this.referenceToAst(le);return y.bit(Object.assign(Object.assign(Object.assign({bitType:Le,textFormat:o,resourceType:Ge,id:this.parseText(i),externalId:this.parseText(n),spaceId:this.parseText(s),padletId:this.parseText(l),jupyterId:this.parseText(u),jupyterExecutionCount:c,aiGenerated:g,releaseVersion:this.parseText(d),ageRange:f,lang:this.parseText(h),language:this.parseText(m),computerLanguage:this.parseText(T),target:this.parseText(b),tag:this.parseText(v),icon:this.parseText(C),iconTag:this.parseText(k),colorTag:this.parseText(x),flashcardSet:this.parseText(B),subtype:this.parseText(A),bookAlias:this.parseText(w),coverImage:this.parseText(P),publisher:this.parseText(K),publications:this.parseText(_),author:this.parseText(S),date:this.parseText(R),location:this.parseText(I),theme:this.parseText(O),kind:this.parseText(E),action:this.parseText(L),duration:this.parseText(V),referenceProperty:this.parseText(tt),thumbImage:this.parseText(j),focusX:G,focusY:F,deeplink:this.parseText(N),externalLink:this.parseText(M),externalLinkText:this.parseText(D),videoCallLink:this.parseText(U),bot:this.parseText($),list:this.parseText(q),textReference:this.parseText(J),isTracked:H,isInfoOnly:z,labelTrue:this.parseText(W),labelFalse:this.parseText(Y),content2Buy:this.parseText(X),quotedPerson:this.parseText(Z),reasonableNumOfChars:Q,maxCreatedBits:ee,book:this.parseText(te),title:this.parseText(re),subtitle:this.parseText(oe),level:ie,toc:ne,progress:ae,anchor:this.parseText(se),reference:this.parseText(et),referenceEnd:this.parseText(ue)},this.parseItemLeadHintInstruction(ce,pe,ge,de)),this.parseExample(ye)),{imageSource:Ne,partner:Me,markConfig:De,resources:Fe,body:Ve,sampleSolution:this.parseText(ve),elements:this.parseText(Ce),flashcards:Ue,statements:$e,responses:qe,quizzes:Je,heading:He,pairs:ze,matrix:We,choices:Ye,questions:Xe,botResponses:Ze,footer:Qe}))}imageSourceBitToAst(e){var t,r;let o;if(e){const{url:i,mockupId:a,format:s,size:l,trim:u}=e;o=y.imageSource({url:null!==(t=this.parseText(i))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mockupId:null!==(r=this.parseText(a))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,format:this.parseText(s),size:l,trim:u})}return o}partnerBitToAst(e){var t;let r;if(e){const o=this.resourceDataToAst(c.ResourceTag.image,e.avatarImage);r=y.partner({name:null!==(t=this.parseText(e.name))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,avatarImage:o})}return r}markConfigBitToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{mark:e,color:i,emphasis:a}=o,s=y.markConfig({mark:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,color:this.parseText(i),emphasis:this.parseText(a)});r.push(s)}if(0!==r.length)return r}flashcardBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,answer:i,alternativeAnswers:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.flashcard(Object.assign(Object.assign({question:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,answer:this.parseText(i),alternativeAnswers:this.parseText(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}if(0!==r.length)return r}statementBitsToAst(e,t,r,o){var i,a;const s=[];if(e){const r=y.statement(Object.assign({text:null!==(i=this.parseText(e))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,isCorrect:null!=t&&t},this.parseExample(o)));s.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:o,lead:i,hint:l,instruction:u,example:c}=e,p=y.statement(Object.assign(Object.assign({text:null!==(a=this.parseText(t))&&void 0!==a?a:n.Breakscape.EMPTY_STRING,isCorrect:r},this.parseItemLeadHintInstruction(o,i,l,u)),this.parseExample(c)));s.push(p)}if(0!==s.length)return s}choiceBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{choice:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.choice(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}if(0!==r.length)return r}responseBitsToAst(e,t){var r;const o=[];if(e.root!==l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=e,p=y.response(Object.assign(Object.assign({text:null!==(r=this.parseText(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));o.push(p)}if(0!==o.length)return o}}selectOptionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.selectOption(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}return r}highlightTextBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,isHighlighted:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.highlightText(Object.assign(Object.assign({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i,isHighlighted:a},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}return r}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const o of t){const{item:t,lead:i,hint:n,instruction:a,choices:s,responses:l}=o,u=this.choiceBitsToAst(s),c=this.responseBitsToAst(e,l),p=y.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,i,n,a)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){var t,r;let o;return e&&(o=y.heading({forKeys:null!==(t=this.parseText(e.forKeys))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,forValues:null!==(r=this.parseText(e.forValues))&&void 0!==r?r:[]})),o}pairBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{key:e,keyAudio:i,keyImage:n,values:a,item:s,lead:l,hint:u,instruction:p,example:g,isCaseSensitive:d}=o,f=this.resourceDataToAst(c.ResourceTag.audio,i),h=this.resourceDataToAst(c.ResourceTag.image,n),m=y.pair(Object.assign(Object.assign(Object.assign({key:this.parseText(e),keyAudio:f,keyImage:h,values:null!==(t=this.parseText(a))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,l,u,p)),this.parseExample(g)),{isCaseSensitive:d}));r.push(m)}if(0!==r.length)return r}matrixBitsToAst(e){var t,r;const o=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:a,item:s,lead:l,hint:u,instruction:c,example:p}=i,g=y.matrix(Object.assign(Object.assign({key:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,cells:null!==(r=this.matrixCellsToAst(a))&&void 0!==r?r:[]},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));o.push(g)}if(0!==o.length)return o}matrixCellsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{values:e,item:i,lead:n,hint:a,instruction:s,isCaseSensitive:l,example:u}=o,c=y.matrixCell(Object.assign(Object.assign(Object.assign({values:null!==(t=this.parseText(e))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(i,n,a,s)),{isCaseSensitive:l}),this.parseExample(u)));r.push(c)}if(0!==r.length)return r}questionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,partialAnswer:i,sampleSolution:a,item:s,lead:l,hint:u,instruction:c,example:p,reasonableNumOfChars:g}=o,d=y.question(Object.assign(Object.assign(Object.assign({question:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,partialAnswer:this.parseText(i),sampleSolution:this.parseText(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)),{reasonableNumOfChars:g}));r.push(d)}if(0!==r.length)return r}botResponseBitsToAst(e,t){var r,o,i;const a=[];if(e.root===l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:s,feedback:l,item:u,lead:c,hint:p}=e,g=y.botResponse({response:null!==(r=this.parseText(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,reaction:null!==(o=this.parseText(s))&&void 0!==o?o:n.Breakscape.EMPTY_STRING,feedback:null!==(i=this.parseText(l))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,item:this.parseText(u),lead:this.parseText(c),hint:this.parseText(p)});a.push(g)}if(0!==a.length)return a}}getResourceType(e){if(e){return c.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const o=null!==(t=c.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:c.ResourceTag.unknown;let i;if(e.type===c.ResourceTag.imageResponsive){const t=e,o=this.resourceDataToAst(c.ResourceTag.imagePortrait,t.imagePortrait),i=this.resourceDataToAst(c.ResourceTag.imageLandscape,t.imageLandscape);o&&r.push(o),i&&r.push(i)}else if(e.type===c.ResourceTag.stillImageFilm){const t=e,o=this.resourceDataToAst(c.ResourceTag.image,t.image),i=this.resourceDataToAst(c.ResourceTag.audio,t.audio);o&&r.push(o),i&&r.push(i)}else{if(i=e[o],!i)return;const t=this.resourceDataToAst(e.type,i);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,o;let i;if(t){if(!t)return;const n=g.StringUtils.isString(t)?t:void 0,a=t.url||t.src||t.href||t.app||t.body||n,s=this.resourceDataToAst(c.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(c.ResourceTag.image,e))):void 0;i=f.resource({type:e,value:this.parseText(a),format:this.parseText(t.format),src1x:this.parseText(t.src1x),src2x:this.parseText(t.src2x),src3x:this.parseText(t.src3x),src4x:this.parseText(t.src4x),caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(o=t.height)&&void 0!==o?o:void 0,alt:this.parseText(t.alt),duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:s,thumbnails:l,siteName:this.parseText(t.siteName),license:this.parseText(t.license),copyright:this.parseText(t.copyright),showInIndex:t.showInIndex})}return i}bodyToAst(e,t,r){let o,i;const n={};if(Array.isArray(e)?(i=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):i=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(i){const e=[],t=g.StringUtils.splitPlaceholders(i,Object.keys(n));for(let r=0,o=t.length;r<o;r++){const o=t[r];if(n[o])e.push(n[o]);else{const t=this.bodyTextToAst(o);e.push(t)}}o=y.body({bodyParts:e})}return o}bodyTextToAst(e){var t;return y.bodyText({text:null!==(t=this.parseText(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING})}bodyBitToAst(e){switch(e.type){case u.BodyBitType.gap:return this.gapBitToAst(e);case u.BodyBitType.mark:return this.markBitToAst(e);case u.BodyBitType.select:return this.selectBitToAst(e);case u.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return y.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){var t;const{item:r,lead:o,hint:i,instruction:n,example:a,isCaseSensitive:s,solutions:l}=e;return y.gap(Object.assign(Object.assign(Object.assign({solutions:null!==(t=this.parseText(l))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(r,o,i,n)),this.parseExample(a)),{isCaseSensitive:s}))}markBitToAst(e){var t;const{solution:r,mark:o,item:i,lead:a,hint:s,instruction:l,example:u}=e;return y.mark(Object.assign(Object.assign({solution:null!==(t=this.parseText(r))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mark:this.parseText(o)},this.parseItemLeadHintInstruction(i,a,s,l)),this.parseExample(u)))}selectBitToAst(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.selectOptionBitsToAst(t);return y.select(Object.assign(Object.assign({options:u,prefix:this.parseText(r),postfix:this.parseText(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.highlightTextBitsToAst(t);return y.highlight(Object.assign(Object.assign({texts:u,prefix:this.parseText(r),postfix:this.parseText(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}parseItemLeadHintInstruction(e,t,r,o){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(o)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(this.textParser.isAst(e)){return this.textGenerator.generateSync(e,t)}if(Array.isArray(e)){const r=[];for(let o=0,i=e.length;o<i;o++){const i=e[o];if(this.textParser.isAst(i)){const e=this.textGenerator.generateSync(i,t);r[o]=e}else r[o]=n.Breakscape.breakscape(i)}return r}return n.Breakscape.breakscape(e)}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const o=r(1353),i=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(i.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){if(Array.isArray(e))return e;const r=e,i=Object.assign({},t);i.textFormat||(i.textFormat=o.TextFormat.bitmarkMinusMinus);const a=i.textFormat===o.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(null!=r?r:"",{startRule:a})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4764).parse;t.parse=o},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const o=r(672);const i=new class{fillStringExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const i of e)if(!i.isExample&&(t?(i.isDefaultExample=!0,i.isExample=!0):(i.isDefaultExample=!1,i.example=r),o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!i||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=o.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=i},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},3589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,o=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||null==o&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||!1===o&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||""===o&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(o)&&0===o.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(o)&&0===Object.keys(o).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let o=r[t];if(Array.isArray(o)){if(0===o.length)return;o=o[o.length-1]}return o}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}splitPlaceholders(e,t){let r=[e];const o=(e,t)=>{const r=[];for(const o of e){const e=o.split(t);for(let o=0,i=e.length;o<i;o++){const n=e[o],a=o===i-1;r.push(n),a||r.push(t)}}return r};for(const e of t)r=o(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const o=e.split("\n");return o.length>0?o[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const o=e.length,i=o-t;let n,a=0;for(;a<i;){let o;const i=a+t,s=e.indexOf("\n",a);if(s>-1&&s>a&&s<i){o=s-a,n=e.substr(a,o),a=a+o+1,r.push(n);continue}const l=e.lastIndexOf(" ",i);let u=0;l>-1&&l!=a-1?(o=l-a,o>0&&(u=a+o+1)):(o=t,u=a+t),n=e.substr(a,o),a=u,r.push(n.trim())}return a<o&&(n=e.substr(a),r.push(n)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const o=r(2164),i=r(7619),n=r(306),a=r(9870);const s=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,a.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===o.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?o.Environment.node:o.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):n.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,i.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):n.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",o="",i="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?o=n:2===e?a=n:3===e&&(i=n)}return{full:e,major:r,minor:o,patch:a,build:i}}};t.env=s;const l=s.init.bind(s);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const o=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=o},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const o=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=o},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const o=r(2164),i=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:o.Environment.unknown,os:i.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let o="";for(let e=0,i=t.length;e<i;e++){const i=t[e];let n=!1;for(let e=0;e<=9;e++)if(i.startsWith(`${e}`)){n=!0;break}n?r.versions[o]=i.replace("_","."):r.keys.add(i),o=i}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),a=t.keys.has("chromium"),s=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return s&&!n&&!a?(e.browser=o.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=o.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=o.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=i.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var i=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return i.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return i.Output}});var n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var a=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return a.ResourceBuilder}});var s=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return s.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return f.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return f.AliasBitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var C=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return C.CardSetVersion}});var k=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return k.InfoType}});var x=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return x.InfoFormat}});(0,t.init)()})(),o})()));
|