@gmb/bitmark-parser-generator 3.35.0 → 3.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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={855:e=>{var t,i,r=Object.create,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,i,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))l.call(e,s)||s===i||a(e,s,{get:()=>t[s],enumerable:!(r=n(t,s))||r.enumerable});return e},u=(e,t,i)=>(i=null!=e?r(s(e)):{},c(!t&&e&&e.__esModule?i:a(i,"default",{value:e,enumerable:!0}),e)),p=(e,t,i)=>((e,t,i)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),d=(t={"node_modules/@ncoderz/superenum/dist/cjs/superenum.js"(e){function t(e,t){var i;const r=Object.freeze,a=Object.defineProperty,n=Object.assign,o={enumerable:!1},s=new Map,l=new Map,c=new Map,u=new Map,p=new Map,d=(null!==(i=null==t?void 0:t.iterationKeys)&&void 0!==i?i:Object.keys(e)).map(e=>`${e}`);for(const[t,i]of Object.entries(e))s.set(t,i),c.set(t.toLowerCase(),i);for(const[e,t]of s){const i="string"==typeof t?t.toLowerCase():t;l.set(t,e),u.set(i,e)}const g=d.map(e=>s.get(e)),h=d.map(e=>[e,s.get(e)]);return(t=>{let i=e;function m(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(u.get(e.toLowerCase())):l.has(e)?e:void 0}Object.isExtensible(e)||(i=n({},e)),a(i,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):s.get(`${e}`)}},o)),a(i,"fromValue",n({value:m},o)),a(i,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):l.get(e)}},o)),a(i,"setMetadata",n({value:function(e,t,i){const r=m(e);null!=r&&p.set(r,t)}},o)),a(i,"getMetadata",n({value:function(e,t){return p.get(e)}},o)),a(i,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<d.length?{value:s.get(`${d[e++]}`),done:!1}:{done:!0}}}},o)),a(i,"values",n({value:()=>g},o)),a(i,"keys",n({value:()=>d},o)),a(i,"entries",n({value:()=>h},o));let y=i;return(null==t?void 0:t.noFreeze)||(y=r(i),r(d),r(g),r(h)),y})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.superenum=void 0;var i=t;e.superenum=i,i.fromObject=t,i.fromArray=function(e,i){Array.isArray(e)||(e=[]);const r=e.reduce((e,t)=>(e[`${t}`]=t,e),{});return(!i||i&&!i.iterationKeys)&&((i=Object.assign({},i)).iterationKeys=e),t(r,i)}}},function(){return i||(0,t[o(t)[0]])((i={exports:{}}).exports,i),i.exports}),g={};((e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})})(g,{Ast:()=>xe,BitType:()=>m,BitmarkGenerator:()=>Pt,BitmarkParser:()=>Ei,BitmarkParserGenerator:()=>Fi,BitmarkParserType:()=>Ft,BitmarkStringGenerator:()=>It,BitmarkVersion:()=>Je,BodyTextFormat:()=>we,Builder:()=>Ct,CardSetVersion:()=>_t,InfoFormat:()=>Rt,InfoType:()=>Kt,Input:()=>Vi,JsonGenerator:()=>Et,JsonParser:()=>Dt,JsonStringGenerator:()=>Ri,NodeType:()=>Te,Output:()=>Ni,ResourceBuilder:()=>wt,ResourceTag:()=>B,StringWriter:()=>At,bitmarkTextParse:()=>ht}),e.exports=(e=>c(a({},"__esModule",{value:!0}),e))(g);var h=(0,u(d(),1).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"}),m=(0,u(d(),1).superenum)({_error:"_error",_comment:"_comment",_standard:"_standard",aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appBitmarkFromJavascript:"app-bitmark-from-javascript",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcards:"app-flashcards",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",appLink:"app-link",article:"article",articleAi:"article-ai",articleAlt:"article-alt",articleAttachment:"article-attachment",articleEmbed:"article-embed",articleLink:"article-link",articleResponsive:"article-responsive",articleResponsiveAlt:"article-responsive-alt",assignment:"assignment",assignmentList:"assignment-list",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",audioTranscript:"audio-transcript",bitAlias:"bit-alias",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",book:"book",bookAcknowledgements:"book-acknowledgements",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAlias:"book-alias",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookClose:"book-close",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookCover:"book-cover",bookDedication:"book-dedication",bookDiff:"book-diff",bookEnd:"book-end",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",bookReference:"book-reference",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",botActionResponse:"bot-action-response",botActionSave:"bot-action-save",botActionSend:"bot-action-send",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",browserImage:"browser-image",bug:"bug",bugAlt:"bug-alt",bugCollapsible:"bug-collapsible",buttonCopyText:"button-copy-text",callToAction:"call-to-action",callToActionBookNow:"call-to-action-book-now",callToActionContact:"call-to-action-contact",callToActionCreateAccount:"call-to-action-create-account",callToActionDownload:"call-to-action-download",callToActionGetNow:"call-to-action-get-now",callToActionGetOffer:"call-to-action-get-offer",callToActionJoin:"call-to-action-join",callToActionLearnMore:"call-to-action-learn-more",callToActionMail:"call-to-action-mail",callToActionSeeMore:"call-to-action-see-more",callToActionShopNow:"call-to-action-shop-now",callToActionStartNow:"call-to-action-start-now",callToActionSubscribe:"call-to-action-subscribe",callToActionWatch:"call-to-action-watch",card1:"card-1",chapter:"chapter",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",clozeInstructionGrouped:"cloze-instruction-grouped",clozeList:"cloze-list",clozeSeveral:"cloze-several",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",code:"code",codeRuntime:"code-runtime",collapsible:"collapsible",conclusion:"conclusion",conclusionAlt:"conclusion-alt",consoleLog:"console-log",container:"container",containerAccordionTabs:"container-accordion-tabs",containerBits2:"container-bits-2",containerCards:"container-cards",containerCarousel:"container-carousel",containerCookRecipe:"container-cook-recipe",containerFolder:"container-folder",containerFolderAll:"container-folder-all",containerGallery:"container-gallery",containerGrid:"container-grid",containerGroup:"container-group",containerNewsArticle:"container-news-article",containerNowrap:"container-nowrap",containerNowrapStretch:"container-nowrap-stretch",containerPreview:"container-preview",containerScroller:"container-scroller",containerSlides:"container-slides",containerStack:"container-stack",containerTabs:"container-tabs",containerWrap:"container-wrap",conversationLeft1:"conversation-left-1",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",clozeAndMultipleChoiceTextConversationLeft1:"cloze-and-multiple-choice-text-conversation-left-1",clozeAndMultipleChoiceTextConversationLeft1Scream:"cloze-and-multiple-choice-text-conversation-left-1-scream",clozeAndMultipleChoiceTextConversationLeft1Thought:"cloze-and-multiple-choice-text-conversation-left-1-thought",clozeAndMultipleChoiceTextConversationRight1:"cloze-and-multiple-choice-text-conversation-right-1",clozeAndMultipleChoiceTextConversationRight1Scream:"cloze-and-multiple-choice-text-conversation-right-1-scream",clozeAndMultipleChoiceTextConversationRight1Thought:"cloze-and-multiple-choice-text-conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookNoteOnQuantity:"cook-note-on-quantity",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",dangerAlt:"danger-alt",dangerCollapsible:"danger-collapsible",definitionList:"definition-list",definitionTerm:"definition-term",deleted:"deleted",details:"details",details1:"details-1",detailsImage:"details-image",diff:"diff",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",essay:"essay",example:"example",exampleAlt:"example-alt",exampleCollapsible:"example-collapsible",exampleList:"example-list",extractorAiChat:"extractor-ai-chat",extractorBlock:"extractor-block",extractorConfiguration:"extractor-configuration",extractorInformation:"extractor-information",extractorPage:"extractor-page",extractorPageCollapsible:"extractor-page-collapsible",extractorPageFooter:"extractor-page-footer",extractorPageFooterCollapsible:"extractor-page-footer-collapsible",extractorPageHeader:"extractor-page-header",extractorPageHeaderCollapsible:"extractor-page-header-collapsible",extractorPageNumber:"extractor-page-number",extractorPageNumberCollapsible:"extractor-page-number-collapsible",extractorPageWithBlocks:"extractor-page-with-blocks",extractorPageWithBlocksCollapsible:"extractor-page-with-blocks-collapsible",extractorRepeatedText:"extractor-repeated-text",featured:"featured",feedback:"feedback",figure:"figure",flashcard:"flashcard",flashcard1:"flashcard-1",focusImage:"focus-image",footNote:"foot-note",formula:"formula",gapText:"gap-text",gapTextInstructionGrouped:"gap-text-instruction-grouped",glossaryTerm:"glossary-term",groupBorn:"group-born",groupDied:"group-died",handInAudio:"hand-in-audio",handInContact:"hand-in-contact",handInDocument:"hand-in-document",handInFeedbackExpert:"hand-in-feedback-expert",handInFeedbackSelf:"hand-in-feedback-self",handInFile:"hand-in-file",handInLocation:"hand-in-location",handInPhoto:"hand-in-photo",handInScan:"hand-in-scan",handInSubmit:"hand-in-submit",handInVideo:"hand-in-video",handInVoice:"hand-in-voice",help:"help",helpAlt:"help-alt",highlightText:"highlight-text",hint:"hint",hintAlt:"hint-alt",hintCollapsible:"hint-collapsible",image:"image",imageBanner:"image-banner",imageFigure:"image-figure",imageFigureAlt:"image-figure-alt",imageLandscape:"image-landscape",imageLink:"image-link",imageMood:"image-mood",imageOnDevice:"image-on-device",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageResponsive:"image-responsive",imageScreenshot:"image-screenshot",imageSeparator:"image-separator",imageSeparatorAlt:"image-separator-alt",imagesLogoGrave:"images-logo-grave",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",indexTerm:"index-term",info:"info",infoAlt:"info-alt",infoCollapsible:"info-collapsible",internalLink:"internal-link",interview:"interview",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",learningDocumentationFeedback:"learning-documentation-feedback",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",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",leAssignment:"le-assignment",leClassroomEvent:"le-classroom-event",leCompletion:"le-completion",leExternalLink:"le-external-link",leFinishingTask:"le-finishing-task",leFollowUpTask:"le-follow-up-task",leMultiDayEvent:"le-multi-day-event",legend:"legend",leDocumentDownload:"le-document-download",leLearningObjectives:"le-learning-objectives",leLearningStep:"le-learning-step",leListenAudioEmbed:"le-listen-audio-embed",lePreparationTask:"le-preparation-task",leRead:"le-read",leReadBook:"le-read-book",leTask:"le-task",leTodo:"le-todo",leVideoCall:"le-video-call",leWatchVideoEmbed:"le-watch-video-embed",lifeSkillSticker:"life-skill-sticker",list:"list",listItem:"list-item",mark:"mark",match:"match",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",metalevelExplanation:"metalevel-explanation",metaSearchDefaultTerms:"meta-search-default-terms",metaSearchDefaultTopics:"meta-search-default-topics",milestone:"milestone",module:"module",moduleProduct:"module-product",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",noteAlt:"note-alt",notebookArticle:"notebook-article",noteCollapsible:"note-collapsible",output:"output",page:"page",pageAcademy:"page-academy",pageArticle:"page-article",pageArticleAlt:"page-article-alt",pageArticleResponsive:"page-article-responsive",pageBanner:"page-banner",pageBuyButton:"page-buy-button",pageBuyButtonAlt:"page-buy-button-alt",pageBuyButtonPromotion:"page-buy-button-promotion",pageCategory:"page-category",pageCollapsible:"page-collapsible",pageContainer:"page-container",pageContainerFolder:"page-container-folder",pageContainerGroup:"page-container-group",pageContainerNowrap:"page-container-nowrap",pageContainerNowrapStretch:"page-container-nowrap-stretch",pageContainerWrap:"page-container-wrap",pageCoverImage:"page-cover-image",pageFooter:"page-footer",pageHero:"page-hero",pageOpenBook:"page-open-book",pageOpenBookList:"page-open-book-list",pagePerson:"page-person",pageProduct:"page-product",pageProductList:"page-product-list",pageProductVideo:"page-product-video",pageProductVideoList:"page-product-video-list",pagePromotion:"page-promotion",pageSectionFolder:"page-section-folder",pageShopInShop:"page-shop-in-shop",pageSpecial:"page-special",pageSubpage:"page-subpage",pageSubscribe:"page-subscribe",parameters:"parameters",photo:"photo",platformPath:"platform-path",preparationNote:"preparation-note",pronunciationTable:"pronunciation-table",prototypeImages:"prototype-images",qAndA:"q-and-a",qAndACard:"q-and-a-card",question1:"question-1",quote:"quote",rating:"rating",recipe:"recipe",recordAudio:"record-audio",recordVideo:"record-video",releaseNote:"release-note",releaseNotesSummary:"release-notes-summary",remark:"remark",remarkAlt:"remark-alt",remarkCollapsible:"remark-collapsible",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewCustomerNote:"review-customer-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",sampleSolution:"sample-solution",scorm:"scorm",screenshot:"screenshot",selfAssessment:"self-assessment",separator:"separator",separatorAlt:"separator-alt",sequence:"sequence",sideNote:"side-note",sideNoteCollapsible:"side-note-collapsible",smartStandardArticleNonNormative:"smart-standard-article-non-normative",smartStandardArticleNonNormativeCollapsible:"smart-standard-article-non-normative-collapsible",smartStandardArticleNormative:"smart-standard-article-normative",smartStandardArticleNormativeCollapsible:"smart-standard-article-normative-collapsible",smartStandardExampleNonNormative:"smart-standard-example-non-normative",smartStandardExampleNonNormativeCollapsible:"smart-standard-example-non-normative-collapsible",smartStandardExampleNormative:"smart-standard-example-normative",smartStandardExampleNormativeCollapsible:"smart-standard-example-normative-collapsible",smartStandardFormula:"smart-standard-formula",smartStandardFormulaNonNormative:"smart-standard-formula-non-normative",smartStandardFormulaNormative:"smart-standard-formula-normative",smartStandardImageFigureNonNormative:"smart-standard-image-figure-non-normative",smartStandardImageFigureNonNormativeCollapsible:"smart-standard-image-figure-non-normative-collapsible",smartStandardImageFigureNormative:"smart-standard-image-figure-normative",smartStandardImageFigureNormativeCollapsible:"smart-standard-image-figure-normative-collapsible",smartStandardLegend:"smart-standard-legend",smartStandardLegendNonNormative:"smart-standard-legend-non-normative",smartStandardLegendNormative:"smart-standard-legend-normative",smartStandardList:"smart-standard-list",smartStandardListCollapsible:"smart-standard-list-collapsible",smartStandardListItem:"smart-standard-list-item",smartStandardListItemCollapsible:"smart-standard-list-item-collapsible",smartStandardNoteNonNormative:"smart-standard-note-non-normative",smartStandardNoteNonNormativeCollapsible:"smart-standard-note-non-normative-collapsible",smartStandardNoteNormative:"smart-standard-note-normative",smartStandardNoteNormativeCollapsible:"smart-standard-note-normative-collapsible",smartStandardRemarkLegend:"smart-standard-remark-legend",smartStandardRemarkLegendNonNormative:"smart-standard-remark-legend-non-normative",smartStandardRemarkLegendNormative:"smart-standard-remark-legend-normative",smartStandardRemarkFormula:"smart-standard-remark-formula",smartStandardRemarkFormulaNonNormative:"smart-standard-remark-formula-non-normative",smartStandardRemarkFormulaNormative:"smart-standard-remark-formula-normative",smartStandardRemarkNonNormative:"smart-standard-remark-non-normative",smartStandardRemarkNonNormativeCollapsible:"smart-standard-remark-non-normative-collapsible",smartStandardRemarkNormative:"smart-standard-remark-normative",smartStandardRemarkNormativeCollapsible:"smart-standard-remark-normative-collapsible",smartStandardRemarkTableImageNonNormative:"smart-standard-remark-table-image-non-normative",smartStandardRemarkTableImageNonNormativeCollapsible:"smart-standard-remark-table-image-non-normative-collapsible",smartStandardRemarkTableImageNormative:"smart-standard-remark-table-image-normative",smartStandardRemarkTableImageNormativeCollapsible:"smart-standard-remark-table-image-normative-collapsible",smartStandardRemarkTableNonNormative:"smart-standard-remark-table-non-normative",smartStandardRemarkTableNonNormativeCollapsible:"smart-standard-remark-table-non-normative-collapsible",smartStandardRemarkTableNormative:"smart-standard-remark-table-normative",smartStandardRemarkTableNormativeCollapsible:"smart-standard-remark-table-normative-collapsible",smartStandardTableImageNonNormative:"smart-standard-table-image-non-normative",smartStandardTableImageNonNormativeCollapsible:"smart-standard-table-image-non-normative-collapsible",smartStandardTableImageNormative:"smart-standard-table-image-normative",smartStandardTableImageNormativeCollapsible:"smart-standard-table-image-normative-collapsible",smartStandardTableNonNormative:"smart-standard-table-non-normative",smartStandardTableNonNormativeCollapsible:"smart-standard-table-non-normative-collapsible",smartStandardTableNormative:"smart-standard-table-normative",smartStandardTableNormativeCollapsible:"smart-standard-table-normative-collapsible",standardArticleNonNormative:"standard-article-non-normative",standardArticleNormative:"standard-article-normative",standardExampleNonNormative:"standard-example-non-normative",standardExampleNormative:"standard-example-normative",standardImageFigureNonNormative:"standard-image-figure-non-normative",standardImageFigureNormative:"standard-image-figure-normative",standardList:"standard-list",standardListItem:"standard-list-item",standardNoteNonNormative:"standard-note-non-normative",standardNoteNormative:"standard-note-normative",standardRemarkNonNormative:"standard-remark-non-normative",standardRemarkNormative:"standard-remark-normative",standardRemarkTableImageNonNormative:"standard-remark-table-image-non-normative",standardRemarkTableImageNormative:"standard-remark-table-image-normative",standardRemarkTableNonNormative:"standard-remark-table-non-normative",standardRemarkTableNormative:"standard-remark-table-normative",standardTableImageNonNormative:"standard-table-image-non-normative",standardTableImageNormative:"standard-table-image-normative",standardTableNonNormative:"standard-table-non-normative",standardTableNormative:"standard-table-normative",statement:"statement",stdout:"stdout",step:"step",stepImageScreenshot:"step-image-screenshot",stepImageScreenshotWithPointer:"step-image-screenshot-with-pointer",sticker:"sticker",stickyNote:"sticky-note",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",summary:"summary",summaryAi:"summary-ai",survey:"survey",survey1:"survey-1",surveyAnonymous:"survey-anonymous",surveyAnonymous1:"survey-anonymous-1",surveyMatrix:"survey-matrix",surveyMatrixMe:"survey-matrix-me",surveyRating:"survey-rating",surveyRatingDisplay:"survey-rating-display",surveyRatingOnce:"survey-rating-once",table:"table",tableAlt:"table-alt",tableImage:"table-image",tableImageAlt:"table-image-alt",takePicture:"take-picture",toc:"toc",tocChapter:"toc-chapter",tocInline:"toc-inline",tocResource:"toc-resource",tocContent:"toc-content",trueFalse:"true-false",trueFalse1:"true-false-1",vendorAmcharts5Chart:"vendor-amcharts-5-chart",vendorDatadogDashboardEmbed:"vendor-datadog-dashboard-embed",vendorFormbricksEmbed:"vendor-formbricks-embed",vendorFormbricksLink:"vendor-formbricks-link",vendorFormbricksEmbedAnonymous:"vendor-formbricks-embed-anonymous",vendorFormbricksLinkAnonymous:"vendor-formbricks-link-anonymous",vendorHighchartsChart:"vendor-highcharts-chart",vendorIframelyCard:"vendor-iframely-card",vendorIframelyEmbed:"vendor-iframely-embed",vendorIframelyPreview:"vendor-iframely-preview",vendorIframelyPreviewMini:"vendor-iframely-preview-mini",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",vendorJupyterOutput:"vendor-jupyter-output",vendorPadletEmbed:"vendor-padlet-embed",vendorStripePricingTable:"vendor-stripe-pricing-table",vendorStripePricingTableExternal:"vendor-stripe-pricing-table-external",video:"video",videoEmbed:"video-embed",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLandscape:"video-landscape",videoLink:"video-link",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",warningAlt:"warning-alt",warningCollapsible:"warning-collapsible",websiteLink:"website-link",workbookArticle:"workbook-article"}),y=(0,u(d(),1).superenum)({infinity:"infinity"}),f=(0,u(d(),1).superenum)({none:"none",string:"string",boolean:"boolean"}),b=(0,u(d(),1).superenum)({ast_isCaseSensitive:"isCaseSensitive",ast_referenceProperty:"referenceProperty",ast_markConfig:"markConfig",ast_productList:"productList",ast_productVideoList:"productVideoList"}),T=(0,u(d(),1).superenum)({none:"none",plainText:"plainText",bitmarkText:"bitmarkText",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"}),v=((0,u(d(),1).superenum)({}),u(d(),1)),x=u(d(),1),k={action:"action",activityType:"activityType",additionalSolutions:"additionalSolutions",ageRange:"ageRange",aiGenerated:"aiGenerated",analyticsTag:"analyticsTag",allowedBit:"allowedBit",allowSubtitles:"allowSubtitles",alt:"alt",altLangTag:"altLangTag",author:"author",autoplay:"autoplay",availableClassifications:"availableClassifications",blockId:"blockId",book:"book",bookAlias:"bookAlias",bookDiff:"bookDiff",bot:"bot",bubbleTag:"bubbleTag",buttonCaption:"buttonCaption",callToActionUrl:"callToActionUrl",caption:"caption",categoryTag:"categoryTag",chatWithBook:"chatWithBook",chatWithBookBrainKey:"chatWithBookBrainKey",citationStyle:"citationStyle",classification:"classification",codeLineNumbers:"codeLineNumbers",codeMinimap:"codeMinimap",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverColor:"coverColor",coverImage:"coverImage",customerExternalId:"customerExternalId",customerId:"customerId",date:"date",dateEnd:"dateEnd",decimalPlaces:"decimalPlaces",deeplink:"deeplink",disableCalculation:"disableCalculation",disableFeedback:"disableFeedback",diffTo:"diffTo",diffOp:"diffOp",diffRef:"diffRef",diffContext:"diffContext",diffTime:"diffTime",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",feedbackEngine:"feedbackEngine",feedbackType:"feedbackType",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",handInAcceptFileType:"handInAcceptFileType",handInRequirement:"handInRequirement",handInInstruction:"handInInstruction",hasBookNavigation:"hasBookNavigation",hasMarkAsDone:"hasMarkAsDone",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageFirst:"imageFirst",imageSource:"imageSource",index:"index",internalComment:"internalComment",isCaseSensitive:"isCaseSensitive",isInfoOnly:"isInfoOnly",isPublic:"isPublic",isTemplate:"isTemplate",isTemplateStripTheme:"isTemplateStripTheme",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",label:"label",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",layer:"layer",layerRole:"layerRole",levelCEFRp:"levelCEFRp",levelCEFR:"levelCEFR",levelILR:"levelILR",levelACTFL:"levelACTFL",license:"license",list:"list",listItemIndent:"listItemIndent",location:"location",machineTranslated:"machineTranslated",mailingList:"mailingList",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",maxDisplayLevel:"maxDisplayLevel",maxTocChapterLevel:"maxTocChapterLevel",mockupId:"mockupId",mute:"mute",padletId:"padletId",pageNo:"pageNo",partialAnswer:"partialAnswer",partner:"partner",person:"person",path:"path",pointerLeft:"pointerLeft",pointerTop:"pointerTop",posterImage:"posterImage",page:"page",processHandIn:"processHandIn",processHandInLocation:"processHandInLocation",product:"product",productFolder:"productFolder",productId:"productId",productList:"productList",productVideo:"productVideo",productVideoList:"productVideoList",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",property_title:"property_title",publications:"publications",publisher:"publisher",publisherName:"publisherName",quizCountItems:"quizCountItems",quizStrikethroughSolutions:"quizStrikethroughSolutions",quotedPerson:"quotedPerson",ratingLevelEnd:"ratingLevelEnd",ratingLevelSelected:"ratingLevelSelected",ratingLevelStart:"ratingLevelStart",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reductionTag:"reductionTag",refAuthor:"refAuthor",refBookTitle:"refBookTitle",refPublisher:"refPublisher",refPublicationYear:"refPublicationYear",releaseDate:"releaseDate",releaseKind:"releaseKind",releaseVersion:"releaseVersion",resolved:"resolved",resolvedBy:"resolvedBy",resolvedDate:"resolvedDate",revealSolutions:"revealSolutions",scormSource:"scormSource",search:"search",searchIndex:"searchIndex",servings:"servings",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",slug:"slug",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",stripePricingTableId:"stripePricingTableId",stripePublishableKey:"stripePublishableKey",subject:"subject",subtype:"subtype",tableAutoWidth:"tableAutoWidth",tableFixedHeader:"tableFixedHeader",tableHeaderWhitespaceNoWrap:"tableHeaderWhitespaceNoWrap",tableHeight:"tableHeight",tablePagination:"tablePagination",tablePaginationLimit:"tablePaginationLimit",tableResizableColumns:"tableResizableColumns",tableColumnMinWidth:"tableColumnMinWidth",tableSearch:"tableSearch",tableSort:"tableSort",tableWhitespaceNoWrap:"tableWhitespaceNoWrap",tag:"tag",target:"target",technicalTerm:"technicalTerm",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",tocResource:"tocResource",tocContent:"tocContent",topicTag:"topicTag",trim:"trim",unit:"unit",unitAbbr:"unitAbbr",vendorDashboardId:"vendorDashboardId",vendorSurveyId:"vendorSurveyId",vendorUrl:"vendorUrl",videoCallLink:"videoCallLink",width:"width",x:"x",y:"y",zoomDisabled:"zoomDisabled"},w=(0,x.superenum)(k),C=(0,v.superenum)({...k,tag_mark:"mark",tag_reference:"reference",tag_sampleSolution:"sampleSolution",tag_title:"title"}),A=(0,u(d(),1).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"}),B=(0,u(d(),1).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",icon:"icon",backgroundWallpaper:"backgroundWallpaper",imagePlaceholder:"imagePlaceholder"}),_=(0,u(d(),1).superenum)({tag_title:"#",tag_anchor:"▼",tag_reference:"►",tag_property:"@",tag_itemLead:"%",tag_instruction:"!",tag_hint:"?",tag_true:"+",tag_false:"-",tag_sampleSolution:"$",tag_gap:"_",tag_mark:"=",tag_resource:"&"}),S=(0,u(d(),1).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkText:"bitmark++"}),P=(0,u(d(),1).superenum)({_flashcard:"_flashcard",_definitionList:"_definitionList",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_feedback:"_feedback",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_table:"_table",_pronunciationTable:"_pronunciationTable",_botActionResponses:"_botActionResponses",_exampleBitList:"_exampleBitList",_clozeList:"_clozeList",_ingredients:"_ingredients",_bookReferenceList:"_bookReferenceList"}),I=u(d(),1),L=u(d(),1),E={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_technicalTerm:"group_technicalTerm",group_person:"group_person",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_quizCommon:"group_quizCommon",group_resourceBitTags:"group_resourceBitTags",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceIcon:"group_resourceIcon",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"},V=(0,L.superenum)(E),N=u(d(),1),F={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",icon:"icon",backgroundWallpaper:"backgroundWallpaper",imagePlaceholder:"imagePlaceholder"},R=(0,N.superenum)(F),K=u(d(),1),O={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"},D=(0,K.superenum)(O),$=(0,I.superenum)({_unknown:"_unknown",...O,...k,...F,...E});!function(){const e=new Set,t=[O,k,F,E];for(const i of t)for(const t in i)e.add(t)}();var M=(0,u(d(),1).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"}),j=class{constructor(e,t,i,r,a,n,o,s,l){p(this,"type"),p(this,"configKey"),p(this,"tag"),p(this,"maxCount"),p(this,"minCount"),p(this,"chain"),p(this,"jsonKey"),p(this,"astKey"),p(this,"deprecated"),this.type=e,this.configKey=t,this.tag=i,this.maxCount=r,this.minCount=a,this.chain=n,this.jsonKey=o,this.astKey=s,this.deprecated=l}},W=class extends j{constructor(e,t,i,r,a,n){super(h.tag,e,t,i,r,a,void 0,void 0,n),p(this,"type",h.tag)}toString(e){const t=Object.assign({},e);let i=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},z=class extends j{constructor(e,t,i,r,a,n,o,s,l,c,u){super(h.property,e,t,i,r,a,n,o,u),p(this,"type",h.property),p(this,"single"),p(this,"format"),p(this,"defaultValue"),this.single=s,this.format=l,this.defaultValue=c}toString(e){const t=Object.assign({},e);let i=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.single&&(i+=`, sgl=${this.single}`),null!=this.format&&(i+=`, fmt=${this.format}`),null!=this.defaultValue&&(i+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`),null!=this.astKey&&(i+=`, ast=${this.astKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},J=class extends j{constructor(e,t,i,r,a,n,o){super(h.resource,e,t,i,r,a,n,void 0,o),p(this,"type",h.resource)}toString(e){const t=Object.assign({},e);let i=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},q=class{constructor(e,t,i,r){p(this,"tags"),p(this,"bodyAllowed"),p(this,"bodyRequired"),p(this,"repeatCount"),this.tags=e,this.bodyAllowed=t??!0,this.bodyRequired=i,this.repeatCount=r}toString(e){const t=Object.assign({},e);let i="";const r=[];this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),null!=this.repeatCount&&r.push(`repeatCount=${this.repeatCount}`),i+=`[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))i+=`\n${e.toString(t)}`;return i}},H=class{constructor(e,t){p(this,"configKey"),p(this,"variants"),this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let i="",r=0,a=0;for(const e of this.variants){for(const n of e)i+=`[Card - Side ${r}, Variant ${a}]`,i+=`\n${n.toString(t)}`,a++;r++}return i}},G=class{constructor(e){p(this,"since"),p(this,"bitType"),p(this,"inheritedBitTypes"),p(this,"inheritedBitTypesSet"),p(this,"textFormatDefault"),p(this,"tags",{}),p(this,"cardSet"),p(this,"quizBit"),p(this,"deprecated"),p(this,"bodyAllowed"),p(this,"bodyRequired"),p(this,"footerAllowed"),p(this,"footerRequired"),p(this,"resourceAttachmentAllowed"),p(this,"rootExampleType"),p(this,"comboResourceType");const{since:t,bitType:i,inheritedBitTypes:r,textFormatDefault:a,tags:n,cardSet:o,quizBit:s,deprecated:l,bodyAllowed:c,bodyRequired:u,footerAllowed:d,footerRequired:g,resourceAttachmentAllowed:h,rootExampleType:m,comboResourceType:y}=e;this.since=t,this.bitType=i,this.inheritedBitTypes=r,this.inheritedBitTypesSet=new Set(r),this.textFormatDefault=a,this.tags=n,this.cardSet=o,this.quizBit=s,this.deprecated=l,this.bodyAllowed=c??!0,this.bodyRequired=u,this.footerAllowed=d??!0,this.footerRequired=g,this.resourceAttachmentAllowed=h??!0,this.rootExampleType=m,this.comboResourceType=y}toString(e){const t=Object.assign({},e);let i=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(i+="\n\n[Inheritance]",i+=`\n${this.inheritedBitTypes.join(" => ")}`),i+=`\n\n[Default text format]\n${this.textFormatDefault}`;const r=[];null!=this.since&&r.push(`since=${this.since}`),null!=this.deprecated&&r.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),this.footerAllowed&&r.push("footerAllowed"),this.footerRequired&&r.push("footerRequired"),this.resourceAttachmentAllowed&&r.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&r.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&r.push(`comboResourceType=${this.comboResourceType}`),i+=`\n\n[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===y.infinity||e.maxCount>0)&&(i+=`\n${e.toString(t)}`);return this.cardSet&&(i+=`\n\n${this.cardSet.toString(t)}`),i}},U=class{constructor(e,t,i,r){p(this,"tags"),p(this,"resourceAttachmentAllowed"),p(this,"resourceTypeAttachment"),p(this,"comboResourceTagTypesMap"),this.tags=e,this.resourceAttachmentAllowed=t??!1,this.resourceTypeAttachment=i,this.comboResourceTagTypesMap=r}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}},Y=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)}getViaPath(e,t){if(!e)return;if(!t)return;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let i=e;for(const e of t){if(null==i)return;i=i[e]}return i}setViaPath(e,t,i,r){if(!e)return!1;if(!t)return!1;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let a=e;for(let e=0;e<t.length-1;e++){const i=t[e];if(null==a[i]){if(!r)return!1;a[i]={}}a=a[i]}return a[t[t.length-1]]=i,!0}flatMapPath(e,t){if(!e)return[];if(!t)return[];Array.isArray(t)||(t=[t]);const i=e,r=t.shift();if(null==r)return i;const a=i[r];return a?Array.isArray(a)?a.flatMap(e=>this.flatMapPath(e,t.slice())):[this.flatMapPath(a,t)].flat():[]}orderProperties(e,t){const i=e,r=Object.assign({},i);for(const e of Object.keys(i))delete i[e];for(const e of t)Object.prototype.hasOwnProperty.call(r,e)&&(i[e]=r[e])}removeUndefinedProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||null==r&&delete i[e]}removeFalseProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||!1===r&&delete i[e]}removeEmptyStringProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||""===r&&delete i[e]}removeEmptyArrayProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||Array.isArray(r)&&0===r.length&&delete i[e]}removeEmptyObjectProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||this.isObject(r)&&0===Object.keys(r).length&&delete i[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 i=e;if(null==i[t])return;let r=i[t];if(Array.isArray(r)){if(0===r.length)return;r=r[r.length-1]}return r}deepMerge(...e){return function e(...t){function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function r(t,r){for(const[a,n]of Object.entries(r)){const r=i(n);void 0!==t[a]&&i(t[a])===r&&["array","object"].includes(r)?t[a]=e(t[a],n):t[a]=structuredClone(n)}}let a=structuredClone(t.shift());for(const e of t){const t=i(e);i(a)===t?"array"===t?a=[...a,...structuredClone(e)]:"object"===t?r(a,e):a=e:a=structuredClone(e)}return a}(...e)}},Q={[P._definitionList]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.group,configKey:V.group_resourceIcon}],repeatCount:y.infinity}]]},[P._flashcard]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.group,configKey:V.group_resourceIcon}],repeatCount:y.infinity}]]},[P._elements]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}],repeatCount:y.infinity}]]},[P._statements]:{variants:[[{tags:[{type:h.tag,configKey:D.true,maxCount:1},{type:h.tag,configKey:D.false,maxCount:1},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}],bodyAllowed:!1}]]},[P._quiz]:{variants:[[{tags:[{type:h.group,configKey:V.group_trueFalse},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}],bodyAllowed:!1}]]},[P._feedback]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_trueFalse},{type:h.tag,configKey:D.title}],bodyAllowed:!1}],[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.property,configKey:w.reasonableNumOfChars},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title}],bodyAllowed:!0}]]},[P._questions]:{variants:[[{tags:[{type:h.property,configKey:w.reasonableNumOfChars},{type:h.tag,configKey:D.sampleSolution},{type:h.property,configKey:w.property_sampleSolution},{type:h.property,configKey:w.additionalSolutions,maxCount:y.infinity},{type:h.property,configKey:w.partialAnswer},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}],repeatCount:y.infinity}]]},[P._matchPairs]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.property,configKey:w.isCaseSensitive}],repeatCount:y.infinity}]]},[P._matchAudioPairs]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.resource,configKey:R.audio}],repeatCount:y.infinity}]]},[P._matchImagePairs]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.resource,configKey:R.image}],repeatCount:y.infinity}]]},[P._matchMatrix]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.tag,configKey:D.title},{type:h.property,configKey:w.isCaseSensitive}],repeatCount:y.infinity}]]},[P._table]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.tag,configKey:D.title}],repeatCount:y.infinity}]]},[P._pronunciationTable]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.tag,configKey:D.title},{type:h.resource,configKey:R.audio}],repeatCount:y.infinity}]]},[P._botActionResponses]:{variants:[[{tags:[{type:h.property,configKey:w.reaction},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}]}]]},[P._clozeList]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardTags},{type:h.group,configKey:V.group_gap}]}]]},[P._exampleBitList]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardTags},{type:h.tag,configKey:D.title}],repeatCount:y.infinity}]]},[P._ingredients]:{variants:[[{tags:[{type:h.tag,configKey:D.title},{type:h.group,configKey:V.group_trueFalse},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.property,configKey:w.unit},{type:h.property,configKey:w.unitAbbr},{type:h.property,configKey:w.decimalPlaces},{type:h.property,configKey:w.disableCalculation}],repeatCount:y.infinity}]]},[P._bookReferenceList]:{variants:[[{tags:[{type:h.group,configKey:V.group_standardTags},{type:h.property,configKey:w.refAuthor,maxCount:y.infinity},{type:h.property,configKey:w.refBookTitle},{type:h.property,configKey:w.refPublisher,maxCount:y.infinity},{type:h.property,configKey:w.refPublicationYear},{type:h.property,configKey:w.citationStyle}],repeatCount:y.infinity}]]}},X={[V.group_standardAllBits]:{type:M.standard,tags:[{type:h.property,configKey:w.id,maxCount:y.infinity},{type:h.property,configKey:w.customerId},{type:h.property,configKey:w.externalId,maxCount:y.infinity},{type:h.property,configKey:w.isTemplate},{type:h.property,configKey:w.isTemplateStripTheme},{type:h.property,configKey:w.aiGenerated},{type:h.property,configKey:w.machineTranslated},{type:h.property,configKey:w.searchIndex,maxCount:y.infinity},{type:h.property,configKey:w.analyticsTag,maxCount:y.infinity},{type:h.property,configKey:w.categoryTag,maxCount:y.infinity},{type:h.property,configKey:w.topicTag,maxCount:y.infinity},{type:h.property,configKey:w.altLangTag},{type:h.property,configKey:w.feedbackEngine},{type:h.property,configKey:w.feedbackType},{type:h.property,configKey:w.disableFeedback},{type:h.property,configKey:w.diffTo},{type:h.property,configKey:w.diffOp},{type:h.property,configKey:w.diffRef},{type:h.property,configKey:w.diffContext},{type:h.property,configKey:w.diffTime},{type:h.property,configKey:w.ageRange,maxCount:y.infinity},{type:h.property,configKey:w.lang},{type:h.property,configKey:w.publisher,maxCount:y.infinity},{type:h.property,configKey:w.publisherName,maxCount:y.infinity},{type:h.property,configKey:w.theme,maxCount:y.infinity},{type:h.property,configKey:w.target,maxCount:y.infinity},{type:h.property,configKey:w.tag,maxCount:y.infinity},{type:h.property,configKey:w.reductionTag,maxCount:y.infinity},{type:h.property,configKey:w.bubbleTag,maxCount:y.infinity},{type:h.property,configKey:w.levelCEFRp},{type:h.property,configKey:w.levelCEFR},{type:h.property,configKey:w.levelILR},{type:h.property,configKey:w.levelACTFL},{type:h.property,configKey:w.icon},{type:h.property,configKey:w.iconTag},{type:h.property,configKey:w.colorTag,maxCount:y.infinity},{type:h.tag,configKey:D.anchor},{type:h.property,configKey:w.search},{type:h.property,configKey:w.showInIndex},{type:h.property,configKey:w.layer,maxCount:y.infinity},{type:h.property,configKey:w.layerRole,maxCount:y.infinity}]},[V.group_standardItemLeadInstructionHint]:{type:M.standard,tags:[{type:h.tag,configKey:D.itemLead,chain:[{type:h.tag,configKey:D.itemLead,maxCount:3}]},{type:h.tag,configKey:D.instruction},{type:h.tag,configKey:D.hint}]},[V.group_standardExample]:{type:M.standard,tags:[{type:h.property,configKey:w.example}]},[V.group_standardTags]:{type:M.standard,tags:[{type:h.group,configKey:V.group_standardAllBits},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}]},[V.group_imageSource]:{type:M.standard,tags:[{type:h.property,configKey:w.imageSource,chain:[{type:h.property,configKey:w.mockupId},{type:h.property,configKey:w.size},{type:h.property,configKey:w.format},{type:h.property,configKey:w.trim}]}]},[V.group_technicalTerm]:{type:M.standard,tags:[{type:h.property,configKey:w.technicalTerm,chain:[{type:h.property,configKey:w.lang}]}]},[V.group_person]:{type:M.standard,tags:[{type:h.property,configKey:w.person,chain:[{type:h.property,configKey:w.property_title},{type:h.group,configKey:V.group_resourceImage}]},{type:h.property,configKey:w.partner,chain:[{type:h.property,configKey:w.property_title},{type:h.group,configKey:V.group_resourceImage}]}]},[V.group_gap]:{type:M.standard,tags:[{type:h.tag,configKey:D.gap,maxCount:y.infinity,chain:[{type:h.tag,configKey:D.gap,maxCount:y.infinity},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample},{type:h.property,configKey:w.isCaseSensitive}]}]},[V.group_trueFalse]:{type:M.standard,tags:[{type:h.tag,configKey:D.true,maxCount:y.infinity,chain:[{type:h.tag,configKey:D.true,maxCount:y.infinity},{type:h.tag,configKey:D.false,maxCount:y.infinity},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}]},{type:h.tag,configKey:D.false,maxCount:y.infinity,chain:[{type:h.tag,configKey:D.true,maxCount:y.infinity},{type:h.tag,configKey:D.false,maxCount:y.infinity},{type:h.group,configKey:V.group_standardItemLeadInstructionHint},{type:h.group,configKey:V.group_standardExample}]}]},[V.group_markConfig]:{type:M.standard,tags:[{type:h.property,configKey:w.markConfig,maxCount:y.infinity,chain:[{type:h.property,configKey:w.color},{type:h.property,configKey:w.emphasis}]}]},[V.group_mark]:{type:M.standard,tags:[{type:h.tag,configKey:D.tag_mark,maxCount:y.infinity,chain:[{type:h.property,configKey:w.property_mark},{type:h.group,configKey:V.group_standardExample}]}]},[V.group_bookCommon]:{type:M.standard,tags:[{type:h.property,configKey:w.language,maxCount:y.infinity},{type:h.property,configKey:w.customerExternalId,maxCount:y.infinity},{type:h.property,configKey:w.spaceId,maxCount:y.infinity},{type:h.property,configKey:w.kind},{type:h.property,configKey:w.hasMarkAsDone},{type:h.property,configKey:w.processHandIn},{type:h.property,configKey:w.processHandInLocation},{type:h.property,configKey:w.isPublic},{type:h.property,configKey:w.isTemplate},{type:h.property,configKey:w.isTemplateStripTheme},{type:h.property,configKey:w.chatWithBook},{type:h.property,configKey:w.chatWithBookBrainKey},{type:h.tag,configKey:D.title,maxCount:2},{type:h.property,configKey:w.subtype,maxCount:y.infinity},{type:h.property,configKey:w.coverImage,maxCount:y.infinity},{type:h.property,configKey:w.coverColor},{type:h.property,configKey:w.subject,maxCount:y.infinity},{type:h.property,configKey:w.author,maxCount:y.infinity},{type:h.property,configKey:w.publications,maxCount:y.infinity},{type:h.property,configKey:w.duration},{type:h.property,configKey:w.maxTocChapterLevel}]},[V.group_learningPathCommon]:{type:M.standard,tags:[{type:h.property,configKey:w.action},{type:h.property,configKey:w.duration},{type:h.property,configKey:w.date},{type:h.property,configKey:w.dateEnd},{type:h.property,configKey:w.location},{type:h.property,configKey:w.list,maxCount:y.infinity},{type:h.property,configKey:w.textReference},{type:h.property,configKey:w.isTracked},{type:h.property,configKey:w.isInfoOnly},{type:h.property,configKey:w.deeplink},{type:h.property,configKey:w.buttonCaption},{type:h.property,configKey:w.book,chain:[{type:h.tag,configKey:D.tag_reference,maxCount:2}]}]},[V.group_quizCommon]:{type:M.standard,tags:[{type:h.property,configKey:w.revealSolutions}]},[V.group_resourceBitTags]:{type:M.standard,tags:[{type:h.resource,configKey:R.imagePlaceholder,chain:[{type:h.group,configKey:V.group_resourceImageCommon}],maxCount:1}]},[V.group_resourceCommon]:{type:M.standard,tags:[{type:h.property,configKey:w.license},{type:h.property,configKey:w.copyright},{type:h.property,configKey:w.caption},{type:h.property,configKey:w.showInIndex},{type:h.property,configKey:w.search}]},[V.group_resourceImageCommon]:{type:M.standard,tags:[{type:h.group,configKey:V.group_resourceCommon},{type:h.property,configKey:w.src1x},{type:h.property,configKey:w.src2x},{type:h.property,configKey:w.src3x},{type:h.property,configKey:w.src4x},{type:h.property,configKey:w.width},{type:h.property,configKey:w.height},{type:h.property,configKey:w.alt},{type:h.property,configKey:w.zoomDisabled}]},[V.group_resourceAudioCommon]:{type:M.standard,tags:[{type:h.group,configKey:V.group_resourceCommon},{type:h.property,configKey:w.duration},{type:h.property,configKey:w.mute},{type:h.property,configKey:w.autoplay}]},[V.group_resourceVideoCommon]:{type:M.standard,tags:[{type:h.group,configKey:V.group_resourceCommon},{type:h.property,configKey:w.width},{type:h.property,configKey:w.height},{type:h.property,configKey:w.duration},{type:h.property,configKey:w.mute},{type:h.property,configKey:w.autoplay},{type:h.property,configKey:w.allowSubtitles},{type:h.property,configKey:w.showSubtitles},{type:h.property,configKey:w.alt},{type:h.property,configKey:w.posterImage,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]},{type:h.property,configKey:w.src1x},{type:h.property,configKey:w.src2x},{type:h.property,configKey:w.src3x},{type:h.property,configKey:w.src4x}]},[V.group_resourceIcon]:{type:M.standard,tags:[{type:h.resource,configKey:R.icon,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceImage]:{type:M.resource,tags:[{type:h.resource,configKey:R.image,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceImagePortrait]:{type:M.resource,tags:[{type:h.resource,configKey:R.imagePortrait,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceImageLandscape]:{type:M.resource,tags:[{type:h.resource,configKey:R.imageLandscape,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceImageEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.imageEmbed,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceImageLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.imageLink,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]}]},[V.group_resourceAudio]:{type:M.resource,tags:[{type:h.resource,configKey:R.audio,chain:[{type:h.group,configKey:V.group_resourceAudioCommon}]}]},[V.group_resourceAudioEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.audioEmbed,chain:[{type:h.group,configKey:V.group_resourceAudioCommon}]}]},[V.group_resourceAudioLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.audioLink,chain:[{type:h.group,configKey:V.group_resourceAudioCommon}]}]},[V.group_resourceVideo]:{type:M.resource,tags:[{type:h.resource,configKey:R.video,chain:[{type:h.group,configKey:V.group_resourceVideoCommon}]}]},[V.group_resourceVideoEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.videoEmbed,chain:[{type:h.group,configKey:V.group_resourceVideoCommon}]}]},[V.group_resourceVideoLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.videoLink,chain:[{type:h.group,configKey:V.group_resourceVideoCommon}]}]},[V.group_resourceStillImageFilmEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.stillImageFilmEmbed,chain:[{type:h.group,configKey:V.group_resourceVideoCommon}]}]},[V.group_resourceStillImageFilmLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.stillImageFilmLink,chain:[{type:h.group,configKey:V.group_resourceVideoCommon}]}]},[V.group_resourceArticle]:{type:M.resource,tags:[{type:h.resource,configKey:R.article,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceArticleEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.articleEmbed,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceArticleLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.articleLink,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceDocument]:{type:M.resource,tags:[{type:h.resource,configKey:R.document,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceDocumentEmbed]:{type:M.resource,tags:[{type:h.resource,configKey:R.documentEmbed,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceDocumentLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.documentLink,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceDocumentDownload]:{type:M.resource,tags:[{type:h.resource,configKey:R.documentDownload,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceAppLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.appLink,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceWebsiteLink]:{type:M.resource,tags:[{type:h.resource,configKey:R.websiteLink,chain:[{type:h.group,configKey:V.group_resourceCommon}]}]},[V.group_resourceStillImageFilm]:{type:M.comboResource,comboResourceType:B.stillImageFilm,tags:[{type:h.group,configKey:V.group_resourceImage,maxCount:1,minCount:1},{type:h.group,configKey:V.group_resourceAudio,maxCount:1,minCount:1}]},[V.group_resourceImageResponsive]:{type:M.comboResource,comboResourceType:B.imageResponsive,tags:[{type:h.group,configKey:V.group_resourceImagePortrait,maxCount:1,minCount:1},{type:h.group,configKey:V.group_resourceImageLandscape,maxCount:1,minCount:1}]}},Z={[w.id]:{tag:C.id,format:T.plainText},[w.internalComment]:{tag:C.internalComment,format:T.plainText},[w.customerId]:{tag:C.customerId,single:!0,format:T.plainText},[w.customerExternalId]:{tag:C.customerExternalId,single:!0,format:T.plainText},[w.externalId]:{tag:C.externalId,format:T.plainText},[w.spaceId]:{tag:C.spaceId,format:T.plainText},[w.padletId]:{tag:C.padletId,single:!0,format:T.plainText},[w.jupyterId]:{tag:C.jupyterId,single:!0,format:T.plainText},[w.jupyterExecutionCount]:{tag:C.jupyterExecutionCount,single:!0,format:T.number},[w.aiGenerated]:{tag:C.aiGenerated,single:!0,format:T.boolean},[w.machineTranslated]:{tag:C.machineTranslated,single:!0,format:T.plainText},[w.searchIndex]:{tag:C.searchIndex,format:T.plainText},[w.analyticsTag]:{tag:C.analyticsTag,format:T.plainText},[w.categoryTag]:{tag:C.categoryTag,format:T.plainText},[w.topicTag]:{tag:C.topicTag,format:T.plainText},[w.altLangTag]:{tag:C.altLangTag,single:!0,format:T.plainText},[w.feedbackEngine]:{tag:C.feedbackEngine,single:!0,format:T.plainText},[w.disableFeedback]:{tag:C.disableFeedback,single:!0,format:T.boolean},[w.diffTo]:{tag:C.diffTo,single:!0,format:T.plainText},[w.diffOp]:{tag:C.diffOp,single:!0,format:T.plainText},[w.diffRef]:{tag:C.diffRef,single:!0,format:T.plainText},[w.diffContext]:{tag:C.diffContext,single:!0,format:T.plainText},[w.diffTime]:{tag:C.diffTime,single:!0,format:T.number},[w.path]:{tag:C.path,single:!0,format:T.plainText},[w.releaseVersion]:{tag:C.releaseVersion,single:!0,format:T.plainText},[w.releaseKind]:{tag:C.releaseKind,single:!0,format:T.plainText},[w.releaseDate]:{tag:C.releaseDate,single:!0,format:T.plainText},[w.resolved]:{tag:C.resolved,single:!0,format:T.boolean},[w.resolvedDate]:{tag:C.resolvedDate,single:!0,format:T.plainText},[w.resolvedBy]:{tag:C.resolvedBy,single:!0,format:T.plainText},[w.handInAcceptFileType]:{tag:C.handInAcceptFileType,format:T.plainText},[w.handInRequirement]:{tag:C.handInRequirement,format:T.plainText},[w.handInInstruction]:{tag:C.handInInstruction,single:!0,format:T.plainText},[w.ageRange]:{tag:C.ageRange,format:T.plainText},[w.lang]:{tag:C.lang,single:!0,format:T.plainText},[w.language]:{tag:C.language,format:T.plainText},[w.computerLanguage]:{tag:C.computerLanguage,single:!0,format:T.plainText},[w.target]:{tag:C.target,format:T.plainText},[w.slug]:{tag:C.slug,single:!0,format:T.plainText},[w.tag]:{tag:C.tag,format:T.plainText},[w.reductionTag]:{tag:C.reductionTag,format:T.plainText},[w.bubbleTag]:{tag:C.bubbleTag,format:T.plainText},[w.levelCEFRp]:{tag:C.levelCEFRp,single:!0,format:T.plainText},[w.levelCEFR]:{tag:C.levelCEFR,single:!0,format:T.plainText},[w.levelILR]:{tag:C.levelILR,single:!0,format:T.plainText},[w.levelACTFL]:{tag:C.levelACTFL,single:!0,format:T.plainText},[w.icon]:{tag:C.icon,single:!0,format:T.plainText},[w.iconTag]:{tag:C.iconTag,single:!0,format:T.plainText},[w.colorTag]:{tag:C.colorTag,format:T.plainText},[w.flashcardSet]:{tag:C.flashcardSet,format:T.plainText},[w.subtype]:{tag:C.subtype,single:!0,format:T.plainText},[w.bookAlias]:{tag:C.bookAlias,format:T.plainText},[w.bookDiff]:{tag:C.bookDiff,single:!0,format:T.plainText},[w.refAuthor]:{tag:C.refAuthor,format:T.plainText},[w.refBookTitle]:{tag:C.refBookTitle,single:!0,format:T.plainText},[w.refPublisher]:{tag:C.refPublisher,format:T.plainText},[w.refPublicationYear]:{tag:C.refPublicationYear,single:!0,format:T.plainText},[w.citationStyle]:{tag:C.citationStyle,single:!0,format:T.plainText},[w.coverImage]:{tag:C.coverImage,format:T.plainText},[w.coverColor]:{tag:C.coverColor,single:!0,format:T.plainText},[w.publisher]:{tag:C.publisher,format:T.plainText},[w.publisherName]:{tag:C.publisherName,single:!0,format:T.plainText},[w.publications]:{tag:C.publications,format:T.plainText},[w.author]:{tag:C.author,format:T.plainText},[w.subject]:{tag:C.subject,format:T.plainText},[w.date]:{tag:C.date,single:!0,format:T.plainText},[w.dateEnd]:{tag:C.dateEnd,single:!0,format:T.plainText},[w.location]:{tag:C.location,single:!0,format:T.plainText},[w.theme]:{tag:C.theme,format:T.plainText},[w.kind]:{tag:C.kind,single:!0,format:T.plainText},[w.hasMarkAsDone]:{tag:C.hasMarkAsDone,defaultValue:"false",single:!0,format:T.boolean},[w.processHandIn]:{tag:C.processHandIn,defaultValue:"false",single:!0,format:T.boolean},[w.processHandInLocation]:{tag:C.processHandInLocation,single:!0,format:T.plainText},[w.isPublic]:{tag:C.isPublic,defaultValue:"false",single:!0,format:T.boolean},[w.isTemplate]:{tag:C.isTemplate,defaultValue:"false",single:!0,format:T.boolean},[w.isTemplateStripTheme]:{tag:C.isTemplateStripTheme,defaultValue:"false",single:!0,format:T.boolean},[w.chatWithBook]:{tag:C.chatWithBook,defaultValue:"false",single:!0,format:T.boolean},[w.chatWithBookBrainKey]:{tag:C.chatWithBookBrainKey,single:!0,format:T.plainText},[w.action]:{tag:C.action,single:!0,format:T.plainText},[w.thumbImage]:{tag:C.thumbImage,single:!0,format:T.plainText},[w.scormSource]:{tag:C.scormSource,single:!0,format:T.plainText},[w.posterImage]:{tag:C.posterImage,single:!0,format:T.plainText},[w.focusX]:{tag:C.focusX,single:!0,format:T.number},[w.focusY]:{tag:C.focusY,single:!0,format:T.number},[w.deeplink]:{tag:C.deeplink,format:T.plainText},[w.externalLink]:{tag:C.externalLink,single:!0,format:T.plainText},[w.externalLinkText]:{tag:C.externalLinkText,single:!0,format:T.plainText},[w.videoCallLink]:{tag:C.videoCallLink,single:!0,format:T.plainText},[w.vendorDashboardId]:{tag:C.vendorDashboardId,single:!0,format:T.plainText},[w.vendorSurveyId]:{tag:C.vendorSurveyId,single:!0,format:T.plainText},[w.vendorUrl]:{tag:C.vendorUrl,single:!0,format:T.plainText},[w.search]:{tag:C.search,single:!0,format:T.plainText},[w.bot]:{tag:C.bot,format:T.plainText},[w.duration]:{tag:C.duration,single:!0,format:T.plainText},[w.property_reference]:{tag:C.tag_reference,format:T.plainText,astKey:b.ast_referenceProperty},[w.list]:{tag:C.list,format:T.plainText},[w.layer]:{tag:C.layer,format:T.plainText},[w.layerRole]:{tag:C.layerRole,format:T.plainText},[w.textReference]:{tag:C.textReference,single:!0,format:T.plainText},[w.isTracked]:{tag:C.isTracked,single:!0,format:T.boolean},[w.isInfoOnly]:{tag:C.isInfoOnly,single:!0,format:T.boolean},[w.labelTrue]:{tag:C.labelTrue,single:!0,format:T.plainText},[w.labelFalse]:{tag:C.labelFalse,single:!0,format:T.plainText},[w.content2Buy]:{tag:C.content2Buy,single:!0,format:T.plainText},[w.quotedPerson]:{tag:C.quotedPerson,single:!0,format:T.plainText},[w.partialAnswer]:{tag:C.partialAnswer,single:!0,format:T.plainText},[w.reasonableNumOfChars]:{tag:C.reasonableNumOfChars,single:!0,format:T.number},[w.maxCreatedBits]:{tag:C.maxCreatedBits,single:!0,format:T.number},[w.maxDisplayLevel]:{tag:C.maxDisplayLevel,single:!0,format:T.number},[w.maxTocChapterLevel]:{tag:C.maxTocChapterLevel,single:!0,format:T.number},[w.tocResource]:{tag:C.tocResource,format:T.plainText},[w.tocContent]:{tag:C.tocContent,format:T.plainText},[w.technicalTerm]:{tag:C.technicalTerm,single:!0,format:T.plainText},[w.servings]:{tag:C.servings,single:!0,format:T.number},[w.unit]:{tag:C.unit,single:!0,format:T.plainText},[w.unitAbbr]:{tag:C.unitAbbr,single:!0,format:T.plainText},[w.decimalPlaces]:{tag:C.decimalPlaces,single:!0,format:T.number,defaultValue:"1"},[w.disableCalculation]:{tag:C.disableCalculation,single:!0,format:T.boolean},[w.example]:{tag:C.example,single:!0,format:T.plainText},[w.toc]:{tag:C.toc,single:!0,format:T.boolean,defaultValue:"true"},[w.page]:{tag:C.page,single:!0,format:T.plainText},[w.product]:{tag:C.product,single:!0,format:T.plainText},[w.productId]:{tag:C.productId,single:!1,format:T.plainText},[w.productList]:{tag:C.product,single:!1,format:T.plainText,astKey:b.ast_productList},[w.productVideo]:{tag:C.productVideo,single:!0,format:T.plainText},[w.productVideoList]:{tag:C.productVideo,single:!1,format:T.plainText,astKey:b.ast_productVideoList},[w.productFolder]:{tag:C.productFolder,single:!0,format:T.plainText},[w.progress]:{tag:C.progress,single:!0,format:T.boolean,defaultValue:"true"},[w.book]:{tag:C.book,single:!0,format:T.plainText},[w.person]:{tag:C.person,single:!0,format:T.plainText},[w.partner]:{tag:C.partner,single:!0,format:T.plainText},[w.property_sampleSolution]:{tag:C.tag_sampleSolution,single:!0,format:T.plainText},[w.additionalSolutions]:{tag:C.additionalSolutions,format:T.plainText},[w.markConfig]:{tag:C.tag_mark,format:T.plainText,astKey:b.ast_markConfig},[w.property_mark]:{tag:C.tag_mark,format:T.plainText},[w.color]:{tag:C.color,single:!0,format:T.plainText},[w.emphasis]:{tag:C.emphasis,single:!0,format:T.plainText},[w.isCaseSensitive]:{tag:C.isCaseSensitive,single:!0,format:T.boolean},[w.reaction]:{tag:C.reaction,single:!0,format:T.plainText},[w.imageSource]:{tag:C.imageSource,single:!0,format:T.plainText},[w.mockupId]:{tag:C.mockupId,single:!0,format:T.plainText},[w.size]:{tag:C.size,single:!0,format:T.number},[w.format]:{tag:C.format,single:!0,format:T.plainText},[w.property_title]:{tag:C.tag_title,single:!0,format:T.plainText},[w.trim]:{tag:C.trim,single:!0,format:T.boolean},[w.width]:{tag:C.width,single:!0,format:T.number},[w.height]:{tag:C.height,single:!0,format:T.number},[w.license]:{tag:C.license,single:!0,format:T.plainText},[w.copyright]:{tag:C.copyright,single:!0,format:T.plainText},[w.mailingList]:{tag:C.mailingList,single:!0,format:T.plainText},[w.buttonCaption]:{tag:C.buttonCaption,single:!0,format:T.plainText},[w.callToActionUrl]:{tag:C.callToActionUrl,single:!0,format:T.plainText},[w.feedbackType]:{tag:C.feedbackType,single:!0,format:T.plainText},[w.caption]:{tag:C.caption,single:!0,format:T.bitmarkText},[w.showInIndex]:{tag:C.showInIndex,single:!0,format:T.boolean,defaultValue:"false"},[w.alt]:{tag:C.alt,single:!0,format:T.plainText},[w.zoomDisabled]:{tag:C.zoomDisabled,single:!0,format:T.boolean},[w.src1x]:{tag:C.src1x,single:!0,format:T.plainText},[w.src2x]:{tag:C.src2x,single:!0,format:T.plainText},[w.src3x]:{tag:C.src3x,single:!0,format:T.plainText},[w.src4x]:{tag:C.src4x,single:!0,format:T.plainText},[w.mute]:{tag:C.mute,single:!0,format:T.boolean},[w.autoplay]:{tag:C.autoplay,single:!0,format:T.boolean},[w.allowSubtitles]:{tag:C.allowSubtitles,single:!0,format:T.boolean},[w.showSubtitles]:{tag:C.showSubtitles,single:!0,format:T.boolean},[w.siteName]:{tag:C.siteName,single:!0,format:T.plainText},[w.pointerLeft]:{tag:C.pointerLeft,single:!0,format:T.plainText},[w.pointerTop]:{tag:C.pointerTop,single:!0,format:T.plainText},[w.listItemIndent]:{tag:C.listItemIndent,single:!0,defaultValue:"0",format:T.number},[w.hasBookNavigation]:{tag:C.hasBookNavigation,single:!0,defaultValue:"true",format:T.boolean},[w.blockId]:{tag:C.blockId,single:!0,format:T.plainText},[w.pageNo]:{tag:C.pageNo,single:!0,format:T.number},[w.x]:{tag:C.x,single:!0,format:T.number},[w.y]:{tag:C.y,single:!0,format:T.number},[w.index]:{tag:C.index,single:!0,format:T.number},[w.classification]:{tag:C.classification,single:!0,format:T.plainText},[w.availableClassifications]:{tag:C.availableClassifications,single:!1,format:T.plainText},[w.allowedBit]:{tag:C.allowedBit,single:!1,format:T.plainText},[w.tableFixedHeader]:{tag:C.tableFixedHeader,single:!0,format:T.boolean},[w.tableHeaderWhitespaceNoWrap]:{tag:C.tableHeaderWhitespaceNoWrap,single:!0,format:T.boolean},[w.tableSearch]:{tag:C.tableSearch,single:!0,format:T.boolean},[w.tableSort]:{tag:C.tableSort,single:!0,format:T.boolean},[w.tablePagination]:{tag:C.tablePagination,single:!0,format:T.boolean},[w.tablePaginationLimit]:{tag:C.tablePaginationLimit,single:!0,format:T.number,defaultValue:"0"},[w.tableHeight]:{tag:C.tableHeight,single:!0,format:T.number,defaultValue:"0"},[w.tableWhitespaceNoWrap]:{tag:C.tableWhitespaceNoWrap,single:!0,format:T.boolean},[w.tableAutoWidth]:{tag:C.tableAutoWidth,single:!0,format:T.boolean},[w.tableResizableColumns]:{tag:C.tableResizableColumns,single:!0,format:T.boolean},[w.tableColumnMinWidth]:{tag:C.tableColumnMinWidth,single:!0,format:T.number},[w.quizCountItems]:{tag:C.quizCountItems,single:!0,format:T.boolean},[w.quizStrikethroughSolutions]:{tag:C.quizStrikethroughSolutions,single:!0,format:T.boolean},[w.codeLineNumbers]:{tag:C.codeLineNumbers,single:!0,format:T.boolean},[w.codeMinimap]:{tag:C.codeMinimap,single:!0,format:T.boolean},[w.stripePricingTableId]:{tag:C.stripePricingTableId,single:!0,format:T.plainText},[w.stripePublishableKey]:{tag:C.stripePublishableKey,single:!0,format:T.plainText},[w.ratingLevelStart]:{tag:C.ratingLevelStart,single:!0,format:T.number},[w.ratingLevelEnd]:{tag:C.ratingLevelEnd,single:!0,format:T.number},[w.ratingLevelSelected]:{tag:C.ratingLevelSelected,single:!0,format:T.number},[w.label]:{tag:C.label,single:!0,format:T.bitmarkText},[w.imageFirst]:{tag:C.imageFirst,single:!0,format:T.boolean,defaultValue:"true"},[w.activityType]:{tag:C.activityType,single:!0,format:T.plainText},[w.revealSolutions]:{tag:C.revealSolutions,single:!0,format:T.boolean}},ee={[R.image]:{tag:B.image},[R.imagePortrait]:{tag:B.imagePortrait,jsonKey:A.imagePortrait},[R.imageLandscape]:{tag:B.imageLandscape,jsonKey:A.imageLandscape},[R.imageEmbed]:{tag:B.imageEmbed,jsonKey:A.imageEmbed},[R.imageLink]:{tag:B.imageLink,jsonKey:A.imageLink},[R.audio]:{tag:B.audio},[R.audioEmbed]:{tag:B.audioEmbed,jsonKey:A.audioEmbed},[R.audioLink]:{tag:B.audioLink,jsonKey:A.audioLink},[R.video]:{tag:B.video},[R.videoEmbed]:{tag:B.videoEmbed,jsonKey:A.videoEmbed},[R.videoLink]:{tag:B.videoLink,jsonKey:A.videoLink},[R.stillImageFilmEmbed]:{tag:B.stillImageFilmEmbed,jsonKey:A.stillImageFilmEmbed},[R.stillImageFilmLink]:{tag:B.stillImageFilmLink,jsonKey:A.stillImageFilmLink},[R.article]:{tag:B.article},[R.articleEmbed]:{tag:B.articleEmbed,jsonKey:A.articleEmbed},[R.articleLink]:{tag:B.articleLink,jsonKey:A.articleLink},[R.document]:{tag:B.document},[R.documentEmbed]:{tag:B.documentEmbed,jsonKey:A.documentEmbed},[R.documentLink]:{tag:B.documentLink,jsonKey:A.documentLink},[R.documentDownload]:{tag:B.documentDownload,jsonKey:A.documentDownload},[R.appLink]:{tag:B.appLink,jsonKey:A.appLink},[R.websiteLink]:{tag:B.websiteLink,jsonKey:A.websiteLink},[R.icon]:{tag:B.icon},[R.backgroundWallpaper]:{tag:B.backgroundWallpaper},[R.imagePlaceholder]:{tag:B.imagePlaceholder}},te={[D.title]:{tag:_.tag_title},[D.anchor]:{tag:_.tag_anchor},[D.tag_reference]:{tag:_.tag_reference},[D.property]:{tag:_.tag_property},[D.itemLead]:{tag:_.tag_itemLead},[D.instruction]:{tag:_.tag_instruction},[D.hint]:{tag:_.tag_hint},[D.true]:{tag:_.tag_true},[D.false]:{tag:_.tag_false},[D.sampleSolution]:{tag:_.tag_sampleSolution},[D.gap]:{tag:_.tag_gap},[D.tag_mark]:{tag:_.tag_mark},[D.resource]:{tag:_.tag_resource}},ie=new class{hydrateTagsConfig(e){const t={tags:{}};for(const i of e){let e;switch(i.type){case h.tag:e=this.hydrateTagConfig(i);break;case h.property:e=this.hydratePropertyTagConfig(i);break;case h.resource:e=this.hydrateResourceTagConfig(i);break;case h.group:e=this.hydrateTagGroupConfig(i)}e&&(t.tags={...t.tags,...e.tags},t.info=Object.assign(t.info??{},e.info))}return t}hydrateCardSetConfig(e){if(!e)return;const t=Q[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const i=[];for(const e of t.variants){const t=[];for(const i of e){const e=this.hydrateCardVariantConfig(i);t.push(e)}i.push(t)}return new H(e,i)}hydrateTagConfig(e){const{configKey:t,maxCount:i,minCount:r,chain:a}=e,n=D.fromKey(t)||$._unknown,o=te[n];if(!o)throw new Error(`No config found for tag config key '${t}'`);const{tag:s,deprecated:l}=o;let c;a&&(c=this.hydrateTagsConfig(a).tags);const u=new W(n,s,i??1,r??0,c,l);return{tags:{[n]:u}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:i,minCount:r,chain:a}=e,n=w.fromKey(t)||$._unknown,o=Z[n];if(!o)throw new Error(`No config found for property config key '${t}'`);const{tag:s,deprecated:l,single:c,format:u,defaultValue:p,jsonKey:d,astKey:g}=o;let h;a&&(h=this.hydrateTagsConfig(a).tags);const m=new z(n,s,i??1,r??0,h,d,g,c,u,p,l);return{tags:{[n]:m}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:i,minCount:r,chain:a}=e,n=R.fromKey(t)||$._unknown,o=ee[n];if(!o)throw new Error(`No config found for resource config key '${t}'`);const{tag:s,deprecated:l,jsonKey:c}=o;let u;a&&(u=this.hydrateTagsConfig(a).tags);const p=new J(n,s,i??1,r??0,u,c,l);return{tags:{[n]:p}}}hydrateTagGroupConfig(e){const{configKey:t}=e,i=V.fromKey(t)||$._unknown,r=X[i];if(!r)throw new Error(`No config found for group config key '${t}'`);const{tags:a}=r,n=this.hydrateTagsConfig(a).tags,o=Object.values(n);if(o.length>0){const t=o[0],i=t;i.maxCount=e.maxCount??t.maxCount,i.minCount=e.minCount??t.minCount}return{tags:n,info:{comboResourceType:r.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:i,bodyRequired:r,repeatCount:a}=e,n=this.hydrateTagsConfig(t);return new q(n.tags,i,r,a)}},re={[m._error]:{since:"1.3.0",tags:[]},[m._comment]:{since:"1.4.12",tags:[]},[m._standard]:{since:"3.2.0",tags:[{type:h.group,configKey:V.group_standardTags}]},[m.appFlashcards]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.tag,configKey:D.title},{type:h.property,configKey:w.flashcardSet,maxCount:y.infinity}],rootExampleType:f.string},[m.appFlashcardsQuiz]:{since:"1.3.0",baseBitType:m.appFlashcards},[m.appFlashcardsLearn]:{since:"1.3.0",baseBitType:m.appFlashcards},[m.appLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceAppLink,minCount:1}],resourceAttachmentAllowed:!1},[m.article]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.title}]},[m.articleAlt]:{since:"1.15.0",baseBitType:m.article},[m.articleResponsive]:{since:"1.21.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.imageFirst}]},[m.articleResponsiveAlt]:{since:"2.0.0",baseBitType:m.articleResponsive},[m.standardArticleNormative]:{since:"1.16.0",baseBitType:m.article},[m.standardArticleNonNormative]:{since:"1.16.0",baseBitType:m.article},[m.smartStandardArticleNormative]:{since:"1.28.0",baseBitType:m.standardArticleNormative},[m.smartStandardArticleNonNormative]:{since:"1.28.0",baseBitType:m.standardArticleNonNormative},[m.smartStandardArticleNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardArticleNormative},[m.smartStandardArticleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardArticleNonNormative},[m.statement]:{since:"1.3.0",baseBitType:m.article},[m.pageArticle]:{since:"1.15.0",baseBitType:m.article},[m.pageArticleAlt]:{since:"1.15.0",baseBitType:m.article},[m.pageArticleResponsive]:{since:"1.21.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.imageFirst}]},[m.buttonCopyText]:{since:"1.4.3",baseBitType:m.article,tags:[{type:h.property,configKey:w.buttonCaption}]},[m.callToAction]:{since:"1.15.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.buttonCaption},{type:h.property,configKey:w.callToActionUrl,minCount:1}]},[m.callToActionSubscribe]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionContact]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionJoin]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionMail]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionLearnMore]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionSeeMore]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionWatch]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionStartNow]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionGetOffer]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionBookNow]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionShopNow]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionGetNow]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionDownload]:{since:"1.15.0",baseBitType:m.callToAction},[m.callToActionCreateAccount]:{since:"1.15.0",baseBitType:m.callToAction},[m.appBitmarkFromJavascript]:{since:"1.4.5",baseBitType:m._standard,tags:[{type:h.property,configKey:w.maxCreatedBits}],textFormatDefault:S.plainText},[m.appBitmarkFromEditor]:{since:"1.4.5",baseBitType:m.appBitmarkFromJavascript},[m.articleEmbed]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceArticleEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.articleLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceArticleLink,minCount:1}],resourceAttachmentAllowed:!1},[m.audio]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceAudio,minCount:1}],resourceAttachmentAllowed:!1},[m.audioEmbed]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceAudioEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.audioLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceAudioLink,minCount:1}],resourceAttachmentAllowed:!1},[m.bitAlias]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.tag_reference},{type:h.tag,configKey:D.anchor}]},[m.diff]:{since:"3.13.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.diffTo}]},[m.book]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_bookCommon}]},[m.bookEnd]:{since:"3.27.0",baseBitType:m.article},[m.bookAcknowledgements]:{since:"1.17.0",baseBitType:m.article},[m.bookAddendum]:{since:"1.3.0",baseBitType:m.article},[m.bookAfterword]:{since:"1.3.0",baseBitType:m.article},[m.bookAppendix]:{since:"1.3.0",baseBitType:m.article},[m.bookArticle]:{since:"1.3.0",baseBitType:m.article},[m.bookAutherBio]:{since:"1.3.0",baseBitType:m.article},[m.bookBibliography]:{since:"1.3.0",baseBitType:m.article},[m.bookComingSoon]:{since:"1.3.0",baseBitType:m.article},[m.bookConclusion]:{since:"1.3.0",baseBitType:m.article},[m.bookCopyright]:{since:"1.3.0",baseBitType:m.article},[m.bookCopyrightPermissions]:{since:"1.3.0",baseBitType:m.article},[m.bookDedication]:{since:"1.3.0",baseBitType:m.article},[m.bookEndnotes]:{since:"1.3.0",baseBitType:m.article},[m.bookEpigraph]:{since:"1.3.0",baseBitType:m.article},[m.bookEpilogue]:{since:"1.3.0",baseBitType:m.article},[m.bookForword]:{since:"1.3.0",baseBitType:m.article},[m.bookFrontispiece]:{since:"1.3.0",baseBitType:m.article},[m.bookImprint]:{since:"1.3.0",baseBitType:m.article},[m.bookIncitingIncident]:{since:"1.3.0",baseBitType:m.article},[m.bookIntroduction]:{since:"1.3.0",baseBitType:m.article},[m.bookListOfContributors]:{since:"1.3.0",baseBitType:m.article},[m.bookNotes]:{since:"1.3.0",baseBitType:m.article},[m.bookPostscript]:{since:"1.3.0",baseBitType:m.article},[m.bookPreface]:{since:"1.3.0",baseBitType:m.article},[m.bookPrologue]:{since:"1.3.0",baseBitType:m.article},[m.bookReadMore]:{since:"1.3.0",baseBitType:m.article},[m.bookReferenceList]:{since:"3.2.0",baseBitType:m._standard,cardSet:P._bookReferenceList},[m.bookRequestForABookReview]:{since:"1.3.0",baseBitType:m.article},[m.bookSummary]:{since:"1.3.0",baseBitType:m.article},[m.bookTeaser]:{since:"1.3.0",baseBitType:m.article},[m.bookTitle]:{since:"1.3.0",baseBitType:m.article},[m.bookCover]:{since:"3.27.0",baseBitType:m.image,tags:[{type:h.tag,configKey:D.title,maxCount:2},{type:h.property,configKey:w.coverColor}]},[m.bookAlias]:{since:"1.4.3",baseBitType:m.book,tags:[{type:h.property,configKey:w.bookAlias,maxCount:y.infinity}]},[m.bookDiff]:{since:"3.10.0",baseBitType:m.book,tags:[{type:h.property,configKey:w.bookDiff}]},[m.bookClose]:{since:"1.18.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.buttonCaption}]},[m.bookReference]:{since:"2.2.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.refAuthor,maxCount:y.infinity},{type:h.property,configKey:w.refBookTitle},{type:h.property,configKey:w.refPublisher,maxCount:y.infinity},{type:h.property,configKey:w.refPublicationYear},{type:h.property,configKey:w.citationStyle}]},[m.botActionResponse]:{since:"1.3.0",baseBitType:m._standard,tags:[],cardSet:P._botActionResponses},[m.botActionSend]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.date}]},[m.browserImage]:{since:"1.3.0",baseBitType:m.image,tags:[{type:h.property,configKey:w.focusX},{type:h.property,configKey:w.focusY}]},[m.card1]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon}]},[m.question1]:{since:"1.3.0",baseBitType:m.card1},[m.survey1]:{since:"1.3.0",baseBitType:m.card1},[m.surveyAnonymous1]:{since:"1.3.0",baseBitType:m.card1},[m.chapter]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.anchor},{type:h.tag,configKey:D.title},{type:h.property,configKey:w.toc},{type:h.property,configKey:w.progress}]},[m.clozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_gap},{type:h.group,configKey:V.group_trueFalse}]},[m.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:m.clozeAndMultipleChoiceText},[m.cloze]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.isCaseSensitive},{type:h.property,configKey:w.quizCountItems},{type:h.property,configKey:w.quizStrikethroughSolutions},{type:h.property,configKey:w.quizStrikethroughSolutions},{type:h.property,configKey:w.additionalSolutions,maxCount:y.infinity},{type:h.group,configKey:V.group_gap}]},[m.clozeInstructionGrouped]:{since:"1.3.0",baseBitType:m.cloze},[m.clozeSolutionGrouped]:{since:"1.3.0",baseBitType:m.cloze},[m.clozeSeveral]:{since:"3.5.0",baseBitType:m.cloze},[m.gapText]:{since:"1.5.15",baseBitType:m.cloze},[m.gapTextInstructionGrouped]:{since:"1.5.15",baseBitType:m.clozeInstructionGrouped},[m.coachSelfReflectionCloze]:{since:"1.3.0",baseBitType:m.cloze},[m.coachCallToActionCloze]:{since:"1.3.0",baseBitType:m.cloze},[m.clozeList]:{since:"1.4.13",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon}],cardSet:P._clozeList},[m.code]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.computerLanguage},{type:h.property,configKey:w.codeLineNumbers},{type:h.property,configKey:w.codeMinimap}],textFormatDefault:S.plainText},[m.formula]:{since:"1.35.0",baseBitType:m._standard,tags:[],textFormatDefault:S.latex},[m.smartStandardFormula]:{since:"3.11.0",baseBitType:m.formula},[m.smartStandardFormulaNonNormative]:{since:"3.11.0",baseBitType:m.formula},[m.smartStandardFormulaNormative]:{since:"3.11.0",baseBitType:m.formula},[m.smartStandardRemarkFormula]:{since:"3.11.0",baseBitType:m.formula},[m.smartStandardRemarkFormulaNonNormative]:{since:"3.11.0",baseBitType:m.formula},[m.smartStandardRemarkFormulaNormative]:{since:"3.11.0",baseBitType:m.formula},[m.appCodeCell]:{since:"1.4.3",baseBitType:m.code},[m.appCodeEditor]:{since:"1.4.3",baseBitType:m.code},[m.appCodeIde]:{since:"1.4.3",baseBitType:m.code},[m.codeRuntime]:{since:"1.4.3",baseBitType:m.code},[m.consoleLog]:{since:"1.4.3",baseBitType:m.code},[m.output]:{since:"1.4.3",baseBitType:m.code},[m.stdout]:{since:"1.4.3",baseBitType:m.code},[m.step]:{since:"1.5.1",baseBitType:m.article},[m.stepImageScreenshot]:{since:"1.5.1",baseBitType:m.image},[m.stepImageScreenshotWithPointer]:{since:"1.5.1",baseBitType:m.image,tags:[{type:h.property,configKey:w.pointerTop,minCount:1,maxCount:1},{type:h.property,configKey:w.pointerLeft,minCount:1,maxCount:1}]},[m.milestone]:{since:"1.20.0",baseBitType:m.step},[m.conversationLeft1]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_person}]},[m.conversationLeft1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.conversationLeft1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.conversationRight1]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.conversationRight1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.conversationRight1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationLeft1]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationLeft1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationLeft1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationRight1]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationRight1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.clozeAndMultipleChoiceTextConversationRight1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1},[m.cookPreparation]:{since:"1.3.0",baseBitType:m.article},[m.cookStep]:{since:"1.3.0",baseBitType:m.article},[m.cookIngredients]:{since:"1.5.16",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_technicalTerm},{type:h.property,configKey:w.servings,chain:[{type:h.property,configKey:w.unit},{type:h.property,configKey:w.unitAbbr},{type:h.property,configKey:w.decimalPlaces},{type:h.property,configKey:w.disableCalculation},{type:h.tag,configKey:D.hint}]}],cardSet:P._ingredients},[m.recipe]:{since:"1.5.24",baseBitType:m.cookIngredients},[m.cookRemark]:{since:"1.3.0",baseBitType:m.article},[m.cookVariation]:{since:"1.3.0",baseBitType:m.article},[m.cookInsert]:{since:"1.3.0",baseBitType:m.article},[m.cookNoteOnQuantity]:{since:"3.27.0",baseBitType:m.article},[m.cookArrangement]:{since:"1.3.0",baseBitType:m.article},[m.cookPracticeAdvise]:{since:"1.3.0",baseBitType:m.article},[m.cookPlate]:{since:"1.3.0",baseBitType:m.article},[m.cookRecommendation]:{since:"1.3.0",baseBitType:m.article},[m.cookPersonalRecommendation]:{since:"1.3.0",baseBitType:m.article},[m.cookSideDrink]:{since:"1.3.0",baseBitType:m.article},[m.cookSideDish]:{since:"1.3.0",baseBitType:m.article},[m.cookTimer]:{since:"1.3.0",baseBitType:m.article},[m.document]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceDocument,minCount:1}],resourceAttachmentAllowed:!1},[m.documentDownload]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceDocumentDownload,minCount:1}],resourceAttachmentAllowed:!1},[m.leDocumentDownload]:{since:"3.18.0",baseBitType:m.documentDownload},[m.documentEmbed]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceDocumentEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.documentLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceDocumentLink,minCount:1}],resourceAttachmentAllowed:!1},[m.essay]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.reasonableNumOfChars},{type:h.property,configKey:w.property_sampleSolution},{type:h.property,configKey:w.additionalSolutions,maxCount:y.infinity},{type:h.property,configKey:w.partialAnswer},{type:h.property,configKey:w.property_reference,maxCount:y.infinity}],rootExampleType:f.string},[m.coachSelfReflectionEssay]:{since:"1.3.0",baseBitType:m.essay},[m.coachCallToActionEssay]:{since:"1.3.0",baseBitType:m.essay},[m.example]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.title}],rootExampleType:f.string},[m.exampleAlt]:{since:"1.16.0",baseBitType:m.example},[m.standardExampleNormative]:{since:"1.16.0",baseBitType:m.example},[m.standardExampleNonNormative]:{since:"1.16.0",baseBitType:m.example},[m.smartStandardExampleNormative]:{since:"1.28.0",baseBitType:m.standardExampleNormative},[m.smartStandardExampleNonNormative]:{since:"1.28.0",baseBitType:m.standardExampleNonNormative},[m.smartStandardExampleNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardExampleNormative},[m.smartStandardExampleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardExampleNonNormative},[m.appAiPrompt]:{since:"1.3.0",baseBitType:m.article},[m.aiPrompt]:{since:"1.3.0",baseBitType:m.article},[m.articleAi]:{since:"1.3.0",baseBitType:m.article},[m.articleAttachment]:{since:"1.3.0",baseBitType:m.article},[m.assignment]:{since:"1.3.0",baseBitType:m.essay},[m.audioTranscript]:{since:"1.3.0",baseBitType:m.article},[m.bitmarkExample]:{since:"1.3.0",baseBitType:m.example},[m.blogArticle]:{since:"1.3.0",baseBitType:m.article},[m.bug]:{since:"1.3.0",baseBitType:m.article},[m.bugAlt]:{since:"1.16.0",baseBitType:m.bug},[m.checklist]:{since:"1.3.0",baseBitType:m.article},[m.coachAudioTranscript]:{since:"1.3.0",baseBitType:m.article},[m.coachCallToActionChecklist]:{since:"1.3.0",baseBitType:m.article},[m.coachHomeRules]:{since:"1.3.0",baseBitType:m.article},[m.coachVideoTranscript]:{since:"1.3.0",baseBitType:m.article},[m.correction]:{since:"1.3.0",baseBitType:m.article},[m.danger]:{since:"1.3.0",baseBitType:m.article},[m.dangerAlt]:{since:"1.16.0",baseBitType:m.article},[m.definitionTerm]:{since:"1.34.0",baseBitType:m.article},[m.deleted]:{since:"3.9.0",baseBitType:m.article},[m.details1]:{since:"1.3.0",baseBitType:m.article},[m.details]:{since:"1.3.0",baseBitType:m.article},[m.qAndA]:{since:"3.5.0",baseBitType:m.article},[m.editorial]:{since:"1.3.0",baseBitType:m.article},[m.editorNote]:{since:"1.3.0",baseBitType:m.article},[m.featured]:{since:"1.3.0",baseBitType:m.article},[m.glossaryTerm]:{since:"1.33.0",baseBitType:m.article},[m.help]:{since:"1.3.0",baseBitType:m.article},[m.helpAlt]:{since:"1.16.0",baseBitType:m.help},[m.hint]:{since:"1.3.0",baseBitType:m.article},[m.hintAlt]:{since:"1.16.0",baseBitType:m.hint},[m.indexTerm]:{since:"1.33.0",baseBitType:m.article},[m.info]:{since:"1.3.0",baseBitType:m.article},[m.infoAlt]:{since:"1.16.0",baseBitType:m.info},[m.langLearningOutcomes]:{since:"1.3.0",baseBitType:m.article},[m.langEnablingLanguageSkills]:{since:"1.3.0",baseBitType:m.article},[m.langLifeSkills]:{since:"1.3.0",baseBitType:m.article},[m.langEnglishAroundWorld]:{since:"1.3.0",baseBitType:m.article},[m.langGoodToKnow]:{since:"1.3.0",baseBitType:m.article},[m.langLearningGoal]:{since:"1.3.0",baseBitType:m.article},[m.langLearningStrategy]:{since:"1.3.0",baseBitType:m.article},[m.langLikeALocal]:{since:"1.3.0",baseBitType:m.article},[m.langMaterial]:{since:"1.3.0",baseBitType:m.article},[m.langUsefulPhrases]:{since:"1.3.0",baseBitType:m.article},[m.langLevelDown]:{since:"1.3.0",baseBitType:m.article},[m.langLevelUp]:{since:"1.3.0",baseBitType:m.article},[m.langExtraActivity]:{since:"1.3.0",baseBitType:m.article},[m.langVideoScript]:{since:"1.3.0",baseBitType:m.article},[m.langAudioScript]:{since:"1.3.0",baseBitType:m.article},[m.langVocabulary]:{since:"1.3.0",baseBitType:m.article},[m.langHomework]:{since:"1.3.0",baseBitType:m.article},[m.langTeacherNote]:{since:"1.3.0",baseBitType:m.article},[m.langTeacherPronunciation]:{since:"1.3.0",baseBitType:m.article},[m.list]:{since:"1.22.0",baseBitType:m.article},[m.standardList]:{since:"1.22.0",baseBitType:m.article},[m.smartStandardList]:{since:"1.28.0",baseBitType:m.standardList},[m.smartStandardListCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardList},[m.message]:{since:"1.3.0",baseBitType:m.article},[m.newspaperArticle]:{since:"1.3.0",baseBitType:m.article},[m.note]:{since:"1.3.0",baseBitType:m.article},[m.noteAlt]:{since:"1.16.0",baseBitType:m.note},[m.standardNoteNormative]:{since:"1.16.0",baseBitType:m.note},[m.standardNoteNonNormative]:{since:"1.16.0",baseBitType:m.note},[m.smartStandardNoteNormative]:{since:"1.28.0",baseBitType:m.standardNoteNormative},[m.smartStandardNoteNonNormative]:{since:"1.28.0",baseBitType:m.standardNoteNonNormative},[m.smartStandardNoteNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardNoteNormative},[m.smartStandardNoteNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardNoteNonNormative},[m.noteAi]:{since:"1.3.0",baseBitType:m.note},[m.notebookArticle]:{since:"1.3.0",baseBitType:m.article},[m.preparationNote]:{since:"1.3.0",baseBitType:m.article},[m.releaseNotesSummary]:{since:"1.3.0",baseBitType:m.article},[m.remark]:{since:"1.3.0",baseBitType:m.article},[m.remarkAlt]:{since:"1.16.0",baseBitType:m.remark},[m.standardRemarkNormative]:{since:"1.16.0",baseBitType:m.article},[m.standardRemarkNonNormative]:{since:"1.16.0",baseBitType:m.article},[m.smartStandardRemarkNormative]:{since:"1.28.0",baseBitType:m.standardRemarkNormative},[m.smartStandardRemarkNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkNonNormative},[m.smartStandardRemarkNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkNormative},[m.smartStandardRemarkNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkNonNormative},[m.selfAssessment]:{since:"1.3.0",baseBitType:m.article},[m.separator]:{since:"1.4.15",baseBitType:m.article},[m.separatorAlt]:{since:"1.16.0",baseBitType:m.separator},[m.sticker]:{since:"1.5.28",baseBitType:m.article},[m.sideNote]:{since:"1.3.0",baseBitType:m.article},[m.summary]:{since:"1.3.0",baseBitType:m.article},[m.summaryAi]:{since:"1.3.0",baseBitType:m.summary},[m.videoTranscript]:{since:"1.3.0",baseBitType:m.article},[m.warning]:{since:"1.3.0",baseBitType:m.article},[m.warningAlt]:{since:"1.16.0",baseBitType:m.warning},[m.workbookArticle]:{since:"1.3.0",baseBitType:m.article},[m.collapsible]:{since:"1.21.0",baseBitType:m.article},[m.sideNoteCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.infoCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.remarkCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.warningCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.dangerCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.noteCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.exampleCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.hintCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.bugCollapsible]:{since:"1.21.0",baseBitType:m.article},[m.platformPath]:{since:"3.14.1",baseBitType:m._standard,tags:[{type:h.property,configKey:w.path}]},[m.container]:{since:"1.9.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.allowedBit,maxCount:y.infinity}]},[m.containerWrap]:{since:"1.9.0",baseBitType:m.container},[m.containerNowrap]:{since:"1.9.0",baseBitType:m.container},[m.containerNowrapStretch]:{since:"1.9.0",baseBitType:m.container},[m.containerGroup]:{since:"1.9.0",baseBitType:m.container},[m.containerFolder]:{since:"1.9.0",baseBitType:m.container},[m.containerCarousel]:{since:"1.11.0",baseBitType:m.container},[m.containerCards]:{since:"1.11.0",baseBitType:m.container},[m.containerGrid]:{since:"1.11.0",baseBitType:m.container},[m.containerStack]:{since:"1.11.0",baseBitType:m.container},[m.containerSlides]:{since:"1.11.0",baseBitType:m.container},[m.containerGallery]:{since:"1.11.0",baseBitType:m.container},[m.containerScroller]:{since:"1.11.0",baseBitType:m.container},[m.containerTabs]:{since:"1.11.0",baseBitType:m.container},[m.containerAccordionTabs]:{since:"1.11.0",baseBitType:m.container},[m.containerFolderAll]:{since:"1.11.0",baseBitType:m.container},[m.containerBits2]:{since:"1.11.0",baseBitType:m.container},[m.containerCookRecipe]:{since:"1.11.0",baseBitType:m.container},[m.containerNewsArticle]:{since:"1.11.0",baseBitType:m.container},[m.containerPreview]:{since:"1.11.0",baseBitType:m.container},[m.pageContainer]:{since:"1.9.0",baseBitType:m.container},[m.pageContainerWrap]:{since:"1.9.0",baseBitType:m.pageContainer},[m.pageContainerNowrap]:{since:"1.9.0",baseBitType:m.pageContainer},[m.pageContainerNowrapStretch]:{since:"1.9.0",baseBitType:m.pageContainer},[m.pageContainerFolder]:{since:"1.9.0",baseBitType:m.pageContainer},[m.pageContainerGroup]:{since:"1.9.0",baseBitType:m.pageContainer},[m.metalevelExplanation]:{since:"1.10.0",baseBitType:m.article},[m.module]:{since:"1.5.26",baseBitType:m.article,tags:[{type:h.property,configKey:w.hasBookNavigation},{type:h.property,configKey:w.productId,minCount:1,maxCount:y.infinity},{type:h.property,configKey:w.duration}]},[m.moduleProduct]:{since:"1.9.0",baseBitType:m.module,tags:[{type:h.property,configKey:w.productId,minCount:1}]},[m.exampleList]:{since:"1.4.13",baseBitType:m.example,cardSet:P._exampleBitList,rootExampleType:f.string},[m.extractorPage]:{since:"1.5.17",baseBitType:m.image},[m.extractorPageCollapsible]:{since:"1.30.0",baseBitType:m.extractorPage},[m.extractorPageWithBlocks]:{since:"1.5.21",baseBitType:m.image},[m.extractorPageWithBlocksCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageWithBlocks},[m.extractorConfiguration]:{since:"1.7.1",baseBitType:m._standard,tags:[],textFormatDefault:S.plainText},[m.extractorInformation]:{since:"3.8.0",baseBitType:m._standard,tags:[],textFormatDefault:S.json},[m.extractorAiChat]:{since:"3.19.0",baseBitType:m._standard},[m.extractorBlock]:{since:"1.5.16",baseBitType:m._standard,tags:[{type:h.property,configKey:w.blockId},{type:h.property,configKey:w.pageNo},{type:h.property,configKey:w.x},{type:h.property,configKey:w.y},{type:h.property,configKey:w.width},{type:h.property,configKey:w.height},{type:h.property,configKey:w.index},{type:h.property,configKey:w.classification},{type:h.property,configKey:w.availableClassifications,maxCount:y.infinity},{type:h.group,configKey:V.group_resourceImage,minCount:1}],resourceAttachmentAllowed:!1},[m.extractorRepeatedText]:{since:"1.5.21",baseBitType:m.article},[m.extractorPageNumber]:{since:"1.5.21",baseBitType:m.article},[m.extractorPageNumberCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageNumber},[m.extractorPageHeader]:{since:"1.5.21",baseBitType:m.article},[m.extractorPageHeaderCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageHeader},[m.extractorPageFooter]:{since:"1.5.21",baseBitType:m.article},[m.extractorPageFooterCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageFooter},[m.pageOpenBook]:{since:"1.5.10",baseBitType:m.article,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.book,chain:[{type:h.tag,configKey:D.tag_reference,maxCount:2}]},{type:h.tag,configKey:D.tag_reference},{type:h.property,configKey:w.buttonCaption}]},[m.pageOpenBookList]:{since:"2.1.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.book,maxCount:y.infinity,chain:[{type:h.tag,configKey:D.tag_reference,maxCount:2}]},{type:h.property,configKey:w.buttonCaption}]},[m.pageSubscribe]:{since:"1.5.10",baseBitType:m.article,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.buttonCaption},{type:h.property,configKey:w.mailingList}]},[m.assignmentList]:{since:"1.4.13",baseBitType:m.exampleList},[m.pageFooter]:{since:"1.4.13",baseBitType:m.article,tags:[{type:h.property,configKey:w.slug}],cardSet:P._exampleBitList},[m.legend]:{since:"3.12.0",baseBitType:m._standard,tags:[],cardSet:P._definitionList},[m.smartStandardLegend]:{since:"3.12.0",baseBitType:m.legend},[m.smartStandardLegendNonNormative]:{since:"3.12.0",baseBitType:m.legend},[m.smartStandardLegendNormative]:{since:"3.12.0",baseBitType:m.legend},[m.smartStandardRemarkLegend]:{since:"3.12.0",baseBitType:m.legend},[m.smartStandardRemarkLegendNonNormative]:{since:"3.12.0",baseBitType:m.legend},[m.smartStandardRemarkLegendNormative]:{since:"3.12.0",baseBitType:m.legend},[m.definitionList]:{since:"1.34.0",baseBitType:m._standard,tags:[],cardSet:P._definitionList},[m.metaSearchDefaultTerms]:{since:"3.12.0",baseBitType:m._standard,tags:[],cardSet:P._definitionList},[m.metaSearchDefaultTopics]:{since:"3.12.0",baseBitType:m.metaSearchDefaultTerms},[m.flashcard]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon}],cardSet:P._flashcard},[m.flashcard1]:{since:"1.3.0",baseBitType:m.flashcard},[m.qAndACard]:{since:"3.25.0",baseBitType:m.flashcard1},[m.focusImage]:{since:"1.3.0",baseBitType:m.image,tags:[{type:h.property,configKey:w.focusX},{type:h.property,configKey:w.focusY}]},[m.highlightText]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}]},[m.image]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.resource,configKey:R.backgroundWallpaper,chain:[{type:h.group,configKey:V.group_resourceImageCommon}]},{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceImage,minCount:1}],resourceAttachmentAllowed:!1},[m.appCreateBitsFromImage]:{since:"1.3.0",baseBitType:m.image},[m.appGetScreenshot]:{since:"1.3.0",baseBitType:m.image},[m.detailsImage]:{since:"1.3.0",baseBitType:m.image},[m.figure]:{since:"1.3.0",baseBitType:m.image,cardSet:P._definitionList},[m.imageBanner]:{since:"1.3.0",baseBitType:m.image},[m.imageFigure]:{since:"1.3.0",baseBitType:m.image,cardSet:P._definitionList},[m.imageFigureAlt]:{since:"1.16.0",baseBitType:m.imageFigure},[m.standardImageFigureNormative]:{since:"1.16.0",baseBitType:m.imageFigure},[m.standardImageFigureNonNormative]:{since:"1.16.0",baseBitType:m.imageFigure},[m.smartStandardImageFigureNormative]:{since:"1.28.0",baseBitType:m.standardImageFigureNormative},[m.smartStandardImageFigureNonNormative]:{since:"1.28.0",baseBitType:m.standardImageFigureNonNormative},[m.smartStandardImageFigureNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardImageFigureNormative},[m.smartStandardImageFigureNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardImageFigureNonNormative},[m.imageLandscape]:{since:"1.3.0",baseBitType:m.image},[m.imageMood]:{since:"1.3.0",baseBitType:m.image},[m.imagePortrait]:{since:"1.3.0",baseBitType:m.image},[m.imagePrototype]:{since:"1.3.0",baseBitType:m.image},[m.imageSeparator]:{since:"1.4.15",baseBitType:m.image},[m.imageSeparatorAlt]:{since:"1.16.0",baseBitType:m.imageSeparator},[m.imageScreenshot]:{since:"1.3.0",baseBitType:m.image},[m.imageStyled]:{since:"1.3.0",baseBitType:m.image},[m.imageSuperWide]:{since:"1.3.0",baseBitType:m.image},[m.imageZoom]:{since:"1.3.0",baseBitType:m.image},[m.langLifeSkillIcon]:{since:"1.3.0",baseBitType:m.image},[m.lifeSkillSticker]:{since:"1.3.0",baseBitType:m.image},[m.pageBanner]:{since:"1.4.3",baseBitType:m.image,tags:[{type:h.property,configKey:w.slug}]},[m.pageHero]:{since:"1.11.0",baseBitType:m.pageBanner},[m.screenshot]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:m.image},[m.tableImage]:{since:"1.5.15",baseBitType:m.image,tags:[{type:h.property,configKey:w.caption}]},[m.tableImageAlt]:{since:"1.16.0",baseBitType:m.tableImage},[m.standardTableImageNormative]:{since:"1.16.0",baseBitType:m.tableImage},[m.standardTableImageNonNormative]:{since:"1.16.0",baseBitType:m.tableImage},[m.standardRemarkTableImageNormative]:{since:"1.17.0",baseBitType:m.tableImage},[m.standardRemarkTableImageNonNormative]:{since:"1.17.0",baseBitType:m.tableImage},[m.smartStandardTableImageNormative]:{since:"1.28.0",baseBitType:m.standardTableImageNormative},[m.smartStandardTableImageNonNormative]:{since:"1.28.0",baseBitType:m.standardTableImageNonNormative},[m.smartStandardRemarkTableImageNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableImageNormative},[m.smartStandardRemarkTableImageNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableImageNonNormative},[m.smartStandardTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableImageNormative},[m.smartStandardTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableImageNonNormative},[m.smartStandardRemarkTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableImageNormative},[m.smartStandardRemarkTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableImageNonNormative},[m.imageLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceImageLink,minCount:1}],resourceAttachmentAllowed:!1},[m.imageOnDevice]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceImage},{type:h.group,configKey:V.group_imageSource}],resourceAttachmentAllowed:!1},[m.imageResponsive]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceImageResponsive}],resourceAttachmentAllowed:!1},[m.imagesLogoGrave]:{since:"1.5.11",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceImage,minCount:1,maxCount:y.infinity}],resourceAttachmentAllowed:!1},[m.prototypeImages]:{since:"1.6.1",baseBitType:m.imagesLogoGrave},[m.internalLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.tag_reference}]},[m.interview]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.reasonableNumOfChars}],cardSet:P._questions},[m.interviewInstructionGrouped]:{since:"1.3.0",baseBitType:m.interview},[m.botInterview]:{since:"1.3.0",baseBitType:m.interview},[m.learningPathBook]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_learningPathCommon}]},[m.bookLink]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.bookLinkNext]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.bookLinkPrev]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathClassroomEvent]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathClassroomTraining]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathClosing]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathFeedback]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathLearningGoal]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathLti]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathSign]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathStep]:{since:"1.3.0",baseBitType:m.learningPathBook},[m.learningPathBotTraining]:{since:"1.3.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.bot}]},[m.learningPathExternalLink]:{since:"1.3.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.externalLink},{type:h.property,configKey:w.externalLinkText}]},[m.learningPathVideoCall]:{since:"1.3.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.videoCallLink}]},[m.leLearningObjectives]:{since:"1.25.0",baseBitType:m.learningPathLearningGoal,tags:[{type:h.property,configKey:w.activityType}]},[m.leVideoCall]:{since:"1.25.0",baseBitType:m.learningPathVideoCall,tags:[{type:h.property,configKey:w.activityType}]},[m.leClassroomEvent]:{since:"1.25.0",baseBitType:m.learningPathClassroomEvent,tags:[{type:h.property,configKey:w.activityType}]},[m.leMultiDayEvent]:{since:"3.32.0",baseBitType:m.leClassroomEvent},[m.leCompletion]:{since:"1.25.0",baseBitType:m.learningPathClosing,tags:[{type:h.property,configKey:w.activityType}]},[m.leExternalLink]:{since:"1.25.0",baseBitType:m.learningPathExternalLink,tags:[{type:h.property,configKey:w.activityType}]},[m.leReadBook]:{since:"1.25.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.activityType}]},[m.leLearningStep]:{since:"1.25.0",baseBitType:m.learningPathStep,tags:[{type:h.property,configKey:w.activityType}]},[m.lePreparationTask]:{since:"1.26.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.activityType}]},[m.leRead]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leTask]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leTodo]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leFollowUpTask]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leFinishingTask]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leAssignment]:{since:"1.27.0",baseBitType:m.lePreparationTask},[m.leWatchVideoEmbed]:{since:"1.27.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.activityType},{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceVideoEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.leListenAudioEmbed]:{since:"1.27.0",baseBitType:m.learningPathBook,tags:[{type:h.property,configKey:w.activityType},{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceAudioEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.listItem]:{since:"1.22.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.listItemIndent}]},[m.standardListItem]:{since:"1.22.0",baseBitType:m.listItem},[m.smartStandardListItem]:{since:"1.28.0",baseBitType:m.standardListItem},[m.smartStandardListItemCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardListItem},[m.mark]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_markConfig},{type:h.group,configKey:V.group_mark}]},[m.match]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.isCaseSensitive}],cardSet:P._matchPairs},[m.matchAll]:{since:"1.3.0",baseBitType:m.match},[m.matchReverse]:{since:"1.3.0",baseBitType:m.match},[m.matchAllReverse]:{since:"1.3.0",baseBitType:m.match},[m.matchSolutionGrouped]:{since:"1.3.0",baseBitType:m.match},[m.matchMatrix]:{since:"1.3.0",baseBitType:m.match,cardSet:P._matchMatrix},[m.matchAudio]:{since:"1.3.0",baseBitType:m.match,cardSet:P._matchAudioPairs},[m.matchPicture]:{since:"1.3.0",baseBitType:m.match,cardSet:P._matchImagePairs},[m.feedback]:{since:"3.13.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.reasonableNumOfChars}],cardSet:P._feedback},[m.learningDocumentationFeedback]:{since:"3.13.0",baseBitType:m.feedback},[m.handInFeedbackExpert]:{since:"3.30.0",baseBitType:m.feedback},[m.handInFeedbackSelf]:{since:"3.30.0",baseBitType:m.feedback},[m.multipleChoice1]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}]},[m.coachSelfReflectionMultipleChoice1]:{since:"1.3.0",baseBitType:m.multipleChoice1},[m.multipleChoice]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}],cardSet:P._quiz},[m.coachSelfReflectionMultipleChoice]:{since:"1.3.0",baseBitType:m.multipleChoice},[m.multipleChoiceText]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}]},[m.coachCallToActionMultipleChoiceText]:{since:"1.3.0",baseBitType:m.multipleChoiceText},[m.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0",baseBitType:m.multipleChoiceText},[m.multipleResponse1]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}]},[m.coachSelfReflectionMultipleResponse1]:{since:"1.3.0",baseBitType:m.multipleResponse1},[m.multipleResponse]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.group,configKey:V.group_trueFalse}],cardSet:P._quiz},[m.coachSelfReflectionMultipleResponse]:{since:"1.3.0",baseBitType:m.multipleResponse},[m.page]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.title},{type:h.property,configKey:w.thumbImage}]},[m.pageCollapsible]:{since:"1.30.0",baseBitType:m.page},[m.pageCoverImage]:{since:"1.22.0",baseBitType:m.page},[m.pageBuyButton]:{since:"1.4.3",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.content2Buy},{type:h.property,configKey:w.buttonCaption}]},[m.pageBuyButtonAlt]:{since:"1.31.0",baseBitType:m.pageBuyButton},[m.pageBuyButtonPromotion]:{since:"1.5.11",baseBitType:m.pageBuyButton},[m.pageSubpage]:{since:"1.6.6",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.page}]},[m.pageShopInShop]:{since:"1.6.6",baseBitType:m.pageSubpage},[m.pageCategory]:{since:"1.6.6",baseBitType:m.pageSubpage},[m.pageAcademy]:{since:"1.6.6",baseBitType:m.pageSubpage},[m.pagePromotion]:{since:"1.6.6",baseBitType:m.pageSubpage},[m.pageSpecial]:{since:"1.6.6",baseBitType:m.pageSubpage},[m.pagePerson]:{since:"1.5.16",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.group,configKey:V.group_person},{type:h.property,configKey:w.buttonCaption}]},[m.pageProduct]:{since:"1.4.17",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.product}]},[m.pageProductList]:{since:"1.4.17",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.productList,maxCount:y.infinity}]},[m.pageProductVideo]:{since:"1.4.17",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.productVideo}]},[m.pageProductVideoList]:{since:"1.4.17",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.productVideoList,maxCount:y.infinity}]},[m.pageSectionFolder]:{since:"1.4.17",baseBitType:m._standard,tags:[{type:h.property,configKey:w.slug},{type:h.property,configKey:w.productFolder}]},[m.photo]:{since:"1.3.0",baseBitType:m.image},[m.quote]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.quotedPerson}]},[m.rating]:{since:"1.3.0",baseBitType:m._standard,tags:[]},[m.coachSelfReflectionRating]:{since:"1.3.0",baseBitType:m.rating},[m.releaseNote]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.releaseVersion},{type:h.property,configKey:w.releaseKind},{type:h.property,configKey:w.releaseDate}]},[m.reviewNote]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.title},{type:h.property,configKey:w.resolved},{type:h.property,configKey:w.resolvedDate},{type:h.property,configKey:w.resolvedBy}],rootExampleType:f.string},[m.reviewAuthorNote]:{since:"1.3.0",baseBitType:m.reviewNote},[m.reviewCustomerNote]:{since:"3.5.0",baseBitType:m.reviewNote},[m.reviewReviewerNote]:{since:"1.3.0",baseBitType:m.reviewNote},[m.reviewRequestForReviewNote]:{since:"1.3.0",baseBitType:m.reviewNote},[m.reviewApprovedNote]:{since:"1.3.0",baseBitType:m.reviewNote},[m.sampleSolution]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.tag,configKey:D.anchor},{type:h.tag,configKey:D.tag_reference}]},[m.sequence]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon}],cardSet:P._elements,rootExampleType:f.boolean},[m.stillImageFilm]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceStillImageFilm}],resourceAttachmentAllowed:!1},[m.stillImageFilmEmbed]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceStillImageFilmEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.stillImageFilmLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceStillImageFilmLink,minCount:1}],resourceAttachmentAllowed:!1},[m.surveyAnonymous]:{since:"1.3.0",baseBitType:m._standard,tags:[]},[m.survey]:{since:"1.3.0",baseBitType:m._standard,tags:[]},[m.surveyMatrix]:{since:"1.6.2",baseBitType:m.image,tags:[{type:h.property,configKey:w.pointerTop,minCount:1,maxCount:1},{type:h.property,configKey:w.pointerLeft,minCount:1,maxCount:1},{type:h.property,configKey:w.buttonCaption,minCount:1,maxCount:1}]},[m.surveyMatrixMe]:{since:"1.6.2",baseBitType:m.surveyMatrix},[m.surveyRating]:{since:"1.6.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.ratingLevelStart,chain:[{type:h.property,configKey:w.label}]},{type:h.property,configKey:w.ratingLevelEnd,chain:[{type:h.property,configKey:w.label}]},{type:h.property,configKey:w.ratingLevelSelected},{type:h.property,configKey:w.buttonCaption}]},[m.surveyRatingOnce]:{since:"1.6.0",baseBitType:m.surveyRating},[m.surveyRatingDisplay]:{since:"1.6.0",baseBitType:m.surveyRating},[m.scorm]:{since:"1.5.11",baseBitType:m._standard,tags:[{type:h.property,configKey:w.scormSource},{type:h.property,configKey:w.posterImage}]},[m.pronunciationTable]:{since:"3.1.0",baseBitType:m._standard,tags:[],cardSet:P._pronunciationTable},[m.table]:{since:"1.5.19",baseBitType:m._standard,tags:[{type:h.property,configKey:w.caption},{type:h.property,configKey:w.tableFixedHeader},{type:h.property,configKey:w.tableHeaderWhitespaceNoWrap},{type:h.property,configKey:w.tableSearch},{type:h.property,configKey:w.tableSort},{type:h.property,configKey:w.tablePagination},{type:h.property,configKey:w.tablePaginationLimit},{type:h.property,configKey:w.tableHeight},{type:h.property,configKey:w.tableWhitespaceNoWrap},{type:h.property,configKey:w.tableAutoWidth},{type:h.property,configKey:w.tableResizableColumns},{type:h.property,configKey:w.tableColumnMinWidth}],cardSet:P._table},[m.tableAlt]:{since:"1.16.0",baseBitType:m.table},[m.standardTableNormative]:{since:"1.16.0",baseBitType:m.table},[m.standardTableNonNormative]:{since:"1.16.0",baseBitType:m.table},[m.standardRemarkTableNormative]:{since:"1.17.0",baseBitType:m.table},[m.standardRemarkTableNonNormative]:{since:"1.17.0",baseBitType:m.table},[m.smartStandardTableNormative]:{since:"1.28.0",baseBitType:m.standardTableNormative},[m.smartStandardTableNonNormative]:{since:"1.28.0",baseBitType:m.standardTableNonNormative},[m.smartStandardRemarkTableNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableNormative},[m.smartStandardRemarkTableNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableNonNormative},[m.smartStandardTableNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableNormative},[m.smartStandardTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableNonNormative},[m.smartStandardRemarkTableNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableNormative},[m.smartStandardRemarkTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableNonNormative},[m.parameters]:{since:"1.18.0",baseBitType:m.table},[m.toc]:{since:"1.3.0",baseBitType:m._standard,tags:[]},[m.tocChapter]:{since:"1.5.5",baseBitType:m.toc,tags:[{type:h.property,configKey:w.maxDisplayLevel}]},[m.tocInline]:{since:"3.24.0",baseBitType:m.toc,tags:[{type:h.property,configKey:w.maxTocChapterLevel}]},[m.tocResource]:{since:"3.31.0",baseBitType:m.toc,tags:[{type:h.property,configKey:w.tocResource,maxCount:y.infinity},{type:h.property,configKey:w.buttonCaption}]},[m.tocContent]:{since:"3.31.0",baseBitType:m.toc,tags:[{type:h.property,configKey:w.tocContent,maxCount:y.infinity},{type:h.property,configKey:w.buttonCaption}]},[m.anchor]:{since:"1.3.0",baseBitType:m._standard},[m.bitBookEnding]:{since:"1.3.0",baseBitType:m._standard},[m.bitBookSummary]:{since:"1.3.0",baseBitType:m._standard},[m.botActionAnnounce]:{since:"1.3.0",baseBitType:m._standard},[m.botActionRatingNumber]:{since:"1.3.0",baseBitType:m._standard},[m.botActionRemind]:{since:"1.3.0",baseBitType:m._standard},[m.botActionSave]:{since:"1.3.0",baseBitType:m._standard},[m.botActionTrueFalse]:{since:"1.3.0",baseBitType:m._standard},[m.chapterSubjectMatter]:{since:"1.3.0",baseBitType:m._standard},[m.chat]:{since:"1.3.0",baseBitType:m._standard},[m.conclusion]:{since:"1.3.0",baseBitType:m._standard},[m.conclusionAlt]:{since:"1.16.0",baseBitType:m.conclusion},[m.documentUpload]:{since:"1.3.0",baseBitType:m._standard},[m.footNote]:{since:"1.3.0",baseBitType:m._standard},[m.groupBorn]:{since:"1.3.0",baseBitType:m._standard},[m.groupDied]:{since:"1.3.0",baseBitType:m._standard},[m.recordAudio]:{since:"1.3.0",baseBitType:m._standard},[m.recordVideo]:{since:"1.5.24",baseBitType:m._standard},[m.stickyNote]:{since:"1.3.0",baseBitType:m._standard},[m.takePicture]:{since:"1.3.0",baseBitType:m._standard},[m.handInAudio]:{since:"1.5.15",baseBitType:m._standard},[m.handInContact]:{since:"1.5.15",baseBitType:m._standard},[m.handInDocument]:{since:"1.5.15",baseBitType:m._standard},[m.handInFile]:{since:"3.2.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.handInAcceptFileType,maxCount:y.infinity}]},[m.handInLocation]:{since:"1.5.15",baseBitType:m._standard},[m.handInPhoto]:{since:"1.5.15",baseBitType:m._standard},[m.handInScan]:{since:"1.5.15",baseBitType:m._standard},[m.handInSubmit]:{since:"3.2.0",baseBitType:m._standard,tags:[{type:h.property,configKey:w.handInRequirement,maxCount:y.infinity},{type:h.property,configKey:w.handInInstruction},{type:h.property,configKey:w.buttonCaption}]},[m.handInVideo]:{since:"1.5.15",baseBitType:m._standard},[m.handInVoice]:{since:"1.5.15",baseBitType:m._standard},[m.trueFalse1]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.labelTrue},{type:h.property,configKey:w.labelFalse},{type:h.tag,configKey:D.true},{type:h.tag,configKey:D.false}],rootExampleType:f.boolean},[m.trueFalse]:{since:"1.3.0",baseBitType:m._standard,quizBit:!0,tags:[{type:h.group,configKey:V.group_quizCommon},{type:h.property,configKey:w.labelTrue},{type:h.property,configKey:w.labelFalse}],cardSet:P._statements},[m.vendorAmcharts5Chart]:{since:"1.5.8",baseBitType:m.code,tags:[],textFormatDefault:S.json},[m.vendorDatadogDashboardEmbed]:{since:"3.12.0",baseBitType:m.code,tags:[{type:h.property,configKey:w.vendorDashboardId}],textFormatDefault:S.plainText},[m.vendorFormbricksEmbed]:{since:"3.8.0",baseBitType:m.code,tags:[{type:h.property,configKey:w.vendorSurveyId}],textFormatDefault:S.plainText},[m.vendorFormbricksEmbedAnonymous]:{since:"3.9.0",baseBitType:m.vendorFormbricksEmbed},[m.vendorFormbricksLink]:{since:"3.8.0",baseBitType:m.code,tags:[{type:h.property,configKey:w.vendorSurveyId}],textFormatDefault:S.plainText},[m.vendorFormbricksLinkAnonymous]:{since:"3.9.0",baseBitType:m.vendorFormbricksLink},[m.vendorHighchartsChart]:{since:"1.5.28",baseBitType:m.vendorAmcharts5Chart},[m.vendorIframelyEmbed]:{since:"1.5.10",baseBitType:m.code,tags:[{type:h.property,configKey:w.width},{type:h.property,configKey:w.height},{type:h.property,configKey:w.vendorUrl}],textFormatDefault:S.plainText},[m.vendorIframelyCard]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed},[m.vendorIframelyPreview]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed},[m.vendorIframelyPreviewMini]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed},[m.vendorJupyterOutput]:{since:"1.4.3",baseBitType:m.code,tags:[{type:h.property,configKey:w.jupyterId},{type:h.property,configKey:w.jupyterExecutionCount}],textFormatDefault:S.plainText},[m.vendorJupyterCellCode]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput},[m.vendorJupyterCellMarkdown]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput},[m.vendorJupyterCellRaw]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput},[m.vendorJupyterIpynb]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput},[m.vendorPadletEmbed]:{since:"1.3.0",baseBitType:m.code,tags:[{type:h.property,configKey:w.padletId}],textFormatDefault:S.plainText},[m.vendorStripePricingTable]:{since:"1.20.0",baseBitType:m.article,tags:[{type:h.property,configKey:w.stripePricingTableId,minCount:1},{type:h.property,configKey:w.stripePublishableKey,minCount:1}]},[m.vendorStripePricingTableExternal]:{since:"3.13.0",baseBitType:m.vendorStripePricingTable},[m.video]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceVideo,minCount:1}],resourceAttachmentAllowed:!1},[m.videoLandscape]:{since:"1.3.0",baseBitType:m.video},[m.videoPortrait]:{since:"1.3.0",baseBitType:m.video},[m.videoEmbed]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceVideoEmbed,minCount:1}],resourceAttachmentAllowed:!1},[m.videoEmbedLandscape]:{since:"1.3.0",baseBitType:m.videoEmbed},[m.videoEmbedPortrait]:{since:"1.3.0",baseBitType:m.videoEmbed},[m.videoLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceVideoLink,minCount:1}],resourceAttachmentAllowed:!1},[m.videoLinkLandscape]:{since:"1.3.0",baseBitType:m.videoLink},[m.videoLinkPortrait]:{since:"1.3.0",baseBitType:m.videoLink},[m.websiteLink]:{since:"1.3.0",baseBitType:m._standard,tags:[{type:h.group,configKey:V.group_resourceBitTags},{type:h.group,configKey:V.group_resourceWebsiteLink,minCount:1}],resourceAttachmentAllowed:!1}},ae=new class{constructor(){p(this,"bitLevelMin",1),p(this,"bitLevelMax",7),p(this,"bitCache",new Map),p(this,"allResourcesCache"),p(this,"comboResourcesCache",new Map)}getBitType(e){return e?.startsWith("|")&&(e=e.substring(1)),m.fromValue(e)??m._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const i=this.getBitConfig(e);if(!i)return!1;if(Array.isArray(t)){for(const e of t)if(i.inheritedBitTypesSet.has(e))return!0;return!1}return i.inheritedBitTypesSet.has(t)}isBitTypeCommented(e){return!!e?.startsWith("|")}getBitConfig(e){let t=this.bitCache.get(e);if(!t){const i=()=>{throw new Error(`No config found for bit: ${e}`)},r=[],a=[];let n=e;for(;n;){const e=re[n];e||i(),r.push(n),a.push(e),n=e.baseBitType}a.reverse();const o=a.reduce((e,t)=>e=Y.deepMerge(e,t),{}),{since:s,textFormatDefault:l,quizBit:c,tags:u,cardSet:p,deprecated:d,bodyAllowed:g,bodyRequired:h,footerAllowed:m,footerRequired:y,resourceAttachmentAllowed:f,rootExampleType:b}=o,T=this.getAllResourcesTagsWithZeroCounts(),v=ie.hydrateTagsConfig(u??[]),x=ie.hydrateCardSetConfig(p),k=v.info?.comboResourceType,w={...v.tags};for(const[e,t]of Object.entries(T))w[e]||(w[e]=t);t=new G({since:s,bitType:e,inheritedBitTypes:r,textFormatDefault:l??S.bitmarkText,tags:w,cardSet:x,quizBit:c,deprecated:d,bodyAllowed:g,bodyRequired:h,footerAllowed:m,footerRequired:y,resourceAttachmentAllowed:f,rootExampleType:b,comboResourceType:k}),this.bitCache.set(e,t)}return t}getRawPropertiesConfig(){return Z}getTagConfigForTag(e,t){if(e)for(const[,i]of Object.entries(e))if(i.tag===t)return i}getTagsConfigForCardSet(e,t,i){const r=this.getBitConfig(e);if(!r)return;const a=r.cardSet;if(!a)return;t=Math.min(t,a.variants.length-1);const n=a.variants[t];return n[i=Math.min(i,n.length-1)].tags}getBitResourcesConfig(e,t){let i={};const r=new Map,a=this.getBitConfig(e),n={};for(const[e,t]of Object.entries(a.tags))t.type===h.resource&&(n[e]=t);const o=a.comboResourceType??(a.resourceAttachmentAllowed&&t);if(o){const e=new Map,a=this.getComboResource(o);if(a){const t=Object.values(a).filter(e=>e.type===h.resource);t.map(e=>e.tag).forEach(i=>{const r=t.find(e=>e.tag===i);r&&e.set(i,r)});const i=this.getComboResourceTagTypes(o);i&&i.length>0&&r.set(o,i)}if(t)for(const[t,r]of Object.entries(n)){const a=o===r.tag,n=!!e&&e.has(r.tag);if(a){const e=new J(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);i[t]=e}else if(n){if(e){const a=e.get(r.tag);a&&(i[t]=a)}}else i[t]=r}else i=n}else i=n;return new U(i,a.resourceAttachmentAllowed,t,r)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter(e=>e.type===h.resource).map(e=>e.tag)}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(X).filter(t=>t.type===M.comboResource&&t.comboResourceType===e).forEach(e=>{t={...t,...ie.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(X).filter(e=>e.type===M.resource).forEach(t=>{e={...e,...ie.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}},ne="@gmb/bitmark-parser-generator",oe="3.35.0",se="ISC",le=(0,u(d(),1).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"}),ce=(0,u(d(),1).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});function ue(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:le.unknown,os:ce.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce((e,t)=>(t&&e.push(t),e),[]),i={keys:new Set,versions:{}};let r="";for(let e=0,a=t.length;e<a;e++){const a=t[e];let n=!1;for(let e=0;e<=9;e++)if(a.startsWith(`${e}`)){n=!0;break}n?i.versions[r]=a.replace("_","."):i.keys.add(a),r=a}return i}(window.navigator.userAgent),i=t.keys.has("firefox"),r=t.keys.has("chrome"),a=t.keys.has("chromium"),n=t.keys.has("safari"),o=r,s=i,l=t.keys.has("macintosh");return n&&!r&&!a?(e.browser=le.safari,e.browserVersion=t.versions.version):o?(e.browser=le.chrome,e.browserVersion=t.versions.chrome):s&&(e.browser=le.firefox,e.browserVersion=t.versions.firefox),l&&(e.os=ce.macos,e.osVersion=t.versions.x),e}var pe={full:"",major:"",minor:"",patch:"",build:""},de=new class{constructor(){p(this,"bootTimestamp"),p(this,"app"),p(this,"appVersion"),p(this,"environment"),p(this,"environmentVersion"),p(this,"os"),p(this,"osVersion"),p(this,"isBrowser"),p(this,"isNode"),p(this,"isCI"),p(this,"NODE_ENV"),p(this,"userAgentInfo"),Object.defineProperty(this,"userAgentInfo",{value:ue(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=pe,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===le.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?le.node:le.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):pe}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,ce.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):pe}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 pe;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let i="",r="",a="",n="";for(let e=0,o=t.length;e<o;e++){const o=t[e];0===e?i=o:1===e?r=o:2===e?n=o:3===e&&(a=o)}return{full:e,major:i,minor:r,patch:n,build:a}}},ge=de.init.bind(de),he=!1;function me(){he||(ge(ne,oe),he=!0)}var ye=(0,u(d(),1).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"}),fe=(0,u(d(),1).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",subscript:"subscript",superscript:"superscript",ins:"ins",del:"del",underline:"underline",doubleUnderline:"doubleUnderline",circle:"circle",languageEmRed:"languageEmRed",languageEmOrange:"languageEmOrange",languageEmYellow:"languageEmYellow",languageEmGreen:"languageEmGreen",languageEmBlue:"languageEmBlue",languageEmPurple:"languageEmPurple",languageEmPink:"languageEmPink",languageEmBrown:"languageEmBrown",languageEmBlack:"languageEmBlack",languageEmWhite:"languageEmWhite",languageEmGray:"languageEmGray",languageEm:"languageEm",userUnderline:"userUnderline",userDoubleUnderline:"userDoubleUnderline",userStrike:"userStrike",userCircle:"userCircle",userHighlight:"userHighlight",notranslate:"notranslate",link:"link",ref:"ref",xref:"xref",extref:"extref",footnote:"footnote",footnoteStar:"footnote*",symbol:"symbol",var:"var",code:"code",timer:"timer",duration:"duration",color:"color",comment:"comment"}),be=(0,u(d(),1).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",noBulletList:"noBulletList",bulletList:"bulletList",orderedList:"orderedList",orderedListRoman:"orderedListRoman",orderedListRomanLower:"orderedListRomanLower",letteredList:"letteredList",letteredListLower:"letteredListLower",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",imageInline:"imageInline",codeBlock:"codeBlock",latex:"latex",gap:"gap",select:"select",highlight:"highlight",mark:"mark"}),Te=(0,u(d(),1).superenum)({unknown:"unknown",action:"action",actionValue:"actionValue",activityType:"activityType",activityTypeValue:"activityTypeValue",additionalSolutions:"additionalSolutions",additionalSolutionsValue:"additionalSolutionsValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",alias:"alias",alignment:"alignment",allowedBit:"allowedBit",allowedBitValue:"allowedBitValue",alt:"alt",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",alternativeDefinitions:"alternativeDefinitions",alternativeDefinitionsValue:"alternativeDefinitionsValue",altLangTag:"altLangTag",altLangTagValue:"altLangTagValue",analyticsTag:"analyticsTag",analyticsTagValue:"analyticsTagValue",anchor:"anchor",answer:"answer",appLink:"appLink",attrs:"attrs",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",author:"author",authorValue:"authorValue",availableClassifications:"availableClassifications",availableClassificationsValue:"availableClassificationsValue",avatarImage:"avatarImage",backgroundWallpaper:"backgroundWallpaper",backgroundWallpaperValue:"backgroundWallpaperValue",bitLevel:"bitLevel",bitmarkAst:"bitmarkAst",bitmarkVersion:"bitmarkVersion",bits:"bits",bitsValue:"bitsValue",bitType:"bitType",blockId:"blockId",blockIdValue:"blockIdValue",body:"body",bodyValue:"bodyValue",bodyBit:"bodyBit",bodyBits:"bodyBits",bodyJson:"bodyJson",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",bodyText:"bodyText",book:"book",bookValue:"bookValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",bookDiff:"bookDiff",bookDiffValue:"bookDiffValue",bot:"bot",botResponses:"botResponses",botResponsesValue:"botResponsesValue",botValue:"botValue",bubbleTag:"bubbleTag",bubbleTagValue:"bubbleTagValue",buttonCaption:"buttonCaption",buttonCaptionValue:"buttonCaptionValue",callToActionUrl:"callToActionUrl",callToActionUrlValue:"callToActionUrlValue",caption:"caption",captionDefinitionList:"captionDefinitionList",captionValue:"captionValue",cardBits:"cardBits",cardBitsValue:"cardBitsValue",cardNode:"cardNode",categoryTag:"categoryTag",categoryTagValue:"categoryTagValue",cells:"cells",cellsValue:"cellsValue",chatWithBook:"chatWithBook",chatWithBookValue:"chatWithBookValue",chatWithBookBrainKey:"chatWithBookBrainKey",chatWithBookBrainKeyValue:"chatWithBookBrainKeyValue",checked:"checked",choice:"choice",choices:"choices",choicesValue:"choicesValue",class:"class",classification:"classification",classificationValue:"classificationValue",codeLineNumbers:"codeLineNumbers",codeLineNumbersValue:"codeLineNumbersValue",codeMinimap:"codeMinimap",codeMinimapValue:"codeMinimapValue",color:"color",colorTag:"colorTag",colorTagValue:"colorTagValue",column:"column",columns:"columns",columnsValue:"columnsValue",comment:"comment",commentedBitType:"commentedBitType",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",content:"contentValue",content2Buy:"content2Buy",contentValue:"contentValue",contentValueValue:"contentValueValue",copyright:"copyright",coverColor:"coverColor",coverColorValue:"coverColorValue",coverImage:"coverImage",coverImageValue:"coverImageValue",customerExternalId:"customerExternalId",customerId:"customerId",customerIdValue:"customerIdValue",data:"data",dataValue:"dataValue",dataValueValue:"dataValueValue",date:"date",dateEnd:"dateEnd",dateEndValue:"dateEndValue",dateValue:"dateValue",decimalPlaces:"decimalPlaces",deeplink:"deeplink",deeplinkValue:"deeplinkValue",definition:"definition",definitions:"definitions",definitionsValue:"definitionsValue",disableCalculation:"disableCalculation",disableFeedback:"disableFeedback",disableFeedbackValue:"disableFeedbackValue",diffTo:"diffTo",diffToValue:"diffToValue",diffOp:"diffOp",diffOpValue:"diffOpValue",diffRef:"diffRef",diffRefValue:"diffRefValue",diffContext:"diffContext",diffContextValue:"diffContextValue",diffTime:"diffTime",diffTimeValue:"diffTimeValue",document:"document",documentDownload:"documentDownload",documentEmbed:"documentEmbed",documentLink:"documentLink",duration:"duration",durationValue:"durationValue",elements:"elements",elementsValue:"elementsValue",emphasis:"emphasis",end:"end",errors:"errors",errorsValue:"errorsValue",example:"example",exampleValue:"exampleValue",externalId:"externalId",externalIdValue:"externalIdValue",externalLink:"externalLink",externalLinkText:"externalLinkText",extraProperties:"extraProperties",feedbacks:"feedbacks",feedbacksValue:"feedbacksValue",feedback:"feedback",feedbackEngine:"feedbackEngine",feedbackEngineValue:"feedbackEngineValue",feedbackType:"feedbackType",flashcards:"flashcards",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",flashcardsValue:"flashcardsValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",footer:"footer",footerText:"footerText",forKeys:"forKeys",format:"format",forValues:"forValues",forValuesValue:"forValuesValue",gap:"gap",handInAcceptFileType:"handInAcceptFileType",handInAcceptFileTypeValue:"handInAcceptFileTypeValue",handInRequirement:"handInRequirement",handInRequirementValue:"handInRequirementValue",handInInstruction:"handInInstruction",handInInstructionValue:"handInInstructionValue",hasBookNavigation:"hasBookNavigation",hasBookNavigationValue:"hasBookNavigationValue",hasMarkAsDone:"hasMarkAsDone",hasMarkAsDoneValue:"hasMarkAsDoneValue",heading:"heading",height:"height",heightValue:"heightValue",highlight:"highlight",hint:"hint",href:"href",icon:"icon",iconTag:"iconTag",iconTagValue:"iconTagValue",iconValue:"iconValue",id:"id",idValue:"idValue",image:"image",imageFirst:"imageFirst",imageFirstValue:"imageFirstValue",imageLandscape:"imageLandscape",imageLink:"imageLink",imagePlaceholder:"imagePlaceholder",imagePlaceholderValue:"imagePlaceholderValue",imagePortrait:"imagePortrait",imageSource:"imageSource",index:"index",indexValue:"indexValue",ingredients:"ingredients",ingredientsValue:"ingredientsValue",instruction:"instruction",internalComment:"internalComment",internalCommentValue:"internalCommentValue",isCaseSensitive:"isCaseSensitive",isCommented:"isCommented",isCorrect:"isCorrect",__isDefaultExample:"__isDefaultExample",isExample:"isExample",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",isPlain:"isPlain",isPublic:"isPublic",isPublicValue:"isPublicValue",isTemplate:"isTemplate",isTemplateValue:"isTemplateValue",isTemplateStripTheme:"isTemplateStripTheme",isTemplateStripThemeValue:"isTemplateStripThemeValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",item:"item",itemLead:"itemLead",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",key:"key",keyAudio:"keyAudio",keyImage:"keyImage",kind:"kind",kindValue:"kindValue",label:"label",labelFalse:"labelFalse",labelFalseValue:"labelFalseValue",labelTrue:"labelTrue",labelTrueValue:"labelTrueValue",lang:"lang",language:"language",languageValue:"languageValue",langValue:"langValue",layer:"layer",layerValue:"layerValue",layerRole:"layerRole",layerRoleValue:"layerRoleValue",lead:"lead",level:"level",levelACTFL:"levelACTFL",levelACTFLValue:"levelACTFLValue",levelCEFR:"levelCEFR",levelCEFRp:"levelCEFRp",levelCEFRpValue:"levelCEFRpValue",levelCEFRValue:"levelCEFRValue",levelILR:"levelILR",levelILRValue:"levelILRValue",license:"license",line:"line",list:"list",listItemIndent:"listItemIndent",listItemIndentValue:"listItemIndentValue",listValue:"listValue",location:"location",locationValue:"locationValue",machineTranslated:"machineTranslated",machineTranslatedValue:"machineTranslatedValue",mailingList:"mailingList",marginNumber:"marginNumber",mark:"mark",markConfig:"markConfig",markConfigValue:"markConfigValue",marks:"marks",marksValue:"marksValue",markup:"markup",matrix:"matrix",matrixValue:"matrixValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",maxDisplayLevel:"maxDisplayLevel",maxDisplayLevelValue:"maxDisplayLevelValue",maxTocChapterLevel:"maxTocChapterLevel",maxTocChapterLevelValue:"maxTocChapterLevelValue",tocResource:"tocResource",tocResourceValue:"tocResourceValue",tocContent:"tocContent",tocContentValue:"tocContentValue",message:"message",mockupId:"mockupId",name:"name",offset:"offset",options:"options",optionsValue:"optionsValue",original:"original",padletId:"padletId",padletIdValue:"padletIdValue",page:"page",pageNo:"pageNo",pageNoValue:"pageNoValue",pageNumber:"pageNumber",pageValue:"pageValue",pairs:"pairs",pairsValue:"pairsValue",parent:"parent",parser:"parser",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",person:"person",path:"path",pathValue:"pathValue",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",posterImage:"posterImage",posterImageValue:"posterImageValue",postfix:"postfix",prefix:"prefix",processHandIn:"processHandIn",processHandInValue:"processHandInValue",processHandInLocation:"processHandInLocation",processHandInLocationValue:"processHandInLocationValue",product:"product",productFolder:"productFolder",productFolderValue:"productFolderValue",productId:"productId",productIdValue:"productIdValue",productList:"productList",productListValue:"productListValue",productValue:"productValue",productVideo:"productVideo",productVideoList:"productVideoList",productVideoListValue:"productVideoListValue",productVideoValue:"productVideoValue",progress:"progress",progressValue:"progressValue",pronunciationTable:"pronunciationTable",properties:"properties",property:"property",propertyKey:"propertyKey",propertyValue:"propertyValue",propertyValues:"propertyValues",provider:"provider",publications:"publications",publicationsValue:"publicationsValue",publisher:"publisher",publisherName:"publisherName",publisherNameValue:"publisherNameValue",publisherValue:"publisherValue",quantity:"quantity",question:"question",questions:"questions",questionsValue:"questionsValue",quizCountItems:"quizCountItems",quizCountItemsValue:"quizCountItemsValue",quizStrikethroughSolutions:"quizStrikethroughSolutions",quizStrikethroughSolutionsValue:"quizStrikethroughSolutionsValue",quizzes:"quizzes",quizzesValue:"quizzesValue",quotedPerson:"quotedPerson",ratingLevelEnd:"ratingLevelEnd",ratingLevelSelected:"ratingLevelSelected",ratingLevelSelectedValue:"ratingLevelSelectedValue",ratingLevelStart:"ratingLevelStart",reaction:"reaction",reason:"reason",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",reductionTag:"reductionTag",reductionTagValue:"reductionTagValue",refAuthor:"refAuthor",refBookTitle:"refBookTitle",reference:"reference",referenceEnd:"referenceEnd",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",refPublisher:"refPublisher",refPublicationYear:"refPublicationYear",citationStyle:"citationStyle",citationStyleValue:"citationStyleValue",releaseDate:"releaseDate",releaseDateValue:"releaseDateValue",releaseKind:"releaseKind",releaseKindValue:"releaseKindValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",resolved:"resolved",resolvedBy:"resolvedBy",resolvedByValue:"resolvedByValue",resolvedDate:"resolvedDate",resolvedDateValue:"resolvedDateValue",resolvedValue:"resolvedValue",resources:"resources",resourcesValue:"resourcesValue",resourceType:"resourceType",response:"response",responses:"responses",responsesValue:"responsesValue",revealSolutions:"revealSolutions",root:"root",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",scormSource:"scormSource",scormSourceValue:"scormSourceValue",search:"search",searchValue:"searchValue",searchIndex:"searchIndex",searchIndexValue:"searchIndexValue",section:"section",select:"select",servings:"servings",servingsValue:"servingsValue",showInIndex:"showInIndex",showInIndexValue:"showInIndexValue",size:"size",slug:"slug",slugValue:"slugValue",solution:"solution",solutions:"solutions",solutionsValue:"solutionsValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",start:"start",statement:"statement",statements:"statements",statementsValue:"statementsValue",statementText:"statementText",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",stripePricingTableId:"stripePricingTableId",stripePricingTableIdValue:"stripePricingTableIdValue",stripePublishableKey:"stripePublishableKey",stripePublishableKeyValue:"stripePublishableKeyValue",subject:"subject",subjectValue:"subjectValue",subtitle:"subtitle",subtype:"subtype",subtypeValue:"subtypeValue",table:"table",tableAutoWidth:"tableAutoWidth",tableAutoWidthValue:"tableAutoWidthValue",tableFixedHeader:"tableFixedHeader",tableFixedHeaderValue:"tableFixedHeaderValue",tableHeaderWhitespaceNoWrap:"tableHeaderWhitespaceNoWrap",tableHeaderWhitespaceNoWrapValue:"tableHeaderWhitespaceNoWrapValue",tableHeight:"tableHeight",tableHeightValue:"tableHeightValue",tablePagination:"tablePagination",tablePaginationLimit:"tablePaginationLimit",tablePaginationLimitValue:"tablePaginationLimitValue",tablePaginationValue:"tablePaginationValue",tableResizableColumns:"tableResizableColumns",tableResizableColumnsValue:"tableResizableColumnsValue",tableColumnMinWidth:"tableColumnMinWidth",tableColumnMinWidthValue:"tableColumnMinWidthValue",tableSearch:"tableSearch",tableSearchValue:"tableSearchValue",tableSort:"tableSort",tableSortValue:"tableSortValue",tableWhitespaceNoWrap:"tableWhitespaceNoWrap",tableWhitespaceNoWrapValue:"tableWhitespaceNoWrapValue",tag:"tag",tagValue:"tagValue",target:"target",targetValue:"targetValue",technicalTerm:"technicalTerm",technicalTermValue:"technicalTermValue",term:"term",text:"text",textAlign:"textAlign",textAst:"textAst",textAstValue:"textAstValue",textFormat:"textFormat",textReference:"textReference",textReferenceValue:"textReferenceValue",texts:"texts",textsValue:"textsValue",theme:"theme",themeValue:"themeValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",title:"title",toc:"toc",tocValue:"tocValue",topicTag:"topicTag",topicTagValue:"topicTagValue",trim:"trim",type:"type",__typeAlias:"__typeAlias",unit:"unit",unitAbbr:"unitAbbr",url:"url",value:"value",values:"values",valuesValue:"valuesValue",vendorDashboardId:"vendorDashboardId",vendorDashboardIdValue:"vendorDashboardIdValue",vendorSurveyId:"vendorSurveyId",vendorSurveyIdValue:"vendorSurveyIdValue",vendorUrl:"vendorUrl",vendorUrlValue:"vendorUrlValue",version:"version",video:"video",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",videoEmbed:"videoEmbed",videoLink:"videoLink",warnings:"warnings",warningsValue:"warningsValue",websiteLink:"websiteLink",width:"width",widthValue:"widthValue",x:"x",xValue:"xValue",y:"y",yValue:"yValue",zoomDisabled:"zoomDisabled"}),ve=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}countOccurrences(e,t){return e.split(t).length-1}countOccurrencesAtStart(e,t){let i=0;for(;e.startsWith(t);)i++,e=e.substring(t.length);return i}countOccurrencesAtEnd(e,t){let i=0;for(;e.endsWith(t);)i++,e=e.substring(0,e.length-t.length);return i}splitPlaceholders(e,t){let i=[e];const r=(e,t)=>{const i=[];for(const r of e){const e=r.split(t);for(let r=0,a=e.length;r<a;r++){const n=e[r],o=r===a-1;i.push(n),o||i.push(t)}}return i};for(const e of t)i=r(i,e);return i}firstLine(e,t){const i=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return i;const r=e.split("\n");return r.length>0?r[0].substring(0,t):i}wordWrap(e,t){const i=[];if(t<1||null==e||e.length<=t)return i;const r=e.length,a=r-t;let n,o=0;for(;o<a;){let r;const a=o+t,s=e.indexOf("\n",o);if(s>-1&&s>o&&s<a){r=s-o,n=e.substr(o,r),o=o+r+1,i.push(n);continue}const l=e.lastIndexOf(" ",a);let c=0;l>-1&&l!=o-1?(r=l-o,r>0&&(c=o+r+1)):(r=t,c=o+t),n=e.substr(o,r),o=c,i.push(n.trim())}return o<r&&(n=e.substr(o),i.push(n)),i}},xe=class{constructor(){me()}walk(e,t,i,r){this.walkRecursive(e,[{index:0,key:t,value:e}],i,r)}getRouteKey(e){return e.reduce((t,i,r)=>(+i.key!==i.index&&(t+=`${i.key}`,r<e.length-1&&(t+="_")),t),"")}printTree(e,t=Te.bitmarkAst){this.walkRecursive(e,[{index:0,key:t,value:e}],{enter:(e,t)=>(console.log("Enter: "+this.getRouteKey(t)),t[t.length-1].key!==Te.bodyJson),between:(e,t,i,r)=>{console.log("Between: "+this.getRouteKey(r))},exit:(e,t)=>{console.log("Exit: "+this.getRouteKey(t))},leaf:(e,t)=>{console.log("Leaf: "+this.getRouteKey(t))}},void 0)}preprocessAst(e){if(ve.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,i,r){const{enter:a,between:n,exit:o,leaf:s}=i,l=t[t.length-1].key,c=!this.isValue(e),u=t[t.length-1];if(c){if(a){if(!1===a(u,t,r))return}}else s&&s(u,t,r);if(c){const a=this.isArray(e),o=Object.keys(e);for(let s=0,c=o.length;s<c;s++){const p=o[s],d=s===c-1,g=e,h=g[p];if(null!=h){const e={key:this.getAstKey(p,l,a),index:s,value:h},c=t.slice();if(c.push(e),this.walkRecursive(h,c,i,r),!d){const i=o[s+1],c=g[i],p={key:this.getAstKey(i,l,a),index:s+1,value:c};if(n){if(!1===n(u,e,p,t,r))break}}}}}c&&o&&o(u,t,r)}getAstKey(e,t,i){let r=e;return i&&t&&(r=`${t}Value`),Te.fromKey(r)||`unknown(${r})`}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)}},ke=(0,u(d(),1).superenum)({tag:"tag",body:"body"}),we=(0,u(d(),1).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"}),Ce=/([*`_!=])(?=\1)/,Ae=/(\^*])/,Be=/(\^+)/,_e=`${Ae.source}|${Be.source}`,Se=`${Ce.source}|${/^(\|)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([^\S\r\n]+)/.source}|${/^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([.@#▼►%!?+\-$_=&])/.source}|${/^(~)(~~~[ \t]*)$/.source}|${/^(\$)(\$\$\$[ \t]*)$/.source}|${Be.source}`,Pe=`${/^(\[)(\^*)(\.)/.source}`,Ie=new RegExp(`${Ce.source}|${Ae.source}|${Be.source}`,"gm"),Le=new RegExp(_e,"gm"),Ee=new RegExp(Se,"gm"),Ve=new RegExp(Pe,"gm"),Ne=new RegExp("^(?:(\\[)(\\^*)(\\.))|(\\^+)","gm"),Fe=new RegExp("\\^([\\^]*)","gm"),Re=new RegExp("^(\\[)\\^(\\^*)(\\.)","gm"),Ke=new RegExp("^(\\||•|#)","gm"),Oe={format:we.bitmarkPlusPlus,location:ke.body,v2:!1};function De(e){return"string"==typeof e||e instanceof String}var $e={format:S.bitmarkText,location:ke.body,inPlaceArray:!1,v2:!1},Me=new class{constructor(){p(this,"EMPTY_STRING","")}breakscape(e,t={}){if(null==e)return;const i=Object.assign({},Oe,t);if(Array.isArray(e))return e.map(e=>this.breakscape(e,i));if(!De(e))return e;const{regex:r,replacer:a}=function(e,t,i=!1){return t===ke.tag?i||e!==we.bitmarkPlusPlus?{regex:Le,replacer:"$2^$1"}:{regex:Ie,replacer:"$1$3^$2"}:e===we.bitmarkPlusPlus?i?{regex:Ne,replacer:"$1$4^$2$3"}:{regex:Ee,replacer:"$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14"}:{regex:Ve,replacer:"$1^$2$3"}}(i.format,i.location,i.v2);let n=e;return n=n.replace(r,a),n}unbreakscape(e,t={}){if(null==e)return;const i=Object.assign({},Oe,t);if(Array.isArray(e))return e.map(e=>this.unbreakscape(e,i));if(!De(e))return e;const{regex:r,replacer:a}=function(e,t){const i=e!==we.bitmarkPlusPlus;return t===ke.body&&i?{regex:Re,replacer:"$1$2$3"}:{regex:Fe,replacer:"$1"}}(i.format,i.location);let n=e;return n=n.replace(r,a),n}breakscapeCode(e,t){if(null==e)return e;const i=Object.assign({},Oe,t),r=e=>e?e.replace(Ke,"$1^"):e;if(Array.isArray(e)){const t=i.inPlaceArray?e:[e.length];for(let t=0,i=e.length;t<i;t++){const i=e[t];De(i)&&(e[t]=r(i))}e=t}else De(e)&&(e=r(e));return e}version(){return oe}license(){return se}},je=new class{constructor(){p(this,"EMPTY_STRING","")}breakscape(e,t){const i=Object.assign({},$e,t);return Me.breakscape(e,{format:i.format,location:i.location,inPlaceArray:i.inPlaceArray,v2:i.v2})}unbreakscape(e,t){const i=Object.assign({},$e,t);return Me.unbreakscape(e,i)}breakscapeCode(e,t){const i=Object.assign({},$e,t);return Me.breakscapeCode(e,i)}concatenate(e,t){return e+t}},We=(0,u(d(),1).superenum)({bitmarkMinusMinus:"bitmark--"}),ze=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}},Je=(u(d(),1),(0,u(d(),1).superenum)({v2:2,v3:3})),qe=Je.v3,He=class{constructor(){p(this,"ast",new xe),p(this,"debugGenerationInline",!1),p(this,"printed",!1)}enter(e,t,i){let r;const a=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof a[n]&&(r=a[n](e,t,i)),r}between(e,t,i,r,a){let n;const o=this,s=`between_${e.key}`;return this.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof o[s]&&(n=o[s](e,t,i,r,a)),n}exit(e,t,i){const r=this,a=`exit_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof r[a]&&r[a](e,t,i)}leaf(e,t,i){const r=this,a=`leaf_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof r[a]&&r[a](e,t,i),this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}getParentNode(e,t=1){if(e.length>t)return e[e.length-t-1]}},Ge={bodyBitCallback:void 0,debugGenerationInline:!1},Ue="==",Ye=["*","`","_","!","="],Qe={[fe.bold]:"**",[fe.light]:"``",[fe.italic]:"__",[fe.highlight]:"!!"},Xe=[fe.bold,fe.light,fe.italic,fe.highlight],Ze=[fe.strike,fe.subscript,fe.superscript,fe.ins,fe.del,fe.underline,fe.doubleUnderline,fe.circle,fe.languageEmRed,fe.languageEmOrange,fe.languageEmYellow,fe.languageEmGreen,fe.languageEmBlue,fe.languageEmPurple,fe.languageEmPink,fe.languageEmBrown,fe.languageEmBlack,fe.languageEmWhite,fe.languageEmGray,fe.languageEm,fe.userUnderline,fe.userDoubleUnderline,fe.userStrike,fe.userCircle,fe.userHighlight,fe.notranslate,fe.link,fe.ref,fe.xref,fe.extref,fe.footnote,fe.footnoteStar,fe.symbol,fe.var,fe.code,fe.timer,fe.duration,fe.color,fe.comment],et=new RegExp(/(\n|\r\n)/,"g"),tt=new RegExp(/https?:\/\/|mailto:(.*)/,"g"),it=new RegExp(/\]/,"g"),rt="enter",at="between",nt="exit",ot=class extends He{constructor(e,t){super(),p(this,"ast",new xe),p(this,"bitmarkVersion"),p(this,"options"),p(this,"generateOptions",{}),p(this,"textFormat",S.bitmarkText),p(this,"textLocation",ke.body),p(this,"writerText",""),p(this,"nodeIndex",0),p(this,"currentIndent",0),p(this,"prevIndent",0),p(this,"indentationStringCache",""),p(this,"inParagraph",!1),p(this,"inHeading",!1),p(this,"inCodeBlock",!1),p(this,"exitedCodeBlock",!1),p(this,"inBulletList",!1),p(this,"inInline",!1),p(this,"textDepth",0),p(this,"placeholderIndex",0),p(this,"placeholders",{}),p(this,"rootParagraphNodeContentIndex",0),p(this,"previousRootParagraphContextType",be.text),p(this,"inPreText",!1),p(this,"thisNodeIsPreText",!1),p(this,"preTextIndexTemp",-1),p(this,"havePreText",!1),p(this,"preTextIndex",-1),this.bitmarkVersion=Je.fromValue(e)??qe,this.options={...Ge,...t},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion,Je.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)}async generate(e,t,i,r){return this.generateSync(e,t,i,r)}generateSync(e,t,i,r){if(this.generateOptions=Object.assign({},r),this.validateGenerateOptions(e),this.generateOptions.plainTextDividerAllowed){const r=this.options.writeCallback,a=this.options.bodyBitCallback;this.options.writeCallback=void 0,this.options.bodyBitCallback=void 0,this.resetState(t,i),this.walkAndWrite(e),this.options.writeCallback=r,this.options.bodyBitCallback=a;const n=this.havePreText,o=this.preTextIndex;this.resetState(t,i),this.havePreText=n,this.preTextIndex=o,this.walkAndWrite(e)}else this.resetState(t,i),this.walkAndWrite(e);return this.writerText}getPlaceholders(){return this.placeholders}resetState(e,t){this.printed=!1,this.textFormat=e??S.bitmarkText,this.textLocation=t,this.writerText="",this.nodeIndex=0,this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inParagraph=!1,this.inHeading=!1,this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.inBulletList=!1,this.inInline=!1,this.textDepth=0,this.placeholderIndex=0,this.placeholders={},this.rootParagraphNodeContentIndex=0,this.previousRootParagraphContextType=be.hardBreak,this.inPreText=!1,this.thisNodeIsPreText=!1,this.preTextIndexTemp=-1,this.havePreText=!1,this.preTextIndex=-1}walkAndWrite(e){this.ast.walk(e,Te.textAst,this,void 0)}enter_textAstValue(e,t){return this.handleEnterNode(e.value,t)}between_textAstValue(e,t,i,r){return this.handleBetweenNode(e.value,t,i,r)}exit_textAstValue(e,t){return this.handleExitNode(e.value,t)}enter_contentValue(e,t){return this.handleEnterContentValueNode(e,t)}between_contentValue(e,t,i,r){this.handleBetweenContentValueNode(e,t,i,r)}exit_contentValue(e,t){this.handleExitContentValueNode(e,t)}enter_contentValueValue(e,t){return this.handleEnterNode(e.value,t)}between_contentValueValue(e,t,i,r){this.handleBetweenNode(e.value,t,i,r)}exit_contentValueValue(e,t){return this.handleExitNode(e.value,t)}handleEnterNode(e,t){switch(this.handleEnterNodePreTextCheck(e,t),this.handleIndent(e),e.type){case be.paragraph:this.inParagraph=!0,this.writeParagraph(e);break;case be.hardBreak:this.writeHardBreak(e);break;case be.text:this.writeMarks(e,rt),this.writeText(e),this.writeMarks(e,at),0===this.textDepth&&(this.inInline=!0),this.textDepth++;break;case be.heading:this.writeHeading(e),this.inHeading=!0;break;case be.section:this.writeSection(e);break;case be.listItem:case be.taskItem:this.writeBullet(e,t);break;case be.image:case be.imageInline:this.writeImage(e);break;case be.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case be.latex:this.writeLatex(e);break;case be.noBulletList:case be.bulletList:case be.orderedList:case be.orderedListRoman:case be.orderedListRomanLower:case be.letteredList:case be.letteredListLower:case be.taskList:this.inBulletList=!0;break;case be.gap:case be.select:case be.highlight:case be.mark:return this.writeBodyBit(e,t),!1}this.exitedCodeBlock=!1}handleBetweenNode(e,t,i,r){e.type}handleExitNode(e,t){switch(e.type){case be.text:this.textDepth--,0===this.textDepth&&(this.inInline=!1),this.writeMarks(e,nt);break;case be.paragraph:this.writeNL(),this.inParagraph=!1;break;case be.heading:this.inHeading=!1;case be.section:case be.image:this.inParagraph||(this.writeNL(),this.writeNL());break;case be.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case be.noBulletList:case be.bulletList:case be.orderedList:case be.orderedListRoman:case be.orderedListRomanLower:case be.letteredList:case be.letteredListLower:case be.taskList:this.currentIndent<=1&&(this.writeNL(),this.inBulletList=!1)}this.handleDedent(e),this.nodeIndex++}handleIndent(e){switch(e.type){case be.noBulletList:case be.bulletList:case be.orderedList:case be.orderedListRoman:case be.orderedListRomanLower:case be.letteredList:case be.letteredListLower:case be.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case be.noBulletList:case be.bulletList:case be.orderedList:case be.orderedListRoman:case be.orderedListRomanLower:case be.letteredList:case be.letteredListLower:case be.taskList:this.currentIndent--}}handleEnterContentValueNode(e,t){3===t.length&&(this.thisNodeIsPreText=!0,this.inPreText=!1,this.previousRootParagraphContextType=be.hardBreak)}handleBetweenContentValueNode(e,t,i,r){if(3===r.length){const e=t.value;this.updatePreTextState(),this.thisNodeIsPreText=!0,this.previousRootParagraphContextType=e.type,this.rootParagraphNodeContentIndex++}}handleExitContentValueNode(e,t){3===t.length&&(this.updatePreTextState(),this.thisNodeIsPreText=!1,this.generateOptions.plainTextDividerAllowed&&this.inPreText&&(this.havePreText=!0,this.preTextIndex=this.preTextIndexTemp),this.inPreText=!1)}updatePreTextState(){!this.inPreText&&this.thisNodeIsPreText&&this.previousRootParagraphContextType===be.hardBreak?(this.inPreText=!0,this.preTextIndexTemp=this.rootParagraphNodeContentIndex):this.inPreText&&!this.thisNodeIsPreText&&(this.inPreText=!1,this.preTextIndexTemp=-1)}handleEnterNodePreTextCheck(e,t){if(4===t.length){if(this.inPreText&&e.type===be.hardBreak)return;if(e.type===be.text)return}this.thisNodeIsPreText=!1}getLinkHref(e){if(e.type===be.text&&e.marks){const t=e.marks.reduce((e,t)=>{if(t.type===fe.link){const e=t,i=e.attrs?.href;if(i)return i}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,t){const i=`[!${this.placeholderIndex}]`;if(this.placeholders[i]=e,this.options.bodyBitCallback){const i=this.options.bodyBitCallback(e,this.placeholderIndex,t);this.write(i)}else this.write(i);this.placeholderIndex++}writeText(e){if(null==e.text)return;const t=this.inCodeBlock;let i=e.text;const r=this.getLinkText(e);if(r&&(i=r),i=r||this.breakscape(i,{format:this.textFormat,location:this.textLocation}),this.currentIndent>1){const e=this.getIndentationString();i=i.replace(et,`$1${e}`)}if(this.havePreText&&this.rootParagraphNodeContentIndex===this.preTextIndex&&(this.writePlainTextDivider(),this.writeNL()),this.havePreText&&this.rootParagraphNodeContentIndex>=this.preTextIndex){const t=this.breakscape(e.text,{format:S.plainText,location:this.textLocation});this.write(t)}else this.write(i);(this.currentIndent>1||t)&&(this.thisNodeIsPreText=!1),this.inPreText||e.text!==i||(this.thisNodeIsPreText=!1)}isSimpleLink(e){if(null==e.text)return!1;if(1!==e.marks?.length)return!1;const t=this.getLinkHref(e);if(t){return t.replace(tt,"$1")===e.text}return!1}getLinkText(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let i;return i=t.replace(tt,"$1")===e.text?t:e.text,i=(i??"").replace(it,"^]"),i}return!1}getInterTextBreakscape(e){if(this.bitmarkVersion===Je.v2)return"";if(this.textFormat===S.plainText)return"";const t=this.writerText.slice(-1),i=e.slice(0,1);return t===i&&-1!==Ye.indexOf(t)||this.textLocation===ke.body&&"["===t&&-1!=="@#▼►%!?+-$_=&".indexOf(i)?"^":""}validateGenerateOptions(e){this.generateOptions.plainTextDividerAllowed&&(1!==e.length||1===e.length&&e[0].type!==be.paragraph)&&(this.generateOptions.plainTextDividerAllowed=!1)}writeMarks(e,t){if(e.marks){const i=!(!this.inInline&&!this.inHeading);this.thisNodeIsPreText=!1;if(0===e.marks.length)return void this.writeMarkTextWrapper(Ue);const r=1===e.marks.length&&i,a=e.marks.reduce((e,t)=>e||(-1!==Xe.indexOf(t.type)?r?Qe[t.type]:Ue:-1!==Ze.indexOf(t.type)?Ue:e),void 0),n=this.isSimpleLink(e);if(null!=a&&!n){if(t!=rt&&t!=at||this.writeMarkTextWrapper(a),t==at)for(const t of e.marks)-1!==Xe.indexOf(t.type)?r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(t)):fe.comment===t.type?(this.writeInlineMarkStartEnd(),this.writeCommentMark(t)):fe.link===t.type?(this.writeInlineMarkStartEnd(),this.writeLinkMark(t)):fe.ref===t.type?(this.writeInlineMarkStartEnd(),this.writeRefMark(t)):fe.xref===t.type?(this.writeInlineMarkStartEnd(),this.writeXRefMark(t)):fe.extref===t.type?(this.writeInlineMarkStartEnd(),this.writeExtRefMark(t)):fe.footnote===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteMark(t)):fe.footnoteStar===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteStarMark(t)):fe.symbol===t.type?(this.writeInlineMarkStartEnd(),this.writeSymbolMark(t)):-1!==Ze.indexOf(t.type)&&(this.writeInlineMarkStartEnd(),this.writeInlineMark(t));if(t==nt){let t=!1;for(const i of e.marks)-1!==Xe.indexOf(i.type)?r||(t=!0):fe.comment!==i.type&&fe.link!==i.type&&fe.ref!==i.type&&fe.xref!==i.type&&fe.footnote!==i.type&&fe.footnoteStar!==i.type&&-1===Ze.indexOf(i.type)||(t=!0);t&&this.writeInlineMarkStartEnd()}}}}writeParagraph(e){if(this.textFormat===S.bitmarkText){if(this.inBulletList)return;const t=e.content?.length??0;if(0===this.nodeIndex){if(1===t){const t=e.content?.[0].type===be.text,i=e.content?.[0].text??"";if(!t||""!==i)return}if(t>1)return}this.write("|"),this.writeNL(),this.exitedCodeBlock&&this.writeNL()}}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){let t="";const i=e.attrs?.level??1;for(let e=0;e<+i;e++)t+="#";t+=" ",this.write(t)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e,t){let i=this.getIndentationString();const r=this.getParentNode(t,2),a=r?.value,n=a?.type,o=a?.attrs?.start??1;if(n===be.bulletList)i+="• ";else if(n===be.noBulletList)i+="•_ ";else if(n===be.orderedList)i+=`•${o} `;else if(n===be.orderedListRoman)i+=`•${o}I `;else if(n===be.orderedListRomanLower)i+=`•${o}i `;else if(n===be.letteredList)i+="•A ";else if(n===be.letteredListLower)i+="•a ";else if(n===be.taskList){const t=e;i+=t.attrs?.checked??!1?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs,i=e.type===be.imageInline,r=this.getMediaAttrs(i?"imageInline":"image",t,{ignoreAttributes:i?new Set(["alt","zoomDisabled","title"]):void 0});let a="";i&&(a=`==${t.alt??""}==`),a+=r?`|${r}|`:"",this.write(a)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeLatex(e){if(null==e.attrs||!e.attrs.formula)return;const t=e.attrs,i=`==${this.breakscape(t.formula,{format:this.textFormat,location:this.textLocation})}==|latex|`;this.write(i)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[i,r]of Object.entries(e.attrs))("language"===i&&"plain text"!==r||"color"===i||"name"===i||"duration"===i)&&(t=`${t}:${r}`);this.write(t)}writeCommentMark(e){const t=`#${e.comment||""}`;this.write(t)}writeLinkMark(e){const t=`link:${((e.attrs?.href||"")??"").replace(it,"^]")}`;this.write(t)}writeRefMark(e){const t=`►${e.attrs?.reference??""}`;this.write(t)}writeXRefMark(e){const t=e.attrs?.xref??"",i=e.attrs?.reference??"";let r=`xref:${t}`;i&&(r+=`|►${i}`),this.write(r)}writeExtRefMark(e){const t=e.attrs?.extref??"",i=e.attrs?.references??[],r=e.attrs?.provider??"";let a=`extref:${t}`;for(const e of i)a+=`|►${e??""}`;a+=`|provider:${r}`,this.write(a)}writeFootnoteMark(e){this.write("footnote:")}writeFootnoteStarMark(e){this.write("footnote*:")}writeSymbolMark(e){if(null==e.attrs)return;const t=e.attrs,i=this.getMediaAttrs("symbol",t)??"";this.write(i)}writeInlineMarkStartEnd(){this.write("|")}writePlainTextDivider(){this.write("==== text ====")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}getMediaAttrs(e,t,i){if(!e)return;const r=Object.assign({},i).ignoreAttributes??new Set;let a=`${e}:${t?.src??""}`;const n=Object.entries(t).filter(([e,t])=>"src"!==e);for(let e=0;e<n.length;e++){const[t,i]=n[e];if(!r.has(t))switch(t){case"textAlign":"left"!==i&&(a+=`|captionAlign:${i}`);break;case"alignment":"center"!==i&&i&&(a+=`|alignment:${i}`);break;case"title":i&&(a+=`|caption:${i}`);break;case"class":"center"!==i&&i&&(a+=`|align:${i}`);break;case"comment":i&&(a+=`|#${i}`);break;case"":ve.isString(i)?a+=`|:${i}`:a+="|";break;case"zoomDisabled":i||(a+="|zoomDisabled:false");break;default:t&&i&&(a+=`|${t}:${i}`)}}return a}breakscape(e,t){return this.generateOptions.noBreakscaping?e:je.breakscape(e,t)}getBitType(e){for(const t of e)if(t.key===Te.bitsValue){const e=t.value;return e?.bitType}}write(e){return e=this.getInterTextBreakscape(e)+e,this.options.writeCallback&&this.options.writeCallback(e),this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const i of e)this.write(`${i}${t??""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}};function st(e){return"string"!=typeof e?null:je.unbreakscape(e)}function lt(e){e&&"object"==typeof e&&(delete e._tempParsingParent,delete e._tempListStart,Object.keys(e).forEach(t=>{lt(e[t])}))}function ct(e){const t=e=>e&&"text"===e.type&&!e.text;function i(e){for(let r=e.length-1;r>=0;r--){const a=e[r];t(a)?e.splice(r,1):a&&Array.isArray(a.content)&&i(a.content)}}return Array.isArray(e)?i(e):e&&Array.isArray(e.content)&&i(e.content),e}function ut(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):gt(e,{startRule:"bitmarkPlusString"})}function pt(e,t,i,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,pt.prototype),a.expected=t,a.found=i,a.location=r,a.name="SyntaxError",a}function dt(e,t,i){return i=i||" ",e.length>t?e:(t-=e.length,e+(i+=i.repeat(t)).slice(0,t))}function gt(e,t){var i,r={},a=(t=void 0!==t?t:{}).grammarSource,n={version:_o,bitmarkPlusPlus:function(){var e,t;if(To++,e=[],(t=So())!==r)for(;t!==r;)e.push(t),t=So();else e=r;e===r&&(e=function(){var e,t;return e=mo,t="",t=Sa(),e=t,e}());To--,e===r&&(t=r,0===To&&Ao(jt));return e},bitmarkPlus:function(){var e,t;To++,e=mo,t=is(),t=vn(t),e=t,To--,t=r,0===To&&Ao(jt);return e},bitmarkMinusMinus:function(){var e,t;To++,e=mo,t=ps(),t=ao(t),e=t,To--,t=r,0===To&&Ao(aa);return e},bitmarkPlusString:function(){var e;To++,e=is(),To--,0===To&&Ao(Bi);return e},bitmarkMinusMinusString:ps},o=_o,s="|",l="### ",c="## ",u="# ",p="code",d=":",g="bitmark++",h="bitmark--",m="JavaScript",y="• ",f="•_ ",b="•",T=" ",v="I ",x="i ",k="•A ",w="•a ",C="•+ ",A="•- ",B="\t",_="image",S="#",P="@",I="width",L="height",E="alignment",V="captionAlign",N="left",F="center",R="right",K="alt",O="caption",D="zoomDisabled",$="true",M="false",j="=",W="|latex|",z="|imageInline:",J="alignmentVertical",q="size",H="top",G="middle",U="bottom",Y="baseline",Q="sub",X="super",Z="text-bottom",ee="text-top",te="line-height",ie="font-height",re="explicit",ae="link:",ne="extref:",oe="provider:",se="xref:",le="►",ce="symbol:",ue="footnote:",pe="footnote*:",de="var:",ge="code:",he="timer",me="timer:",ye="duration:",fe="P",be="color:",Te="|►",ve="bold",xe="italic",ke="light",we="highlight",Ce="strike",Ae="subscript",Be="superscript",_e="ins",Se="del",Pe="underline",Ie="doubleUnderline",Le="circle",Ee="languageEmRed",Ve="languageEmOrange",Ne="languageEmYellow",Fe="languageEmGreen",Re="languageEmBlue",Ke="languageEmPurple",Oe="languageEmPink",De="languageEmBrown",$e="languageEmBlack",Me="languageEmWhite",je="languageEmGray",We="languageEm",ze="userUnderline",Je="userDoubleUnderline",qe="userStrike",He="userCircle",Ge="userHighlight",Ue="notranslate",Ye="aqua",Qe="black",Xe="blue",Ze="brown",et="fuchsia",tt="lightgrey",it="gray",rt="darkgray",at="green",nt="lime",ot="magenta",dt="maroon",gt="navy",ht="olive",mt="orange",yt="pink",ft="purple",bt="red",Tt="silver",vt="teal",xt="violet",kt="white",wt="yellow",Ct="*",At="_",Bt="`",_t="!",St="[!",Pt="]",It="\n",Lt="\r\n",Et="http",Vt="s",Nt="://",Ft="mailto:",Rt=/^[ \t]/,Kt=/^[0-9]/,Ot=/^[\r\u2028-\u2029]/,Dt=/^[^\n\r\u2028\u2029]/,$t=/^[!#-;=?-[\]-_a-{}-~]/,Mt={type:"any"},jt=ko("StyledText"),Wt=vo("|",!1),zt=vo("### ",!1),Jt=vo("## ",!1),qt=vo("# ",!1),Ht=vo("code",!1),Gt=xo([" ","\t"],!1,!1),Ut=vo(":",!1),Yt=vo("bitmark++",!1),Qt=vo("bitmark--",!1),Xt=vo("JavaScript",!1),Zt=vo("• ",!1),ei=vo("•_ ",!1),ti=vo("•",!1),ii=xo([["0","9"]],!1,!1),ri=vo(" ",!1),ai=vo("I ",!1),ni=vo("i ",!1),oi=vo("•A ",!1),si=vo("•a ",!1),li=vo("•+ ",!1),ci=vo("•- ",!1),ui=vo("\t",!1),pi=vo("image",!1),di=vo("#",!1),gi=vo("@",!1),hi=vo("width",!1),mi=vo("height",!1),yi=vo("alignment",!1),fi=vo("captionAlign",!1),bi=vo("left",!1),Ti=vo("center",!1),vi=vo("right",!1),xi=vo("alt",!1),ki=vo("caption",!1),wi=vo("zoomDisabled",!1),Ci=vo("true",!1),Ai=vo("false",!1),Bi=ko("StyledString"),_i=vo("=",!1),Si=vo("|latex|",!1),Pi=vo("|imageInline:",!1),Ii=vo("alignmentVertical",!1),Li=vo("size",!1),Ei=vo("top",!1),Vi=vo("middle",!1),Ni=vo("bottom",!1),Fi=vo("baseline",!1),Ri=vo("sub",!1),Ki=vo("super",!1),Oi=vo("text-bottom",!1),Di=vo("text-top",!1),$i=vo("line-height",!1),Mi=vo("font-height",!1),ji=vo("explicit",!1),Wi=vo("link:",!1),zi=vo("extref:",!1),Ji=vo("provider:",!1),qi=vo("xref:",!1),Hi=vo("►",!1),Gi=vo("symbol:",!1),Ui=vo("footnote:",!1),Yi=vo("footnote*:",!1),Qi=vo("var:",!1),Xi=vo("code:",!1),Zi=vo("timer",!1),er=vo("timer:",!1),tr=vo("duration:",!1),ir=vo("P",!1),rr=vo("color:",!1),ar=vo("|►",!1),nr=vo("bold",!1),or=vo("italic",!1),sr=vo("light",!1),lr=vo("highlight",!1),cr=vo("strike",!1),ur=vo("subscript",!1),pr=vo("superscript",!1),dr=vo("ins",!1),gr=vo("del",!1),hr=vo("underline",!1),mr=vo("doubleUnderline",!1),yr=vo("circle",!1),fr=vo("languageEmRed",!1),br=vo("languageEmOrange",!1),Tr=vo("languageEmYellow",!1),vr=vo("languageEmGreen",!1),xr=vo("languageEmBlue",!1),kr=vo("languageEmPurple",!1),wr=vo("languageEmPink",!1),Cr=vo("languageEmBrown",!1),Ar=vo("languageEmBlack",!1),Br=vo("languageEmWhite",!1),_r=vo("languageEmGray",!1),Sr=vo("languageEm",!1),Pr=vo("userUnderline",!1),Ir=vo("userDoubleUnderline",!1),Lr=vo("userStrike",!1),Er=vo("userCircle",!1),Vr=vo("userHighlight",!1),Nr=vo("notranslate",!1),Fr=vo("aqua",!1),Rr=vo("black",!1),Kr=vo("blue",!1),Or=vo("brown",!1),Dr=vo("fuchsia",!1),$r=vo("lightgrey",!1),Mr=vo("gray",!1),jr=vo("darkgray",!1),Wr=vo("green",!1),zr=vo("lime",!1),Jr=vo("magenta",!1),qr=vo("maroon",!1),Hr=vo("navy",!1),Gr=vo("olive",!1),Ur=vo("orange",!1),Yr=vo("pink",!1),Qr=vo("purple",!1),Xr=vo("red",!1),Zr=vo("silver",!1),ea=vo("teal",!1),ta=vo("violet",!1),ia=vo("white",!1),ra=vo("yellow",!1),aa=ko("MinimalStyledText"),na=ko("MinimalStyledString"),oa=vo("*",!1),sa=vo("_",!1),la=vo("`",!1),ca=vo("!",!1),ua=vo("[!",!1),pa=vo("]",!1),da=ko("Line Terminator"),ga=vo("\n",!1),ha=vo("\r\n",!1),ma=xo(["\r",["\u2028","\u2029"]],!1,!1),ya=(ko("whitespace in line"),ko("space"),ko("language tag separator"),ko("white space, separator"),xo(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),xo(["\n","\r","\u2028","\u2029"],!1,!1),xo(["\n","\r","\u2028","\u2029"],!0,!1)),fa=(xo(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),vo("http",!1)),ba=vo("s",!1),Ta=vo("://",!1),va=vo("mailto:",!1),xa=xo(["!",["#",";"],"=",["?","["],["]","_"],["a","{"],["}","~"]],!1,!1),ka=function(){return"8.34.3"},wa=function(e){return ct({...e})},Ca=function(e){let t={...e};lt(t);return ct(t)},Aa=function(e){return{...e}},Ba=function(e){return{...e}},_a=function(e){return ct({...e})},Sa=function(){return[]},Pa=function(e,t){return{type:"heading",content:ut(t),attrs:{level:e.length-1}}},Ia=function(e){return e},La=function(e,t){return{...e,content:t}},Ea=function(){return{type:"codeBlock",language:""}},Va=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},Na=function(e){return[{type:"text",text:st(e.trim())}]},Fa=function(e){return e},Ra=function(e,t){return{...e,content:t,attrs:{}}},Ka=function(e,t){return{...e,content:t,attrs:{}}},Oa=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}},Da=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}},$a=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}},Ma=function(e,t){return{...e,content:t,attrs:{}}},ja=function(e,t){return{...e,content:t,attrs:{}}},Wa=function(e,t){return{...e,content:t,attrs:{}}},za=function(){return{type:"bulletList"}},Ja=function(){return{type:"noBulletList"}},qa=function(){return{type:"orderedList"}},Ha=function(){return{type:"orderedListRoman"}},Ga=function(){return{type:"orderedListRomanLower"}},Ua=function(){return{type:"letteredList"}},Ya=function(){return{type:"letteredListLower"}},Qa=function(){return{type:"taskList"}},Xa=function(e,t,i,r){return r},Za=function(e,t,i,r){let a="bulletList";const n=e.match(/•([0-9]+)([Ii]?) /);let o=1;if(n&&(a="orderedList",n.length>1&&(o=Number(n[1])),n.length>2)){let e=n[2];"I"==e&&(a="orderedListRoman"),"i"==e&&(a="orderedListRomanLower")}"•_ "==e&&(a="noBulletList"),"•A "==e&&(a="letteredList"),"•a "==e&&(a="letteredListLower"),"•+ "!=e&&"•- "!=e||(a="taskList");let s=[{type:"paragraph",attrs:{},content:ut((t+i.join("")).trim())}];if(r&&r[0]&&r[0]._tempParsingParent){let e={type:r[0]._tempParsingParent,attrs:{start:o},content:r};if((e.type.startsWith("orderedList")||e.type.startsWith("letteredList"))&&r[0]._tempListStart){const t=r[0]._tempListStart;t>1&&(e.attrs.start=t)}s.push(e)}let l="listItem",c=null;if("taskList"==a){l="taskItem";let t=!1;"•+ "==e&&(t=!0),c={checked:t}}return c?{type:l,attrs:c,content:s,_tempParsingParent:a,_tempListStart:o}:{type:l,content:s,_tempParsingParent:a,_tempListStart:o}},en=function(e){return e},tn=function(e){return e.join("")===Ls},rn=function(e){return e.length>Ls.length},an=function(e){Is.push(Ls),Ls=e.join("")},nn=function(){return Ls=Is.pop(),!0},on=function(e){return{type:"paragraph",content:ut(e.trim()),attrs:{}}},sn=function(e){return{type:"paragraph",content:ut(e.trim()),attrs:{}}},ln=function(e){return{type:"paragraph",content:ut(e.trim()),attrs:{}}},cn=function(e){return e},un=function(e,t,i){const r=Object.assign({},...i);let a=r.alignment||"center";delete r.alignment;let n=r.captionAlign||"left";delete r.captionAlign;let o=r.alt||null;delete r.alt;let s=r.caption||null;delete r.caption;let l=r.align||"center";delete r.align;let c=void 0===r.zoomDisabled||("boolean"==typeof r.zoomDisabled?r.zoomDisabled:"true"===String(r.zoomDisabled).toLowerCase());return delete r.zoomDisabled,{type:e,attrs:{alignment:a,textAlign:n,src:t,alt:st(o),title:st(s),class:l,zoomDisabled:c,...r}}},pn=function(e){return e},dn=function(e){return{comment:e.trim()}},gn=function(e,t){return{[e]:parseInt(t)}},hn=function(e,t){return{[e]:t.trim()}},mn=function(e,t){return{[e]:t}},yn=function(e,t){return{[e]:t}},fn=function(e){return{[e]:!0}},bn=function(){},Tn=function(e){return{error:"Found unknown property or invalid value: "+e}},vn=function(e){return[{type:"paragraph",content:e,attrs:{}}]},xn=function(e,t){return ct(e?[e,...t.flat()]:t.flat())},kn=function(){return{type:"hardBreak"}},wn=function(e){return{text:st(e),type:"text"}},Cn=function(e){return{index:+e,type:"bit"}},An=function(e){return{attrs:{formula:st(e)},type:"latex"}},Bn=function(e,t,i){return{attrs:{alt:e,src:(t.pr+t.t).trim(),...Object.assign({},...i),zoomDisabled:!0},type:"imageInline"}},_n=function(e,t){return t||(t=[]),{marks:t,text:st(e),type:"text"}},Sn=function(e){return{marks:[{type:"bold"}],text:st(e),type:"text"}},Pn=function(e){return{marks:[{type:"italic"}],text:st(e),type:"text"}},In=function(e){return{marks:[{type:"light"}],text:st(e),type:"text"}},Ln=function(e){return{marks:[{type:"highlight"}],text:st(e),type:"text"}},En=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},Vn=function(e){return e},Nn=function(e){return e},Fn=function(e){return{comment:e}},Rn=function(e,t){return{[e]:parseInt(t)}},Kn=function(e,t){return{type:"error",msg:e+" must be a positive integer.",found:t}},On=function(e,t){return{[e]:t}},Dn=function(e,t){return{[e]:t}},$n=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},Mn=function(e,t,i){return{type:"extref",attrs:{extref:e.trim(),references:t,provider:i.trim()}}},jn=function(e,t){return{type:"xref",attrs:{xref:e.trim(),reference:t.trim()}}},Wn=function(e){return{type:"xref",attrs:{xref:e.trim(),reference:""}}},zn=function(e){return{type:"ref",attrs:{reference:e.trim()}}},Jn=function(e,t){const i=Object.assign({},...t);return{type:"symbol",attrs:{src:e.trim(),...i}}},qn=function(e){return{type:"footnote",attrs:{content:ut(e.trim())}}},Hn=function(e){return{type:"footnote*",attrs:{content:ut(e.trim())}}},Gn=function(e){return{type:"var",attrs:{name:e.trim()}}},Un=function(){return{type:"code",attrs:{language:"plain text"}}},Yn=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},Qn=function(){return{type:"timer",attrs:{name:""}}},Xn=function(e){return{type:"timer",attrs:{name:e.trim()}}},Zn=function(e){return{type:"duration",attrs:{duration:e}}},eo=function(e){return{type:"color",attrs:{color:e}}},to=function(e){return{type:e}},io=function(e){return{type:"comment",comment:e}},ro=function(e){return e.trim()},ao=function(e){return[{type:"paragraph",content:e,attrs:{}}]},no=function(e,t){return ct(e?[e,...t.flat()]:t.flat())},oo=function(){return{type:"hardBreak"}},so=function(e){return{text:st(e),type:"text"}},lo=function(e){return{index:+e,type:"bit"}},co=function(e){return{marks:[{type:"bold"}],text:st(e),type:"text"}},uo=function(e){return{marks:[{type:"italic"}],text:st(e),type:"text"}},po=function(e){return{marks:[{type:"light"}],text:st(e),type:"text"}},go=function(e){return{marks:[{type:"highlight"}],text:st(e),type:"text"}},ho=function(e,t){return{pr:e,t}},mo=0|t.peg$currPos,yo=[{line:1,column:1}],fo=mo,bo=t.peg$maxFailExpected||[],To=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in n))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=n[t.startRule]}function vo(e,t){return{type:"literal",text:e,ignoreCase:t}}function xo(e,t,i){return{type:"class",parts:e,inverted:t,ignoreCase:i}}function ko(e){return{type:"other",description:e}}function wo(t){var i,r=yo[t];if(r)return r;if(t>=yo.length)i=yo.length-1;else for(i=t;!yo[--i];);for(r={line:(r=yo[i]).line,column:r.column};i<t;)10===e.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return yo[t]=r,r}function Co(e,t,i){var r=wo(e),n=wo(t),o={source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}};return i&&a&&"function"==typeof a.offset&&(o.start=a.offset(o.start),o.end=a.offset(o.end)),o}function Ao(e){mo<fo||(mo>fo&&(fo=mo,bo=[]),bo.push(e))}function Bo(e,t,i){return new pt(pt.buildMessage(e,t),e,t,i)}function _o(){var t,i,a;for(t=mo,i=[],e.length>mo?(a=e.charAt(mo),mo++):(a=r,0===To&&Ao(Mt));a!==r;)i.push(a),e.length>mo?(a=e.charAt(mo),mo++):(a=r,0===To&&Ao(Mt));return t=i=ka()}function So(){var t,i;return t=mo,i=function(){var t,i,a,n,o;if(t=mo,i=Lo(),i!==r){for(a=mo,n=[],o=Bs();o!==r;)n.push(o),o=Bs();a=e.substring(a,mo),(n=_s())!==r?((o=As())===r&&(o=null),t=Pa(i,a)):(mo=t,t=r)}else mo=t,t=r;return t}(),i!==r&&(i=wa(i)),(t=i)===r&&(t=mo,i=function(){var e,t,i,a;if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Fo(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=za());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Ra(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Ro(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Ja());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Ka(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Ko(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=qa());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Oa(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Oo(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Ha());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Da(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Do(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Ga());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=$a(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=$o(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Ua());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Ma(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r){if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=Mo(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Ya());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=ja(t,i)):(mo=e,e=r)}else mo=e,e=r;if(e===r)if(e=mo,t=function(){var e,t,i;e=mo,t=mo,To++,i=jo(),To--,i!==r?(mo=t,t=void 0):t=r;t!==r&&(t=Qa());return e=t,e}(),t!==r){if(i=[],(a=zo())!==r)for(;a!==r;)i.push(a),a=zo();else i=r;i!==r?((a=As())===r&&(a=null),e=Wa(t,i)):(mo=e,e=r)}else mo=e,e=r}}}}}}return e}(),i!==r&&(i=Ca(i)),(t=i)===r&&(t=mo,(i=Qo())!==r&&(i=Aa(i)),(t=i)===r&&(t=mo,i=function(){var t,i,a;t=mo,i=Vo(),i!==r?(a=function(){var t,i,a,n;t=mo,i=mo,a=[],n=No();for(;n!==r;)a.push(n),n=No();return i=e.substring(i,mo),i=Na(i),t=i,t}(),t=La(i,a)):(mo=t,t=r);return t}(),i!==r&&(i=Ba(i)),(t=i)===r&&(t=mo,i=function(){var e,t,i;e=mo,t=mo,To++,i=Po(),To--,i===r?t=void 0:(mo=t,t=r);t!==r&&(i=Ho())!==r?e=on(i):(mo=e,e=r);e===r&&(e=mo,(t=Uo())!==r&&(i=Ho())!==r?e=sn(i):(mo=e,e=r),e===r&&(e=mo,(t=Uo())!==r?e=ln(i=""):(mo=e,e=r)));return e}(),i!==r&&(i=_a(i)),t=i)))),t}function Po(){var e;return(e=Lo())===r&&(e=Wo())===r&&(e=Qo())===r&&(e=Vo())===r&&(e=Uo()),e}function Io(){var t;return 124===e.charCodeAt(mo)?(t=s,mo++):(t=r,0===To&&Ao(Wt)),t}function Lo(){var t;return e.substr(mo,4)===l?(t=l,mo+=4):(t=r,0===To&&Ao(zt)),t===r&&(e.substr(mo,3)===c?(t=c,mo+=3):(t=r,0===To&&Ao(Jt)),t===r&&(e.substr(mo,2)===u?(t=u,mo+=2):(t=r,0===To&&Ao(qt)))),t}function Eo(){var t,i;return t=mo,Io()!==r?(i=function(){var t;return e.substr(mo,4)===p?(t=p,mo+=4):(t=r,0===To&&Ao(Ht)),t}(),i!==r?t=Ia(i):(mo=t,t=r)):(mo=t,t=r),t}function Vo(){var t,i,a,n,o,s,l;if(t=mo,Eo()!==r){for(i=mo,a=mo,n=[],o=e.charAt(mo),Rt.test(o)?mo++:(o=r,0===To&&Ao(Gt));o!==r;)n.push(o),o=e.charAt(mo),Rt.test(o)?mo++:(o=r,0===To&&Ao(Gt));(o=_s())!==r?a=n=[n,o]:(mo=a,a=r),(i=a!==r?e.substring(i,mo):a)!==r?t=Ea():(mo=t,t=r)}else mo=t,t=r;if(t===r)if(t=mo,Eo()!==r)if(58===e.charCodeAt(mo)?(i=d,mo++):(i=r,0===To&&Ao(Ut)),i!==r)if(a=function(){var t,i,a;e.substr(mo,9)===g?(t=g,mo+=9):(t=r,0===To&&Ao(Yt));if(t===r&&(e.substr(mo,9)===h?(t=h,mo+=9):(t=r,0===To&&Ao(Qt)),t===r&&(e.substr(mo,10)===m?(t=m,mo+=10):(t=r,0===To&&Ao(Xt)),t===r))){if(t=mo,i=[],(a=Bs())!==r)for(;a!==r;)i.push(a),a=Bs();else i=r;(t=i!==r?e.substring(t,mo):i)===r&&(t="")}return t}(),a!==r){for(n=mo,o=mo,s=[],l=e.charAt(mo),Rt.test(l)?mo++:(l=r,0===To&&Ao(Gt));l!==r;)s.push(l),l=e.charAt(mo),Rt.test(l)?mo++:(l=r,0===To&&Ao(Gt));(l=_s())!==r?o=s=[s,l]:(mo=o,o=r),(n=o!==r?e.substring(n,mo):o)!==r?t=Va(a):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;else mo=t,t=r;return t}function No(){var t,i,a,n,o,s;if(t=mo,i=mo,To++,a=Po(),To--,a===r?i=void 0:(mo=i,i=r),i!==r){if(a=mo,n=mo,o=[],(s=Bs())!==r)for(;s!==r;)o.push(s),s=Bs();else o=r;o!==r&&(s=_s())!==r?n=o=[o,s]:(mo=n,n=r),(a=n!==r?e.substring(a,mo):n)!==r?t=Fa(a):(mo=t,t=r)}else mo=t,t=r;return t===r&&(t=As()),t}function Fo(){var t;return e.substr(mo,2)===y?(t=y,mo+=2):(t=r,0===To&&Ao(Zt)),t}function Ro(){var t;return e.substr(mo,3)===f?(t=f,mo+=3):(t=r,0===To&&Ao(ei)),t}function Ko(){var t,i,a,n,o;if(t=mo,i=mo,8226===e.charCodeAt(mo)?(a=b,mo++):(a=r,0===To&&Ao(ti)),a!==r){if(n=[],o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii)),o!==r)for(;o!==r;)n.push(o),o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii));else n=r;n!==r?(32===e.charCodeAt(mo)?(o=T,mo++):(o=r,0===To&&Ao(ri)),o!==r?i=a=[a,n,o]:(mo=i,i=r)):(mo=i,i=r)}else mo=i,i=r;return t=i!==r?e.substring(t,mo):i}function Oo(){var t,i,a,n,o;if(t=mo,i=mo,8226===e.charCodeAt(mo)?(a=b,mo++):(a=r,0===To&&Ao(ti)),a!==r){if(n=[],o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii)),o!==r)for(;o!==r;)n.push(o),o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii));else n=r;n!==r?(e.substr(mo,2)===v?(o=v,mo+=2):(o=r,0===To&&Ao(ai)),o!==r?i=a=[a,n,o]:(mo=i,i=r)):(mo=i,i=r)}else mo=i,i=r;return t=i!==r?e.substring(t,mo):i}function Do(){var t,i,a,n,o;if(t=mo,i=mo,8226===e.charCodeAt(mo)?(a=b,mo++):(a=r,0===To&&Ao(ti)),a!==r){if(n=[],o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii)),o!==r)for(;o!==r;)n.push(o),o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii));else n=r;n!==r?(e.substr(mo,2)===x?(o=x,mo+=2):(o=r,0===To&&Ao(ni)),o!==r?i=a=[a,n,o]:(mo=i,i=r)):(mo=i,i=r)}else mo=i,i=r;return t=i!==r?e.substring(t,mo):i}function $o(){var t;return e.substr(mo,3)===k?(t=k,mo+=3):(t=r,0===To&&Ao(oi)),t}function Mo(){var t;return e.substr(mo,3)===w?(t=w,mo+=3):(t=r,0===To&&Ao(si)),t}function jo(){var t;return e.substr(mo,3)===C?(t=C,mo+=3):(t=r,0===To&&Ao(li)),t===r&&(e.substr(mo,3)===A?(t=A,mo+=3):(t=r,0===To&&Ao(ci))),t}function Wo(){var e;return(e=Fo())===r&&(e=Ro())===r&&(e=Ko())===r&&(e=Oo())===r&&(e=Do())===r&&(e=$o())===r&&(e=Mo())===r&&(e=jo()),e}function zo(){var t,i,a,n,o,s,l,c;if(t=mo,qo()!==r)if((i=Wo())!==r){for(a=mo,n=mo,o=[],s=mo,l=mo,To++,c=As(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?s=l=[l,c]:(mo=s,s=r)):(mo=s,s=r);s!==r;)o.push(s),s=mo,l=mo,To++,c=As(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?s=l=[l,c]:(mo=s,s=r)):(mo=s,s=r);for((s=As())===r&&(s=null),n=o=[o,s],a=e.substring(a,mo),n=[],o=Jo();o!==r;)n.push(o),o=Jo();if(o=mo,s=function(){var t,i,a,n;t=mo,To++,i=mo,a=[],9===e.charCodeAt(mo)?(n=B,mo++):(n=r,0===To&&Ao(ui));if(n!==r)for(;n!==r;)a.push(n),9===e.charCodeAt(mo)?(n=B,mo++):(n=r,0===To&&Ao(ui));else a=r;a!==r?(n=(n=rn(a))?void 0:r)!==r?i=an(a):(mo=i,i=r):(mo=i,i=r);To--,i!==r?(mo=t,t=void 0):t=r;return t}(),s!==r){for(l=[],c=zo();c!==r;)l.push(c),c=zo();c=function(){var e;e=nn(),e=e?void 0:r;return e}(),c!==r?o=Xa(i,a,n,l):(mo=o,o=r)}else mo=o,o=r;o===r&&(o=null),t=Za(i,a,n,o)}else mo=t,t=r;else mo=t,t=r;return t}function Jo(){var t,i,a,n,o,s,l,c,u,p;if(t=mo,i=mo,To++,a=function(){var t,i,a;t=mo,i=[],a=e.charAt(mo),Rt.test(a)?mo++:(a=r,0===To&&Ao(Gt));for(;a!==r;)i.push(a),a=e.charAt(mo),Rt.test(a)?mo++:(a=r,0===To&&Ao(Gt));a=As(),a!==r?t=i=[i,a]:(mo=t,t=r);return t}(),To--,a===r?i=void 0:(mo=i,i=r),i!==r)if((a=qo())!==r)if(n=mo,To++,o=Wo(),To--,o===r?n=void 0:(mo=n,n=r),n!==r){if(o=mo,s=mo,l=[],c=mo,u=mo,To++,p=As(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(e.length>mo?(p=e.charAt(mo),mo++):(p=r,0===To&&Ao(Mt)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=mo,u=mo,To++,p=As(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(e.length>mo?(p=e.charAt(mo),mo++):(p=r,0===To&&Ao(Mt)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r);else l=r;l!==r&&(c=_s())!==r?s=l=[l,c]:(mo=s,s=r),(o=s!==r?e.substring(o,mo):s)!==r?t=en(o):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;else mo=t,t=r;return t}function qo(){var t,i,a;for(t=mo,i=[],9===e.charCodeAt(mo)?(a=B,mo++):(a=r,0===To&&Ao(ui));a!==r;)i.push(a),9===e.charCodeAt(mo)?(a=B,mo++):(a=r,0===To&&Ao(ui));return(a=(a=tn(i))?void 0:r)!==r?t=i=[i,a]:(mo=t,t=r),t}function Ho(){var t,i,a;if(t=mo,i=[],(a=Go())!==r)for(;a!==r;)i.push(a),a=Go();else i=r;return t=i!==r?e.substring(t,mo):i}function Go(){var t,i,a,n,o,s;if(t=mo,i=mo,To++,a=Po(),To--,a===r?i=void 0:(mo=i,i=r),i!==r){if(a=mo,n=mo,o=[],(s=Bs())!==r)for(;s!==r;)o.push(s),s=Bs();else o=r;o!==r&&(s=_s())!==r?n=o=[o,s]:(mo=n,n=r),(a=n!==r?e.substring(a,mo):n)!==r?t=i=[i,a]:(mo=t,t=r)}else mo=t,t=r;return t===r&&(t=As()),t}function Uo(){var t,i,a,n,o,s;if(t=mo,(i=Io())!==r){for(a=mo,n=mo,o=[],s=e.charAt(mo),Rt.test(s)?mo++:(s=r,0===To&&Ao(Gt));s!==r;)o.push(s),s=e.charAt(mo),Rt.test(s)?mo++:(s=r,0===To&&Ao(Gt));(s=_s())!==r?n=o=[o,s]:(mo=n,n=r),(a=n!==r?e.substring(a,mo):n)!==r?((n=As())===r&&(n=null),t=i=[i,a,n]):(mo=t,t=r)}else mo=t,t=r;return t}function Yo(){var t,i;return t=mo,Io()!==r?(i=function(){var t;return e.substr(mo,5)===_?(t=_,mo+=5):(t=r,0===To&&Ao(pi)),t}(),i!==r?t=cn(i):(mo=t,t=r)):(mo=t,t=r),t}function Qo(){var t,i,a,n,o,s,l,c,u,p,g,h;if(t=mo,(i=Yo())!==r)if(58===e.charCodeAt(mo)?(a=d,mo++):(a=r,0===To&&Ao(Ut)),a!==r)if(32===e.charCodeAt(mo)?(n=T,mo++):(n=r,0===To&&Ao(ri)),n===r&&(n=null),o=function(){var t,i,a,n,o,s,l,c,u;t=mo,i=mo,e.substr(mo,4)===Et?(a=Et,mo+=4):(a=r,0===To&&Ao(fa));if(a!==r)if(115===e.charCodeAt(mo)?(n=Vt,mo++):(n=r,0===To&&Ao(ba)),n===r&&(n=null),e.substr(mo,3)===Nt?(o=Nt,mo+=3):(o=r,0===To&&Ao(Ta)),o!==r){for(s=[],l=mo,c=mo,To++,u=Io(),To--,u===r?c=void 0:(mo=c,c=r),c!==r&&(u=Ps())!==r?l=c=[c,u]:(mo=l,l=r);l!==r;)s.push(l),l=mo,c=mo,To++,u=Io(),To--,u===r?c=void 0:(mo=c,c=r),c!==r&&(u=Ps())!==r?l=c=[c,u]:(mo=l,l=r);i=a=[a,n,o,s]}else mo=i,i=r;else mo=i,i=r;t=i!==r?e.substring(t,mo):i;return t}(),o!==r){for(s=[],32===e.charCodeAt(mo)?(l=T,mo++):(l=r,0===To&&Ao(ri));l!==r;)s.push(l),32===e.charCodeAt(mo)?(l=T,mo++):(l=r,0===To&&Ao(ri));if((l=Io())!==r){for(c=Xo(),u=mo,p=mo,g=[],h=e.charAt(mo),Rt.test(h)?mo++:(h=r,0===To&&Ao(Gt));h!==r;)g.push(h),h=e.charAt(mo),Rt.test(h)?mo++:(h=r,0===To&&Ao(Gt));(h=_s())!==r?p=g=[g,h]:(mo=p,p=r),(u=p!==r?e.substring(u,mo):p)!==r?((p=As())===r&&(p=null),t=un(i,o,c)):(mo=t,t=r)}else mo=t,t=r}else mo=t,t=r;else mo=t,t=r;else mo=t,t=r;return t}function Xo(){var e,t,i;for(e=mo,t=[],i=Zo();i!==r;)t.push(i),i=Zo();return e=t=pn(t)}function Zo(){var t,i,a,n,o,s,l,c,u,p;if(t=mo,35===e.charCodeAt(mo)?(i=S,mo++):(i=r,0===To&&Ao(di)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=dn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=es())!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));if(s=mo,l=[],c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(p=e.charAt(mo),Kt.test(p)?mo++:(p=r,0===To&&Ao(ii)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(p=e.charAt(mo),Kt.test(p)?mo++:(p=r,0===To&&Ao(ii)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r);else l=r;if((s=l!==r?e.substring(s,mo):l)!==r){for(l=[],32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));c!==r;)l.push(c),32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));(c=Io())!==r?t=gn(a,s):(mo=t,t=r)}else mo=t,t=r}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),a=function(){var t;e.substr(mo,3)===K?(t=K,mo+=3):(t=r,0===To&&Ao(xi));t===r&&(e.substr(mo,7)===O?(t=O,mo+=7):(t=r,0===To&&Ao(ki)));return t}(),a!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));for(s=mo,l=[],c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r&&(p=Bs())!==r?c=u=[u,p]:(mo=c,c=r);c!==r;)l.push(c),c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r&&(p=Bs())!==r?c=u=[u,p]:(mo=c,c=r);s=e.substring(s,mo),(l=Io())!==r?t=hn(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),a=function(){var t;e.substr(mo,9)===E?(t=E,mo+=9):(t=r,0===To&&Ao(yi));t===r&&(e.substr(mo,12)===V?(t=V,mo+=12):(t=r,0===To&&Ao(fi)));return t}(),a!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));if(s=function(){var t;e.substr(mo,4)===N?(t=N,mo+=4):(t=r,0===To&&Ao(bi));t===r&&(e.substr(mo,6)===F?(t=F,mo+=6):(t=r,0===To&&Ao(Ti)),t===r&&(e.substr(mo,5)===R?(t=R,mo+=5):(t=r,0===To&&Ao(vi))));return t}(),s!==r){for(l=[],32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));c!==r;)l.push(c),32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));(c=Io())!==r?t=mn(a,s):(mo=t,t=r)}else mo=t,t=r}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=ts())!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));if(s=function(){var t;e.substr(mo,4)===$?(t=$,mo+=4):(t=r,0===To&&Ao(Ci));t===r&&(e.substr(mo,5)===M?(t=M,mo+=5):(t=r,0===To&&Ao(Ai)));return t}(),s!==r){for(l=[],32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));c!==r;)l.push(c),32===e.charCodeAt(mo)?(c=T,mo++):(c=r,0===To&&Ao(ri));(c=Io())!==r?t=yn(a,s):(mo=t,t=r)}else mo=t,t=r}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=ts())!==r){for(n=[],32===e.charCodeAt(mo)?(o=T,mo++):(o=r,0===To&&Ao(ri));o!==r;)n.push(o),32===e.charCodeAt(mo)?(o=T,mo++):(o=r,0===To&&Ao(ri));(o=Io())!==r?t=fn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r&&(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=Io())!==r?t=bn():(mo=t,t=r),t===r)){for(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Tn(a):(mo=t,t=r)}}}}}}return t}function es(){var t;return e.substr(mo,5)===I?(t=I,mo+=5):(t=r,0===To&&Ao(hi)),t===r&&(e.substr(mo,6)===L?(t=L,mo+=6):(t=r,0===To&&Ao(mi))),t}function ts(){var t;return e.substr(mo,12)===D?(t=D,mo+=12):(t=r,0===To&&Ao(wi)),t}function is(){var e,t,i,a;for(e=mo,(t=rs())===r&&(t=null),i=[],(a=os())===r&&(a=rs());a!==r;)i.push(a),(a=os())===r&&(a=rs());return e=xn(t,i)}function rs(){var t,i,a,n,o,s,l;if(t=mo,(i=As())!==r&&(i=kn()),(t=i)===r){if(t=mo,i=mo,a=[],n=mo,(o=ss())===r&&(o=null),s=mo,To++,l=os(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?n=o=[o,s,l]:(mo=n,n=r),n===r&&(n=mo,(o=ss())!==r?(s=mo,To++,l=os(),To--,l===r?s=void 0:(mo=s,s=r),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r)),n!==r)for(;n!==r;)a.push(n),n=mo,(o=ss())===r&&(o=null),s=mo,To++,l=os(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?n=o=[o,s,l]:(mo=n,n=r),n===r&&(n=mo,(o=ss())!==r?(s=mo,To++,l=os(),To--,l===r?s=void 0:(mo=s,s=r),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r));else a=r;(i=a!==r?e.substring(i,mo):a)!==r&&(i=wn(i)),t=i}return t}function as(){var t;return 61===e.charCodeAt(mo)?(t=j,mo++):(t=r,0===To&&Ao(_i)),t}function ns(){var e,t,i;return e=mo,(t=as())!==r&&(i=as())!==r?e=t=[t,i]:(mo=e,e=r),e}function os(){var t,i,a,n,o,l,c,u;if(t=mo,(i=xs())!==r){if(a=mo,n=[],o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii)),o!==r)for(;o!==r;)n.push(o),o=e.charAt(mo),Kt.test(o)?mo++:(o=r,0===To&&Ao(ii));else n=r;(a=n!==r?e.substring(a,mo):n)!==r&&(n=ks())!==r?t=Cn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=ns())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=ns())!==r?(e.substr(mo,7)===W?(o=W,mo+=7):(o=r,0===To&&Ao(Si)),o!==r?t=An(a):(mo=t,t=r)):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=ns())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=ns())!==r?(e.substr(mo,13)===z?(o=z,mo+=13):(o=r,0===To&&Ao(Pi)),o!==r&&(l=Ss())!==r?(124===e.charCodeAt(mo)?(c=s,mo++):(c=r,0===To&&Ao(Wt)),c!==r?(u=function(){var e,t,i;e=mo,t=[],i=ls();for(;i!==r;)t.push(i),i=ls();return t=Nn(t),e=t,e}(),t=Bn(a,l,u)):(mo=t,t=r)):(mo=t,t=r)):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=ns())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=ns(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=ns())!==r?(o=function(){var t,i,a,n;t=mo,124===e.charCodeAt(mo)?(i=s,mo++):(i=r,0===To&&Ao(Wt));if(i!==r){if(a=[],(n=cs())!==r)for(;n!==r;)a.push(n),n=cs();else a=r;a!==r?t=Vn(a):(mo=t,t=r)}else mo=t,t=r;return t}(),o!==r?t=_n(a,o):(mo=t,t=r)):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=fs())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=fs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=fs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=fs())!==r?t=Sn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=bs())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=bs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=bs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=bs())!==r?t=Pn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=Ts())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=Ts(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=Ts(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=Ts())!==r?t=In(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,(i=vs())!==r){for(a=mo,n=[],o=mo,l=mo,To++,c=vs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);o!==r;)n.push(o),o=mo,l=mo,To++,c=vs(),To--,c===r?l=void 0:(mo=l,l=r),l!==r?(e.length>mo?(c=e.charAt(mo),mo++):(c=r,0===To&&Ao(Mt)),c!==r?o=l=[l,c]:(mo=o,o=r)):(mo=o,o=r);a=e.substring(a,mo),(n=vs())!==r?t=Ln(a):(mo=t,t=r)}else mo=t,t=r;t===r&&(t=mo,(i=Ss())!==r&&(i=En(i)),t=i)}}}}}}}return t}function ss(){var t,i,a,n,o;if(t=mo,i=mo,(a=ns())!==r){if(n=[],(o=as())!==r)for(;o!==r;)n.push(o),o=as();else n=r;n!==r?i=a=[a,n]:(mo=i,i=r)}else mo=i,i=r;if((t=i!==r?e.substring(t,mo):i)===r){if(t=mo,i=mo,(a=Ts())!==r){if(n=[],(o=ms())!==r)for(;o!==r;)n.push(o),o=ms();else n=r;n!==r?i=a=[a,n]:(mo=i,i=r)}else mo=i,i=r;if((t=i!==r?e.substring(t,mo):i)===r){if(t=mo,i=mo,(a=vs())!==r){if(n=[],(o=ys())!==r)for(;o!==r;)n.push(o),o=ys();else n=r;n!==r?i=a=[a,n]:(mo=i,i=r)}else mo=i,i=r;t=i!==r?e.substring(t,mo):i}}return t}function ls(){var t,i,a,n,o,s,l,c,u,p;if(t=mo,35===e.charCodeAt(mo)?(i=S,mo++):(i=r,0===To&&Ao(di)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Fn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=es())!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));if(s=mo,l=[],c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(p=e.charAt(mo),Kt.test(p)?mo++:(p=r,0===To&&Ao(ii)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r?(p=e.charAt(mo),Kt.test(p)?mo++:(p=r,0===To&&Ao(ii)),p!==r?c=u=[u,p]:(mo=c,c=r)):(mo=c,c=r);else l=r;(s=l!==r?e.substring(s,mo):l)!==r&&(l=Io())!==r?t=Rn(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),(a=es())!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));for(s=mo,l=[],c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r&&(p=Bs())!==r?c=u=[u,p]:(mo=c,c=r);c!==r;)l.push(c),c=mo,u=mo,To++,p=Io(),To--,p===r?u=void 0:(mo=u,u=r),u!==r&&(p=Bs())!==r?c=u=[u,p]:(mo=c,c=r);s=e.substring(s,mo),(l=Io())!==r?t=Kn(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;if(t===r){if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),e.substr(mo,17)===J?(a=J,mo+=17):(a=r,0===To&&Ao(Ii)),a!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s=function(){var t;e.substr(mo,3)===H?(t=H,mo+=3):(t=r,0===To&&Ao(Ei));t===r&&(e.substr(mo,6)===G?(t=G,mo+=6):(t=r,0===To&&Ao(Vi)),t===r&&(e.substr(mo,6)===U?(t=U,mo+=6):(t=r,0===To&&Ao(Ni)),t===r&&(e.substr(mo,8)===Y?(t=Y,mo+=8):(t=r,0===To&&Ao(Fi)),t===r&&(e.substr(mo,3)===Q?(t=Q,mo+=3):(t=r,0===To&&Ao(Ri)),t===r&&(e.substr(mo,5)===X?(t=X,mo+=5):(t=r,0===To&&Ao(Ki)),t===r&&(e.substr(mo,11)===Z?(t=Z,mo+=11):(t=r,0===To&&Ao(Oi)),t===r&&(e.substr(mo,8)===ee?(t=ee,mo+=8):(t=r,0===To&&Ao(Di)))))))));return t}(),s!==r&&(l=Io())!==r?t=On(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r;if(t===r)if(t=mo,64===e.charCodeAt(mo)?(i=P,mo++):(i=r,0===To&&Ao(gi)),i===r&&(i=null),e.substr(mo,4)===q?(a=q,mo+=4):(a=r,0===To&&Ao(Li)),a!==r)if(58===e.charCodeAt(mo)?(n=d,mo++):(n=r,0===To&&Ao(Ut)),n!==r){for(o=[],32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s!==r;)o.push(s),32===e.charCodeAt(mo)?(s=T,mo++):(s=r,0===To&&Ao(ri));s=function(){var t;e.substr(mo,11)===te?(t=te,mo+=11):(t=r,0===To&&Ao($i));t===r&&(e.substr(mo,11)===ie?(t=ie,mo+=11):(t=r,0===To&&Ao(Mi)),t===r&&(e.substr(mo,5)===X?(t=X,mo+=5):(t=r,0===To&&Ao(Ki)),t===r&&(e.substr(mo,3)===Q?(t=Q,mo+=3):(t=r,0===To&&Ao(Ri)),t===r&&(e.substr(mo,8)===re?(t=re,mo+=8):(t=r,0===To&&Ao(ji))))));return t}(),s!==r&&(l=Io())!==r?t=Dn(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r}}}return t}function cs(){var t,i,a,n,o,s,l,c,u,d,g;if(t=mo,e.substr(mo,5)===ae?(i=ae,mo+=5):(i=r,0===To&&Ao(Wi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=$n(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,7)===ne?(i=ne,mo+=7):(i=r,0===To&&Ao(zi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);if(a=e.substring(a,mo),n=function(){var e,t;e=[],t=us();for(;t!==r;)e.push(t),t=us();return e}(),(o=Io())!==r)if(e.substr(mo,9)===oe?(s=oe,mo+=9):(s=r,0===To&&Ao(Ji)),s!==r){for(l=mo,c=[],u=mo,d=mo,To++,g=Io(),To--,g===r?d=void 0:(mo=d,d=r),d!==r&&(g=Bs())!==r?u=d=[d,g]:(mo=u,u=r);u!==r;)c.push(u),u=mo,d=mo,To++,g=Io(),To--,g===r?d=void 0:(mo=d,d=r),d!==r&&(g=Bs())!==r?u=d=[d,g]:(mo=u,u=r);l=e.substring(l,mo),(c=Io())!==r?t=Mn(a,n,l):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,5)===se?(i=se,mo+=5):(i=r,0===To&&Ao(qi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);if(a=e.substring(a,mo),(n=Io())!==r)if(9658===e.charCodeAt(mo)?(o=le,mo++):(o=r,0===To&&Ao(Hi)),o!==r){for(s=mo,l=[],c=mo,u=mo,To++,d=Io(),To--,d===r?u=void 0:(mo=u,u=r),u!==r&&(d=Bs())!==r?c=u=[u,d]:(mo=c,c=r);c!==r;)l.push(c),c=mo,u=mo,To++,d=Io(),To--,d===r?u=void 0:(mo=u,u=r),u!==r&&(d=Bs())!==r?c=u=[u,d]:(mo=c,c=r);s=e.substring(s,mo),(l=Io())!==r?t=jn(a,s):(mo=t,t=r)}else mo=t,t=r;else mo=t,t=r}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,5)===se?(i=se,mo+=5):(i=r,0===To&&Ao(qi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Wn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,9658===e.charCodeAt(mo)?(i=le,mo++):(i=r,0===To&&Ao(Hi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=zn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,7)===ce?(i=ce,mo+=7):(i=r,0===To&&Ao(Gi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?(o=Xo(),t=Jn(a,o)):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,9)===ue?(i=ue,mo+=9):(i=r,0===To&&Ao(Ui)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=qn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,10)===pe?(i=pe,mo+=10):(i=r,0===To&&Ao(Yi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Hn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,4)===de?(i=de,mo+=4):(i=r,0===To&&Ao(Qi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Gn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r&&(t=mo,e.substr(mo,4)===p?(i=p,mo+=4):(i=r,0===To&&Ao(Ht)),i!==r&&(a=Io())!==r?t=Un():(mo=t,t=r),t===r)){if(t=mo,e.substr(mo,5)===ge?(i=ge,mo+=5):(i=r,0===To&&Ao(Xi)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Yn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r&&(t=mo,e.substr(mo,5)===he?(i=he,mo+=5):(i=r,0===To&&Ao(Zi)),i!==r&&(a=Io())!==r?t=Qn():(mo=t,t=r),t===r)){if(t=mo,e.substr(mo,6)===me?(i=me,mo+=6):(i=r,0===To&&Ao(er)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=Xn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,e.substr(mo,9)===ye?(i=ye,mo+=9):(i=r,0===To&&Ao(tr)),i!==r){if(a=mo,n=mo,80===e.charCodeAt(mo)?(o=fe,mo++):(o=r,0===To&&Ao(ir)),o!==r){for(s=mo,l=[],c=mo,u=mo,To++,d=Io(),To--,d===r?u=void 0:(mo=u,u=r),u!==r&&(d=Bs())!==r?c=u=[u,d]:(mo=c,c=r);c!==r;)l.push(c),c=mo,u=mo,To++,d=Io(),To--,d===r?u=void 0:(mo=u,u=r),u!==r&&(d=Bs())!==r?c=u=[u,d]:(mo=c,c=r);n=o=[o,s=e.substring(s,mo)]}else mo=n,n=r;(a=n!==r?e.substring(a,mo):n)!==r&&(n=Io())!==r?t=Zn(a):(mo=t,t=r)}else mo=t,t=r;if(t===r&&(t=mo,e.substr(mo,6)===be?(i=be,mo+=6):(i=r,0===To&&Ao(rr)),i!==r?(a=function(){var t;e.substr(mo,4)===Ye?(t=Ye,mo+=4):(t=r,0===To&&Ao(Fr));t===r&&(e.substr(mo,5)===Qe?(t=Qe,mo+=5):(t=r,0===To&&Ao(Rr)),t===r&&(e.substr(mo,4)===Xe?(t=Xe,mo+=4):(t=r,0===To&&Ao(Kr)),t===r&&(e.substr(mo,5)===Ze?(t=Ze,mo+=5):(t=r,0===To&&Ao(Or)),t===r&&(e.substr(mo,7)===et?(t=et,mo+=7):(t=r,0===To&&Ao(Dr)),t===r&&(e.substr(mo,9)===tt?(t=tt,mo+=9):(t=r,0===To&&Ao($r)),t===r&&(e.substr(mo,4)===it?(t=it,mo+=4):(t=r,0===To&&Ao(Mr)),t===r&&(e.substr(mo,8)===rt?(t=rt,mo+=8):(t=r,0===To&&Ao(jr)),t===r&&(e.substr(mo,5)===at?(t=at,mo+=5):(t=r,0===To&&Ao(Wr)),t===r&&(e.substr(mo,4)===nt?(t=nt,mo+=4):(t=r,0===To&&Ao(zr)),t===r&&(e.substr(mo,7)===ot?(t=ot,mo+=7):(t=r,0===To&&Ao(Jr)),t===r&&(e.substr(mo,6)===dt?(t=dt,mo+=6):(t=r,0===To&&Ao(qr)),t===r&&(e.substr(mo,4)===gt?(t=gt,mo+=4):(t=r,0===To&&Ao(Hr)),t===r&&(e.substr(mo,5)===ht?(t=ht,mo+=5):(t=r,0===To&&Ao(Gr)),t===r&&(e.substr(mo,6)===mt?(t=mt,mo+=6):(t=r,0===To&&Ao(Ur)),t===r&&(e.substr(mo,4)===yt?(t=yt,mo+=4):(t=r,0===To&&Ao(Yr)),t===r&&(e.substr(mo,6)===ft?(t=ft,mo+=6):(t=r,0===To&&Ao(Qr)),t===r&&(e.substr(mo,3)===bt?(t=bt,mo+=3):(t=r,0===To&&Ao(Xr)),t===r&&(e.substr(mo,6)===Tt?(t=Tt,mo+=6):(t=r,0===To&&Ao(Zr)),t===r&&(e.substr(mo,4)===vt?(t=vt,mo+=4):(t=r,0===To&&Ao(ea)),t===r&&(e.substr(mo,6)===xt?(t=xt,mo+=6):(t=r,0===To&&Ao(ta)),t===r&&(e.substr(mo,5)===kt?(t=kt,mo+=5):(t=r,0===To&&Ao(ia)),t===r&&(e.substr(mo,6)===wt?(t=wt,mo+=6):(t=r,0===To&&Ao(ra))))))))))))))))))))))));return t}(),a!==r&&(n=Io())!==r?t=eo(a):(mo=t,t=r)):(mo=t,t=r),t===r&&(t=mo,i=function(){var t;e.substr(mo,4)===ve?(t=ve,mo+=4):(t=r,0===To&&Ao(nr));t===r&&(e.substr(mo,6)===xe?(t=xe,mo+=6):(t=r,0===To&&Ao(or)),t===r&&(e.substr(mo,5)===ke?(t=ke,mo+=5):(t=r,0===To&&Ao(sr)),t===r&&(e.substr(mo,9)===we?(t=we,mo+=9):(t=r,0===To&&Ao(lr)),t===r&&(e.substr(mo,6)===Ce?(t=Ce,mo+=6):(t=r,0===To&&Ao(cr)),t===r&&(e.substr(mo,9)===Ae?(t=Ae,mo+=9):(t=r,0===To&&Ao(ur)),t===r&&(e.substr(mo,11)===Be?(t=Be,mo+=11):(t=r,0===To&&Ao(pr)),t===r&&(e.substr(mo,3)===_e?(t=_e,mo+=3):(t=r,0===To&&Ao(dr)),t===r&&(e.substr(mo,3)===Se?(t=Se,mo+=3):(t=r,0===To&&Ao(gr)),t===r&&(e.substr(mo,9)===Pe?(t=Pe,mo+=9):(t=r,0===To&&Ao(hr)),t===r&&(e.substr(mo,15)===Ie?(t=Ie,mo+=15):(t=r,0===To&&Ao(mr)),t===r&&(e.substr(mo,6)===Le?(t=Le,mo+=6):(t=r,0===To&&Ao(yr)),t===r&&(e.substr(mo,13)===Ee?(t=Ee,mo+=13):(t=r,0===To&&Ao(fr)),t===r&&(e.substr(mo,16)===Ve?(t=Ve,mo+=16):(t=r,0===To&&Ao(br)),t===r&&(e.substr(mo,16)===Ne?(t=Ne,mo+=16):(t=r,0===To&&Ao(Tr)),t===r&&(e.substr(mo,15)===Fe?(t=Fe,mo+=15):(t=r,0===To&&Ao(vr)),t===r&&(e.substr(mo,14)===Re?(t=Re,mo+=14):(t=r,0===To&&Ao(xr)),t===r&&(e.substr(mo,16)===Ke?(t=Ke,mo+=16):(t=r,0===To&&Ao(kr)),t===r&&(e.substr(mo,14)===Oe?(t=Oe,mo+=14):(t=r,0===To&&Ao(wr)),t===r&&(e.substr(mo,15)===De?(t=De,mo+=15):(t=r,0===To&&Ao(Cr)),t===r&&(e.substr(mo,15)===$e?(t=$e,mo+=15):(t=r,0===To&&Ao(Ar)),t===r&&(e.substr(mo,15)===Me?(t=Me,mo+=15):(t=r,0===To&&Ao(Br)),t===r&&(e.substr(mo,14)===je?(t=je,mo+=14):(t=r,0===To&&Ao(_r)),t===r&&(e.substr(mo,10)===We?(t=We,mo+=10):(t=r,0===To&&Ao(Sr)),t===r&&(e.substr(mo,13)===ze?(t=ze,mo+=13):(t=r,0===To&&Ao(Pr)),t===r&&(e.substr(mo,19)===Je?(t=Je,mo+=19):(t=r,0===To&&Ao(Ir)),t===r&&(e.substr(mo,10)===qe?(t=qe,mo+=10):(t=r,0===To&&Ao(Lr)),t===r&&(e.substr(mo,10)===He?(t=He,mo+=10):(t=r,0===To&&Ao(Er)),t===r&&(e.substr(mo,13)===Ge?(t=Ge,mo+=13):(t=r,0===To&&Ao(Vr)),t===r&&(e.substr(mo,11)===Ue?(t=Ue,mo+=11):(t=r,0===To&&Ao(Nr)))))))))))))))))))))))))))))));return t}(),i!==r&&(a=Io())!==r?t=to(i):(mo=t,t=r),t===r)))if(t=mo,35===e.charCodeAt(mo)?(i=S,mo++):(i=r,0===To&&Ao(di)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),(n=Io())!==r?t=io(a):(mo=t,t=r)}else mo=t,t=r}}}}}}}}}}}return t}function us(){var t,i,a,n,o,s,l;if(t=mo,e.substr(mo,2)===Te?(i=Te,mo+=2):(i=r,0===To&&Ao(ar)),i!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),t=ro(a)}else mo=t,t=r;return t}function ps(){var e,t,i,a;for(To++,e=mo,(t=ds())===r&&(t=null),i=[],(a=ws())===r&&(a=ds());a!==r;)i.push(a),(a=ws())===r&&(a=ds());return e=no(t,i),To--,t=r,0===To&&Ao(na),e}function ds(){var t,i,a,n,o,s,l;if(t=mo,(i=As())!==r&&(i=oo()),(t=i)===r){if(t=mo,i=mo,a=[],n=mo,(o=Cs())===r&&(o=null),s=mo,To++,l=ws(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?n=o=[o,s,l]:(mo=n,n=r),n===r&&(n=mo,(o=Cs())!==r?(s=mo,To++,l=ws(),To--,l===r?s=void 0:(mo=s,s=r),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r)),n!==r)for(;n!==r;)a.push(n),n=mo,(o=Cs())===r&&(o=null),s=mo,To++,l=ws(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Bs())!==r?n=o=[o,s,l]:(mo=n,n=r),n===r&&(n=mo,(o=Cs())!==r?(s=mo,To++,l=ws(),To--,l===r?s=void 0:(mo=s,s=r),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r));else a=r;(i=a!==r?e.substring(i,mo):a)!==r&&(i=so(i)),t=i}return t}function gs(){var t;return 42===e.charCodeAt(mo)?(t=Ct,mo++):(t=r,0===To&&Ao(oa)),t}function hs(){var t;return 95===e.charCodeAt(mo)?(t=At,mo++):(t=r,0===To&&Ao(sa)),t}function ms(){var t;return 96===e.charCodeAt(mo)?(t=Bt,mo++):(t=r,0===To&&Ao(la)),t}function ys(){var t;return 33===e.charCodeAt(mo)?(t=_t,mo++):(t=r,0===To&&Ao(ca)),t}function fs(){var e,t,i;return e=mo,(t=gs())!==r&&(i=gs())!==r?e=t=[t,i]:(mo=e,e=r),e}function bs(){var e,t,i;return e=mo,(t=hs())!==r&&(i=hs())!==r?e=t=[t,i]:(mo=e,e=r),e}function Ts(){var e,t,i;return e=mo,(t=ms())!==r&&(i=ms())!==r?e=t=[t,i]:(mo=e,e=r),e}function vs(){var e,t,i;return e=mo,(t=ys())!==r&&(i=ys())!==r?e=t=[t,i]:(mo=e,e=r),e}function xs(){var t;return e.substr(mo,2)===St?(t=St,mo+=2):(t=r,0===To&&Ao(ua)),t}function ks(){var t;return 93===e.charCodeAt(mo)?(t=Pt,mo++):(t=r,0===To&&Ao(pa)),t}function ws(){var t,i,a,n,o,s;if(t=mo,xs()!==r){if(i=mo,a=[],n=e.charAt(mo),Kt.test(n)?mo++:(n=r,0===To&&Ao(ii)),n!==r)for(;n!==r;)a.push(n),n=e.charAt(mo),Kt.test(n)?mo++:(n=r,0===To&&Ao(ii));else a=r;(i=a!==r?e.substring(i,mo):a)!==r&&(a=ks())!==r?t=lo(i):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,fs()!==r){for(i=mo,a=[],n=mo,o=mo,To++,s=fs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);n!==r;)a.push(n),n=mo,o=mo,To++,s=fs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);i=e.substring(i,mo),(a=fs())!==r?t=co(i):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,bs()!==r){for(i=mo,a=[],n=mo,o=mo,To++,s=bs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);n!==r;)a.push(n),n=mo,o=mo,To++,s=bs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);i=e.substring(i,mo),(a=bs())!==r?t=uo(i):(mo=t,t=r)}else mo=t,t=r;if(t===r){if(t=mo,Ts()!==r){for(i=mo,a=[],n=mo,o=mo,To++,s=Ts(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);n!==r;)a.push(n),n=mo,o=mo,To++,s=Ts(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);i=e.substring(i,mo),(a=Ts())!==r?t=po(i):(mo=t,t=r)}else mo=t,t=r;if(t===r)if(t=mo,vs()!==r){for(i=mo,a=[],n=mo,o=mo,To++,s=vs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);n!==r;)a.push(n),n=mo,o=mo,To++,s=vs(),To--,s===r?o=void 0:(mo=o,o=r),o!==r?(e.length>mo?(s=e.charAt(mo),mo++):(s=r,0===To&&Ao(Mt)),s!==r?n=o=[o,s]:(mo=n,n=r)):(mo=n,n=r);i=e.substring(i,mo),(a=vs())!==r?t=go(i):(mo=t,t=r)}else mo=t,t=r}}}return t}function Cs(){var t,i,a,n,o;if(t=mo,i=mo,(a=Ts())!==r){if(n=[],(o=ms())!==r)for(;o!==r;)n.push(o),o=ms();else n=r;n!==r?i=a=[a,n]:(mo=i,i=r)}else mo=i,i=r;if((t=i!==r?e.substring(t,mo):i)===r){if(t=mo,i=mo,(a=vs())!==r){if(n=[],(o=ys())!==r)for(;o!==r;)n.push(o),o=ys();else n=r;n!==r?i=a=[a,n]:(mo=i,i=r)}else mo=i,i=r;t=i!==r?e.substring(t,mo):i}return t}function As(){var t;return To++,10===e.charCodeAt(mo)?(t=It,mo++):(t=r,0===To&&Ao(ga)),t===r&&(e.substr(mo,2)===Lt?(t=Lt,mo+=2):(t=r,0===To&&Ao(ha)),t===r&&(t=e.charAt(mo),Ot.test(t)?mo++:(t=r,0===To&&Ao(ma)))),To--,t===r&&(0===To&&Ao(da)),t}function Bs(){var t;return t=e.charAt(mo),Dt.test(t)?mo++:(t=r,0===To&&Ao(ya)),t}function _s(){var t,i;return(t=As())===r&&(t=mo,To++,e.length>mo?(i=e.charAt(mo),mo++):(i=r,0===To&&Ao(Mt)),To--,i===r?t=void 0:(mo=t,t=r)),t}function Ss(){var t,i,a,n,o,s,l;if(t=mo,i=mo,a=mo,e.substr(mo,4)===Et?(n=Et,mo+=4):(n=r,0===To&&Ao(fa)),n!==r?(115===e.charCodeAt(mo)?(o=Vt,mo++):(o=r,0===To&&Ao(ba)),o===r&&(o=null),e.substr(mo,3)===Nt?(s=Nt,mo+=3):(s=r,0===To&&Ao(Ta)),s!==r?a=n=[n,o,s]:(mo=a,a=r)):(mo=a,a=r),a===r&&(e.substr(mo,7)===Ft?(a=Ft,mo+=7):(a=r,0===To&&Ao(va))),(i=a!==r?e.substring(i,mo):a)!==r){for(a=mo,n=[],o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Ps())!==r?o=s=[s,l]:(mo=o,o=r);o!==r;)n.push(o),o=mo,s=mo,To++,l=Io(),To--,l===r?s=void 0:(mo=s,s=r),s!==r&&(l=Ps())!==r?o=s=[s,l]:(mo=o,o=r);a=e.substring(a,mo),t=ho(i,a)}else mo=t,t=r;return t}function Ps(){var t;return t=e.charAt(mo),$t.test(t)?mo++:(t=r,0===To&&Ao(xa)),t}var Is=[],Ls="";if(e=e.trimStart(),i=o(),t.peg$library)return{peg$result:i,peg$currPos:mo,peg$FAILED:r,peg$maxFailExpected:bo,peg$maxFailPos:fo};if(i!==r&&mo===e.length)return i;throw i!==r&&mo<e.length&&Ao({type:"end"}),Bo(bo,fo<e.length?e.charAt(fo):null,fo<e.length?Co(fo,fo+1):Co(fo,fo))}!function(e,t){function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i}(pt,Error),pt.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var i,r=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){r=e[i].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+n.line+":"+n.column;if(r){var s=this.location.end,l=dt("",n.line.toString().length," "),c=r[a.line-1],u=(a.line===s.line?s.column:c.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+l+" |\n"+n.line+" | "+c+"\n"+l+" | "+dt("",a.column-1," ")+dt("",u,"^")}else t+="\n at "+o}return t},pt.buildMessage=function(e,t){var i,r={literal:function(e){return'"'+n(e.text)+'"'},class:function(e){var t=e.parts.map(function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)});return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function a(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(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"+a(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+a(e)})}function o(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"+a(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+a(e)})}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,i,r=e.map(s);if(r.sort(),r.length>0){for(t=1,i=1;t<r.length;t++)r[t-1]!==r[t]&&(r[i]=r[t],i++);r.length=i}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+(((i=t)?'"'+n(i)+'"':"end of input")+" found.")};var ht=gt,mt=class{version(){return ht("",{startRule:"version"})}preprocessAst(e){if(ve.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;let i=e??"";if(!i)return[];let r="bitmarkPlusPlus";return Object.assign({},t).location===ke.tag&&(r="bitmarkPlus"),i=i.trim(),ht(i,{startRule:r})}extractBodyBits(e){if(!Array.isArray(e))return[];const t=[],i=e;for(const e of i)switch(e.type){case be.gap:case be.select:case be.highlight:case be.mark:t.push(e);break;default:{const i=this.extractBodyBits(e.content);for(const e of i)t.push(e)}}return t}walkBodyBits(e,t){if(!Array.isArray(e))return;const i=e;for(let e=0;e<i.length;e++){const r=i[e];switch(r.type){case be.gap:case be.select:case be.highlight:case be.mark:t(i,e,r);break;default:this.walkBodyBits(r.content,t)}}}},yt=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}},ft=new class{asNumber(e,t){if(null==e)return t??void 0;const i=+e;return Number.isNaN(i)||!isFinite(i)?t??void 0:i}isNumeric(e){if(null==e)return!1;const t=+e;return!Number.isNaN(t)&&isFinite(t)}},bt=class{constructor(){p(this,"textParser"),p(this,"textGenerator"),this.textParser=new mt,this.textGenerator=new ot}toExample(e,t,i){if(null!=t){let e;return e=yt.isBoolean(i)?yt.toBoolean(t):t,{isExample:!0,example:e,__defaultExample:i??null}}return e?{isExample:!0,example:i??null,__defaultExample:i??null}:{isExample:!1,example:null,__defaultExample:i??null}}toAstProperty(e,t){if(null==t)return;const i=ae.getRawPropertiesConfig()[e],r=e=>{if(null!=e){switch(i.format){case T.plainText:return null!=ft.asNumber(e)&&(e=`${e}`),ve.isString(e)?ve.trimmedString(e):void 0;case T.number:return ft.asNumber(e);case T.boolean:return yt.toBoolean(e,!0);case T.invertedBoolean:return!yt.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,i=e.length;t<i;t++)e[t]=r(e[t])}else t=r(t);return ze.asArray(t)}getEmptyTextAst(e){return this.handleJsonText(e,ke.tag," ")}handleJsonText(e,t,i){let r;const{textFormat:a}=e;if(null==i)r=[];else if(this.textParser.isAst(i))r=i;else{if(Array.isArray(i)){const e=[];for(let r=0,n=i.length;r<n;r++){const n=i[r];this.textParser.isAst(n)?e[r]=n:ve.isString(n)?(e[r]=this.textParser.toAst(je.breakscape(n,{format:a,location:t}),{format:a,location:t}),e[r].__tag="text"):e[r]=[]}return e}r=ve.isString(i)?this.textParser.toAst(je.breakscape(i,{format:a,location:t,v2:!0}),{format:a,location:t}):[]}return r.__tag="text",r}},Tt=new mt,vt=new class{fillStringExample(e,t,i,r,a){if(t){Array.isArray(t)||(t=[t]);for(const n of t)if(!n.isExample&&(i?(n.example=n.__defaultExample,n.isExample=!0):n.example=r?Tt.toAst(r,{format:e,location:ke.tag}):void 0,a))break}}fillBooleanExample(e,t,i,r){if(e){Array.isArray(e)||(e=[e]);for(const a of e)if(!a.isExample&&(!r||a.isCorrect)&&(t?(a.example=a.__defaultExample,a.isExample=!0):a.example=yt.toBoolean(i),r))break}}},xt=new class{fileExtensionFromUrl(e){let t;if(e)try{const i=new URL(e).pathname.split(".");i.length>1&&(t=i[i.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}},kt=new class{validateBit(e){if(!e)return e;return e}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;let t=e,i=!1;switch(e.type){case B.image:i=!!e.image.src;break;case B.imageLink:i=!!e.imageLink.url;break;case B.audio:i=!!e.audio.src;break;case B.audioEmbed:i=!!e.audioEmbed.src;break;case B.audioLink:i=!!e.audioLink.url;break;case B.video:i=!!e.video.src;break;case B.videoEmbed:i=!!e.videoEmbed.url;break;case B.videoLink:i=!!e.videoLink.url;break;case B.stillImageFilm:i=!!e.image.src&&!!e.audio.src;break;case B.stillImageFilmEmbed:i=!!e.stillImageFilmEmbed.url;break;case B.stillImageFilmLink:i=!!e.stillImageFilmLink.url;break;case B.article:i=!!e.article.body;break;case B.document:i=!!e.document.url;break;case B.documentEmbed:i=!!e.documentEmbed.url;break;case B.documentLink:i=!!e.documentLink.url;break;case B.documentDownload:i=!!e.documentDownload.url;break;case B.appLink:i=!!e.appLink.url;break;case B.websiteLink:i=!!e.websiteLink.url;break;default:i=!1}return i||e.type&&(t={type: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(!ve.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!ve.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!ve.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!ve.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(!ve.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`)}},wt=class extends bt{resourceFromResourceJson(e,t){if(!t)return;const i=[];Array.isArray(t)||(t=[t]);for(const r of t){let t=B.fromValue(r.type);if(!t)return;const a=B.keyFromValue(t);if(!a)return;let n;if(t=B.fromValue(r.__typeAlias)??t,t===B.imageResponsive){const t=r,a=this.resourceFromResourceDataJson(e,B.imagePortrait,t.imagePortrait),n=this.resourceFromResourceDataJson(e,B.imageLandscape,t.imageLandscape);a&&i.push(a),n&&i.push(n)}else if(t===B.stillImageFilm){const t=r,a=this.resourceFromResourceDataJson(e,B.image,t.image),n=this.resourceFromResourceDataJson(e,B.audio,t.audio);a&&i.push(a),n&&i.push(n)}else{if(n=r[a],!n)return;const o=this.resourceFromResourceDataJson(e,t,n);o&&i.push(o)}}return 0!==i.length?1===i.length?i[0]:i:void 0}resourceFromResourceDataJson(e,t,i){if(!i)return;if(!(t=B.fromValue(t)))return;const r=ve.isString(i)?i:void 0,a=i.url||i.src||i.body||r,n=i.posterImage?this.resourceFromResourceDataJson(e,B.image,i.posterImage)?.image:void 0,o=i.thumbnails?i.thumbnails.map(t=>this.resourceFromResourceDataJson(e,B.image,t)?.image):void 0;return this.resource(e,{type:t,value:a,format:i.format,src1x:i.src1x,src2x:i.src2x,src3x:i.src3x,src4x:i.src4x,caption:this.handleJsonText(e,ke.tag,i.caption),width:i.width??void 0,height:i.height??void 0,alt:i.alt,zoomDisabled:i.zoomDisabled,duration:i.duration,mute:i.mute,autoplay:i.autoplay,allowSubtitles:i.allowSubtitles,showSubtitles:i.showSubtitles,posterImage:n,thumbnails:o,siteName:void 0,license:i.license,copyright:i.copyright,showInIndex:i.showInIndex,search:i.search})}resource(e,t){let i;const{type:r,value:a,format:n,...o}=t,s={type:r,value:a??je.EMPTY_STRING,format:n??je.EMPTY_STRING,...o};switch(r){case B.video:case B.videoEmbed:case B.videoLink:case B.stillImageFilmEmbed:case B.stillImageFilmLink:{const i=["src1x","src2x","src3x","src4x"],r=[];for(const a of i){const i=t[a];if(i){const t=this.resource(e,{type:B.image,value:i});t&&r.push(t.image)}}s.thumbnails=[...s.thumbnails||[],...r]}}switch(r){case B.image:case B.imagePortrait:case B.imageLandscape:case B.backgroundWallpaper:case B.imagePlaceholder:case B.icon:i=this.imageResource(e,s,r);break;case B.imageLink:i=this.imageLinkResource(e,s);break;case B.audio:i=this.audioResource(e,s);break;case B.audioEmbed:i=this.audioEmbedResource(e,s);break;case B.audioLink:i=this.audioLinkResource(e,s);break;case B.video:i=this.videoResource(e,s);break;case B.videoEmbed:i=this.videoEmbedResource(e,s);break;case B.videoLink:i=this.videoLinkResource(e,s);break;case B.stillImageFilmEmbed:i=this.stillImageFilmEmbedResource(e,s);break;case B.stillImageFilmLink:i=this.stillImageFilmLinkResource(e,s);break;case B.article:i=this.articleResource(e,s);break;case B.document:i=this.documentResource(e,s);break;case B.documentEmbed:i=this.documentEmbedResource(e,s);break;case B.documentLink:i=this.documentLinkResource(e,s);break;case B.documentDownload:i=this.documentDownloadResource(e,s);break;case B.appLink:i=this.appLinkResource(e,s);break;case B.websiteLink:i=this.websiteLinkResource(e,s)}return i}imageResource(e,t,i){const{value:r,src1x:a,src2x:n,src3x:o,src4x:s,width:l,height:c,alt:u,zoomDisabled:p,license:d,copyright:g,showInIndex:h,caption:y,search:f}=t,{bitType:b}=e;let T=!1;ae.isOfBitType(b,[m.imageSeparator,m.pageBanner,m.imagesLogoGrave,m.prototypeImages])&&(T=!0);const v={type:B.image,__typeAlias:i??B.image,image:{format:xt.fileExtensionFromUrl(r)??void 0,provider:xt.domainFromUrl(r)??void 0,src:r??"",src1x:a??void 0,src2x:n??void 0,src3x:o??void 0,src4x:s??void 0,width:l??null,height:c??null,alt:u??"",zoomDisabled:p??T,license:d??"",copyright:g??"",showInIndex:h??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0}};return Y.removeUnwantedProperties(v.image,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","alt","license","copyright"]}),kt.validateResource(v)}imageLinkResource(e,t){const{value:i,src1x:r,src2x:a,src3x:n,src4x:o,width:s,height:l,alt:c,zoomDisabled:u,license:p,copyright:d,showInIndex:g,caption:h,search:m}=t,y={type:B.imageLink,__typeAlias:B.imageLink,imageLink:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",src1x:r??void 0,src2x:a??void 0,src3x:n??void 0,src4x:o??void 0,width:s??null,height:l??null,alt:c??"",zoomDisabled:u??!1,license:p??"",copyright:d??"",showInIndex:g??!1,caption:this.handleJsonText(e,ke.tag,h),search:m??void 0}};return Y.removeUnwantedProperties(y.imageLink,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","alt","license","copyright"]}),kt.validateResource(y)}audioResource(e,t){const{value:i,duration:r,mute:a,autoplay:n,license:o,copyright:s,showInIndex:l,caption:c,search:u}=t,p={type:B.audio,__typeAlias:B.audio,audio:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:a??void 0,autoplay:n??void 0,license:o??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ke.tag,c),search:u??void 0}};return Y.removeUnwantedProperties(p.audio,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(p)}audioEmbedResource(e,t){const{value:i,duration:r,mute:a,autoplay:n,license:o,copyright:s,showInIndex:l,caption:c,search:u}=t,p={type:B.audioEmbed,__typeAlias:B.audioEmbed,audioEmbed:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:a??void 0,autoplay:n??void 0,license:o??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ke.tag,c),search:u??void 0}};return Y.removeUnwantedProperties(p.audioEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(p)}audioLinkResource(e,t){const{value:i,duration:r,mute:a,autoplay:n,license:o,copyright:s,showInIndex:l,caption:c,search:u}=t,p={type:B.audioLink,__typeAlias:B.audioLink,audioLink:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",duration:r??void 0,mute:a??void 0,autoplay:n??void 0,license:o??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ke.tag,c),search:u??void 0}};return Y.removeUnwantedProperties(p.audioLink,{ignoreEmptyString:["url"]}),kt.validateResource(p)}videoResource(e,t){const{value:i,width:r,height:a,duration:n,mute:o,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:u,posterImage:p,thumbnails:d,license:g,copyright:h,showInIndex:m,caption:y,search:f}=t,b={type:B.video,__typeAlias:B.video,video:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,src:i??"",width:r??null,height:a??null,duration:n??void 0,mute:o??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:u??"",license:g??"",copyright:h??"",showInIndex:m??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0,posterImage:p??void 0,thumbnails:d??void 0}};return Y.removeUnwantedProperties(b.video,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(b)}videoEmbedResource(e,t){const{value:i,width:r,height:a,duration:n,mute:o,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:u,posterImage:p,thumbnails:d,license:g,copyright:h,showInIndex:m,caption:y,search:f}=t,b={type:B.videoEmbed,__typeAlias:B.videoEmbed,videoEmbed:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:a??null,duration:n??void 0,mute:o??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:u??"",posterImage:p??void 0,thumbnails:d??void 0,license:g??"",copyright:h??"",showInIndex:m??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0}};return Y.removeUnwantedProperties(b.videoEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(b)}videoLinkResource(e,t){const{value:i,width:r,height:a,duration:n,mute:o,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:u,posterImage:p,thumbnails:d,license:g,copyright:h,showInIndex:m,caption:y,search:f}=t,b={type:B.videoLink,__typeAlias:B.videoLink,videoLink:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:a??null,duration:n??void 0,mute:o??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:u??"",posterImage:p??void 0,thumbnails:d??void 0,license:g??"",copyright:h??"",showInIndex:m??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0}};return Y.removeUnwantedProperties(b.videoLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(b)}stillImageFilmEmbedResource(e,t){const{value:i,width:r,height:a,duration:n,mute:o,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:u,posterImage:p,thumbnails:d,license:g,copyright:h,showInIndex:m,caption:y,search:f}=t,b={type:B.stillImageFilmEmbed,__typeAlias:B.stillImageFilmEmbed,stillImageFilmEmbed:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:a??null,duration:n??void 0,mute:o??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:u??"",posterImage:p??void 0,thumbnails:d??void 0,license:g??"",copyright:h??"",showInIndex:m??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0}};return Y.removeUnwantedProperties(b.stillImageFilmEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(b)}stillImageFilmLinkResource(e,t){const{value:i,width:r,height:a,duration:n,mute:o,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:u,posterImage:p,thumbnails:d,license:g,copyright:h,showInIndex:m,caption:y,search:f}=t,b={type:B.stillImageFilmLink,__typeAlias:B.stillImageFilmLink,stillImageFilmLink:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:a??null,duration:n??void 0,mute:o??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:u??"",posterImage:p??void 0,thumbnails:d??void 0,license:g??"",copyright:h??"",showInIndex:m??!1,caption:this.handleJsonText(e,ke.tag,y),search:f??void 0}};return Y.removeUnwantedProperties(b.stillImageFilmLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(b)}articleResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.article,__typeAlias:B.article,article:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,body:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.article,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["body","alt","license","copyright"]}),kt.validateResource(l)}documentResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.document,__typeAlias:B.document,document:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.document,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}documentEmbedResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.documentEmbed,__typeAlias:B.documentEmbed,documentEmbed:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.documentEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}documentLinkResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.documentLink,__typeAlias:B.documentLink,documentLink:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.documentLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}documentDownloadResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.documentDownload,__typeAlias:B.documentDownload,documentDownload:{format:xt.fileExtensionFromUrl(i)??void 0,provider:xt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.documentDownload,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}appLinkResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.appLink,__typeAlias:B.appLink,appLink:{provider:void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.appLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}websiteLinkResource(e,t){const{value:i,license:r,copyright:a,showInIndex:n,caption:o,search:s}=t,l={type:B.websiteLink,__typeAlias:B.websiteLink,websiteLink:{provider:void 0,url:i??"",license:r??"",copyright:a??"",showInIndex:n??!1,caption:this.handleJsonText(e,ke.tag,o),search:s??void 0}};return Y.removeUnwantedProperties(l.websiteLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),kt.validateResource(l)}},Ct=class extends bt{constructor(){super(...arguments),p(this,"resourceBuilder",new wt)}buildBitmark(e){const{bits:t,errors:i}=e,r={bits:t,errors:i};return Y.removeUnwantedProperties(r),r}buildBit(e){const t=ae.getBitConfig(e.bitType),i=e.bitType,r=We.fromValue(e.textFormat);let a=S.fromValue(e.textFormat)??t.textFormatDefault;r===We.bitmarkMinusMinus&&(a=S.bitmarkText);const n={bitConfig:t,bitType:i,textFormat:a},o=this.buildCardNode(n,e),s=ae.isOfBitType(e.bitType,m.essay)?this.toAstProperty(w.reasonableNumOfChars,e.reasonableNumOfChars):void 0,l={...this.toExample(e.__isDefaultExample,e.example)},c={bitType:i,bitLevel:e.bitLevel,textFormat:a,resourceType:B.fromValue(e.resourceType),isCommented:e.isCommented,id:this.toAstProperty(w.id,e.id),internalComment:this.toAstProperty(w.internalComment,e.internalComment),customerId:this.toAstProperty(w.customerId,e.customerId),customerExternalId:this.toAstProperty(w.customerExternalId,e.customerExternalId),externalId:this.toAstProperty(w.externalId,e.externalId),spaceId:this.toAstProperty(w.spaceId,e.spaceId),padletId:this.toAstProperty(w.padletId,e.padletId),jupyterId:this.toAstProperty(w.jupyterId,e.jupyterId),jupyterExecutionCount:this.toAstProperty(w.jupyterExecutionCount,e.jupyterExecutionCount),isPublic:this.toAstProperty(w.isPublic,e.isPublic),isTemplate:this.toAstProperty(w.isTemplate,e.isTemplate),isTemplateStripTheme:this.toAstProperty(w.isTemplateStripTheme,e.isTemplateStripTheme),aiGenerated:this.toAstProperty(w.aiGenerated,e.aiGenerated),machineTranslated:this.toAstProperty(w.machineTranslated,e.machineTranslated),searchIndex:this.toAstProperty(w.searchIndex,e.searchIndex),analyticsTag:this.toAstProperty(w.analyticsTag,e.analyticsTag),categoryTag:this.toAstProperty(w.categoryTag,e.categoryTag),topicTag:this.toAstProperty(w.topicTag,e.topicTag),altLangTag:this.toAstProperty(w.altLangTag,e.altLangTag),feedbackEngine:this.toAstProperty(w.feedbackEngine,e.feedbackEngine),feedbackType:this.toAstProperty(w.feedbackType,e.feedbackType),disableFeedback:this.toAstProperty(w.disableFeedback,e.disableFeedback),diffTo:this.toAstProperty(w.diffTo,e.diffTo),diffOp:this.toAstProperty(w.diffOp,e.diffOp),diffRef:this.toAstProperty(w.diffRef,e.diffRef),diffContext:this.toAstProperty(w.diffContext,e.diffContext),diffTime:this.toAstProperty(w.diffTime,e.diffTime),path:this.toAstProperty(w.path,e.path),releaseVersion:this.toAstProperty(w.releaseVersion,e.releaseVersion),releaseKind:this.toAstProperty(w.releaseKind,e.releaseKind),releaseDate:this.toAstProperty(w.releaseDate,e.releaseDate),book:this.buildBooks(n,e.book),ageRange:this.toAstProperty(w.ageRange,e.ageRange),lang:this.toAstProperty(w.lang,e.lang),language:this.toAstProperty(w.language,e.language),publisher:this.toAstProperty(w.publisher,e.publisher),publisherName:this.toAstProperty(w.publisherName,e.publisherName),theme:this.toAstProperty(w.theme,e.theme),computerLanguage:this.toAstProperty(w.computerLanguage,e.computerLanguage),target:this.toAstProperty(w.target,e.target),slug:this.toAstProperty(w.slug,e.slug),tag:this.toAstProperty(w.tag,e.tag),reductionTag:this.toAstProperty(w.reductionTag,e.reductionTag),bubbleTag:this.toAstProperty(w.bubbleTag,e.bubbleTag),levelCEFRp:this.toAstProperty(w.levelCEFRp,e.levelCEFRp),levelCEFR:this.toAstProperty(w.levelCEFR,e.levelCEFR),levelILR:this.toAstProperty(w.levelILR,e.levelILR),levelACTFL:this.toAstProperty(w.levelACTFL,e.levelACTFL),icon:this.toAstProperty(w.icon,e.icon),iconTag:this.toAstProperty(w.iconTag,e.iconTag),colorTag:this.toAstProperty(w.colorTag,e.colorTag),flashcardSet:this.toAstProperty(w.flashcardSet,e.flashcardSet),subtype:this.toAstProperty(w.subtype,e.subtype),bookAlias:this.toAstProperty(w.bookAlias,e.bookAlias),bookDiff:this.toAstProperty(w.bookDiff,e.bookDiff),coverImage:this.toAstProperty(w.coverImage,e.coverImage),coverColor:this.toAstProperty(w.coverColor,e.coverColor),publications:this.toAstProperty(w.publications,e.publications),author:this.toAstProperty(w.author,e.author),subject:this.toAstProperty(w.subject,e.subject),date:this.toAstProperty(w.date,e.date),dateEnd:this.toAstProperty(w.dateEnd,e.dateEnd),location:this.toAstProperty(w.location,e.location),kind:this.toAstProperty(w.kind,e.kind),hasMarkAsDone:this.toAstProperty(w.hasMarkAsDone,e.hasMarkAsDone),processHandIn:this.toAstProperty(w.processHandIn,e.processHandIn),processHandInLocation:this.toAstProperty(w.processHandInLocation,e.processHandInLocation),chatWithBook:this.toAstProperty(w.chatWithBook,e.chatWithBook),chatWithBookBrainKey:this.toAstProperty(w.chatWithBookBrainKey,e.chatWithBookBrainKey),action:this.toAstProperty(w.action,e.action),showInIndex:this.toAstProperty(w.showInIndex,e.showInIndex),refAuthor:this.toAstProperty(w.refAuthor,e.refAuthor),refBookTitle:this.toAstProperty(w.refBookTitle,e.refBookTitle),refPublisher:this.toAstProperty(w.refPublisher,e.refPublisher),refPublicationYear:this.toAstProperty(w.refPublicationYear,e.refPublicationYear),citationStyle:this.toAstProperty(w.citationStyle,e.citationStyle),blockId:this.toAstProperty(w.blockId,e.blockId),pageNo:this.toAstProperty(w.pageNo,e.pageNo),x:this.toAstProperty(w.x,e.x),y:this.toAstProperty(w.y,e.y),width:this.toAstProperty(w.width,e.width),height:this.toAstProperty(w.height,e.height),index:this.toAstProperty(w.index,e.index),classification:this.toAstProperty(w.classification,e.classification),availableClassifications:this.toAstProperty(w.availableClassifications,e.availableClassifications),allowedBit:this.toAstProperty(w.allowedBit,e.allowedBit),tableFixedHeader:this.toAstProperty(w.tableFixedHeader,e.tableFixedHeader),tableHeaderWhitespaceNoWrap:this.toAstProperty(w.tableHeaderWhitespaceNoWrap,e.tableHeaderWhitespaceNoWrap),tableSearch:this.toAstProperty(w.tableSearch,e.tableSearch),tableSort:this.toAstProperty(w.tableSort,e.tableSort),tablePagination:this.toAstProperty(w.tablePagination,e.tablePagination),tablePaginationLimit:this.toAstProperty(w.tablePaginationLimit,e.tablePaginationLimit),tableHeight:this.toAstProperty(w.tableHeight,e.tableHeight),tableWhitespaceNoWrap:this.toAstProperty(w.tableWhitespaceNoWrap,e.tableWhitespaceNoWrap),tableAutoWidth:this.toAstProperty(w.tableAutoWidth,e.tableAutoWidth),tableResizableColumns:this.toAstProperty(w.tableResizableColumns,e.tableResizableColumns),tableColumnMinWidth:this.toAstProperty(w.tableColumnMinWidth,e.tableColumnMinWidth),quizCountItems:this.toAstProperty(w.quizCountItems,e.quizCountItems),quizStrikethroughSolutions:this.toAstProperty(w.quizStrikethroughSolutions,e.quizStrikethroughSolutions),codeLineNumbers:this.toAstProperty(w.codeLineNumbers,e.codeLineNumbers),codeMinimap:this.toAstProperty(w.codeMinimap,e.codeMinimap),stripePricingTableId:this.toAstProperty(w.stripePricingTableId,e.stripePricingTableId),stripePublishableKey:this.toAstProperty(w.stripePublishableKey,e.stripePublishableKey),thumbImage:this.toAstProperty(w.thumbImage,e.thumbImage),scormSource:this.toAstProperty(w.scormSource,e.scormSource),posterImage:this.toAstProperty(w.posterImage,e.posterImage),focusX:this.toAstProperty(w.focusX,e.focusX),focusY:this.toAstProperty(w.focusY,e.focusY),pointerLeft:this.toAstProperty(w.pointerLeft,e.pointerLeft),pointerTop:this.toAstProperty(w.pointerTop,e.pointerTop),listItemIndent:this.toAstProperty(w.listItemIndent,e.listItemIndent),backgroundWallpaper:this.toImageResource(n,e.backgroundWallpaper),hasBookNavigation:this.toAstProperty(w.hasBookNavigation,e.hasBookNavigation),duration:this.toAstProperty(w.duration,e.duration),deeplink:this.toAstProperty(w.deeplink,e.deeplink),externalLink:this.toAstProperty(w.externalLink,e.externalLink),externalLinkText:this.toAstProperty(w.externalLinkText,e.externalLinkText),videoCallLink:this.toAstProperty(w.videoCallLink,e.videoCallLink),vendorDashboardId:this.toAstProperty(w.vendorDashboardId,e.vendorDashboardId),vendorSurveyId:this.toAstProperty(w.vendorSurveyId,e.vendorSurveyId),vendorUrl:this.toAstProperty(w.vendorUrl,e.vendorUrl),search:this.toAstProperty(w.search,e.search),list:this.toAstProperty(w.list,e.list),layer:this.toAstProperty(w.layer,e.layer),layerRole:this.toAstProperty(w.layerRole,e.layerRole),textReference:this.toAstProperty(w.textReference,e.textReference),isTracked:this.toAstProperty(w.isTracked,e.isTracked),isInfoOnly:this.toAstProperty(w.isInfoOnly,e.isInfoOnly),imageFirst:this.toAstProperty(w.imageFirst,e.imageFirst),activityType:this.toAstProperty(w.activityType,e.activityType),labelTrue:this.toAstProperty(w.labelTrue,e.labelTrue),labelFalse:this.toAstProperty(w.labelFalse,e.labelFalse),content2Buy:this.toAstProperty(w.content2Buy,e.content2Buy),mailingList:this.toAstProperty(w.mailingList,e.mailingList),buttonCaption:this.toAstProperty(w.buttonCaption,e.buttonCaption),callToActionUrl:this.toAstProperty(w.callToActionUrl,e.callToActionUrl),caption:this.handleJsonText(n,ke.tag,e.caption),quotedPerson:this.toAstProperty(w.quotedPerson,e.quotedPerson),reasonableNumOfChars:s,resolved:this.toAstProperty(w.resolved,e.resolved),resolvedDate:this.toAstProperty(w.resolvedDate,e.resolvedDate),resolvedBy:this.toAstProperty(w.resolvedBy,e.resolvedBy),handInAcceptFileType:this.toAstProperty(w.handInAcceptFileType,e.handInAcceptFileType),handInRequirement:this.toAstProperty(w.handInRequirement,e.handInRequirement),handInInstruction:this.toAstProperty(w.handInInstruction,e.handInInstruction),maxCreatedBits:this.toAstProperty(w.maxCreatedBits,e.maxCreatedBits),maxDisplayLevel:this.toAstProperty(w.maxDisplayLevel,e.maxDisplayLevel),maxTocChapterLevel:this.toAstProperty(w.maxTocChapterLevel,e.maxTocChapterLevel),tocResource:this.toAstProperty(w.tocResource,e.tocResource),tocContent:this.toAstProperty(w.tocContent,e.tocContent),page:this.toAstProperty(w.page,e.page),productId:this.toAstProperty(w.productId,e.productId),product:this.toAstProperty(w.product,e.product),productList:this.toAstProperty(w.productList,e.productList),productVideo:this.toAstProperty(w.productVideo,e.productVideo),productVideoList:this.toAstProperty(w.productVideoList,e.productVideoList),productFolder:this.toAstProperty(w.productFolder,e.productFolder),technicalTerm:this.buildTechnicalTerm(n,e.technicalTerm),servings:this.buildServings(n,e.servings),ratingLevelStart:this.buildRatingLevelStartEnd(n,e.ratingLevelStart),ratingLevelEnd:this.buildRatingLevelStartEnd(n,e.ratingLevelEnd),ratingLevelSelected:this.toAstProperty(w.ratingLevelSelected,e.ratingLevelSelected),markConfig:this.buildMarkConfigs(n,e.markConfig),imageSource:this.buildImageSource(n,e.imageSource),person:this.buildPerson(n,e.person),bot:this.toAstProperty(w.bot,e.bot),referenceProperty:this.toAstProperty(w.property_reference,e.referenceProperty),title:this.handleJsonText(n,ke.tag,e.title),subtitle:this.handleJsonText(n,ke.tag,e.subtitle),level:ft.asNumber(e.level),toc:this.toAstProperty(w.toc,e.toc),progress:this.toAstProperty(w.progress,e.progress),anchor:e.anchor,reference:e.reference,referenceEnd:e.referenceEnd,revealSolutions:this.toAstProperty(w.revealSolutions,e.revealSolutions),item:this.handleJsonText(n,ke.tag,e.item),lead:this.handleJsonText(n,ke.tag,e.lead),pageNumber:this.handleJsonText(n,ke.tag,e.pageNumber),marginNumber:this.handleJsonText(n,ke.tag,e.marginNumber),hint:this.handleJsonText(n,ke.tag,e.hint),instruction:this.handleJsonText(n,ke.tag,e.instruction),partialAnswer:this.toAstProperty(w.partialAnswer,e.partialAnswer),sampleSolution:this.toAstProperty(w.property_sampleSolution,e.sampleSolution),additionalSolutions:this.toAstProperty(w.additionalSolutions,e.additionalSolutions),...this.toExample(e.__isDefaultExample,e.example),imagePlaceholder:this.toImageResource(n,e.imagePlaceholder),resources:ze.asArray(this.resourceBuilder.resourceFromResourceJson(n,e.resources)),body:this.buildBody(n,e.body),cardNode:o,footer:this.buildFooter(n,e.footer),extraProperties:this.parseExtraProperties(e.extraProperties),markup:e.markup,parser:e.parser,__isDefaultExample:e.__isDefaultExample??!1};return ae.isOfBitType(c.bitType,m.interview)&&this.pushDownTree(n,void 0,void 0,o,"questions",w.reasonableNumOfChars,e.reasonableNumOfChars),ae.isOfBitType(c.bitType,m.feedback)&&this.pushDownTree(n,void 0,void 0,o,["feedbacks","reason"],w.reasonableNumOfChars,e.reasonableNumOfChars),this.pushDownTree(n,[c.body,...o?.cardBits?.map(e=>e.body)||[]],[ye.gap],void 0,void 0,w.isCaseSensitive,e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,o,"pairs",w.isCaseSensitive,e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,o,["matrix","cells"],w.isCaseSensitive,e.isCaseSensitive??!0),this.pushExampleDownTree(n,c.body,o,c.__isDefaultExample,l.example),this.setDefaultBitValues(c),this.setIsExampleFlags(c),this.addVersionToParserInfo(c),Y.removeUnwantedProperties(c,{ignoreAllFalse:!0,ignoreUndefined:["example"],ignoreEmptyArrays:["item","lead","pageNumber","marginNumber","hint","instruction"]}),kt.validateBit(c)}buildBooks(e,t){if(ve.isString(t))return t;if(!Array.isArray(t))return;const i=t.map(t=>this.buildBook(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildBook(e,t){if(!t)return;const i={book:t.book??"",reference:t.reference??"",referenceEnd:t.referenceEnd??void 0};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["book","reference"]}),i}buildFeedbackChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedbackChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedbackChoice(e,t){if(!t)return;const i={choice:t.choice??"",requireReason:!!t.requireReason,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildFeedbackReason(e,t){if(!t)return;const i=this.handleJsonText(e,ke.tag,"true"),r={text:t.text??"",reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__textAst:t.__textAst};return Y.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example","reasonableNumOfChars"]}),r}buildChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildChoice(e,t){if(!t)return;const i={choice:t.choice??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildResponse(e,t){if(!t)return;const i={response:t.response??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildBotResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.botResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}botResponse(e,t){if(!t)return;const i={response:t.response??"",reaction:t.reaction??"",feedback:t.feedback??"",item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint)};return Y.removeUnwantedProperties(i,{ignoreEmptyString:["response","reaction","feedback"],ignoreAllFalse:!0,ignoreEmptyArrays:["item"],ignoreUndefined:["example"]}),i}buildFeedbacks(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedback(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedback(e,t){if(!t)return;let i,r;if(!t.choices)return;i=this.buildFeedbackChoices(e,t.choices),t.reason&&(r=this.buildFeedbackReason(e,t.reason));const a={item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),choices:i,reason:r};return Y.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),a}buildQuizzes(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuiz(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuiz(e,t){if(!t)return;const i={...this.toExample(t.__isDefaultExample,t.__defaultExample)};let r,a;if(t.choices)r=this.buildChoices(e,t.choices),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!0,r);else{if(!t.responses)return;a=this.buildResponses(e,t.responses),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!1,a)}const n={item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),isExample:!!t.__defaultExample,choices:r,responses:a};return Y.removeUnwantedProperties(n,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),n}buildHeading(e,t){if(!t)return;if(null==t.forKeys)return;const i={forKeys:t.forKeys??"",forValues:t.forValues??t.__forValuesDefault??""};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["forKeys","forValues"],ignoreEmptyArrays:["forValues"]}),i}buildPairs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildPair(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildPair(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r=this.resourceBuilder.resourceFromResourceJson(e,t.keyAudio),a=this.resourceBuilder.resourceFromResourceJson(e,t.keyImage),n={key:t.key??"",keyAudio:r,keyImage:a,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),values:t.values||[],__valuesAst:t.__valuesAst};return Y.removeUnwantedProperties(n,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction","values"],ignoreUndefined:["example","isCaseSensitive"]}),n}buildMatricies(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMatrix(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMatrix(e,t){if(!t)return;let i=!1;for(const e of t.cells||[])t.__isDefaultExample&&!e.isExample&&(e.isExample=!0),i=!!e.isExample||i;const r={key:t.key??"",item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),isExample:i,cells:(t.cells||[]).map(t=>this.buildMatrixCell(e,t)).filter(e=>null!=e)};return Y.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["hint","item","cells"],ignoreUndefined:["isCaseSensitive"]}),r}buildMatrixCell(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r={values:t.values||[],item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__valuesAst:t.__valuesAst};return Y.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["instruction","item","values"],ignoreUndefined:["example","isCaseSensitive"]}),r}buildPronunciationTable(e,t){if(!t)return;return{data:(t.data||[]).map(t=>(t||[]).map(t=>{const i=this.resourceBuilder.resourceFromResourceJson(e,t.audio);return{title:this.handleJsonText(e,ke.tag,t.title),body:this.handleJsonText(e,ke.tag,t.body),audio:i}}))}}buildTable(e,t){if(!t)return;return{columns:(t.columns||[]).map(t=>this.handleJsonText(e,ke.tag,t)),data:(t.data||[]).map(t=>(t||[]).map(t=>this.handleJsonText(e,ke.tag,t)))}}buildQuestions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuestion(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuestion(e,t){if(!t)return;const i=t.__sampleSolutionAst,r={question:t.question??"",partialAnswer:t.partialAnswer??"",sampleSolution:t.sampleSolution??"",additionalSolutions:t.additionalSolutions??void 0,reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__sampleSolutionAst:t.__sampleSolutionAst};return Y.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"],ignoreEmptyString:["question","partialAnswer","sampleSolution"]}),r}buildIngredients(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildIngredient(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildIngredient(e,t){if(!t)return;const i={title:this.handleJsonText(e,ke.tag,t.title),checked:t.checked??!1,ingredient:this.handleJsonText(e,ke.tag,t.ingredient),quantity:t.quantity??0,unit:t.unit??"",unitAbbr:t.unitAbbr??"",decimalPlaces:t.decimalPlaces??1,disableCalculation:t.disableCalculation??!1,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["item","unit"]}),i}buildBody(e,t){if(!t)return;let i;const r=[],a=t.placeholders,n=t.bodyString,{textFormat:o}=e,s=()=>{let n,s=t.body;const l={};if(ve.isString(t.body)?(n=(t.body??"").trim(),s=[]):Array.isArray(t.body)||(s=[]),a)for(const[e,t]of Object.entries(a))l[e]=t;if(n){n=je.breakscape(n,{format:o,location:ke.body,v2:!0});let e=0;const t=[];for(const[i,r]of Object.entries(l))if(n){const a=`[!${e}]`;n=n.replace(`${i}`,a),t.push(r),e++}s=this.textParser.toAst(n,{format:o,location:ke.body});const i=e=>{for(let r=0,a=e.length;r<a;r++){const a=e[r];if("bit"===a.type){const i=a.index;null!=t[i]&&(e[r]=t[i])}else a.content&&i(a.content)}};i(s)}s=structuredClone(s),this.textParser.walkBodyBits(s,(t,i,a)=>{let n;switch(a.type){case ye.gap:n=this.buildGap(e,a);break;case ye.mark:n=this.buildMark(e,a);break;case ye.select:n=this.buildSelect(e,a);break;case ye.highlight:n=this.buildHighlight(e,a)}null!=n&&(t[i]=n,r.push(n))}),i=s,i.__tag="text"},l=o===S.bitmarkText;o===S.json?(()=>{if("string"==typeof t.body)try{i=JSON.parse(t.body)}catch(e){i=null}else i=t.body})():l?s():i=t.body;return{body:i,bodyBits:r,bodyString:n}}buildFooter(e,t){if(!t)return;return{footer:this.handleJsonText(e,ke.body,t.footer)}}buildGap(e,t){if(!t)return;const i=Array.isArray(t.__solutionsAst)&&t.__solutionsAst.length>0?t.__solutionsAst[0]:null;t=this.bodyBitCopyFromAttrs(t);const r={type:ye.gap,solutions:t.solutions||[],item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__solutionsAst:t.__solutionsAst,attrs:{}};return Y.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example","isCaseSensitive"]}),r}buildMarkConfigs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMarkConfig(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMarkConfig(e,t){if(!t)return;const i={mark:t.mark??"unknown",color:t.color??"",emphasis:t.emphasis??""};return Y.removeUnwantedProperties(i,{ignoreAllEmptyString:!0}),i}buildMark(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:ye.mark,solution:t.solution??"",mark:t.mark??"",item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0),attrs:{}};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"],ignoreEmptyString:["solution","mark"]}),i}buildSelect(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:ye.select,options:this.buildSelectOptions(e,t.options)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(!1,void 0,void 0),__hintString:t.__hintString,__instructionString:t.__instructionString,attrs:{}};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildSelectOptions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildSelectOption(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildSelectOption(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildHighlight(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:ye.highlight,texts:this.buildHighlightTexts(e,t.texts)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(!1,void 0,void 0),attrs:{}};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildHighlightTexts(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildHighlightText(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildHighlightText(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,isHighlighted:!!t.isHighlighted,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildFlashcards(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFlashcard(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFlashcard(e,t){if(!t)return;const i={question:this.buildTextAndIcon(e,t.question),answer:this.buildTextAndIcon(e,t.answer),alternativeAnswers:(t.alternativeAnswers||[]).map(t=>this.buildTextAndIcon(e,t)).filter(e=>null!=e),item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeAnswers","item","hint","instruction"],ignoreUndefined:["example"]}),i}buildDefinitionList(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildDefinitionListItem(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildDefinitionListItem(e,t){if(!t)return;const{bitType:i}=e,r=ae.isOfBitType(i,[m.metaSearchDefaultTerms]),a={term:this.buildTextAndIcon(e,t.term,r),definition:this.buildTextAndIcon(e,t.definition,r),alternativeDefinitions:(t.alternativeDefinitions||[]).map(t=>this.buildTextAndIcon(e,t,r)).filter(e=>null!=e),item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return Y.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeDefinitions","item","hint","instruction"],ignoreUndefined:["example"]}),a}buildTextAndIcon(e,t,i=!1){const r=this.resourceBuilder.resourceFromResourceJson(e,t?.icon);let a=this.handleJsonText(e,ke.tag,t?.text||t);i&&(a=this.textGenerator.generateSync(a,S.plainText,ke.body,{noBreakscaping:!0}).trim());const n={text:a,icon:r};return Y.removeUnwantedProperties(n,{ignoreEmptyArrays:["text"],ignoreUndefined:["icon"]}),n}buildStatements(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildStatement(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildStatement(e,t){if(!t)return;const i={statement:t.statement??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ke.tag,t.item),lead:this.handleJsonText(e,ke.tag,t.lead),hint:this.handleJsonText(e,ke.tag,t.hint),instruction:this.handleJsonText(e,ke.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return Y.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),i}buildImageSource(e,t){if(!t)return;const{url:i,mockupId:r,size:a,format:n,trim:o}=t,s={url:i??"",mockupId:r??"",size:a??null,format:n??null,trim:yt.isBoolean(o)?o:null};return Y.removeUnwantedProperties(s,{ignoreFalse:["trim"],ignoreEmptyString:["url","mockupId"],ignoreAllUndefined:!0}),s}buildPerson(e,t){if(!t)return;const{name:i,title:r,avatarImage:a}=t,n={name:i??"",title:r??void 0,avatarImage:this.resourceBuilder.resourceFromResourceJson(e,a)};return Y.removeUnwantedProperties(n,{ignoreEmptyString:["name"],ignoreAllUndefined:!0}),n}buildTechnicalTerm(e,t){if(!t)return;const{technicalTerm:i,lang:r}=t,a={technicalTerm:i??"",lang:r??""};return Y.removeUnwantedProperties(a,{ignoreEmptyString:["technicalTerm"]}),a}buildServings(e,t){if(!t)return;const{servings:i,unit:r,unitAbbr:a,decimalPlaces:n,disableCalculation:o,hint:s}=t,l={servings:i??0,unit:r??"",unitAbbr:a??"",decimalPlaces:n??1,disableCalculation:o??!1,hint:s??""};return Y.removeUnwantedProperties(l,{ignoreEmptyString:["servings","unit"]}),l}buildRatingLevelStartEnd(e,t){if(!t)return;const{level:i,label:r}=t,a={level:i??0,label:this.handleJsonText(e,ke.tag,r)};return Y.removeUnwantedProperties(a,{}),a}buildCardBits(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildCardBit(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildCardBit(e,t){if(!t)return;const{bitType:i,textFormat:r}=e,a=this.buildBit({...t,bitType:i,textFormat:r});return Y.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),kt.validateCardBit(a)}toImageResource(e,t){return ze.asSingle(this.resourceBuilder.resourceFromResourceDataJson(e,B.image,t?.image))}buildCardNode(e,t){const i={heading:this.buildHeading(e,t.heading),questions:this.buildQuestions(e,t.questions),elements:t.elements,flashcards:this.buildFlashcards(e,t.flashcards),definitions:this.buildDefinitionList(e,t.definitions??t.legend),statement:this.buildStatement(e,t.statement),statements:this.buildStatements(e,t.statements),choices:this.buildChoices(e,t.choices),responses:this.buildResponses(e,t.responses),feedbacks:this.buildFeedbacks(e,t.feedbacks),quizzes:this.buildQuizzes(e,t.quizzes),pairs:this.buildPairs(e,t.pairs),matrix:this.buildMatricies(e,t.matrix),pronunciationTable:this.buildPronunciationTable(e,t.pronunciationTable),table:this.buildTable(e,t.table),botResponses:this.buildBotResponses(e,t.botResponses),ingredients:this.buildIngredients(e,t.ingredients),cardBits:this.buildCardBits(e,t.cardBits)};return Y.removeUnwantedProperties(i),Object.keys(i).length>0?i:void 0}bodyBitCopyFromAttrs(e){const t={...e};if(e.attrs)for(const[i,r]of Object.entries(e.attrs))t[i]=r;return t}pushExampleDownTree(e,t,i,r,a){if(r||null!=a){if(i){if(this.pushExampleDownTreeString(e,r,a,i.pairs),this.pushExampleDownTreeBoolean(e,r,a,!1,i.flashcards),this.pushExampleDownTreeBoolean(e,r,a,!1,i.definitions),this.pushExampleDownTreeBoolean(e,r,a,!0,i.choices),this.pushExampleDownTreeBoolean(e,r,a,!1,i.responses,i.statements,i.statement),i.quizzes)for(const t of i.quizzes)this.pushExampleDownTreeBoolean(e,r,a,!0,t.choices),this.pushExampleDownTreeBoolean(e,r,a,!1,t.responses);if(i.matrix)for(const t of i.matrix)this.pushExampleDownTreeString(e,r,a,t.cells)}t&&this.pushExampleDownTreeBodyBits(e,r,a,t)}}pushExampleDownTreeBoolean(e,t,i,r,...a){if((t||null!=i)&&Array.isArray(a))for(const e of a)if(e){const a=Array.isArray(e)?e:[e];vt.fillBooleanExample(a,t,i,r)}}pushExampleDownTreeString(e,t,i,...r){if((t||i)&&Array.isArray(r))for(const a of r)if(a){const r=Array.isArray(a)?a:[a];vt.fillStringExample(e.textFormat,r,t,i,!1)}}pushExampleDownTreeBodyBits(e,t,i,r){if(!t&&!i)return;const a=this.textParser.extractBodyBits(r?.body);for(const r of a)if(r)switch(r.type){case ye.gap:{const a=r;vt.fillStringExample(e.textFormat,[a],t,i,!1);break}case ye.mark:{const e=r;vt.fillBooleanExample([e],t,i,!1);break}case ye.select:{const e=r;vt.fillBooleanExample(e.options,t,i,!0);break}case ye.highlight:{const e=r;vt.fillBooleanExample(e.texts,t,i,!0);break}}}pushDownTree(e,t,i,r,a,n,o){if(void 0!==o){if(r&&a){Array.isArray(a)||(a=[a]);const e=Y.flatMapPath(r,a);for(const t of e)null==t[n]&&(t[n]=o)}if(t){const e=Array.isArray(t)?t:[t];for(const t of e)if(t&&t.body&&i){const e=this.textParser.extractBodyBits(t.body);if(i&&e&&e.length>0)for(const t of e)if(t&&-1!==i.indexOf(t.type)){const e=t;null==e[n]&&(e[n]=o)}}}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const i={};for(const[e,r]of t)i[e]=ze.asArray(r)||[r];return i}setIsExampleFlags(e){const t=t=>!!t&&(t.isExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:i,cardNode:r}=e,a=this.textParser.extractBodyBits(i?.body);for(const e of a)switch(e.type){case ye.gap:case ye.mark:t(e);break;case ye.select:{const i=e;let r=!1;for(const e of i.options)r=!!t(e)||r;i.isExample=r;break}case ye.highlight:{const i=e;let r=!1;for(const e of i.texts)r=!!t(e)||r;i.isExample=r;break}}if(r){for(const e of r.flashcards||[])t(e);for(const e of r.definitions||[])t(e);for(const e of r.pairs||[])t(e);for(const e of r.matrix||[]){let i=!1;for(const r of e.cells||[])i=!!t(r)||i;e.isExample=i}for(const e of r.quizzes||[]){let i=!1;for(const r of e.responses||[])i=!!t(r)||i;for(const r of e.choices||[])i=!!t(r)||i;e.isExample=i}for(const e of r.responses||[])t(e);for(const e of r.choices||[])t(e);for(const e of r.statements||[])t(e);t(r.statement);for(const e of r.questions||[])t(e)}t(e.statement);for(const i of e.responses||[])t(i);for(const i of e.choices||[])t(i);t(e)}setDefaultBitValues(e){switch(e.bitType){case m.articleAi:case m.noteAi:case m.summaryAi:e.aiGenerated=this.toAstProperty(w.aiGenerated,!0)}}addVersionToParserInfo(e){const t=e.parser??{};t.version=de.appVersion.full,e.parser=t}},At=class{constructor(){p(this,"_buffer"),p(this,"_string",""),p(this,"endOfLineString","\n"),p(this,"lastWrite","")}get isSync(){return!0}getString(){return this._string}async open(){return this.openSync(),Promise.resolve()}async close(){try{this.closeSync()}catch(e){return Promise.reject(e)}return 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.lastWrite=e+this.endOfLineString):(this._buffer.push(this.endOfLineString),this.lastWrite=this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;let i="";for(let r=0,a=e.length;r<a;r++){const n=e[r];this._buffer.push(n),i+=n,t&&r<a-1&&(this._buffer.push(t),i+=t),this._buffer.push(this.endOfLineString),i+=this.endOfLineString}return this.lastWrite=i,this}write(e){return this._buffer?(null==e||(e&&(this.lastWrite=e),this._buffer.push(e)),this):this}writeWhiteSpace(){return this.write(" "),this}getLastWrite(){return this.lastWrite}},Bt=u(d(),1),_t=(0,u(d(),1).superenum)({v1:1,v2:2}),St={debugGenerationInline:!1},Pt=class extends He{constructor(e,t){super(),p(this,"ast",new xe),p(this,"textGenerator"),p(this,"bitmarkVersion"),p(this,"options"),p(this,"mainWriter"),p(this,"partWriter"),p(this,"writer"),p(this,"prettifySpace"),p(this,"spacesAroundValues"),p(this,"spacesAroundValuesStr"),p(this,"bitType",m._error),p(this,"textFormat",S.bitmarkText),p(this,"isBodyBitmarkText",!1),p(this,"isCardAllowed",!1),p(this,"firstBit",!0),p(this,"hasCardSet",!1),p(this,"hasFooter",!1),p(this,"inTag",!0),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.write=this.write.bind(this),this.bodyBitCallback=this.bodyBitCallback.bind(this),this.bitmarkVersion=Je.fromValue(t?.bitmarkVersion)??qe,this.options={...St,...t?.bitmarkOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion===Je.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=_t.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=_t.v2),this.prettifySpace=!0===this.options.prettifyJson?2:this.options.prettifyJson||void 0,this.spacesAroundValues=this.calcSpacesAroundValues(),this.spacesAroundValuesStr=" ".repeat(this.spacesAroundValues),this.textGenerator=new ot(this.bitmarkVersion,{writeCallback:this.write,bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.mainWriter=e,this.partWriter=new At,this.writer=this.mainWriter,this.generateResourceHandlers(),this.generatePropertyHandlers()}async generate(e){this.resetState(),await this.writer.open(),this.walkAndWrite(e),this.writeLine(),await this.writer.close()}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.bitType=m._error,this.textFormat=S.bitmarkText,this.isBodyBitmarkText=!1,this.isCardAllowed=!1,this.firstBit=!0,this.hasCardSet=!1,this.hasFooter=!1,this.inTag=!0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,Te.bitmarkAst,this,void 0),this.writeLine()}enter_bitsValue(e,t){const i=e.value,r=ae.getBitConfig(i.bitType),a=ae.getBitResourcesConfig(i.bitType,i.resourceType);if(this.bitType=i.bitType,this.textFormat=i.textFormat??r.textFormatDefault,this.isBodyBitmarkText=this.textFormat===S.bitmarkText,this.isCardAllowed=this.calculateIsCardAllowed(),this.hasCardSet=this.haveValidCardSet(i),this.hasFooter=this.haveValidFooter(i),this.firstBit||(this.writeNL(),this.writeNL(),this.writeNL()),this.writeOPD(i.bitLevel),i.isCommented&&this.writeString("|"),this.writeTagKey(i.bitType),i.textFormat){this.isWriteTextFormat(i.textFormat,r.textFormatDefault)&&(this.writeColon(),this.writeTagKey(i.textFormat))}let n;if(r.resourceAttachmentAllowed&&i.resources&&i.resources.length>0){const e=a.comboResourceTagTypesMap;if(a.comboResourceTagTypesMap.size>0)for(const t of e.keys())n=t;else n=i.resources[0].type}return n&&(this.writeAmpersand(),this.writeTagKey(n)),this.writeCL(),!0}exit_bitsValue(e,t){this.firstBit=!1}enter_internalComment(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;for(let e=0;e<i.length;e++){const t=i[e];this.writeNL(),this.writeProperty("internalComment",t,{format:T.plainText,single:!1,ignoreEmpty:!0})}return!1}enter_labelTrue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const a=r?.value;if(a){const e=""!=i,t=a.labelFalse&&""!=a.labelFalse[0];(e||t)&&this.writeNL(),e&&this.writeProperty(C.labelTrue,i,{format:T.plainText,single:!0,ignoreEmpty:!0}),t&&this.writeProperty(C.labelFalse,a.labelFalse,{format:T.plainText,single:!0,ignoreEmpty:!0})}return!1}enter_labelFalse(e,t){return!0}enter_imageSource(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const{url:a,mockupId:n,size:o,format:s,trim:l}=i;return this.writeNL(),this.writeProperty("imageSource",a,{format:T.plainText,single:!0,ignoreEmpty:!0}),a&&(n&&this.writeProperty("mockupId",n,{format:T.plainText,single:!0,ignoreEmpty:!0}),o&&this.writeProperty("size",o,{format:T.plainText,single:!0,ignoreEmpty:!0}),s&&this.writeProperty("format",s,{format:T.plainText,single:!0,ignoreEmpty:!0}),yt.isBoolean(l)&&this.writeProperty("trim",l,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}enter_technicalTerm(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const{technicalTerm:a,lang:n}=i;return this.writeNL(),this.writeProperty("technicalTerm",a,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=n&&this.writeProperty("lang",n,{format:T.plainText,single:!0,ignoreEmpty:!0}),!1}enter_servings(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const{servings:a,unit:n,unitAbbr:o,decimalPlaces:s,disableCalculation:l,hint:c}=i;return this.writeNL(),this.writeProperty("servings",a,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=n&&this.writeProperty("unit",n,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=o&&this.writeProperty("unitAbbr",o,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=s&&this.writeProperty("decimalPlaces",s,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=l&&this.writeProperty("disableCalculation",l,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=c&&(this.writeOPQ(),this.writeTextOrValue(c,S.plainText,ke.tag),this.writeCL()),!1}enter_person(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const{name:a,title:n,avatarImage:o}=i;return this.writeNL(),this.writeProperty("person",a,{format:T.plainText,single:!0,ignoreEmpty:!0}),n&&this.writeProperty("title",n,{format:T.plainText,single:!0,ignoreEmpty:!0}),o&&this.writeResource(B.image,o.image.src),!1}enter_text(e,t){const i=this.getParentNode(t);return!i||i.key!==Te.term&&i.key!==Te.definition&&i.key!==Te.alternativeDefinitionsValue&&i.key!==Te.question&&i.key!==Te.answer&&i.key!==Te.alternativeAnswersValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body)),!1)}leaf_text(e,t){const i=this.getParentNode(t);return!i||i.key!==Te.term&&i.key!==Te.definition&&i.key!==Te.alternativeDefinitionsValue&&i.key!==Te.question&&i.key!==Te.answer&&i.key!==Te.alternativeAnswersValue&&i.key!==Te.reason||(ve.isString(e.value)&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body)),!1)}enter_icon(e,t){const i=e.value,r=this.getParentNode(t);return!r||(r.key!==Te.term&&r.key!==Te.definition&&r.key!==Te.alternativeDefinitionsValue&&r.key!==Te.question&&r.key!==Te.answer&&r.key!==Te.alternativeAnswersValue||(this.writeNL(),this.writeResource(B.icon,i.image.src)),!0)}leaf_iconValue(e,t){return this.writeNL(),this.writeProperty("icon",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0}),!1}enter_ratingLevelStart(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enter_ratingLevelEnd(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enterRatingLevelStartEndCommon(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;const{level:a,label:n}=i,o=e.key===Te.ratingLevelStart?C.ratingLevelStart:C.ratingLevelEnd;return this.writeNL(),this.writeProperty(o,a,{format:T.plainText,single:!0,ignoreEmpty:!0}),n&&this.writeProperty("label",n,{format:T.bitmarkText,single:!0,ignoreEmpty:!0}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.markConfig)return!0;const{mark:a,color:n,emphasis:o}=i;return a&&(this.writeNL(),this.writeProperty("mark",a,{format:T.plainText,single:!0,ignoreEmpty:!0}),n&&this.writeProperty("color",n,{format:T.plainText,single:!0,ignoreEmpty:!0}),o&&this.writeProperty("emphasis",o,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}enter_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}leaf_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}enter_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}leaf_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})),!1}leaf_reasonableNumOfChars(e,t){this.writeNL(),this.writeProperty("reasonableNumOfChars",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_additionalSolutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===Te.questionsValue&&(this.writeNL(),this.writeProperty("additionalSolutions",e.value,{format:T.plainText,single:!1}))}enter_item(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.lead)||(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i,S.bitmarkText,ke.tag),this.writeCL(),!0))))}enter_lead(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,S.bitmarkText,ke.tag),this.writeCL(),!0)))}enter_pageNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i??"",S.bitmarkText,ke.tag),this.writeCL(),!0))}enter_marginNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.pageNumber??"",S.bitmarkText,ke.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,S.bitmarkText,ke.tag),this.writeCL(),!0)}enter_body(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue&&i?.key!==Te.cardBitsValue)return!0;this.inTag=!1;const r=e.value;if(this.textFormat===S.json){const e=r.body??null;if(Array.isArray(e)||Y.isObject(e)){const t=JSON.stringify(e,null,this.prettifySpace);t&&(this.writePlainTextDivider(),this.writeNL(),this.writeTextOrValue(t,S.plainText,ke.body))}}else if(this.isBodyBitmarkText){const e=!(this.hasCardSet||this.hasFooter);this.writeNL();const t=Array.isArray(r.body)?r.body:[];this.writeTextOrValue(t,this.textFormat,ke.body,{plainTextDividerAllowed:e})}else{this.writePlainTextDivider(),this.writeNL();const e=ve.isString(r.body)?r.body:"";this.writeTextOrValue(`${e}`,S.plainText,ke.body)}return!1}exit_body(e,t){this.inTag=!0}bodyBitCallback(e,t,i){const r=Te.fromValue(e.type)??Te.bodyBit;return this.ast.walk(e,r,this,void 0),""}enter_gap(e,t){const i=e.value;if(i.solutions&&0===i.solutions.length)this.writeOPU(),this.writeCL();else for(const e of i.solutions)this.writeOPU(),this.writeTextOrValue(e,S.plainText,ke.tag),this.writeCL();return!0}enter_mark(e,t){const i=e.value;return this.writeOPE(),this.writeTextOrValue(i.solution,S.plainText,ke.tag),this.writeCL(),!0}enter_select(e,t){return!0}enter_highlight(e,t){return!0}enter_footer(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return!0;const r=e.value;return this.textFormat===S.json||r.footer&&r.footer.length>0&&this.isBodyBitmarkText&&(this.writeNL(),this.writeTextOrValue("==== footer ====",S.plainText,ke.body),this.writeNL(),this.writeTextOrValue(r.footer,this.textFormat,ke.body,{plainTextDividerAllowed:!0})),!1}enter_solutions(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return!0;const r=e.value;return r&&0===r.length&&(this.writeOPU(),this.writeCL()),!0}leaf_solution(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return;const r=e.value,a=this.getParentNode(t,2)?.value;a?.type===ye.mark&&r&&(this.writeOPE(),this.writeTextOrValue(r,S.plainText,ke.tag),this.writeCL())}leaf_mark(e,t){const i=t[0];if(i?.key!==Te.mark)return;const r=e.value;r&&this.writeProperty("mark",r,{format:T.plainText,single:!0,ignoreEmpty:!0})}enter_optionsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,S.plainText,ke.tag),this.writeCL(),!0}enter_textsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,S.plainText,ke.tag),this.writeCL(),!0}enter_cardNode(e,t){return!this.isCardAllowed||(this.writeCardSetStart(),!0)}between_cardNode(e,t,i,r){this.isCardAllowed&&this.writeCardSetCardDivider()}exit_cardNode(e,t){this.isCardAllowed&&(this.writeCardSetEnd(),this.options.cardSetVersion,_t.v1)}enter_elements(e,t){}between_elements(e,t,i,r){this.writeCardSetVariantDivider()}between_flashcards(e,t,i,r){this.writeCardSetCardDivider()}between_flashcardsValue(e,t,i,r){this.isCardAllowed&&(i.key===Te.answer?this.writeCardSetSideDivider():i.key===Te.alternativeAnswers&&0!==i.value?.length&&this.writeCardSetVariantDivider())}between_alternativeAnswers(e,t){this.writeCardSetVariantDivider()}between_alternativeDefinitions(e,t){this.writeCardSetVariantDivider()}enter_statements(e,t){}between_statements(e,t,i,r){this.isOfBitType(m.trueFalse1)||this.writeCardSetCardDivider()}enter_statementsValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.statement,S.plainText,ke.tag),this.writeCL(),!0}enter_choicesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect||i.requireReason?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.choice,S.plainText,ke.tag),this.writeCL(),!0}enter_responsesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.response,S.plainText,ke.tag),this.writeCL(),!0}between_feedbacks(e,t,i,r){this.writeCardSetCardDivider()}enter_reason(e,t){return this.writeCardSetSideDivider(),!0}enter_quizzes(e,t){}between_quizzes(e,t,i,r){this.writeCardSetCardDivider()}enter_heading(e,t){}between_heading(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_forValues(e,t){}between_forValues(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_pairs(e,t){}between_pairs(e,t,i,r){this.writeCardSetCardDivider()}enter_keyAudio(e,t){const i=e.value;return this.writeNL(),this.writeResource(B.audio,i.audio.src),!1}enter_keyImage(e,t){const i=e.value;return this.writeNL(),this.writeResource(B.image,i.image.src),!1}enter_matrix(e,t){}between_matrix(e,t,i,r){this.writeCardSetCardDivider()}enter_values(e,t){this.isCardAllowed&&this.writeCardSetSideDivider()}between_values(e,t,i,r){this.isCardAllowed&&this.writeCardSetVariantDivider()}between_pronunciationTable(e,t,i,r){const a=this.getParentNode(r);a?.key===Te.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_table(e,t,i,r){const a=this.getParentNode(r);a?.key===Te.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_data(e,t,i,r){const a=this.getParentNode(r);a?.key!==Te.table&&a?.key!==Te.pronunciationTable||this.writeCardSetCardDivider()}between_columns(e,t,i,r){const a=this.getParentNode(r),n=a?.key;n!==Te.table&&n!==Te.captionDefinitionList||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL()}enter_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,S.bitmarkText,ke.tag),this.writeCL()}between_dataValue(e,t,i,r){const a=this.getParentNode(r,2);a?.key!==Te.table&&a?.key!==Te.pronunciationTable||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_dataValueValue(e,t){const i=this.getParentNode(t,3);i?.key===Te.table&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body))}enter_dataValueValue(e,t){const i=this.getParentNode(t,3);if((i?.key===Te.table||i?.key===Te.pronunciationTable)&&e.value){if(i?.key===Te.pronunciationTable){const t=e.value;return t.title&&(this.writeNL(),this.writeOP(),this.writeHash(),this.writeTextOrValue(t.title,S.bitmarkText,ke.tag),this.writeCL()),t.audio&&(this.writeNL(),this.writeResource(B.audio,t.audio.audio.src)),t.body&&(this.writeNL(),this.writeTextOrValue(t.body,this.textFormat,ke.body)),!1}this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body)}}between_captionDefinitionList(e,t,i,r){const a=this.getParentNode(r);a?.key===Te.cardNode&&this.writeCardSetCardDivider()}leaf_term(e,t){const i=this.getParentNode(t);return i?.key!==Te.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body)),!1)}leaf_definition(e,t){const i=this.getParentNode(t);return i?.key!==Te.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body)),!1)}between_definitions(e,t,i,r){const a=this.getParentNode(r);a?.key!==Te.cardNode&&a?.key!==Te.captionDefinitionList||this.writeCardSetCardDivider()}between_definitionsValue(e,t,i,r){const a=this.getParentNode(r);a?.key===Te.definitions&&this.isCardAllowed&&(i.key===Te.definition?this.writeCardSetSideDivider():i.key===Te.alternativeDefinitions&&i.value?.length>0&&this.writeCardSetVariantDivider())}enter_questions(e,t){}between_questions(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredients(e,t){}between_ingredients(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredientsValue(e,t){const i=e.value;return null!=i.title&&(this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(i.title,S.bitmarkText,ke.tag),this.writeCL()),null!=i.ingredient&&(this.writeNL(),i.checked?this.writeOPP():this.writeOPM(),this.writeCL(),null!=i.quantity&&(this.writeOPB(),this.writeTextOrValue(`${i.quantity}`,S.plainText,ke.tag),this.writeCL()),null!=i.unit&&this.writeProperty("unit",i.unit,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=i.unitAbbr&&this.writeProperty("unitAbbr",i.unitAbbr,{format:T.plainText,single:!0,ignoreEmpty:!0}),null!=i.decimalPlaces&&this.writeProperty("decimalPlaces",i.decimalPlaces,{format:T.plainText,single:!0,ignoreEmpty:!0}),i.disableCalculation&&this.writeProperty("disableCalculation",!0,{format:T.plainText,single:!0,ignoreEmpty:!0}),this.writeNL(),this.writeTextOrValue(i.ingredient,this.textFormat,ke.body)),!0}enter_botResponses(e,t){}between_botResponses(e,t,i,r){this.writeCardSetCardDivider()}enter_cardBits(e,t){}between_cardBits(e,t,i,r){this.writeCardSetCardDivider()}leaf_response(e,t){const i=this.getParentNode(t);i?.key===Te.botResponsesValue&&(this.writeNL(),this.writeOPB(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL())}leaf_reaction(e,t){const i=this.getParentNode(t);i?.key===Te.botResponsesValue&&(this.writeNL(),this.writeProperty("reaction",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0}))}leaf_feedback(e,t){const i=this.getParentNode(t);if(i?.key!==Te.botResponsesValue)return;const r=e.value;r&&(this.writeNL(),this.writeTextOrValue(r,this.textFormat,ke.body))}enter_backgroundWallpaper(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}enter_imagePlaceholder(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}exit_imagePlaceholder(e,t){}enter_posterImage(e,t){const i=this.getParentNode(t);if(i?.key===Te.bitsValue){const t=e.value;t&&this.writeProperty("posterImage",t,{format:T.plainText,single:!0,ignoreEmpty:!0})}else{const t=e.value;t&&t.src&&this.writeProperty("posterImage",t.src,{format:T.plainText,single:!0,ignoreEmpty:!0})}return!0}enter_thumbnails(e,t){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<i.length&&t!==e.length;t++){const r=i[t],a=e[t];this.writeProperty(a,r.src,{format:T.plainText,single:!0,ignoreEmpty:!0})}}return!1}leaf_level(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return!0;if(!ae.isOfBitType(this.bitType,[m.chapter]))return!0;const r=e.value,a=i?.value;if(r>0&&null==a.title){this.writeNL(),this.writeOP();for(let e=0;e<+r;e++)this.writeHash();this.writeCL()}return!1}enter_title(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return!0;const r=e.value,a=i?.value,n=a.level||1;if(n&&r){this.writeNL(),this.writeOP();for(let e=0;e<+n;e++)this.writeHash();this.writeTextOrValue(r,S.bitmarkText,ke.tag),this.writeCL()}return!1}enter_subtitle(e,t){const i=this.getParentNode(t);if(i?.key!==Te.bitsValue)return!0;const r=e.value;if(r){this.writeNL(),this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeTextOrValue(r,S.bitmarkText,ke.tag),this.writeCL()}return!1}enter_book(e,t){}enter_bookValue(e,t){const i=e.value;return i&&(this.writeNL(),this.writeProperty("book",i.book,{format:T.plainText,single:!0,ignoreEmpty:!1}),i.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(i.reference,S.plainText,ke.tag),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(i.referenceEnd,S.plainText,ke.tag),this.writeCL()))),!1}leaf_book(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(this.writeNL(),this.writeProperty("book",e.value,{format:T.plainText,single:!0,ignoreEmpty:!1}),r.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(r.reference,S.plainText,ke.tag),this.writeCL(),r.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(r.referenceEnd,S.plainText,ke.tag),this.writeCL())))}leaf_anchor(e,t){e.value&&(this.writeNL(),this.writeOPDANGLE(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL())}leaf_reference(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(r.book||(this.writeNL(),this.writeOPRANGLE(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL()))}enter_hint(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPQ(),this.writeTextOrValue(i,S.bitmarkText,ke.tag),this.writeCL()),!1}enter_instruction(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPB(),this.writeTextOrValue(i,S.bitmarkText,ke.tag),this.writeCL()),!1}enter_lang(e,t){e.value&&(this.writeNL(),this.writeProperty("lang",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0}))}enter_refAuthor(e,t){e.value&&(this.writeNL(),this.writeProperty("refAuthor",e.value,{format:T.plainText,single:!1,ignoreEmpty:!0}))}enter_refBookTitle(e,t){e.value&&(this.writeNL(),this.writeProperty("refBookTitle",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0}))}enter_refPublisher(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublisher",e.value,{format:T.plainText,single:!1,ignoreEmpty:!0}))}enter_refPublicationYear(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublicationYear",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0}))}enter_citationStyle(e,t){e.value&&(this.writeNL(),this.writeProperty("citationStyle",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0}))}leaf_isExample(e,t){if(!e.value)return;const i=this.getParentNode(t),r=i?.value.example??null;null!=r&&""!==r&&(this.writeNL_IfNotChain(t),this.writeOPA(),this.writeString("example"),this.writeColon(),!0===r?this.writeString(" true "):!1===r?this.writeString(" false "):Array.isArray(r)?this.writeTextOrValue(r,S.bitmarkText,ke.tag):this.writeTextOrValue(r,S.plainText,ke.tag),this.writeCL())}leaf_elementsValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body))}leaf_solutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===Te.bitsValue&&null!=e.value&&(this.writeOPU(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL())}leaf_prefix(e,t){e.value&&(this.writeOPPRE(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL())}leaf_postfix(e,t){e.value&&(this.writeOPPOST(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL())}leaf_isCaseSensitive(e,t){this.writeProperty("isCaseSensitive",e.value,{format:T.boolean,single:!0,ignoreFalse:!1,ignoreTrue:!0})}leaf_forKeys(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL()}leaf_forValues(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL()}leaf_forValuesValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,S.plainText,ke.tag),this.writeCL()}leaf_key(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body))}leaf_valuesValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body))}leaf_question(e,t){const i=this.getParentNode(t);i?.key!==Te.questionsValue&&i?.key!==Te.flashcardsValue||e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ke.body))}leaf_src1x(e,t){this.writeProperty("src1x",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_src2x(e,t){this.writeProperty("src2x",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_src3x(e,t){this.writeProperty("src3x",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_src4x(e,t){this.writeProperty("src4x",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_width(e,t){this.writeProperty("width",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_height(e,t){this.writeProperty("height",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_alt(e,t){this.writeProperty("alt",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_zoomDisabled(e,t){ae.isOfBitType(this.bitType,[m.imageSeparator,m.pageBanner,m.imagesLogoGrave,m.prototypeImages])?this.writeProperty("zoomDisabled",e.value,{format:T.boolean,single:!0,ignoreFalse:!1,ignoreTrue:!0}):this.writeProperty("zoomDisabled",e.value,{format:T.boolean,single:!0,ignoreFalse:!0,ignoreTrue:!1})}leaf_license(e,t){this.writeProperty("license",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_copyright(e,t){this.writeProperty("copyright",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_provider(e,t){}leaf_showInIndex(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("showInIndex",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0,ignoreFalse:!0}))}enter_caption(e,t){const i=e.value;return this.writeNL_IfNotChain(t),this.writeProperty("caption",i,{format:T.bitmarkText,single:!0,ignoreEmpty:!0}),!1}leaf_search(e,t){const i=e.value;i&&(this.writeNL_IfNotChain(t),this.writeProperty("search",i,{format:T.plainText,single:!0,ignoreEmpty:!0}))}leaf_duration(e,t){const i=this.getParentNode(t);i?.key!==Te.bitsValue&&this.writeProperty("duration",e.value,{format:T.plainText,single:!0,ignoreEmpty:!0})}leaf_mute(e,t){this.writeProperty("mute",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0})}leaf_autoplay(e,t){this.writeProperty("autoplay",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0})}leaf_allowSubtitles(e,t){this.writeProperty("allowSubtitles",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0})}leaf_showSubtitles(e,t){this.writeProperty("showSubtitles",e.value,{format:T.boolean,single:!0,ignoreEmpty:!0})}generateResourceHandlers(){for(const e of B.keys()){if(e===B.keyFromValue(B.unknown))continue;const t=`enter_${e}`;"function"!=typeof this[t]&&(this[t]=(e,t)=>{const i=e.value;if(null==i)return!1;const r=this.getParentNode(t);if(r?.key!==Te.resourcesValue)return!0;const a=B.fromValue(r.value.__typeAlias)??B.fromValue(r.value.type);if(!a)return!1;const n=i.url||i.src||i.body||"";return this.writeNL(),this.writeResource(a,n),!0},this[t]=this[t].bind(this))}}generatePropertyHandlers(){const e=ae.getRawPropertiesConfig();for(const t of Object.values(e)){const e=t.astKey??t.tag,i=`enter_${e}`;"function"!=typeof this[i]&&("example"!==e&&(this[i]=(e,i)=>{if(null==e.value)return;const r=this.getParentNode(i);r?.key===Te.bitsValue&&(this.writeNL_IfNotChain(i),this.writeProperty(t.tag,e.value,{format:t.format??T.plainText,single:t.single??!1,ignoreFalse:"false"===t.defaultValue,ignoreTrue:"true"===t.defaultValue}))},this[i]=this[i].bind(this)))}}isChain(e){const t=this.getParentNode(e);return t?.key!==Te.bitsValue&&(t?.key!==Te.cardBitsValue&&(t?.key!==Te.feedbacksValue&&(t?.key!==Te.quizzesValue&&(t?.key!==Te.pairsValue&&(t?.key!==Te.matrixValue&&(t?.key!==Te.definitionsValue&&(t?.key!==Te.questionsValue&&t?.key!==Te.reason)))))))}haveValidCardSet(e){const t=ae.getBitConfig(e.bitType);return!!t&&!!t.cardSet}haveValidFooter(e){const t=e.footer;if(!t)return!1;return e.textFormat!==S.json&&(!!(t.footer&&t.footer.length>0)&&!!this.isBodyBitmarkText)}calcSpacesAroundValues(){const e=this.options.spacesAroundValues;let t=1;return null!=e&&(t=!0===e?1:!1===e?0:e),t=Math.min(Math.max(t,0),10),t}writeTagKey(e){null!=e&&this.write(je.breakscape(`${e}`,{format:S.plainText,location:ke.tag}))}writeTextOrValue(e,t,i,r){const a=i===ke.tag,n="string"==typeof e?e:void 0,o=Array.isArray(e)?e:void 0,s=a?this.spacesAroundValuesStr:"",l=t===S.bitmarkText?t:S.plainText,c=e=>a?`${s}${e}${s}`:e,u=e=>{const t=this.writer;this.writer=this.partWriter,this.partWriter.openSync(),e(),this.partWriter.closeSync();const i=this.partWriter.getString().trim();return this.writer=t,i};if(null!=n){const e=()=>this.write(je.breakscape(n,{format:l,location:i}));if(a){const t=u(e);t&&this.write(c(t))}else e();return}if(null!=o){const e=()=>this.textGenerator.generateSync(o,t,i,r);if(a){const t=u(e);t&&this.write(c(t))}else e()}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(e){this.write(`[${".".repeat(e)}`)}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(){0===this.spacesAroundValues&&this.writer.getLastWrite().endsWith("^")?this.write(" ]"):this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeSpacesAroundValues(){this.write(this.spacesAroundValuesStr)}writePlainTextDivider(){this.writeNL(),this.write("==== text ====")}writeCardSetStart(){this.writeNL(),this.options.cardSetVersion===_t.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.writeNL(),this.options.cardSetVersion===_t.v1&&this.write("===")}writeCardSetCardDivider(){this.writeNL(),this.options.cardSetVersion===_t.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.writeNL(),this.options.cardSetVersion===_t.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.writeNL(),this.options.cardSetVersion===_t.v1?this.write("--"):this.write("++")}writeNL_IfNotChain(e){this.isChain(e)||this.writeNL()}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writePropertyStyleResource(e,t,i=!1){if(e&&t){const r=t[B.keyFromValue(t.type)??""],a=r&&(r.src||r.url||r.body)||"";i?this.writeOPA():this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(a,S.plainText,ke.tag),t.type,B.article,this.writeCL()}}writeResource(e,t){e&&(this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,S.plainText,ke.tag),B.article,this.writeCL())}writeProperty(e,t,i){let r;if(void 0!==t){const a=i.format===T.bitmarkText;if(a){if(i.ignoreEmpty&&a&&this.isEmptyText(t))return;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,S.bitmarkText,ke.tag),this.writeCL()}else if(r=Array.isArray(t)?t:[t],r.length>0){i.single&&(r=r.slice(r.length-1));for(const t of r)if(void 0!==t){if(i.ignoreFalse&&!1===t)continue;if(i.ignoreTrue&&!0===t)continue;if(i.ignoreEmpty&&""===t)continue;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${t}`,S.plainText,ke.tag),this.writeCL()}}}}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}isEmptyText(e){return!e||(!Array.isArray(e)||0===e.length)}isWriteTextFormat(e,t){return!!(!(S.fromValue(e)===t)||this.options.explicitTextFormat)}calculateIsCardAllowed(){return this.isBodyBitmarkText&&!this.isOfBitType1()}isOfBitType1(){return this.isOfBitType([m.trueFalse1,m.multipleChoice1,m.multipleResponse1])}isOfBitType(e){return ae.isOfBitType(this.bitType,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}},It=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new At,this.generator=new Pt(this.writer,e)}async generate(e){return await this.generator.generate(e),this.writer.getString()}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}},Lt={},Et=class extends He{constructor(e,t){super(),p(this,"ast",new xe),p(this,"textGenerator"),p(this,"bitmarkVersion"),p(this,"textParserVersion"),p(this,"textParser",new mt),p(this,"options"),p(this,"jsonPrettifySpace"),p(this,"writer"),p(this,"json",[]),p(this,"bitWrapperJson",{}),p(this,"bitJson",{}),p(this,"textDefault",je.EMPTY_STRING),p(this,"bodyDefault",je.EMPTY_STRING),p(this,"bodyJson",this.bodyDefault),p(this,"listItem"),p(this,"placeholderIndex",0),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.bodyBitCallback=this.bodyBitCallback.bind(this),this.bitmarkVersion=Je.fromValue(t?.bitmarkVersion)??qe,this.textParserVersion=this.textParser.version(),this.options={...Lt,...t?.jsonOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===Je.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.textGenerator=new ot(Je.v2,{bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.writer=e,this.generatePropertyHandlers()}async generate(e){this.resetState(),await this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),await 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?je.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?je.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.listItem=void 0,this.placeholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,Te.bitmarkAst,this,void 0)}enter_bitmarkAst(e,t){this.json=[]}exit_bitmarkAst(e,t){this.options.textAsPlainText&&this.convertAllBitmarkTextsToStringsForPlainText(this.json),this.removeTemporaryProperties(this.json)}enter_bitsValue(e,t){const i=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(i),this.bitWrapperJson.bit=this.bitJson;const r=ae.getBitConfig(i.bitType),a=this.getTextFormat(t),n=!!r.rootExampleType,o=r.rootExampleType===f.boolean;if(n){let e;o?(e=!0,ae.isOfBitType(i.bitType,m.trueFalse1)&&void 0!==i.cardNode?.statement?.isCorrect&&(e=i.cardNode.statement.isCorrect)):e="true";const t=this.toExample(i,{defaultExample:e,isBoolean:o,textFormat:a});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else i.isExample&&(this.bitJson.isExample=!0);this.placeholderIndex=0}exit_bitsValue(e,t){const i=this.bitJson.isExample,r=this.bitJson.example;delete this.bitJson.isExample,delete this.bitJson.example,this.bitJson.isExample=i,this.bitJson.example=r,this.cleanBitJson(this.bitJson)}enter_imageSource(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_person(e,t){const i=this.getBitType(t);let r="person";return ae.isOfBitType(i,m.conversationLeft1)&&(r="partner"),this.standardHandler(e,t,Te.bitsValue,{array:!1,keyOverride:r})}enter_ratingLevelStart(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_ratingLevelEnd(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_productId(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==Te.bitsValue)return!0;return this.getBitType(t)===m.module?this.addProperty(this.bitJson,"productId",i,{array:!0}):i.length>0&&this.addProperty(this.bitJson,"productId",i[i.length-1],{array:!1}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);return r?.key!==Te.markConfig||(this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(i),!1)}enter_item(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_lead(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_pageNumber(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_marginNumber(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_hint(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_instruction(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_title(e,t){return this.standardHandler(e,t,[Te.bitsValue,Te.cardNode],{array:!0})}enter_subtitle(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_caption(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}enter_width(e,t){let i=e.value;const r=this.getBitType(t),a=this.getParentNode(t);return a?.key===Te.bitsValue&&ae.isOfBitType(r,m.extractorBlock)&&(i=ft.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_height(e,t){let i=e.value;const r=this.getBitType(t),a=this.getParentNode(t);return a?.key===Te.bitsValue&&ae.isOfBitType(r,m.extractorBlock)&&(i=ft.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_extraProperties(e,t){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let i=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(i=`_${e}`),this.addProperty(this.bitJson,i,t,{array:!0})}}enter_cardBitsValue(e,t){const i=e.value,r=this.getBitType(t);if(!r)return;let a;if(r===m.bookReferenceList){this.bitJson.bookReferences||(this.bitJson.bookReferences=[]);const e={};this.addProperty(e,"lang",i.lang,{array:!1}),this.addProperty(e,"refAuthor",i.refAuthor??[],{array:!0}),this.addProperty(e,"refBookTitle",i.refBookTitle??[],{array:!1}),this.addProperty(e,"refPublisher",i.refPublisher??[],{array:!0}),this.addProperty(e,"refPublicationYear",i.refPublicationYear??[],{array:!1}),this.addProperty(e,"citationStyle",i.citationStyle??[],{array:!1}),this.bitJson.bookReferences.push(e)}else r===m.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),a=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),a=this.bitJson.listItems),this.listItem={item:i.item??[],lead:i.lead??[],hint:i.hint??[],instruction:i.instruction??[],body:this.bodyDefault},a.push(this.listItem)}exit_cardBitsValue(e,t){this.listItem=void 0}enter_body(e,t){const i=e.value,r=this.getParentNode(t);if(!r)return!1;const a=this.getTextFormat(t),n=a===S.bitmarkText;if(this.bodyJson=i.body,r.key===Te.bitsValue){this.bitJson.body=this.bodyJson;const e=n&&this.isBitmarkText(this.bodyJson);if(this.options.textAsPlainText&&e){const e=this.textGenerator.generateSync(this.bodyJson,a,ke.body,{noBreakscaping:!0});this.bitJson.body=(e??"").trim()}else e&&(this.bitJson.body=this.moveBodyBitPropertiesToAttrs(this.bodyJson))}else r.key===Te.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson);return!1}bodyBitCallback(e,t,i){const r=`{${this.placeholderIndex}}`;return this.placeholderIndex++,this.bitJson.placeholders=this.bitJson.placeholders??{},this.bitJson.placeholders[r]=e,r}moveBodyBitPropertiesToAttrs(e,t=0){if(0===t)e=structuredClone(e);else if(t>5e3)throw new Error("Recursion limit exceeded");for(const i of e)if(i.type!==ye.text&&ye.values().includes(i.type)){const e=i;e.attrs={};for(const[t,i]of Object.entries(e))"type"!==t&&"attrs"!==t&&(e.attrs[t]=i,delete e[t])}else Array.isArray(i.content)&&(t++,this.moveBodyBitPropertiesToAttrs(i.content,t));return e}enter_footer(e,t){return this.standardHandler(e,t,void 0,{array:!0,valueOverride:e.value.footer})}enter_elements(e,t){return this.standardHandler(e,t,void 0,{array:!0})}enter_flashcards(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0,keyOverride:"cards"})}enter_definitions(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_statement(e,t){const i=e.value,r=this.getParentNode(t);r?.key===Te.cardNode&&i&&(this.bitJson.statement=i.statement??"",this.bitJson.isCorrect=i.isCorrect??!1,this.bitJson.example=i.example,this.bitJson.isExample=i.isExample)}enter_statements(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_choices(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_responses(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_feedbacks(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_quizzes(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_heading(e,t){return this.standardHandler(e,t,void 0,{array:!1})}enter_pairs(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_matrix(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_pronunciationTable(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!1})}enter_table(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!1})}enter_questions(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_botResponses(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0,keyOverride:"responses"})}enter_ingredients(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!0})}enter_captionDefinitionList(e,t){return this.standardHandler(e,t,Te.cardNode,{array:!1})}enter_backgroundWallpaper(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_imagePlaceholder(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_resources(e,t){const i=e.value,r=this.getBitType(t),a=this.getResourceType(t);if(!i||!r)return!0;let n;const o=ae.getBitConfig(r),s=ae.getBitResourcesConfig(r,a),l=s.comboResourceTagTypesMap;if(s.comboResourceTagTypesMap.size>0)for(const[e,t]of l.entries()){const r={type:e,__typeAlias:e};for(const e of t){const t=i.find(t=>t.__typeAlias===e);if(t){const e=ae.getTagConfigForTag(o.tags,t.__typeAlias),i=e?.jsonKey??t.__typeAlias,a=e?.tag??t.__typeAlias,n=t.__typeAlias===a?t:void 0;if(n)for(const[e,t]of Object.entries(n))"type"!==e&&(r[i]=t)}}n=r}else if(ae.isOfBitType(r,[m.imagesLogoGrave,m.prototypeImages])){const e=[];for(const t of i)t.type===B.image&&e.push(t);r===m.imagesLogoGrave?this.bitJson.logos=e:this.bitJson.images=e}else i.length>=1&&(n=i[0]);return this.bitJson.resource=n,!1}leaf_level(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}enter_book(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!0})}leaf_book(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}leaf_anchor(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}leaf_reference(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}leaf_referenceEnd(e,t){return this.standardHandler(e,t,Te.bitsValue,{array:!1})}leaf_markup(e,t){const i=e.value;return i&&(this.bitWrapperJson.bitmark=i),!1}enter_internalComment(e,t){return!1}enter_parser(e,t){const i=e.value,r=this.getBitType(t),a=this.getParentNode(t);if(i&&r){const{version:e,excessResources:r,warnings:n,errors:o,...s}=i,l=`${this.bitmarkVersion}`,c=this.textParserVersion;let u;if(Array.isArray(r)&&r.length>0){u=[];for(const e of r)u.push(e)}const p=this.getInternalComments(t);a?.key===Te.bitsValue&&(this.bitWrapperJson.parser={version:e,bitmarkVersion:l,textParserVersion:c,internalComments:p,...s,warnings:n,errors:o,excessResources:u},this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){const e=ae.getRawPropertiesConfig();for(const t of Object.values(e)){const e=t.astKey??t.tag,i=`enter_${e}`;"function"!=typeof this[i]&&("example"!==e&&(this[i]=(e,i)=>{const r=e.value;if(null==r)return;const a=this.getParentNode(i);if(a?.key!==Te.bitsValue)return;const n=t.jsonKey??t.tag;this.addProperty(this.bitJson,n,r,{array:!t.single})},this[i]=this[i].bind(this)))}}standardHandler(e,t,i,r){if(i){const e=Array.isArray(i)?i:[i],r=this.getParentNode(t);if(!r?.key||!e.includes(r?.key))return!0}return this.addProperty(this.bitJson,r.keyOverride??e.key,r.valueOverride??e.value,r),!1}addProperty(e,t,i,r){if(void 0!==i){let a;Array.isArray(i)||(i=[i]);const n=i;a=!r.array&&n.length>=1?n[n.length-1]:n,(r.allowNull||null!=a)&&(e[t]=a)}}toExample(e,t){const{isExample:i,example:r,__isDefaultExample:a}=e,{defaultExample:n,isBoolean:o}=t;if(!i)return{isExample:!1,example:null};let s;return s=a?o?yt.toBoolean(n):this.convertBreakscapedStringToJsonText(n,t.textFormat,ke.tag):o?yt.toBoolean(r):this.convertBreakscapedStringToJsonText(r,t.textFormat,ke.tag),{isExample:!0,example:s}}getBitType(e){for(const t of e)if(t.key===Te.bitsValue){const e=t.value;return e?.bitType}}getTextFormat(e){const t=this.getBitType(e);if(t){const i=ae.getBitConfig(t);for(const t of e)if(t.key===Te.bitsValue){const e=t.value;return S.fromValue(e?.textFormat)??i.textFormatDefault}}return S.bitmarkText}getResourceType(e){for(const t of e)if(t.key===Te.bitsValue){const e=t.value;return e?.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===Te.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t,i){if(!e)return"";if(!(t===S.bitmarkText))return e||"";if(this.options.textAsPlainText)return e||"";return this.textParser.toAst(e,{format:t,location:i})}concatenatePlainTextWithJsonTexts(e,t,i){if(Array.isArray(e)){if(i=i.trim()){const r=i.split("\n"),a=[];for(let e=0;e<t;e++)a.push({type:be.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&a.push({text:t,type:be.text}),e<r.length-1&&a.push({type:be.hardBreak})}const n=e[e.length-1];n&&n.type===be.paragraph?n.content=[...n.content??[],...a]:e.push({type:be.paragraph,content:a,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}isBitmarkText(e){return null!=e&&(!!Array.isArray(e)&&"text"===e.__tag)}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){const t=e.textFormat;return{type:e.isCommented?m._comment:e.bitType,originalType:e.isCommented?e.bitType:void 0,format:t,bitLevel:e.bitLevel}}cleanBitJson(e){const t=ae.getBitType(e.type),i=ae.getBitConfig(t);if(null==e.originalType&&(e.originalType=void 0),e.item||(e.item=void 0),ae.isOfBitType(t,[m._error,m._comment]))delete e.format,delete e.item,delete e.lead,delete e.pageNumber,delete e.marginNumber,delete e.hint,delete e.instruction;else{let r=!1,a=!1;ae.isOfBitType(t,[m.page])?(null!=e.item&&0!==e.item?.length||delete e.item,null!=e.lead&&0!==e.lead?.length||delete e.lead,null!=e.pageNumber&&0!==e.pageNumber?.length||delete e.pageNumber,null!=e.marginNumber&&0!==e.marginNumber?.length||delete e.marginNumber,null!=e.hint&&0!==e.hint?.length||delete e.hint,null!=e.instruction&&0!==e.instruction?.length||delete e.instruction):(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.pageNumber&&(e.pageNumber=this.textDefault),null==e.marginNumber&&(e.marginNumber=this.textDefault)),null==e.body&&(e.body=this.bodyDefault),ae.isOfBitType(t,[m.article]),ae.isOfBitType(t,[m.example])&&(r=!0,a=!0),ae.isOfBitType(t,[m.multipleChoice1,m.multipleResponse1,m.multipleChoiceText,m.highlightText,m.gapText,m.gapTextInstructionGrouped,m.clozeAndMultipleChoiceText,m.sequence,m.mark,m.flashcard,m.definitionList])&&(r=!0,null==e.body&&(e.body=this.bodyDefault)),ae.isOfBitType(t,[m.sequence])&&(r=!0,a=!0,null==e.body&&(e.body=this.bodyDefault)),ae.isOfBitType(t,m.cloze)&&(r=!0,ae.isOfBitType(t,m.clozeSolutionGrouped)?(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!0)):ae.isOfBitType(t,m.clozeInstructionGrouped)&&(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!1))),ae.isOfBitType(t,[m.multipleChoice,m.multipleResponse])&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault)),ae.isOfBitType(t,m.essay)&&(r=!0,a=!0,null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="")),ae.isOfBitType(t,m.trueFalse1)&&(r=!0,a=!0,null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault)),ae.isOfBitType(t,m.trueFalse)&&(r=!0,null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault)),ae.isOfBitType(t,m.chapter)&&(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)),ae.isOfBitType(t,m.interview)&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[])),t===m.matchMatrix&&(r=!0),ae.isOfBitType(t,m.match)&&(r=!0,null==e.heading&&(e.heading={})),ae.isOfBitType(t,m.learningPathBook)&&(null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1)),ae.isOfBitType(t,m.table)&&(null==e.tableFixedHeader&&(e.tableFixedHeader=!1),null==e.tableHeaderWhitespaceNoWrap&&(e.tableHeaderWhitespaceNoWrap=!0),null==e.tableSearch&&(e.tableSearch=!1),null==e.tableSort&&(e.tableSort=!1),null==e.tablePagination&&(e.tablePagination=!1),null==e.tablePaginationLimit&&(e.tablePaginationLimit=0),null==e.tableHeight&&(e.tableHeight=0),null==e.tableWhitespaceNoWrap&&(e.tableWhitespaceNoWrap=!1),null==e.tableAutoWidth&&(e.tableAutoWidth=!0),null==e.tableResizableColumns&&(e.tableResizableColumns=!1),null==e.tableColumnMinWidth&&(e.tableColumnMinWidth=0)),ae.isOfBitType(t,m.bookReference)&&(null==e.refAuthor&&(e.refAuthor=[]),null==e.refBookTitle&&(e.refBookTitle=""),null==e.refPublisher&&(e.refPublisher=[]),null==e.refPublicationYear&&(e.refPublicationYear="")),ae.isOfBitType(t,[m.pageBanner,m.pageBuyButton,m.pageBuyButtonAlt,m.pageBuyButtonPromotion,m.pageFooter,m.pageOpenBook,m.pagePerson,m.pageProduct,m.pageProductList,m.pageProductVideo,m.pageProductVideoList,m.pageSectionFolder,m.pageSubscribe,m.pageSubpage])&&(null==e.slug&&(e.slug=""),null==e.body&&(e.body=this.bodyDefault),ae.isOfBitType(t,m.pageBuyButton)&&null==e.content2Buy&&(e.content2Buy="")),ae.isOfBitType(t,m.tocResource)&&null==e.tocResource&&(e.tocResource=[]),ae.isOfBitType(t,m.tocContent)&&null==e.tocContent&&(e.tocContent=[]),ae.isOfBitType(t,m.book)&&(null==e.maxTocChapterLevel&&(e.maxTocChapterLevel=-1),null==e.hasMarkAsDone&&(e.hasMarkAsDone=!1),null==e.processHandIn&&(e.processHandIn=!1),null==e.isPublic&&(e.isPublic=!1),null==e.chatWithBook&&(e.chatWithBook=!1),null==e.chatWithBookBrainKey&&(e.chatWithBookBrainKey="")),t!==m.articleAi&&t!==m.noteAi&&t!==m.summaryAi||null==e.aiGenerated&&(e.aiGenerated=!0),ae.isOfBitType(t,[m.articleResponsive,m.pageArticleResponsive])&&null==e.imageFirst&&(e.imageFirst=!0),ae.isOfBitType(t,m.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy="")),ae.isOfBitType(t,[m.imagesLogoGrave,m.prototypeImages])&&(t===m.imagesLogoGrave?null==e.logos&&(e.logos=[]):null==e.images&&(e.images=[])),ae.isOfBitType(t,[m.stepImageScreenshotWithPointer,m.surveyMatrix])&&(null==e.pointerTop&&(e.pointerTop=""),null==e.pointerLeft&&(e.pointerLeft=""),ae.isOfBitType(t,[m.surveyMatrix])&&null==e.buttonCaption&&(e.buttonCaption="")),ae.isOfBitType(t,[m.listItem])&&null==e.listItemIndent&&(e.listItemIndent=0),ae.isOfBitType(t,m.surveyRating)&&(null==e.ratingLevelStart&&(e.ratingLevelStart={level:0}),null==e.ratingLevelEnd&&(e.ratingLevelEnd={level:0})),ae.isOfBitType(t,m.vendorStripePricingTable)&&(null==e.stripePricingTableId&&(e.stripePricingTableId=""),null==e.stripePublishableKey&&(e.stripePublishableKey="")),ae.isOfBitType(t,m.callToAction)&&(null==e.buttonCaption&&(e.buttonCaption=""),null==e.callToActionUrl&&(e.callToActionUrl="")),ae.isOfBitType(t,m.handInFile)&&null==e.handInAcceptFileType&&(e.handInAcceptFileType=[]),ae.isOfBitType(t,m.handInSubmit)&&(null==e.handInRequirement&&(e.handInRequirement=[]),null==e.handInInstruction&&(e.handInInstruction=""),null==e.buttonCaption&&(e.buttonCaption="")),ae.isOfBitType(t,m.module)&&null==e.hasBookNavigation&&(e.hasBookNavigation=!0),ae.isOfBitType(t,m.container)&&null==e.allowedBit&&(e.allowedBit=[]),i.quizBit&&null==e.revealSolutions&&(e.revealSolutions=!1),ae.isOfBitType(t,m.platformPath)&&null==e.path&&(e.path=""),r?null==e.isExample&&(e.isExample=!1):(delete e.isExample,delete e.example),a?null==e.example&&(e.example=null):delete e.example}return e}convertAllBitmarkTextsToStringsForPlainText(e){if(!this.options.textAsPlainText)return;const t=e;for(const e in t){const i=t[e];if(this.isBitmarkText(i)){const r=this.textGenerator.generateSync(i,S.bitmarkText,ke.tag,{noBreakscaping:!0});t[e]=(r??"").trim()}else"object"==typeof t[e]&&this.convertAllBitmarkTextsToStringsForPlainText(t[e])}}removeTemporaryProperties(e){const t=e;for(const e in t)e.startsWith("__")?delete t[e]:"object"==typeof t[e]&&this.removeTemporaryProperties(t[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}},Vt=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new At,this.generator=new Et(this.writer,e)}async generate(e){return await this.generator.generate(e),JSON.parse(this.writer.getString())}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}},Nt=class{getSupportedBits(e){const t=e?.includeNonDeprecated??!0,i=e?.includeDeprecated??!1,r=[];for(const e of m.values()){if(e===m._error||e===m._comment)continue;const a=ae.getBitType(e),n=ae.getBitConfig(a),o=n.inheritedBitTypes.length>0?n.inheritedBitTypes:void 0;(t&&!n.deprecated||i&&n.deprecated)&&r.push({name:e,since:n.since,deprecated:n.deprecated,inheritedBitTypes:o})}return r}getSupportedBitConfigs(){const e=[];for(const t of m.values()){if(t===m._error||t===m._comment)continue;const i=ae.getBitType(t),r=ae.getBitConfig(i);e.push(r)}return e}},Ft=(0,u(d(),1).superenum)({peggy:"peggy"}),Rt=(0,u(d(),1).superenum)({text:"text",json:"json",pojo:"pojo"}),Kt=(0,u(d(),1).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"}),Ot=new Ct,Dt=class{toAst(e){const t=this.preprocessJson(e),i=[];for(const e of t){const{bit:t,parser:r}=e,a=this.bitToAst(t,r?.internalComments);a&&i.push(a)}const r=i.length>0?{bits:i}:{};return Ot.buildBitmark(r)}preprocessJson(e){const t=[];if(ve.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const i=e=>{if(this.isBitWrapper(e)){const i=e;t.push(i)}else if(this.isBit(e)){const i=e;t.push(this.bitToBitWrapper(i))}};if(Array.isArray(e))for(const t of e)i(t);else i(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 ae.getBitType(t.type)!==m._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){const{statement:i,product:r,productVideo:a,reference:n,...o}=e,s=e.type===m._comment&&void 0!==e.originalType,l=ae.getBitType(s?e.originalType:e.type),c=ae.getBitConfig(l),u=We.fromValue(e.format);let p=S.fromValue(e.format)??c.textFormatDefault;u===We.bitmarkMinusMinus&&(p=S.bitmarkText);return Ot.buildBit({...o,bitType:l,bitLevel:Math.max(Math.min(e.bitLevel??1,ae.bitLevelMax),ae.bitLevelMin),textFormat:e.format,resourceType:this.getResourceType(e.resource),isCommented:s,internalComment:t,productList:r,productVideoList:a,...this.processReference(n),...this.parseExample(e.example),person:e.partner??e.person,markConfig:e.marks,resources:this.processResources(l,e.resource,e.images,e.logos),body:this.processBody(e.body,e.placeholders),flashcards:e.cards,statements:this.processStatements(i,e.isCorrect,e.statements,e.example),responses:this.processResponses(l,e.responses),botResponses:this.processBotResponse(l,e.responses),cardBits:this.processListItems(e.listItems??e.sections??e.bookReferences,e.placeholders),footer:this.processFooter(e.footer)})}processStatements(e,t,i,r){const a=[];if(e){const i={statement:e??"",isCorrect:t??!1,...this.parseExample(r)};i&&a.push(i)}if(Array.isArray(i))for(const e of i)a.push(e);if(0!==a.length)return a}processResponses(e,t){if(!ae.isOfBitType(e,m.botActionResponse)&&Array.isArray(t))return t}processBotResponse(e,t){if(ae.isOfBitType(e,m.botActionResponse)&&Array.isArray(t))return t}processListItems(e,t){const i=[];if(Array.isArray(e))for(const r of e){const e={...r};e.body&&(e.body={body:e.body,placeholders:t}),e&&i.push(e)}if(0!==i.length)return i}getResourceType(e){if(e){return B.fromValue(e.type)}}processResources(e,t,i,r){const a=[];if(t&&a.push(t),ae.isOfBitType(e,[m.prototypeImages])&&Array.isArray(i))for(const e of i)e&&a.push(e);if(ae.isOfBitType(e,[m.imagesLogoGrave])&&Array.isArray(r))for(const e of r)e&&a.push(e);return a}processBody(e,t){return{body:e,placeholders:t}}processFooter(e){if(e)return{footer:e}}processReference(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}parseExample(e){if(null==e)return;if(!0===e)return{example:!0};if(!1===e)return{example:!1};const t=ve.isString(e)||Array.isArray(e)?e:void 0;return t?{example:t}:{example:!!e}}},$t=u(d(),1),Mt=class{constructor(e,t){p(this,"source"),p(this,"start"),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}},jt=(0,$t.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:_.tag_title,Anchor:_.tag_anchor,Reference:_.tag_reference,ItemLead:_.tag_itemLead,Instruction:_.tag_instruction,Hint:_.tag_hint,True:_.tag_true,False:_.tag_false,Gap:_.tag_gap,Mark:_.tag_mark,SampleSolution:_.tag_sampleSolution,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",BodyTextPlain:"BodyTextPlain",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain",PlainTextDivider:"PlainTextDivider",FooterDivider:"FooterDivider"}),Wt=(0,$t.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"}),zt=class{constructor(e){p(this,"cardIndex",0),p(this,"cardSideIndex",0),p(this,"cardVariantIndex",0),p(this,"parse"),p(this,"parserText"),p(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){const t=e.trim();if(this.debugPrint("RAW BIT",t),!t)return;const i=this.parserLocation()?.start??{line:1,column:1,offset:0},r=this.parse(e,{startRule:"bit",grammarSource:new Mt("bit",i)});return r.value&&(r.value.markup=t),r}handleTextFormat(e){return{type:jt.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:jt.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:jt.Property,key:je.unbreakscape(e,{format:S.plainText,location:ke.tag}),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:jt.Resource,key:je.unbreakscape(e,{format:S.plainText,location:ke.tag}),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let i=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),i=[e]}return i}handlePlainTextDivider(e){return e=this.reduceToString(e),{type:jt.PlainTextDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleFooterDivider(e){return e=this.reduceToString(e),{type:jt.FooterDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSet(e){const t=e,i={cards:[]},r={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:r,parser:a}=e;if(!t||t!==jt.Card)continue;const{cardIndex:n,cardSideIndex:o,cardVariantIndex:s,value:l}=r;let c=i.cards[n];c||(c={sides:[]},i.cards[n]=c);let u=c.sides[o];u||(u={variants:[]},c.sides[o]=u);u.variants[s]?u.variants[s].value+=l:u.variants[s]={value:l,parser:a}}i.cards=i.cards.filter(e=>e.sides.some(e=>e.variants.some(e=>0!==ve.trimmedString(e.value).length)));for(const t of i.cards){const i={sides:[]};r.cards.push(i);for(const r of t.sides){const t={variants:[]};i.sides.push(t);for(const i of r.variants){let r={line:1,column:1,offset:0};if(i.parser.location){r=i.parser.location.start;const e=i.parser.text,t=e?e.length:0,a=1;r.offset+=t,r.line+=a}let a=this.parse(i.value,{startRule:"cardContent",grammarSource:new Mt("card-content",r)});a=this.reduceToArrayOfTypes(a),this.debugPrint("parsedCardContent",a),t.variants.push({parser:e,content:a})}}}}return{type:jt.CardSet,value:r,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 i=!1,r=!1,a=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===_t.v1?(i="==="===e,r="=="===e,a="--"===e):(i="===="===e,r="--"===e,a="++"===e)),i?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):r?(this.cardSideIndex++,this.cardVariantIndex=0):a&&this.cardVariantIndex++,this.isType(e,jt.Card)?e:{type:jt.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:jt.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){const t=[];let i,r;for(const a of e)switch(a.type){case jt.BodyChar:if(i){const e=`${i.value??""}${a.value??""}`;i.value=e}else i={type:jt.BodyText,value:a.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case jt.CardChar:if(r){const e=`${r.value??""}${a.value??""}`;r.value=e}else r={type:jt.CardText,value:a.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:i&&(t.push(i),i=void 0),r&&(t.push(r),r=void 0),t.push(a)}return i&&t.push(i),r&&t.push(r),t}isType(e,t){if(!e)return!1;const{type:i}=e;return t?Array.isArray(t)?t.indexOf(i)>=0:t===i:!!jt.fromValue(i)}reduceToArrayOfTypes(e,t,i){if(!Array.isArray(e))return[];return e.reduce((e,r,a)=>{if(null==r)return e;const{type:n,value:o}=r;if(Array.isArray(r)){const i=this.reduceToArrayOfTypes(r,t);e.push(...i)}else{if(!this.isType(r,t))return e;if(i&&Array.isArray(o)){const i=this.reduceToArrayOfTypes(o,t);e.push(...i)}else n&&e.push(r)}return e},[])}reduceToString(e){if(!Array.isArray(e))return"";return e.reduce((e,t,i)=>{if(null==t)return e;if(Array.isArray(t)){e+=this.reduceToString(t)}else e+=t;return e},[])}debugPrint(e,t){}},Jt=["----","\n==\n","\n---\n"],qt=["==\n","--\n"],Ht=["\n==","\n--"],Gt=new class{validateBitTags(e,t){if(!t)return[];const{bitConfig:i,bitType:r,resourceType:a}=e,{tags:n,cardSet:o}=i,s={...n,...ae.getBitResourcesConfig(r,a).tags};return this.validateTagChainsRecursive(e,Wt.Bit,r,t,s,o).validated}checkBody(e,t,i,r,a){if(!a)return a;const{bitConfig:n}=e,{bodyAllowed:o}=n;return a.length>0&&!o&&e.addWarning(`Bit '${i}' should not have a body.`),a}checkBodyPart(e,t,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,i),i):i}checkFooter(e,t,i){if(!i)return i;const{bitConfig:r,bitType:a}=e,{footerAllowed:n}=r;return this.checkBodyForCommonPotentialMistakes(e,t,i),n||e.addWarning(`Bit '${a}' should not have a footer.`),i}checkCardBody(e,t,i,r,a,n,o){if(!r||!r.body)return r;const{bitConfig:s}=e;if(!s.cardSet)return r;const l=this.getVariantConfig(s.cardSet.variants,n,o);if(!l)return r;const{bodyAllowed:c}=l;return r.bodyString.length>0&&!c&&e.addWarning(`Bit '${i}' should not have a card body at card:${a+1}, side:${n+1}, variant:${o+1}.`),r}validateTagChainsRecursive(e,t,i,r,a,n,o){if(!r)return{validated:[]};let s;const l=[...r],c=this.convertTagsToTypeKeyMap(e,t,i,a),u=(e,t,i)=>{c.set(e,{maxCount:t,minCount:i,_type:e,_tag:e,_seenCount:0})};var p,d,g;p=C.internalComment,d=y.infinity,g=0,c.set(`${jt.Property}:${p}`,{maxCount:d,minCount:g,_type:h.property,_tag:_.tag_property,_seenCount:0}),t===Wt.Bit?(n&&u(jt.CardSet,1,0),u(jt.TextFormat,1,0),u(jt.BodyText,y.infinity,0),u(jt.BodyTextPlain,y.infinity,0),u(jt.PlainTextDivider,y.infinity,0),u(jt.FooterDivider,y.infinity,0)):t===Wt.Card&&u(jt.CardText,y.infinity,0);for(let r=0;r<l.length;r++){const a=l[r];if(!a)continue;const{type:u,key:p}=a;let d=jt.fromValue(u);if(!d)continue;let g=d;d!==jt.Property&&d!==jt.Resource||(g=`${d}:${p}`);let h=c.get(g);if(!h&&d===jt.Property&&(p===B.backgroundWallpaper||p===B.imagePlaceholder)&&(h=c.get(`${jt.Resource}:${p}`),h)){d=jt.Resource,a.type=jt.Resource;const t=`Falling back to '[&${p}]' from '[@${p}]'. Replace '[@${p}]' with '[&${p}]' to avoid this warning.`;e.addWarning(t)}const{validated:m,warning:y}=this.validateSingleTag(e,t,i,a,d,h,n);d===jt.Resource&&(o=jt.Resource);let f=!0;if(!m)if(t===Wt.Chain&&o!==jt.Resource){s=a;const e=l.slice(r+1);e.length>0&&(s.chain=e),l.splice(r),f=!1}else l.splice(r,1,null);if(y&&f&&e.addWarning(y.warning??"",y.content,y.previousContent),t===Wt.Chain&&h&&h.chain&&m&&!m.chain){const e=l.slice(r+1);e.length>0&&(m.chain=e),l.splice(r+1)}if(m&&Array.isArray(m.chain)&&m.chain.length>0)if(h&&h.chain){const{validated:t,remaining:a}=this.validateTagChainsRecursive(e,Wt.Chain,i,m.chain,h.chain,void 0,m.type);t&&t.length>0?m.chain=t:m.chain=void 0,a&&l.splice(r+1,0,a)}else if(m.type!==jt.Resource){const e=m.chain[0];m.chain.length>1&&(e.chain=m.chain.slice(1)),l.splice(r+1,0,e),m.chain=void 0}}for(const t of c.values()){const{minCount:i,_seenCount:r}=t;if(null!=i&&r<i){const r=`${this.getTagSignature(t)} is required at least ${i} time(s)`;e.addWarning(r)}}return{validated:l.filter(e=>null!=e),remaining:s}}validateSingleTag(e,t,i,r,a,n,o){const{type:s,key:l}=r,c=n?this.getTagSignature(n):this.getUnknownTagSignature(s,l),u=" It will be ignored";let p,d,g="";if(n)switch(n._seenCount++,a){case jt.Property:{const{content:a,warning:o}=this.validatePropertyTag(e,t,i,n,r);p=a,d=o;break}case jt.Resource:{const{content:a,warning:o}=this.validateResourceTag(e,t,i,n,r);p=a,d=o;break}case jt.CardSet:{const{content:t,warning:a}=this.validateCardSet(e,i,n,r,o);p=t,d=a;break}default:{const{content:a,warning:o}=this.validateStandardTag(e,t,i,n,r);p=a,d=o}}else switch(a){case jt.Property:d={extraProperty:!0},t!==Wt.Chain&&(p=r);break;case jt.Resource:d={excessResource:!0},p=r;break;default:d={invalid:!0}}if(d){const e=n?._previous;d.invalid||d.excessResource?g=`${c} is not valid here (incorrectly chained?).${u}`:null!=d.tooMany?(g=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(g+=" The earlier ones will be ignored")):d.extraProperty?g=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?g=`${c} is not expected here.${u}`:d.unexpectedCardSideVariant&&(g=`${c} has a card / side / variant that is not expected here.${u}`),d.warning=g,d.content=p,d.previousContent=e}return n&&(n._previous=r),{validated:p,warning:d}}validateStandardTag(e,t,i,r,a){const n=null==r.maxCount?1:r.maxCount;return n!==y.infinity&&r._seenCount>n?{warning:{tooMany:n},content:a}:{content:a}}validatePropertyTag(e,t,i,r,a){const n=null==r.maxCount?1:r.maxCount;return n!==y.infinity&&r._seenCount>n?{warning:{tooMany:n},content:a}:{content:a}}validateResourceTag(e,t,i,r,a){const n=null==r.maxCount?1:r.maxCount;return n!==y.infinity&&r._seenCount>n?{warning:{tooMany:n},content:a}:{content:a}}validateCardSet(e,t,i,r,a){if(!a||!a.variants||0===a.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=r,o=n;let s,l=0,c=0;for(const i of o.cards){l=0;for(const r of i.sides){c=0;for(const i of r.variants){const n=i.content;let o;const u=this.getVariantConfig(a.variants,l,c);if(u){o=this.validateTagChainsRecursive(e,Wt.Card,t,n,u.tags).validated}else s={unexpectedCardSideVariant:!0};o&&o.length>0?r.variants[c]={parser:i.parser,content:o}:r.variants[c]={parser:i.parser,content:[]},c++}l++}}return{content:r,warning:s}}checkBodyForCommonPotentialMistakes(e,t,i){if(!i)return;const{bitType:r}=e;for(const t of Jt)i.includes(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of qt)i.startsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of Ht)i.endsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`)}convertTagsToTypeKeyMap(e,t,i,r){const a=new Map;for(const e of Object.values(r)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===h.tag,isProperty:e.type===h.property,isResource:e.type===h.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)a.set(`${jt.Property}:${e.tag}`,t);else if(t.isResource)a.set(`${jt.Resource}:${e.tag}`,t);else{const i=jt.fromValue(e.tag);i&&a.set(i,t)}}return a}getVariantConfig(e,t,i){let r;if(0===e.length)return;const a=e[Math.min(t,e.length-1)],n=a.length-1;if(i>n){if(r=a[n],r.repeatCount!==y.infinity)return}else r=a[i];return r}getTagSignature(e){switch(e._type){case h.tag:return`[${e._tag}]`;case h.property:return`[@${e._tag}]`;case h.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case jt.Property:return`[@${t}]`;case jt.Resource:return`[&${t}]`;default:return t?`'${e}' tag '${t}'`:`'${e}' tag`}}},Ut=new class{concatenatePlainTextWithAstTexts(e,t,i){if(Array.isArray(e)){if(i=i&&i.trim()){const r=i.split("\n"),a=[];for(let e=0;e<t;e++)a.push({type:be.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&a.push({text:t,type:be.text}),e<r.length-1&&a.push({type:be.hardBreak})}const n=e[e.length-1];n&&n.type===be.paragraph?n.content=[...n.content??[],...a]:e.push({type:be.paragraph,content:a,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}},Yt=new mt,Qt=new class{process(e,t,i,r,a,n,o,s){const l=[];let c,u;const p=o.length>0?this.trimBodyParts(o):void 0,d=s?p:Gt.checkBody(e,t,i,r,p);if(r===S.json&&d){c=d.reduce((e,t)=>{if(t.type===ye.text&&t.data){return e+(t.data.bodyText??"")}return e},"");try{c=JSON.parse(c)}catch(t){c=null,e.addError("Body JSON is invalid.")}}else{let e="",t="",i="",a=0;const n=e=>`[!${e}]`;if(d)for(let r=0;r<d.length;r++){const o=d[r];if(o.type===ye.text){const r=o,a=r.data.bodyText;r.data.isPlain?t=je.concatenate(t,a):e=je.concatenate(e,a),i=je.concatenate(i,a)}else{const t=n(a);e=je.concatenate(e,t),l.push(o),a++}}const o=r===S.bitmarkText?Yt.toAst(e,{format:r,location:ke.body}):je.unbreakscape(e,{format:S.plainText,location:ke.body}),s=je.unbreakscape(t,{format:S.plainText,location:ke.body}),p=ve.countOccurrencesAtEnd(e,"\n")+ve.countOccurrencesAtStart(t,"\n");c=Ut.concatenatePlainTextWithAstTexts(o,p,s),u=je.unbreakscape(i,{format:r,location:ke.body}).trim();const g=Array.isArray(c)?c:void 0;if(g&&d){a=0;for(let e=0;e<d.length;e++){const t=d[e];if(t.type===ye.text)continue;const i=t;let r;switch(t.type){case ye.gap:case ye.mark:case ye.select:case ye.highlight:r=i}r&&this.replacePlaceholderWithBodyBit(g,r,a),a++}}}return{body:c,bodyBits:l.length>0?l:void 0,bodyString:u}}buildBodyText(e,t){return{type:ye.text,data:{bodyText:e,isPlain:t}}}replacePlaceholderWithBodyBit(e,t,i){const r=(e,a,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const i=e[t];if(r(i,e,t))return!0}else{if("bit"===e.type&&e.index===i)return a[n]=t,!0;if(e.content){if(r(e.content,e,"content"))return!0}}return!1};r(e,null,null)}trimBodyParts(e){let t=!1,i=e.reduce((e,i)=>{const r=i;if(t||r.type!==ye.text)t=!0,e.push(i);else{const i=r.data.bodyText.trimStart();i&&(t=!0,r.data.bodyText=i,e.push(r))}return e},[]);return t=!1,i=i.reduceRight((e,i)=>{const r=i;if(t||r.type!==ye.text)t=!0,e.unshift(i);else{const i=r.data.bodyText.trimEnd();i&&(t=!0,r.data.bodyText=i,e.unshift(r))}return e},[]),i}};function Xt(e,t,i,r,a,n,o,s){const{bitConfig:l}=e;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let c={};const u=function(e,t){const i={cards:[],internalComments:[]};if(!t)return i;const{bitType:r}=e;let a=0,n=0,o=0;for(const s of t.cards){const t={no:a++,sides:[]};i.cards.push(t);for(const a of s.sides){const s={no:n++,variants:[]};t.sides.push(s);for(const l of a.variants){const{parser:a,content:c}=l,u={parser:a,no:o++};s.variants.push(u);const p=ae.getTagsConfigForCardSet(r,n,o),d=e.bitContentProcessor(Wt.Card,p,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",d),d.cardBody=Gt.checkCardBody(e,Wt.Card,r,d.cardBody,t.no,s.no,u.no),d.cardBodyStr=d.cardBody?.bodyString,u.data=d,d.internalComments&&i.internalComments.push(...d.internalComments)}o=0}n=0}return i}(e,r),p=l.cardSet?.configKey;switch(p){case P._flashcard:case P._definitionList:c=function(e,t,i){const r=[],a=[];let n,o,s,l="",c=[],u=0,p={};const d=t===m.flashcard1,g=Zt(i);for(let h=0;h<i.cards.length;h++){const y=i.cards[h];if(!g||0!==h){n=void 0,o=void 0,c=[],u=0,p={};for(const e of y.sides)for(const t of e.variants){const{cardBody:e,resources:i,...r}=t.data;p={...p,...r};const a=i&&i.length>0?i[0]:void 0,d=e?.body;0===u?(s=t,l=e?.bodyString??"",n={text:d,icon:a}):1===u?o={text:d,icon:a}:c.push({text:d,icon:a}),u++}if(0!==h&&d){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${l}'`,s);break}if(ae.isOfBitType(t,[m.flashcard])){const e={question:n,answer:o,alternativeAnswers:c,...p};e&&r.push(e)}else{const e={term:n,definition:o,alternativeDefinitions:c,...p};e&&a.push(e)}}}return{heading:g?.heading,flashcards:r.length>0?r:void 0,definitions:a.length>0?a:void 0}}(e,t,u);break;case P._elements:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;r.push(t.cardBodyStr??"")}return{elements:r.length>0?r:void 0}}(0,0,u);break;case P._statements:c=function(e,t,i,r,a){const n=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{statements:t,statement:i,...r}=e.data;if(Array.isArray(t))for(const e of t){const t={statement:e.statement??"",isCorrect:e.isCorrect,item:e.item,lead:e.lead,hint:e.hint,instruction:e.instruction,example:e.example,...r};t&&n.push(t)}}r&&n.push(r);Array.isArray(a)&&a.length>0&&n.push(...a);return{statements:n.length>0?n:void 0}}(0,0,u,a,n);break;case P._feedback:c=function(e,t,i){let r;const a=[],n=Zt(i);for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(!n||0!==e){r=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const i=t.data,{cardBody:n,cardBodyStr:o,choices:s,...l}=i;if(0===e){const e=[];if(s&&s.length>0)for(const t of s){const{__isDefaultExample:i,example:r,...a}=t,n={choice:a.choice,requireReason:a.isCorrect,__isDefaultExample:i,example:r};e.push(n)}r={...i,choices:e},r&&a.push(r)}else if(1===e){const e={text:o??"",__textAst:n?.body,...l};r&&(r.reason=e)}}}}}return{heading:n?.heading,feedbacks:a.length>0?a:void 0}}(0,0,u);break;case P._quiz:c=function(e,t,i,r,a){const n=[],o=ae.isOfBitType(t,m.multipleChoice),s=ae.isOfBitType(t,m.multipleResponse);if(!o&&!s)return{};let l,c=!1;for(const e of i.cards){c=!1,l=void 0;for(const t of e.sides)for(const e of t.variants){const{__isDefaultExample:t,example:i,...r}=e.data;if(c=!0===t||c,l=i||l,r.trueFalse&&r.trueFalse.length>0){const e=[];for(const t of r.trueFalse){const{__isDefaultExample:i,example:r,...a}=t,n=i||c,o=r||l,u={isCorrect:a.isCorrect,__isDefaultExample:n,example:o};s?u.response=a.text:u.choice=a.text,u&&e.push(u)}s?r.responses=e:r.choices=e}const a={...r,choices:r.choices,responses:r.responses,__isDefaultExample:c,__defaultExample:l};a&&n.push(a)}}if(o&&Array.isArray(r)&&r.length>0){const e={choices:r};e&&n.push(e)}if(s&&Array.isArray(a)&&a.length>0){const e={responses:a};e&&n.push(e)}return{quizzes:n.length>0?n:void 0}}(0,t,u,o,s);break;case P._questions:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,i={question:t.cardBodyStr??"",...t};i&&r.push(i)}return{questions:r.length>0?r:void 0}}(0,0,u);break;case P._matchPairs:c=function(e,t,i){const r=[];let a,n,o,s,l=[],c=[],u={},p=!1;const d=ae.isOfBitType(t,m.matchMatrix),g=Zt(i,d),h=g?.isDefaultExampleCardSet??!1;let y=g?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(g&&0===e)continue;a=void 0,l=[],c=[],n=void 0,o=void 0,u={},p=!1,s=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const{cardBody:i,cardBodyStr:r,resources:d,__isDefaultExample:g,example:m,...y}=t.data;if(p=!0===g||p,s=m||s,0===e)if(Array.isArray(d)&&d.length>0){const e=d[0];e.type===B.audio?n=e:e.type===B.image&&(o=e)}else a=r;else{const e=r??"",t=i?.body;l.push(e),c.push(t),!h&&!p||s||(s=t),delete y.item,delete y.lead}u={...u,...y}}}p&&(y=void 0);const d=p||h,m=s||y,f={key:a??"",keyAudio:n,keyImage:o,values:l,__valuesAst:c,...u,__isDefaultExample:d,example:m};f&&r.push(f)}return{heading:g?.heading,pairs:r.length>0?r:void 0}}(0,t,u);break;case P._matchMatrix:c=function(e,t,i){let r,a;const n=[];let o,s,l,c,u=[],p=[],d=[],g={},h=!1,m=!1;const y=Zt(i,!0),f=y?.isDefaultExampleCardSet??!1;let b=y?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(y&&0===e)continue;r=void 0,a=void 0,u=[],p=[],d=[],h=!1,o=void 0,l=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];p=[],d=[],g={},m=!1,s=void 0,c=void 0;for(const t of i.variants){const i=t.data,{cardBody:n,cardBodyStr:u,__isDefaultExample:y,example:b,isCaseSensitive:T,...v}=i;if(m=!0===y||m,s=b||s,Object.assign(g,v),0===e)r=u,a=v,h=!0===y||h,o=b||o,l=null!=T?T:l;else{const e=u??je.EMPTY_STRING,t=n?.body;p.push(e),d.push(t),!f&&!m||s||(s=t),c=null!=T?T:l}}if(e>0){m&&(o=b=void 0),h&&(b=void 0);const e=m||h||f,t=s||o||b,i={values:p,__valuesAst:d,...g,__isDefaultExample:e,example:t,isCaseSensitive:c};i&&u.push(i)}}const T={key:r??je.EMPTY_STRING,cells:u,...a};T&&n.push(T)}return{heading:y?.heading,matrix:n.length>0?n:void 0}}(0,0,u);break;case P._pronunciationTable:c=function(e,t,i){const r=[];let a=[];for(const e of i.cards){a=[];for(const t of e.sides)for(const e of t.variants){const t=e.data,{title:i,cardBody:r,resources:n}=t,o=i&&i[1].titleAst,s=n&&n.length>0?n.find(e=>e.type===B.audio):void 0,l={title:o??[],body:r?.body??[],audio:s};a.push(l)}r.push(a)}return{pronunciationTable:{data:r}}}(0,0,u);break;case P._table:c=function(e,t,i){let r=!1;const a=[],n=[];let o=[];for(let e=0;e<i.cards.length;e++){const t=i.cards[e];r=!1,o=[];for(const i of t.sides)for(const t of i.variants){const i=t.data,{title:n,cardBody:s}=i,l=n&&n[1].titleAst;if(0===e&&null!=l&&(r=!0),r)a.push(l??[]);else{const e=s?.body??[];o.push(e)}}r||n.push(o)}return{table:{columns:a,data:n}}}(0,0,u);break;case P._botActionResponses:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{__instructionString:t,reaction:i,cardBodyStr:a,...n}=e.data,o={response:t??je.EMPTY_STRING,reaction:i??je.EMPTY_STRING,feedback:a??je.EMPTY_STRING,...n};o&&r.push(o)}return{botResponses:r.length>0?r:void 0}}(0,0,u);break;case P._ingredients:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{title:t,__instructionString:i,unit:a,unitAbbr:n,decimalPlaces:o,disableCalculation:s,cardBodyStr:l,cardBody:c,...u}=e.data,p=Array.isArray(t)&&t.length>0?t[t.length-1].titleString:void 0;let d=!1,g=ft.asNumber(i);if(c&&c.bodyBits){const e=c.bodyBits.find(e=>e.type===ye.select);e&&(g=e.__instructionString?ft.asNumber(e.__instructionString):g,e.options&&e.options.length>0&&(d=e.options[0].isCorrect))}const h={title:p,checked:d,ingredient:l,quantity:g,unit:a??je.EMPTY_STRING,unitAbbr:n??je.EMPTY_STRING,decimalPlaces:o??1,disableCalculation:s,...u};h&&r.push(h)}return{ingredients:r.length>0?r:void 0}}(0,0,u);break;case P._clozeList:case P._exampleBitList:case P._bookReferenceList:c=function(e,t,i,r){const a=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{cardBody:t,...i}=e.data,r={body:t,...i};r&&a.push(r)}return{cardBits:a.length>0?a:void 0}}(0,0,0,u)}return c.internalComments=u.internalComments.length>0?u.internalComments:void 0,c}function Zt(e,t=!1){let i,r,a=!1;const n=[];let o,s=!1;if(0===e.cards.length)return;const l=e.cards[0];for(let e=0;e<l.sides.length;e++){const t=l.sides[e];if(0===t.variants.length)continue;const i=t.variants[0].data,{title:c,__isDefaultExample:u,example:p}=i,d=c&&c[1].titleString;null!=d&&(a=!0),0===e?a&&(r=d,s=!0===u||s,o=p||o):a&&(n.push(d??""),s=!0===u||s,o=p||o)}if(a){let e=n;e=t?n:n.length>=1?n[n.length-1]:"",i={forKeys:r??"",forValues:e}}return i?{heading:i,isDefaultExampleCardSet:s,exampleCardSet:o}:void 0}function ei(e,t,i,r,a){const{type:n,value:o}=r,{textFormat:s}=e,l=new mt,c=ve.trimmedString(o);switch(n){case jt.Instruction:a.instruction=l.toAst(c,{format:s,location:ke.tag}),a.__instructionString=je.unbreakscape(c,{format:S.bitmarkText,location:ke.tag});break;case jt.Hint:a.hint=l.toAst(c,{format:s,location:ke.tag}),a.__hintString=je.unbreakscape(c,{format:S.bitmarkText,location:ke.tag});break;case jt.Anchor:a.anchor=je.unbreakscape(c,{format:S.bitmarkText,location:ke.tag});break;case jt.Reference:a.reference=je.unbreakscape(c,{format:S.bitmarkText,location:ke.tag});break;case jt.SampleSolution:a.sampleSolution=je.unbreakscape(c,{format:S.bitmarkText,location:ke.tag}),a.__sampleSolutionAst=l.toAst(c,{format:s,location:ke.tag}),e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",r)}}var ti=new mt,ii=new class{process(e,t,i,r,a,n){const{textFormat:o}=e;let s;a=a.trimStart(),n=n.trimEnd();const l=!!a.trim(),c=!!n.trim();let u=0;if(l&&c&&(u=ve.countOccurrencesAtEnd(a,"\n")+ve.countOccurrencesAtStart(n,"\n")),a||n){const i=o===S.bitmarkText;a&&(a=Gt.checkFooter(e,t,a));const r=i?ti.toAst(a,{format:o,location:ke.body}):je.unbreakscape(a,{format:S.plainText,location:ke.body}),l=je.unbreakscape(n,{format:S.plainText,location:ke.body});s=Ut.concatenatePlainTextWithAstTexts(r,u,l)}return s?{footer:s}:void 0}},ri=new mt;function ai(e,t,i,r,a,n){if(t===Wt.Chain)!function(e,t,i,r,a){const{textFormat:n}=e,{value:o}=r,s=a.solutions,l=a.__solutionsAst;if(s&&l&&ve.isString(o)){const e=ve.trimmedString(o);s.push(je.unbreakscape(e,{format:S.bitmarkText,location:ke.tag}));const t=ri.toAst(e,{format:n,location:ke.tag});l.push(t)}}(e,0,0,r,a);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const a=ae.getTagConfigForTag(i,_.fromValue(r.type)),n=[r,...r.chain??[]],o=e.bitContentProcessor(Wt.Chain,a?.chain,n);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",o);const s={type:ye.gap,...o};return s}(e,0,i,r);t&&n.push(t)}}function ni(e,t,i,r,a){t===Wt.Chain?function(e,t,i,r,a){const{textFormat:n}=e,{value:o}=r,s=new mt,l=ve.trimmedString(o);a.itemLead||(a.itemLead=[]);const c=s.toAst(l,{format:n,location:ke.tag});a.itemLead.push(c)}(e,0,0,r,a):function(e,t,i,r,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("item lead content",r);const n=ae.getTagConfigForTag(i,_.fromValue(r.type)),o=[r,...r.chain??[]],s=e.bitContentProcessor(Wt.Chain,n?.chain,o);e.DEBUG_CHAIN_TAGS&&e.debugPrint("item lead TAGS",s);a.itemLead=s.itemLead}(e,0,i,r,a)}function oi(e,t,i,r,a,n){if(t===Wt.Chain)!function(e,t,i,r){const{value:a}=i;ve.isString(a)&&(r.solution=ve.trimmedString(a))}(0,Wt.Chain,r,a);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const a=ae.getTagConfigForTag(i,_.fromValue(r.type)),n=e.bitContentProcessor(Wt.Chain,i,[r]),o=e.bitContentProcessor(Wt.Chain,a?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",o);const{solution:s}=n,{mark:l,...c}=o,u={type:ye.mark,solution:s??"",mark:ze.asSingle(l)??"",...c};return u}(e,0,i,r);t&&n.push(t)}}function si(e,t,i,r,a){t===Wt.Chain||function(e,t,i,r,a){const{bitConfig:n}=e;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const o=e.bitContentProcessor(Wt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",o);const{reference:s,referenceEnd:l}=o,c=je.unbreakscape(ve.trimmedString(r.value),{format:S.bitmarkText,location:ke.tag}),u=n.tags[w.book];if(u&&(u.maxCount===y.infinity||u.maxCount>1))return Array.isArray(a.book)||(a.book=[]),void a.book.push({book:c,reference:s??"",referenceEnd:l??void 0});a.book=c,a.reference=s,a.referenceEnd=l}(e,0,i,r,a)}var li=new mt;function ci(e,t,i,r){const{bitType:a}=e,{value:n}=i,o=n;ae.isOfBitType(a,[m.cloze,m.clozeAndMultipleChoiceText,m.multipleChoiceText,m.highlightText,m.trueFalse,m.trueFalse1,m.multipleResponse,m.multipleResponse1,m.multipleChoice,m.multipleChoice1])?function(e,t,i,r){const{bitType:a,textFormat:n}=e;let o;Array.isArray(r.trueFalse)&&r.trueFalse.length>0&&(o=r.trueFalse[r.trueFalse.length-1]??void 0);o?!0===i?(o.__isDefaultExample=!0,o.example=!!o.isCorrect):yt.isBooleanString(i)?o.example=yt.toBoolean(i):(o.__isDefaultExample=!0,o.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t)):Array.isArray(r.__solutionsAst)&&r.__solutionsAst.length>0?r.example=!0===i?r.__solutionsAst[r.__solutionsAst.length-1]??void 0:i?li.toAst(i,{format:n,location:ke.tag}):void 0:ae.isOfBitType(a,[m.multipleChoiceText,m.highlightText,m.trueFalse,m.trueFalse1,m.multipleResponse,m.multipleResponse1])?function(e,t,i,r){if(!0===i)r.__isDefaultExample=!0,r.example=void 0;else{const a=i?je.unbreakscape(i,{format:S.bitmarkText,location:ke.tag}):void 0;yt.isBooleanString(a)?r.example=yt.toBoolean(a):(r.__isDefaultExample=!0,r.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t))}}(e,t,i,r):ae.isOfBitType(a,[m.clozeAndMultipleChoiceText,m.multipleChoice,m.multipleChoice1])?(r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("At this level, only default [@example] is allowed, using default",t)):ui(e,t,i,r)}(e,i,o,r):ae.isOfBitType(a,m.mark)?function(e,t,i,r){r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("Only default [@example] is allowed, using default",t)}(e,i,o,r):ui(e,i,o,r)}function ui(e,t,i,r){const{textFormat:a}=e;!0===i||"true"===i?(r.__isDefaultExample=!0,r.example=void 0):r.example=i?li.toAst(i,{format:a,location:ke.tag}):void 0}function pi(e,t,i,r,a){t===Wt.Chain?function(e,t,i,r,a){const{value:n}=r,o=je.unbreakscape(ve.trimmedString(n),{format:S.bitmarkText,location:ke.tag});a.imageSourceUrl=o}(0,0,0,r,a):function(e,t,i,r,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",r);const{key:n}=r,o=ae.getTagConfigForTag(i,C.fromValue(n)),s=e.bitContentProcessor(Wt.Chain,i,[r]),l=e.bitContentProcessor(Wt.Chain,o?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",l);const{imageSourceUrl:c}=s,{mockupId:u,...p}=l;c||e.addWarning("[@imageSource] is missing the image url",r);u||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",r);const d={url:c??"",mockupId:u??"",...p};a.imageSource=d}(e,0,i,r,a)}function di(e,t,i,r,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("person content",r);const n=e.bitContentProcessor(Wt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("person TAGS",n);const{propertyTitle:o,resources:s}=n,l=je.unbreakscape(ve.trimmedString(r.value),{format:S.bitmarkText,location:ke.tag}),c=ve.trimmedString(o),u=function(e,t){let i;const r=[];if(t)for(const e of t.reverse())i||B.image!==e.type?r.push(e):i=e;r.length>0&&(e.parser.excessResources=r,e.addWarning(`${r.length} excess resource(s) present in the [@person] chain.`));return i}(e,s),p={name:l,title:c,avatarImage:u};a.person=p}var gi=new mt;var hi=new mt;function mi(e,t,i,r,a){const{value:n}=r;let{key:o}=r;const s=t===Wt.Chain,l=ae.getTagConfigForTag(i,C.fromValue(o)),c=l?l.configKey:void 0;if(o===C.internalComment)return void function(e,t,i,r){if(!r.internalComments)return;const{value:a}=i,n=ve.isString(a)?ve.trimmedString(a):void 0;n&&r.internalComments.push(n)}(0,0,r,a);if(l){if(c===w.example)return void ci(e,0,r,a);if(c===w.ratingLevelStart||c===w.ratingLevelEnd)return void function(e,t,i,r,a){const{textFormat:n}=e,{key:o,value:s}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("ratingLevel content",r);const l=e.bitContentProcessor(Wt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("ratingLevel TAGS",l);const{label:c}=l,u={level:ft.asNumber(s)??0,label:c?gi.toAst(c,{format:n,location:ke.tag}):void 0};switch(o){case C.ratingLevelStart:a.ratingLevelStart=u;break;case C.ratingLevelEnd:a.ratingLevelEnd=u}}(e,0,l.chain,r,a);if(c===w.technicalTerm)return void function(e,t,i,r,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("technicalTerm content",r);const n=e.bitContentProcessor(Wt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("technicalTerm TAGS",n);const{lang:o}=n,s={technicalTerm:je.unbreakscape(ve.trimmedString(r.value),{format:S.bitmarkText,location:ke.tag}),lang:o};a.technicalTerm=s}(e,0,l.chain,r,a);if(c===w.servings)return void function(e,t,i,r,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("servings content",r);const n=e.bitContentProcessor(Wt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("servings TAGS",n);const{unit:o,unitAbbr:s,decimalPlaces:l,disableCalculation:c,__hintString:u}=n,p={servings:ft.asNumber(r.value)??1,unit:o,unitAbbr:s,decimalPlaces:l??1,disableCalculation:c,hint:u};a.servings=p}(e,0,l.chain,r,a);if(c===w.person||c===w.partner)return void di(e,0,l.chain,r,a);if(c===w.imageSource)return void pi(e,t,i,r,a);if(c===w.book)return void si(e,t,l.chain,r,a);if(c===w.markConfig&&!s)return void function(e,t,i,r,a){const{key:n}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const o=a.markConfig;if(!o)return;const s=ae.getTagConfigForTag(i,C.fromValue(n)),{mark:l,...c}=e.bitContentProcessor(Wt.Chain,s?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const u={mark:je.unbreakscape(ve.trimmedString(r.value)??"unknown",{format:S.bitmarkText,location:ke.tag}),emphasis:"underline",...c};u&&o.push(u)}(e,0,i,r,a);c===w.property_title&&s&&(o="propertyTitle")}const u=(e,t,i,r)=>{if(i=(e=>{if(null!=e){if(r)switch(r.format){case T.plainText:return je.unbreakscape(ve.isString(e)?ve.trimmedString(e):void 0,{format:S.plainText,location:ke.tag});case T.number:return ft.asNumber(je.unbreakscape(e,{format:S.plainText,location:ke.tag}));case T.boolean:return yt.toBoolean(je.unbreakscape(e,{format:S.plainText,location:ke.tag}),!0);case T.invertedBoolean:return!yt.toBoolean(je.unbreakscape(e,{format:S.plainText,location:ke.tag}),!0);case T.bitmarkText:return e=ve.isString(e)?e:"",hi.toAst(e,{format:S.bitmarkText,location:ke.tag})}return je.unbreakscape(e,{format:S.plainText,location:ke.tag})}})(i),r?.astKey&&(t=r.astKey),r?.single)e[t]=i;else if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];e[t]=[...r,i]}else e[t]=[i]};u(l?a:a.extraProperties,o,n,l),o===C.tag_sampleSolution&&u(a,"__sampleSolutionAst",n,new z($.sampleSolution,C.tag_sampleSolution,1,1,void 0,void 0,void 0,!0,T.bitmarkText,void 0,void 0))}function yi(e,t,i,r,a,n){const{value:o}=r,s=ve.trimmedString(o);n?a.referenceEnd=je.unbreakscape(s,{format:S.bitmarkText,location:ke.tag}):a.reference=je.unbreakscape(s,{format:S.bitmarkText,location:ke.tag})}var fi=new wt;function bi(e,t,i,r,a){const{type:n,key:o,value:s,chain:l}=r,c=a.resources;if(!c)return;const u=B.fromValue(o);if(u){const t=ae.getTagConfigForTag(i,u),{posterImage:r,...n}=e.bitContentProcessor(Wt.Chain,t?.chain,l);let o;if(r){const{subConfig:i,subChain:a}=function(e,t,i){let r;e&&(r=e[i]?.chain);const a=t?.reduce((e,t)=>{if(e)return e;const i=t;return"posterImage"===i.key?i.chain:void 0},void 0);return{subConfig:r,subChain:a}}(t?.chain,l,"posterImage"),{posterImage:n,...s}=e.bitContentProcessor(Wt.Chain,i,a);o=fi.resource(e,{type:B.image,value:r,...s}).image}const p=fi.resource(e,{type:u,value:je.unbreakscape(s,{format:S.bitmarkText,location:ke.tag}),posterImage:o,...n});p&&(u===B.backgroundWallpaper||u===B.imagePlaceholder?a.propertyStyleResources&&(a.propertyStyleResources[u]=p):c.push(p))}}var Ti=new mt;function vi(e,t,i,r,a){const{textFormat:n}=e,{value:o}=r,s=a.title;if(!s)return;const l=o,c=ve.trimmedString(l.title);s[l.level.length]={titleAst:Ti.toAst(c??"",{format:n,location:ke.tag}),titleString:c??""}}function xi(e,t,i,r,a,n){t===Wt.Chain?function(e,t,i,r){const{type:a,value:n}=i,o=r.trueFalse;if(!o)return;const s=je.unbreakscape(ve.trimmedString(n),{format:S.bitmarkText,location:ke.tag});o.push({text:s,isCorrect:a===jt.True,__isDefaultExample:!1})}(0,Wt.Chain,r,a):function(e,t,i,r,a,n){const{bitType:o}=e,s=[r,...r.chain??[]],l=a.statements,c=a.choices,u=a.responses;if(!(l&&c&&u&&n))return;if(ae.isOfBitType(o,m.trueFalse1))a.statement=function(e,t,i){const{bitType:r}=e;if(!ae.isOfBitType(r,m.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const{trueFalse:a,...n}=e.bitContentProcessor(Wt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",n);let o,s;a&&a.length>0&&(s=a[0]);if(s){const{statement:e,...t}=n;o={...s,statement:s.text,...t}}return o}(e,i,s);else if(ae.isOfBitType(o,[m.trueFalse,m.multipleChoice,m.multipleChoice1,m.multipleResponse,m.multipleResponse1,m.feedback])){const t=function(e,t,i){const{bitType:r}=e,a=ae.isOfBitType(r,m.trueFalse),n=ae.isOfBitType(r,[m.multipleChoice,m.multipleChoice1,m.feedback]),o=ae.isOfBitType(r,[m.multipleResponse,m.multipleResponse1]);if(!a&&!n&&!o)return{};const s=[],l=[],c=[],u=e.splitBitContent(i,[jt.True,jt.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",u);for(const i of u){const{trueFalse:r,...u}=e.bitContentProcessor(Wt.Chain,t,i);let p;if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",u),r&&r.length>0&&(p=r[0]),p)if(a){const{statement:e,...t}=u,i={...p,statement:p.text,...t};i&&s.push(i)}else if(n){const e={...p,choice:p.text,...u};e&&l.push(e)}else if(o){const e={...p,response:p.text,...u};e&&c.push(e)}}const p={};a?p.statements=s:n?p.choices=l:o&&(p.responses=c);return p}(e,i,s);t.statements&&l.push(...t.statements),t.choices&&c.push(...t.choices),t.responses&&u.push(...t.responses)}else if(ae.isOfBitType(o,m.highlightText)){const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const{trueFalse:r,...a}=e.bitContentProcessor(Wt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",{trueFalse:r,...a});const n=[];if(r)for(const e of r){const t={...e,isHighlighted:!1};t&&n.push(t)}const o={type:ye.highlight,texts:n,...a};return o}(e,i,s);t&&n.push(t)}else{const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const{trueFalse:r,...a}=e.bitContentProcessor(Wt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",{trueFalse:r,...a});const n=[];if(r)for(const e of r){const t=e;t&&n.push(t)}const o={type:ye.select,options:n,...a};return o}(e,i,s);t&&n.push(t)}}(e,0,i,r,a,n)}var ki=!1,wi=!0,Ci=!0,Ai=!0,Bi=!0,_i=new Ct,Si=class{constructor(e){p(this,"context"),p(this,"nonFatalWarnings",[]),p(this,"nonFatalErrors",[]),p(this,"parser",{}),p(this,"parse"),p(this,"parserText"),p(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={bitConfig:ae.getBitConfig(m._error),bitType:m._error,textFormat:S.bitmarkText,DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:ki,DEBUG_BIT_CONTENT:wi,DEBUG_BIT_TAGS:Ci,DEBUG_BODY:Ai,DEBUG_FOOTER:Bi,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){const t=[];let i=[];for(const r of e){if(!r)continue;const e=r.value;e?t.push(e):i=i.concat(r.errors??[])}return _i.buildBitmark({bits:t,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:i,textFormat:r,resourceType:a,bitLevel:n,isCommented:o}=e;if(!i||ae.isOfBitType(i,m._error))return this.invalidBit();const s=ae.getBitConfig(i);this.context.bitConfig=s,this.context.bitType=i,this.context.textFormat=r,this.context.resourceType=a;const l=ae.isOfBitType(i,m.trueFalse1),c=ae.isOfBitType(i,m.multipleChoice1),u=ae.isOfBitType(i,m.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=this.squashUnwantedInlineBodyBits(t),t=Gt.validateBitTags(this.context,t);const{body:p,footer:d,cardSet:g,title:h,statement:f,statements:b,choices:T,responses:v,propertyStyleResources:x,resources:k,posterImage:w,internalComments:C,...A}=this.bitContentProcessor(Wt.Bit,s.tags,t);this.debugPrint("BIT TAGS",A),this.debugPrint("BIT BODY",p),this.debugPrint("BIT FOOTER",d);const _=function(e,t,i){if(i=i??[],ae.isOfBitType(t,m.chapter)){let e;return i.length>0&&(e=i[i.length-1]),{title:e?.titleAst??[],titleString:e?.titleString??"",level:i.length>0?i.length-1:void 0}}return{title:i[1]?.titleAst??void 0,titleString:i[1]?.titleString??void 0,subtitle:i[2]?.titleAst??void 0,subtitleString:i[2]?.titleString??void 0}}(this.context,i,h),S=Xt(this.context,i,0,g,f,b,T,v),P=function(e,t,i){const{bitType:r}=e,a=[],n=[],o=B.fromValue(t),s=ae.getBitResourcesConfig(r,o),l=s.resourceAttachmentAllowed,c=s.getCountsMin(),u=s.getCountsMax();if(i)for(const e of i.reverse()){let t=c.get(e.__typeAlias)??0,i=u.get(e.__typeAlias)??0;t=Math.max(0,t-1),i===y.infinity?a.unshift(e):i>0?(a.unshift(e),i--):n.unshift(e),c.set(e.__typeAlias,t),u.set(e.__typeAlias,i)}if(!l&&t){const i=`Resource type [&${t}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(i)}else 0===a.length&&t&&e.addWarning(`Resource type [&${t}] is specified in the bit header, but no such a resource is present`);return n.length>0&&(e.parser.excessResources=n),a}(this.context,a,k),I=[...C??[],...S.internalComments??[]],L=this.buildBitLevelWarnings(),E=this.buildBitLevelErrors();L&&(this.parser.warnings=L),E&&(this.parser.errors=E);return{value:_i.buildBit({bitType:i,bitLevel:n,isCommented:o,textFormat:r,resourceType:a,..._,posterImage:w,statement:l?f:void 0,choices:c?T:void 0,responses:u?v:void 0,...A,...x,resources:P,...S,body:p,footer:d,internalComment:I,parser:this.parser})}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:_i.buildBit({bitType:ae.getBitType(m._error),bitLevel:1,parser:this.parser})}}buildBitHeader(e,t,i){const r=je.unbreakscape(e,{format:S.plainText,location:ke.tag}),a=ae.getBitType(r),n=ae.isBitTypeCommented(r);ae.isOfBitType(a,m._error)&&this.addError(`Invalid bit type: '${r}'`);const o=ae.getBitConfig(a);t>ae.bitLevelMax?(this.addWarning(`Bit level of ${t} too high, setting to max value of ${ae.bitLevelMax}`),t=ae.bitLevelMax):t<ae.bitLevelMin&&(this.addWarning(`Bit level of ${t} too low, setting to min value of ${ae.bitLevelMin}`),t=ae.bitLevelMin);let s=S.fromValue(i.textFormat);i.textFormat&&!s&&this.addWarning(`Invalid text format '${i.textFormat}', defaulting to '${we.bitmarkPlusPlus}'`);const l=We.fromValue(i.textFormat);l&&(s=S.bitmarkText,this.addWarning(`${l} text format is deprecated. Bit will be parsed as '${we.bitmarkPlusPlus}'`)),s=s??o.textFormatDefault;const c=B.fromValue(i.resourceType);return i.resourceType&&!c&&this.addWarning(`Invalid resource type '${i.resourceType}', it will be ignored`),{bitType:a,bitLevel:t,textFormat:s??o.textFormatDefault,resourceType:c,isCommented:n}}buildTextAndResourceType(e,t){const i={},r=e=>{if(e){const t=je.unbreakscape(ve.string(e.value),{format:S.plainText,location:ke.tag});e.type===jt.TextFormat?i.textFormat=t:i.resourceType=t}};return r(e),r(t),i}resetParserState(){this.context.state={}}squashUnwantedInlineBodyBits(e){const t=[];if(!e)return t;const{textFormat:i}=this.context,r=i===S.bitmarkText,a=(e,t="")=>{const{chain:i,parser:r}=e;if(t+=r.text,i)for(const e of i)t=a(e,t);return t};let n=!1;for(const i of e){const{type:e,value:o}=i,s=o??"";let l=!1;if(n||(e===jt.BodyText&&!r&&s&&s.trim()&&(n=!0),e===jt.PlainTextDivider&&(n=!0,l=!0)),l)t.push({type:jt.BodyText,value:"\n"});else if(n)if(e===jt.BodyText)t.push({type:jt.BodyTextPlain,value:o});else{const e=a(i);t.push({type:jt.BodyTextPlain,value:e})}else t.push(i)}return t}bitContentProcessor(e,t,i){const r={};if(!i)return r;const{bitType:a,textFormat:n}=this.context;r.title=[],r.solutions=[],r.__solutionsAst=[],r.statements=[],r.choices=[],r.responses=[],r.propertyStyleResources={},r.resources=[],r.trueFalse=[],r.markConfig=[],r.extraProperties={},r.internalComments=[];let o=!1,s=!1;const l=[];let c=je.EMPTY_STRING,u=je.EMPTY_STRING,p=je.EMPTY_STRING,d=je.EMPTY_STRING;const g=e===Wt.Bit,h=e===Wt.Card,m=e===Wt.Chain,y=()=>{if(c){c=Gt.checkBodyPart(this.context,e,c);const t=Qt.buildBodyText(c,!1);l.push(t)}c=je.EMPTY_STRING};for(const a of i){const{type:i,value:n}=a;switch(i){case jt.ItemLead:ni(this.context,e,t,a,r);break;case jt.Instruction:case jt.Hint:case jt.Anchor:case jt.SampleSolution:ei(this.context,0,0,a,r);break;case jt.Reference:yi(this.context,0,0,a,r,o),o=!0;break;case jt.Title:vi(this.context,0,0,a,r);break;case jt.Property:mi(this.context,e,t,a,r);break;case jt.Gap:m||y(),ai(this.context,e,t,a,r,l);break;case jt.Mark:m||y(),oi(this.context,e,t,a,r,l);break;case jt.True:case jt.False:m||y(),xi(this.context,e,t,a,r,l);break;case jt.Resource:bi(this.context,0,t,a,r);break;case jt.CardSet:r.cardSet=n,s=!0;break;case jt.BodyText:case jt.CardText:s?u=je.concatenate(u,n):c=je.concatenate(c,n);break;case jt.BodyTextPlain:s?d=je.concatenate(d,n):p=je.concatenate(p,n);break;case jt.FooterDivider:s&&(u=je.concatenate(u,n)),s=!0}}y();const f=p?Qt.buildBodyText(p,!0):void 0;if(f&&l.push(f),r.itemLead){const e=r.itemLead.length;e>0&&(r.item=r.itemLead[0]),e>1&&(r.lead=r.itemLead[1]),e>2&&(r.pageNumber=r.itemLead[2]),e>3&&(r.marginNumber=r.itemLead[e-1])}return g?r.body=Qt.process(this.context,e,a,n,t,r,l,!1):h&&(r.cardBody=Qt.process(this.context,e,a,n,t,r,l,!0)),r.footer=ii.process(this.context,e,t,r,u,d),0===Object.keys(r.extraProperties).length&&delete r.extraProperties,0===r.title.length&&delete r.title,0===r.solutions.length&&delete r.solutions,0===r.statements.length&&delete r.statements,0===r.choices.length&&delete r.choices,0===r.responses.length&&delete r.responses,0===r.trueFalse.length&&delete r.trueFalse,0===r.markConfig.length&&delete r.markConfig,0===Object.keys(r.propertyStyleResources).length&&delete r.propertyStyleResources,0===r.resources.length&&delete r.resources,0===r.internalComments.length&&delete r.internalComments,r}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 i=[];let r=[];for(const a of e)t.includes(a.type)&&(r.length>0&&i.push(r),r=[]),r.push(a);return r.length>0&&i.push(r),i}addWarning(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalWarnings.push(r)}addError(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalErrors.push(r)}debugPrint(e,t){}};function Pi(e,t,i,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Pi.prototype),a.expected=t,a.found=i,a.location=r,a.name="SyntaxError",a}function Ii(e,t,i){return i=i||" ",e.length>t?e:(t-=e.length,e+(i+=i.repeat(t)).slice(0,t))}!function(e,t){function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i}(Pi,Error),Pi.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var i,r=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){r=e[i].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+n.line+":"+n.column;if(r){var s=this.location.end,l=Ii("",n.line.toString().length," "),c=r[a.line-1],u=(a.line===s.line?s.column:c.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+l+" |\n"+n.line+" | "+c+"\n"+l+" | "+Ii("",a.column-1," ")+Ii("",u,"^")}else t+="\n at "+o}return t},Pi.buildMessage=function(e,t){var i,r={literal:function(e){return'"'+n(e.text)+'"'},class:function(e){var t=e.parts.map(function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)});return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function a(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(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"+a(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+a(e)})}function o(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"+a(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+a(e)})}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,i,r=e.map(s);if(r.sort(),r.length>0){for(t=1,i=1;t<r.length;t++)r[t-1]!==r[t]&&(r[i]=r[t],i++);r.length=i}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+(((i=t)?'"'+n(i)+'"':"end of input")+" found.")};var Li=function e(t,i){var r,a={},n=(i=void 0!==i?i:{}).grammarSource,o={bitmark:ri,bit:function(){var e,t,i,r,n;e=Mt,t=[],i=Ii();for(;i!==a;)t.push(i),i=Ii();if((i=oi())!==a){for(r=[],n=Ii();n!==a;)r.push(n),n=Ii();Wt=e,e=He(i)}else Mt=e,e=a;return e},cardContent:function(){var e,t,i;e=Mt,t=[],(i=ui())===a&&(i=vi());for(;i!==a;)t.push(i),(i=ui())===a&&(i=vi());return Wt=e,t=Tt(t),e=t}},s=ri,l="[.",c="]",u="[",p=":",d="&",g="$$$$",h="====",m="text",y="~~~~",f="footer",b="--",T="++",v="===",x="==",k="[@id",w="#",C="[▼",A="[►",B="[@",_="[%",S="[!",P="[?",I="[+",L="[-",E="[$",V="[_",N="[=",F="[&",R="^]",K="id:",O=".",D="\n",$="\r\n",M=/^[^\]]/,j=/^[^:\]]/,W=/^[^&:\]]/,z=/^[ \t]/,J=/^[^\n\r\u2028\u2029]/,q=/^[\r\u2028-\u2029]/,H=/^[ \t\n\r\u2028\u2029]/,G=Yt("[.",!1),U=Qt(["]"],!0,!1),Y=Yt("]",!1),Q=Yt("[",!1),X=Yt(":",!1),Z=Yt("&",!1),ee={type:"any"},te=Yt("$$$$",!1),ie=Yt("====",!1),re=Yt("text",!1),ae=Yt("~~~~",!1),ne=Yt("footer",!1),oe=Yt("--",!1),se=Yt("++",!1),le=Yt("===",!1),ce=Yt("==",!1),ue=Yt("[@id",!1),pe=Yt("#",!1),de=Yt("[▼",!1),ge=Yt("[►",!1),he=Yt("[@",!1),me=Yt("[%",!1),ye=Yt("[!",!1),fe=Yt("[?",!1),be=Yt("[+",!1),Te=Yt("[-",!1),ve=Yt("[$",!1),xe=Yt("[_",!1),ke=Yt("[=",!1),we=Yt("[&",!1),Ce=Yt("^]",!1),Ae=Yt("id:",!1),Be=Qt([":","]"],!0,!1),_e=Yt(".",!1),Se=Qt(["&",":","]"],!0,!1),Pe=(Xt("Empty"),Qt([" ","\t"],!1,!1)),Ie=Xt("Anything"),Le=Xt("Character"),Ee=Qt(["\n","\r","\u2028","\u2029"],!0,!1),Ve=Xt("Line"),Ne=(Xt("whitespace in line"),Xt("Blank Line")),Fe=Xt("Line Terminator"),Re=Yt("\n",!1),Ke=Yt("\r\n",!1),Oe=Qt(["\r",["\u2028","\u2029"]],!1,!1),De=Xt("Whitespace, then Line Terminator"),$e=Xt("whitespace"),Me=Qt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),je=function(e,t){return Oi.buildBits([e,...t])},We=function(e){return Ki.handleRawBit(e)},ze=function(e){return e},Je=function(e){return Ki.handleRawBit(e)},qe=function(e){return e},He=function(e){return e},Ge=function(e,t){return Oi.buildBit(e,t)},Ue=function(e){return Oi.invalidBit(e)},Ye=function(e,t,i){return Oi.buildBitHeader(t,e,i)},Qe=function(e,t){return Oi.buildTextAndResourceType(e,t)},Xe=function(e){return Ki.handleTextFormat(e)},Ze=function(e){return Ki.handleResourceType(e)},et=function(e){return Ki.handleBitContent(e)},tt=function(e){return Ki.handleTagChain(e)},it=function(e){return e},rt=function(e){return Ki.handleBitTag(e)},at=function(e){return{type:jt.BodyChar,value:e}},nt=function(e){return Ki.handlePlainTextDivider(e)},ot=function(e){return Ki.handleFooterDivider(e)},st=function(e){return Ki.handleCardSet(e[1].flat())},lt=function(){Ki.handleCardSetStart()},ct=function(){Ki.handleCardSetEnd()},ut=function(e){return Ki.handleCards(e)},pt=function(e){return Ki.handleCardLineOrDivider(e,2)},dt=function(e){return Ki.handleCardLine(e)},gt=function(e){return Ki.handleCardSet(e[1].flat())},ht=function(){Ki.handleCardSetStart()},mt=function(){Ki.handleCardSetEnd()},yt=function(e){return Ki.handleCards(e)},ft=function(e){return Ki.handleCardLineOrDivider(e,1)},bt=function(e){return Ki.handleCardLine(e)},Tt=function(e){return Ki.handleCardContent(e)},vt=function(e){return{type:jt.CardChar,value:e}},xt=function(e){return Ki.handlePropertyTag("id",e)},kt=function(e,t){return Ki.handleTag(jt.Title,{level:e,title:t})},wt=function(e){return Ki.handleTag(jt.Anchor,e)},Ct=function(e){return Ki.handleTag(jt.Reference,e)},At=function(e,t){return Ki.handlePropertyTag(e,t)},Bt=function(e){return Ki.handleTag(jt.ItemLead,e)},_t=function(e){return Ki.handleTag(jt.Instruction,e)},St=function(e){return Ki.handleTag(jt.Hint,e)},Pt=function(e){return Ki.handleTag(jt.True,e)},It=function(e){return Ki.handleTag(jt.False,e)},Lt=function(e){return Ki.handleTag(jt.SampleSolution,e)},Et=function(e){return Ki.handleTag(jt.Gap,e)},Vt=function(e){return Ki.handleTag(jt.Mark,e)},Nt=function(e,t){return Ki.handleResourceTag(e,t)},Ft=function(e){return e},Rt=function(e){return e?e.trim():""},Kt=function(e){return e.length},Ot=function(e){return e?e.trim():null},Dt=function(e){return e?e.trim():""},$t=function(){return!0},Mt=0|i.peg$currPos,Wt=Mt,Jt=[{line:1,column:1}],qt=Mt,Ht=i.peg$maxFailExpected||[],Gt=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in o))throw new Error("Can't start parsing from rule \""+i.startRule+'".');s=o[i.startRule]}function Ut(){return t.substring(Wt,Mt)}function Yt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Qt(e,t,i){return{type:"class",parts:e,inverted:t,ignoreCase:i}}function Xt(e){return{type:"other",description:e}}function Zt(e){var i,r=Jt[e];if(r)return r;if(e>=Jt.length)i=Jt.length-1;else for(i=e;!Jt[--i];);for(r={line:(r=Jt[i]).line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return Jt[e]=r,r}function ei(e,t,i){var r=Zt(e),a=Zt(t),o={source:n,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return i&&n&&"function"==typeof n.offset&&(o.start=n.offset(o.start),o.end=n.offset(o.end)),o}function ti(e){Mt<qt||(Mt>qt&&(qt=Mt,Ht=[]),Ht.push(e))}function ii(e,t,i){return new Pi(Pi.buildMessage(e,t),e,t,i)}function ri(){return function(){var e,i,r,n;e=Mt,i=[],r=Vi();for(;r!==a;)i.push(r),r=Vi();return r=function(){var e,i,r,n;e=Mt,i=Mt,r=[],n=ni();for(;n!==a;)r.push(n),n=ni();return i=t.substring(i,Mt),Wt=e,i=We(i),e=i,e}(),n=function(){var e,t;e=[],t=ai();for(;t!==a;)e.push(t),t=ai();return e}(),Wt=e,e=je(r,n),e}()}function ai(){var e,i,r,n;for(e=Mt,i=[],r=Ii();r!==a;)i.push(r),r=Ii();return(r=Li())===a&&(r=null),n=function(){var e,i,r,n,o,s;if(e=Mt,i=Mt,r=Mt,n=function(){var e,i,r,n;e=Mt,t.substr(Mt,2)===l?(i=l,Mt+=2):(i=a,0===Gt&&ti(G));if(i!==a){for(r=[],n=t.charAt(Mt),M.test(n)?Mt++:(n=a,0===Gt&&ti(U));n!==a;)r.push(n),n=t.charAt(Mt),M.test(n)?Mt++:(n=a,0===Gt&&ti(U));93===t.charCodeAt(Mt)?(n=c,Mt++):(n=a,0===Gt&&ti(Y)),n!==a?(Wt=e,e=qe(i)):(Mt=e,e=a)}else Mt=e,e=a;return e}(),n!==a){for(o=[],s=ni();s!==a;)o.push(s),s=ni();r=n=[n,o]}else Mt=r,r=a;i=r!==a?t.substring(i,Mt):r;i!==a&&(Wt=e,i=Je(i));return e=i,e}(),n!==a?(Wt=e,e=ze(n)):(Mt=e,e=a),e}function ni(){var e,t,i,r;if(e=Mt,(t=Li())!==a?(i=Mt,Gt++,r=si(),Gt--,r===a?i=void 0:(Mt=i,i=a),i!==a?e=t=[t,i]:(Mt=e,e=a)):(Mt=e,e=a),e===a)if(e=[],(t=Bi())!==a)for(;t!==a;)e.push(t),t=Bi();else e=a;return e}function oi(){var e,i,r;return e=Mt,(i=si())!==a?(r=function(){var e,t,i;e=Mt,t=[],i=hi(),i===a&&(i=yi())===a&&(i=bi())===a&&(i=ui())===a&&(i=gi());for(;i!==a;)t.push(i),(i=hi())===a&&(i=yi())===a&&(i=bi())===a&&(i=ui())===a&&(i=gi());return Wt=e,t=et(t),e=t,e}(),Wt=e,e=Ge(i,r)):(Mt=e,e=a),e===a&&(e=Mt,i=Mt,r=function(){var e,i;Gt++,e=[],t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee));for(;i!==a;)e.push(i),t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee));Gt--,i=a,0===Gt&&ti(Ie);return e}(),i=t.substring(i,Mt),Wt=e,e=i=Ue(i)),e}function si(){var e,i,r,n,o,s;return e=Mt,91===t.charCodeAt(Mt)?(i=u,Mt++):(i=a,0===Gt&&ti(Q)),i!==a?(r=function(){var e,i,r;e=Mt,i=[],46===t.charCodeAt(Mt)?(r=O,Mt++):(r=a,0===Gt&&ti(_e));if(r!==a)for(;r!==a;)i.push(r),46===t.charCodeAt(Mt)?(r=O,Mt++):(r=a,0===Gt&&ti(_e));else i=a;i!==a&&(Wt=e,i=Kt(i));return e=i,e}(),r!==a?(n=Ci(),o=function(){var e,t,i;e=Mt,t=li(),t===a&&(t=ci());t===a&&(t=null);i=li(),i===a&&(i=ci());i===a&&(i=null);return Wt=e,e=Qe(t,i),e}(),93===t.charCodeAt(Mt)?(s=c,Mt++):(s=a,0===Gt&&ti(Y)),s!==a?(Wt=e,e=Ye(r,n,o)):(Mt=e,e=a)):(Mt=e,e=a)):(Mt=e,e=a),e}function li(){var e,i,r;return e=Mt,58===t.charCodeAt(Mt)?(i=p,Mt++):(i=a,0===Gt&&ti(X)),i!==a?(r=Ci(),Wt=e,e=Xe(r)):(Mt=e,e=a),e}function ci(){var e,i,r;return e=Mt,38===t.charCodeAt(Mt)?(i=d,Mt++):(i=a,0===Gt&&ti(Z)),i!==a?(r=Ci(),Wt=e,e=Ze(r)):(Mt=e,e=a),e}function ui(){var e,t,i,r,n;if(e=Mt,t=Mt,(i=di())!==a){for(r=[],n=pi();n!==a;)r.push(n),n=pi();t=i=[i,r]}else Mt=t,t=a;return t!==a&&(Wt=e,t=tt(t)),e=t}function pi(){var e,t;return e=Mt,(t=di())!==a&&(Wt=e,t=it(t)),e=t}function di(){var e,i;return e=Mt,i=function(){var e,i,r,n;e=Mt,t.substr(Mt,4)===k?(i=k,Mt+=4):(i=a,0===Gt&&ti(ue));i!==a&&(r=Ai())!==a?(n=function(){var e;93===t.charCodeAt(Mt)?(e=c,Mt++):(e=a,0===Gt&&ti(Y));return e}(),n!==a?(Wt=e,e=xt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r,n;e=Mt,t.substr(Mt,2)===B?(i=B,Mt+=2):(i=a,0===Gt&&ti(he));i!==a&&(r=ki())!==a&&(n=Ai())!==a&&wi()!==a?(Wt=e,e=At(r,n)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r,n;e=Mt,91===t.charCodeAt(Mt)?(i=u,Mt++):(i=a,0===Gt&&ti(Q));if(i!==a){if(r=[],35===t.charCodeAt(Mt)?(n=w,Mt++):(n=a,0===Gt&&ti(pe)),n!==a)for(;n!==a;)r.push(n),35===t.charCodeAt(Mt)?(n=w,Mt++):(n=a,0===Gt&&ti(pe));else r=a;r!==a?(n=xi(),wi()!==a?(Wt=e,e=kt(r,n)):(Mt=e,e=a)):(Mt=e,e=a)}else Mt=e,e=a;return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===C?(i=C,Mt+=2):(i=a,0===Gt&&ti(de));i!==a?(r=xi(),wi()!==a?(Wt=e,e=wt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===A?(i=A,Mt+=2):(i=a,0===Gt&&ti(ge));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Ct(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===_?(i=_,Mt+=2):(i=a,0===Gt&&ti(me));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Bt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===S?(i=S,Mt+=2):(i=a,0===Gt&&ti(ye));i!==a?(r=xi(),wi()!==a?(Wt=e,e=_t(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===P?(i=P,Mt+=2):(i=a,0===Gt&&ti(fe));i!==a?(r=xi(),wi()!==a?(Wt=e,e=St(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===V?(i=V,Mt+=2):(i=a,0===Gt&&ti(xe));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Et(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===N?(i=N,Mt+=2):(i=a,0===Gt&&ti(ke));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Vt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===E?(i=E,Mt+=2):(i=a,0===Gt&&ti(ve));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Lt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===I?(i=I,Mt+=2):(i=a,0===Gt&&ti(be));i!==a?(r=xi(),wi()!==a?(Wt=e,e=Pt(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r;e=Mt,t.substr(Mt,2)===L?(i=L,Mt+=2):(i=a,0===Gt&&ti(Te));i!==a?(r=xi(),wi()!==a?(Wt=e,e=It(r)):(Mt=e,e=a)):(Mt=e,e=a);return e}(),i===a&&(i=function(){var e,i,r,n;e=Mt,t.substr(Mt,2)===F?(i=F,Mt+=2):(i=a,0===Gt&&ti(we));i!==a&&(r=ki())!==a&&(n=Ai())!==a&&wi()!==a?(Wt=e,e=Nt(r,n)):(Mt=e,e=a);return e}()))))))))))))),i!==a&&(Wt=e,i=rt(i)),e=i}function gi(){var e,i;return e=Mt,t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee)),i!==a&&(Wt=e,i=at(i)),e=i}function hi(){var e;return(e=function(){var e,t,i,r,n;e=Mt,t=Mt,(i=Li())!==a&&(r=mi())!==a&&(n=Ei())!==a?t=i=[i,r,n]:(Mt=t,t=a);t!==a&&(Wt=e,t=ot(t));return e=t,e}())===a&&(e=function(){var e,i,r,n,o;e=Mt,i=Mt,(r=Li())!==a?(n=function(){var e,i,r,n,o,s;t.substr(Mt,4)===g?(e=g,Mt+=4):(e=a,0===Gt&&ti(te));if(e===a)if(e=Mt,t.substr(Mt,4)===h?(i=h,Mt+=4):(i=a,0===Gt&&ti(ie)),i!==a){if(r=[],(n=Vi())!==a)for(;n!==a;)r.push(n),n=Vi();else r=a;if(r!==a)if(t.substr(Mt,4)===m?(n=m,Mt+=4):(n=a,0===Gt&&ti(re)),n!==a){if(o=[],(s=Vi())!==a)for(;s!==a;)o.push(s),s=Vi();else o=a;o!==a?(t.substr(Mt,4)===h?(s=h,Mt+=4):(s=a,0===Gt&&ti(ie)),s!==a?e=i=[i,r,n,o,s]:(Mt=e,e=a)):(Mt=e,e=a)}else Mt=e,e=a;else Mt=e,e=a}else Mt=e,e=a;return e}(),n!==a&&(o=Ei())!==a?i=r=[r,n,o]:(Mt=i,i=a)):(Mt=i,i=a);i!==a&&(Wt=e,i=nt(i));return e=i,e}()),e}function mi(){var e,i,r,n,o,s;if(t.substr(Mt,4)===y?(e=y,Mt+=4):(e=a,0===Gt&&ti(ae)),e===a)if(e=Mt,t.substr(Mt,4)===h?(i=h,Mt+=4):(i=a,0===Gt&&ti(ie)),i!==a){if(r=[],(n=Vi())!==a)for(;n!==a;)r.push(n),n=Vi();else r=a;if(r!==a)if(t.substr(Mt,6)===f?(n=f,Mt+=6):(n=a,0===Gt&&ti(ne)),n!==a){if(o=[],(s=Vi())!==a)for(;s!==a;)o.push(s),s=Vi();else o=a;o!==a?(t.substr(Mt,4)===h?(s=h,Mt+=4):(s=a,0===Gt&&ti(ie)),s!==a?e=i=[i,r,n,o,s]:(Mt=e,e=a)):(Mt=e,e=a)}else Mt=e,e=a;else Mt=e,e=a}else Mt=e,e=a;return e}function yi(){var e,i,r,n,o;if(e=Mt,i=Mt,r=function(){var e,i,r,n,o,s;e=Mt,i=Li(),i!==a?(r=Mt,Gt++,n=Mt,t.substr(Mt,4)===h?(o=h,Mt+=4):(o=a,0===Gt&&ti(ie)),o!==a&&(s=Ei())!==a?n=o=[o,s]:(Mt=n,n=a),Gt--,n!==a?(Mt=r,r=void 0):r=a,r!==a?(Wt=e,e=lt()):(Mt=e,e=a)):(Mt=e,e=a);return e}(),r!==a){for(n=[],o=fi();o!==a;)n.push(o),o=fi();o=function(){var e,t,i,r,n;e=Mt,t=Mt,i=mi(),i===a&&(i=null);r=Mt,Gt++,n=Fi(),Gt--,n!==a?(Mt=r,r=void 0):r=a;r!==a?t=i=[i,r]:(Mt=t,t=a);t!==a&&(Wt=e,t=ct());return e=t,e}(),o!==a?i=r=[r,n,o]:(Mt=i,i=a)}else Mt=i,i=a;return i!==a&&(Wt=e,i=st(i)),e=i}function fi(){var e,i;return e=Mt,i=function(){var e,i,r,n;e=Mt,i=Mt,t.substr(Mt,4)===h?(r=h,Mt+=4):(r=a,0===Gt&&ti(ie));r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a);i===a&&(i=Mt,t.substr(Mt,2)===b?(r=b,Mt+=2):(r=a,0===Gt&&ti(oe)),r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a),i===a&&(i=Mt,t.substr(Mt,2)===T?(r=T,Mt+=2):(r=a,0===Gt&&ti(se)),r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a),i===a&&(i=function(){var e,i,r,n,o,s;e=Mt,i=Mt,Gt++,r=Mt,n=mi(),n!==a&&(o=Fi())!==a?r=n=[n,o]:(Mt=r,r=a);Gt--,r===a?i=void 0:(Mt=i,i=a);if(i!==a){if(r=Mt,n=Mt,o=_i(),(s=Li())!==a?n=o=[o,s]:(Mt=n,n=a),n===a){if(n=Mt,o=[],(s=Bi())!==a)for(;s!==a;)o.push(s),s=Bi();else o=a;o!==a&&(s=Ni())!==a?n=o=[o,s]:(Mt=n,n=a)}(r=n!==a?t.substring(r,Mt):n)!==a?(Wt=e,e=dt(r)):(Mt=e,e=a)}else Mt=e,e=a;return e}())));i!==a&&(Wt=e,i=pt(i));return e=i,e}(),i!==a&&(Wt=e,i=ut(i)),e=i}function bi(){var e,i,r,n,o;if(e=Mt,i=Mt,r=function(){var e,i,r,n,o,s;e=Mt,i=Li(),i!==a?(r=Mt,Gt++,n=Mt,t.substr(Mt,3)===v?(o=v,Mt+=3):(o=a,0===Gt&&ti(le)),o!==a&&(s=Ei())!==a?n=o=[o,s]:(Mt=n,n=a),Gt--,n!==a?(Mt=r,r=void 0):r=a,r!==a?(Wt=e,e=ht()):(Mt=e,e=a)):(Mt=e,e=a);return e}(),r!==a){for(n=[],o=Ti();o!==a;)n.push(o),o=Ti();o=function(){var e,t,i,r,n;e=Mt,t=Mt,i=mi(),i===a&&(i=null);r=Mt,Gt++,n=Fi(),Gt--,n!==a?(Mt=r,r=void 0):r=a;r!==a?t=i=[i,r]:(Mt=t,t=a);t!==a&&(Wt=e,t=mt());return e=t,e}(),o!==a?i=r=[r,n,o]:(Mt=i,i=a)}else Mt=i,i=a;return i!==a&&(Wt=e,i=gt(i)),e=i}function Ti(){var e,i;return e=Mt,i=function(){var e,i,r,n;e=Mt,i=Mt,t.substr(Mt,3)===v?(r=v,Mt+=3):(r=a,0===Gt&&ti(le));r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a);i===a&&(i=Mt,t.substr(Mt,2)===x?(r=x,Mt+=2):(r=a,0===Gt&&ti(ce)),r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a),i===a&&(i=Mt,t.substr(Mt,2)===b?(r=b,Mt+=2):(r=a,0===Gt&&ti(oe)),r!==a?((n=Ei())===a&&(n=Fi()),n!==a?i=r=[r,n]:(Mt=i,i=a)):(Mt=i,i=a),i===a&&(i=function(){var e,i,r,n,o,s;e=Mt,i=Mt,Gt++,r=Mt,n=mi(),n!==a&&(o=Fi())!==a?r=n=[n,o]:(Mt=r,r=a);Gt--,r===a?i=void 0:(Mt=i,i=a);if(i!==a){if(r=Mt,n=Mt,o=_i(),(s=Li())!==a?n=o=[o,s]:(Mt=n,n=a),n===a){if(n=Mt,o=[],(s=Bi())!==a)for(;s!==a;)o.push(s),s=Bi();else o=a;o!==a&&(s=Ni())!==a?n=o=[o,s]:(Mt=n,n=a)}(r=n!==a?t.substring(r,Mt):n)!==a?(Wt=e,e=bt(r)):(Mt=e,e=a)}else Mt=e,e=a;return e}())));i!==a&&(Wt=e,i=ft(i));return e=i,e}(),i!==a&&(Wt=e,i=yt(i)),e=i}function vi(){var e,i;return e=Mt,t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee)),i!==a&&(Wt=e,i=vt(i)),e=i}function xi(){var e,i,r,n;for(e=Mt,i=Mt,r=[],t.substr(Mt,2)===R?(n=R,Mt+=2):(n=a,0===Gt&&ti(Ce)),n===a&&(n=t.charAt(Mt),M.test(n)?Mt++:(n=a,0===Gt&&ti(U)));n!==a;)r.push(n),t.substr(Mt,2)===R?(n=R,Mt+=2):(n=a,0===Gt&&ti(Ce)),n===a&&(n=t.charAt(Mt),M.test(n)?Mt++:(n=a,0===Gt&&ti(U)));return i=t.substring(i,Mt),Wt=e,e=i=Ft(i)}function ki(){var e,i,r,n,o;if(e=Mt,i=Mt,Gt++,t.substr(Mt,3)===K?(r=K,Mt+=3):(r=a,0===Gt&&ti(Ae)),Gt--,r===a?i=void 0:(Mt=i,i=a),i!==a){for(r=Mt,n=[],o=t.charAt(Mt),j.test(o)?Mt++:(o=a,0===Gt&&ti(Be));o!==a;)n.push(o),o=t.charAt(Mt),j.test(o)?Mt++:(o=a,0===Gt&&ti(Be));r=t.substring(r,Mt),Wt=e,e=Rt(r)}else Mt=e,e=a;return e}function wi(){var e,i,r;if(93===t.charCodeAt(Mt)?(e=c,Mt++):(e=a,0===Gt&&ti(Y)),e===a){for(e=Mt,i=[],r=Vi();r!==a;)i.push(r),r=Vi();(r=Ri())!==a?e=i=[i,r]:(Mt=e,e=a)}return e}function Ci(){var e,i,r,n;for(e=Mt,i=Mt,r=[],n=t.charAt(Mt),W.test(n)?Mt++:(n=a,0===Gt&&ti(Se));n!==a;)r.push(n),n=t.charAt(Mt),W.test(n)?Mt++:(n=a,0===Gt&&ti(Se));return i=t.substring(i,Mt),Wt=e,e=i=Ot(i)}function Ai(){var e,i,r;return e=Mt,58===t.charCodeAt(Mt)?(i=p,Mt++):(i=a,0===Gt&&ti(X)),i!==a?(r=xi(),Wt=e,e=Dt(r)):(Mt=e,e=a),e===a&&(i="",Wt=e=Mt,e=i=$t()),e}function Bi(){var e;return Gt++,e=t.charAt(Mt),J.test(e)?Mt++:(e=a,0===Gt&&ti(Ee)),Gt--,e===a&&(0===Gt&&ti(Le)),e}function _i(){var e,t;for(Gt++,e=[],t=Bi();t!==a;)e.push(t),t=Bi();return Gt--,t=a,0===Gt&&ti(Ve),e}function Ii(){var e,i,r;for(Gt++,e=Mt,i=[],r=t.charAt(Mt),z.test(r)?Mt++:(r=a,0===Gt&&ti(Pe));r!==a;)i.push(r),r=t.charAt(Mt),z.test(r)?Mt++:(r=a,0===Gt&&ti(Pe));return(r=Li())!==a?e=i=[i,r]:(Mt=e,e=a),Gt--,e===a&&(i=a,0===Gt&&ti(Ne)),e}function Li(){var e;return Gt++,10===t.charCodeAt(Mt)?(e=D,Mt++):(e=a,0===Gt&&ti(Re)),e===a&&(t.substr(Mt,2)===$?(e=$,Mt+=2):(e=a,0===Gt&&ti(Ke)),e===a&&(e=t.charAt(Mt),q.test(e)?Mt++:(e=a,0===Gt&&ti(Oe)))),Gt--,e===a&&(0===Gt&&ti(Fe)),e}function Ei(){var e,i,r;for(Gt++,e=Mt,i=[],r=t.charAt(Mt),z.test(r)?Mt++:(r=a,0===Gt&&ti(Pe));r!==a;)i.push(r),r=t.charAt(Mt),z.test(r)?Mt++:(r=a,0===Gt&&ti(Pe));return(r=Li())!==a?e=i=[i,r]:(Mt=e,e=a),Gt--,e===a&&(i=a,0===Gt&&ti(De)),e}function Vi(){var e;return Gt++,e=t.charAt(Mt),H.test(e)?Mt++:(e=a,0===Gt&&ti(Me)),Gt--,e===a&&(0===Gt&&ti($e)),e}function Ni(){var e,i;return(e=Li())===a&&(e=Mt,Gt++,t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee)),Gt--,i===a?e=void 0:(Mt=e,e=a)),e}function Fi(){var e,i;return(e=Ei())===a&&(e=Mt,Gt++,t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee)),Gt--,i===a?e=void 0:(Mt=e,e=a)),e}function Ri(){var e,i;return e=Mt,Gt++,t.length>Mt?(i=t.charAt(Mt),Mt++):(i=a,0===Gt&&ti(ee)),Gt--,i===a?e=void 0:(Mt=e,e=a),e}const Ki=new zt({parse:e,parserText:Ut,parserLocation:Di}),Oi=new Si({parse:e,parserText:Ut,parserLocation:Di});function Di(){const e=ei(Wt,Mt);return e?(delete e.source,e):e}function ei(e,t,i){var r=Zt(e),a=Zt(t),o={source:n,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return n&&"function"==typeof n.offset&&(o.start=n.offset(o.start),o.end=n.offset(o.end)),o}if(r=s(),i.peg$library)return{peg$result:r,peg$currPos:Mt,peg$FAILED:a,peg$maxFailExpected:Ht,peg$maxFailPos:qt};if(r!==a&&Mt===t.length)return r;throw r!==a&&Mt<t.length&&ti({type:"end"}),ii(Ht,qt<t.length?t.charAt(qt):null,qt<t.length?ei(qt,qt+1):ei(qt,qt))},Ei=class{constructor(){p(this,"jsonParser",new Dt)}toAst(e,t){return Li(e)}},Vi=(0,Bt.superenum)({string:"string",file:"file"}),Ni=(0,Bt.superenum)({bitmark:"bitmark",json:"json",ast:"ast"}),Fi=class{constructor(){p(this,"ast",new xe),p(this,"jsonParser",new Dt),p(this,"bitmarkParser",new Ei),p(this,"textParser",new mt),p(this,"textGenerator",new ot),p(this,"jsonStringifyPrettify",(e,t,i)=>{const r=!0===t.prettify?2:t.prettify||void 0;return i||!0===t.stringify||void 0!==r?JSON.stringify(e,null,r):e})}version(){return de.appVersion.full}info(e){const t=Object.assign({},e),i=new Nt;let r;const a=!t.outputFormat||t.outputFormat===Rt.text,n=t.outputFormat===Rt.json,o=t.type===Kt.all,s=t.type===Kt.deprecated,l=o||!s,c=o||s;if(t.type===Kt.bit){const e=i.getSupportedBitConfigs().filter(e=>{if(!t.bit)return!0;return ae.getBitType(t.bit)===e.bitType});r=a?e.map(e=>e.toString({includeChains:!0,includeConfigs:!0})).join("\n\n--------------\n\n"):e}else{const e=i.getSupportedBits({includeNonDeprecated:l,includeDeprecated:c}).filter(e=>{if(!t.bit)return!0;const i=ae.getBitType(t.bit);return e.name===i||void 0});r=a?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;r=JSON.stringify(r,null,e)}return r}async convert(e,t){let i;const r=Object.assign({},t),a=Object.assign({},r.jsonOptions),n=r.outputFormat,o=n===Ni.bitmark,s=n===Ni.json,l=n===Ni.ast,c=Ft.peggy;let u=e;if(de.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==Vi.file||de.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));let p=this.ast.preprocessAst(u);const d=!!p;d||(p=this.jsonParser.toAst(u));const g=async e=>{i=this.bitmarkParser.toAst(e,{parserType:c})},h=async e=>{if(c===Ft.peggy)if(p=this.bitmarkParser.toAst(e,{parserType:c}),r.outputFile){const e=new JsonFileGenerator(r.outputFile,r);await e.generate(p)}else{const e=new Vt(r),t=await e.generate(p);i=this.jsonStringifyPrettify(t,a)}},m=async e=>{if(r.outputFile){const t=new BitmarkFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new It(r);i=await t.generate(e)}},y=async e=>{i=this.jsonStringifyPrettify(e,a)},f=async e=>{if(r.outputFile){const t=new JsonFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new Vt(r),n=await t.generate(e);i=this.jsonStringifyPrettify(n,a)}},b=async e=>{i=this.jsonStringifyPrettify(e,a)};return!!!p?.bits&&!d?o?await(async e=>{await g(e),await m(i)})(u):l?await g(u):await h(u):d?l?await y(p):s?await f(p):await m(p):s?await(async e=>{await f(e)})(p):l?await b(p):await(async e=>{if(r.outputFile){const t=new BitmarkFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new It(r);i=await t.generate(e)}})(p),i}async upgrade(e,t){let i;const r=Object.assign({},t),a=Object.assign({},r.jsonOptions),n=r.bitmarkParserType;let o=e;if(de.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==Vi.file||de.isNode&&fs.existsSync(o)&&(o=fs.readFileSync(o,{encoding:"utf8"}));let s=this.jsonParser.toAst(o);const l=async e=>{const t=this.bitmarkParser.toAst(e,{parserType:n});if(r.outputFile){const e=new BitmarkFileGenerator(r.outputFile,r);await e.generate(t)}else{const e=new It(r);i=await e.generate(t)}},c=async e=>{if(r.outputFile){const t=new JsonFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new Vt(r),n=await t.generate(e);i=this.jsonStringifyPrettify(n,a)}};return!!!s?.bits?await l(o):await c(s),i}createAst(e,t){let i,r=e;const a=Object.assign({},t);a.inputFormat&&a.inputFormat!==Vi.file||de.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let n=this.ast.preprocessAst(r);const o=!!n;o||(n=this.jsonParser.toAst(r));return i=!!!n?.bits&&!o?this.bitmarkParser.toAst(r):n,i}async convertText(e,t){let i,r;const a=Object.assign({},t),n=Object.assign({},a.fileOptions),o=Object.assign({},a.jsonOptions),s=TextFormat.fromValue(a.textFormat)??TextFormat.bitmarkText,l=a.textLocation??TextLocation.body;let c=e;if(de.isBrowser&&a.outputFile)throw new Error("Cannot write to file in browser environment");a.inputFormat&&a.inputFormat!==Vi.file||de.isNode&&fs.existsSync(c)&&(c=fs.readFileSync(c,{encoding:"utf8"}));const u=this.textParser.preprocessAst(c),p=!!u;if(r=p?await this.textGenerator.generate(u,s,l):this.textParser.toAst(c,{format:s,location:TextLocation.body}),a.outputFile){const e=a.outputFile.toString();let t=r;p||(t=this.jsonStringifyPrettify(r,o,!0));const i=n.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,t,{flag:i})}else i=p?r:this.jsonStringifyPrettify(r,o);return i}breakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),a=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,n=i.textLocation??TextLocation.body;let o=e;if(de.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==Vi.file||de.isNode&&fs.existsSync(o)&&(o=fs.readFileSync(o,{encoding:"utf8"}));const s=Breakscape.breakscape(o,{format:a,location:n});if(!i.outputFile)return s;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,s,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),a=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,n=i.textLocation??TextLocation.body;let o=e;if(de.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==Vi.file||de.isNode&&fs.existsSync(o)&&(o=fs.readFileSync(o,{encoding:"utf8"}));const s=Breakscape.unbreakscape(o,{format:a,location:n});if(!i.outputFile)return s;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,s,{flag:t})}}supportedBitsAsString(e){let t="";for(const i of e)t+=`${i.name} (since: ${i.since}`,i.deprecated&&(t+=`, deprecated: ${i.deprecated}`),t+=")\n";return t}},Ri=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new At,this.generator=new Et(this.writer,e)}async generate(e){return await this.generator.generate(e),this.writer.getString()}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}};me()}},t={};var i=function i(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}(855);return i})());
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={855:e=>{var t,i,r=Object.create,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t,i,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of n(t))l.call(e,s)||s===i||o(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,i)=>(i=null!=e?r(s(e)):{},c(!t&&e&&e.__esModule?i:o(i,"default",{value:e,enumerable:!0}),e)),p=(e,t,i)=>((e,t,i)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),u=(t={"node_modules/@ncoderz/superenum/dist/cjs/superenum.js"(e){function t(e,t){var i;const r=Object.freeze,o=Object.defineProperty,a=Object.assign,n={enumerable:!1},s=new Map,l=new Map,c=new Map,d=new Map,p=new Map,u=(null!==(i=null==t?void 0:t.iterationKeys)&&void 0!==i?i:Object.keys(e)).map(e=>`${e}`);for(const[t,i]of Object.entries(e))s.set(t,i),c.set(t.toLowerCase(),i);for(const[e,t]of s){const i="string"==typeof t?t.toLowerCase():t;l.set(t,e),d.set(i,e)}const h=u.map(e=>s.get(e)),m=u.map(e=>[e,s.get(e)]);return(t=>{let i=e;function g(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(d.get(e.toLowerCase())):l.has(e)?e:void 0}Object.isExtensible(e)||(i=a({},e)),o(i,"fromKey",a({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):s.get(`${e}`)}},n)),o(i,"fromValue",a({value:g},n)),o(i,"keyFromValue",a({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?d.get(e.toLowerCase()):l.get(e)}},n)),o(i,"setMetadata",a({value:function(e,t,i){const r=g(e);null!=r&&p.set(r,t)}},n)),o(i,"getMetadata",a({value:function(e,t){return p.get(e)}},n)),o(i,Symbol.iterator,a({value:function(){let e=0;return{next:()=>e<u.length?{value:s.get(`${u[e++]}`),done:!1}:{done:!0}}}},n)),o(i,"values",a({value:()=>h},n)),o(i,"keys",a({value:()=>u},n)),o(i,"entries",a({value:()=>m},n));let b=i;return(null==t?void 0:t.noFreeze)||(b=r(i),r(u),r(h),r(m)),b})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.superenum=void 0;var i=t;e.superenum=i,i.fromObject=t,i.fromArray=function(e,i){Array.isArray(e)||(e=[]);const r=e.reduce((e,t)=>(e[`${t}`]=t,e),{});return(!i||i&&!i.iterationKeys)&&((i=Object.assign({},i)).iterationKeys=e),t(r,i)}}},function(){return i||(0,t[n(t)[0]])((i={exports:{}}).exports,i),i.exports}),h={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(h,{Ast:()=>ue,BitType:()=>m,BitmarkGenerator:()=>kt,BitmarkParser:()=>vi,BitmarkParserGenerator:()=>wi,BitmarkParserType:()=>Ct,BitmarkStringGenerator:()=>Tt,BitmarkVersion:()=>Fe,BodyTextFormat:()=>me,Builder:()=>mt,CardSetVersion:()=>ft,InfoFormat:()=>At,InfoType:()=>Bt,Input:()=>xi,JsonGenerator:()=>xt,JsonParser:()=>Pt,JsonStringGenerator:()=>Ci,NodeType:()=>pe,Output:()=>_i,ResourceBuilder:()=>ht,StringWriter:()=>gt,bitmarkTextParse:()=>ot}),e.exports=(e=>c(o({},"__esModule",{value:!0}),e))(h);var m=(0,d(u(),1).superenum)({_error:"_error",_comment:"_comment",_standard:"_standard",aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appBitmarkFromJavascript:"app-bitmark-from-javascript",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcards:"app-flashcards",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",appLink:"app-link",article:"article",articleAi:"article-ai",articleAlt:"article-alt",articleAttachment:"article-attachment",articleEmbed:"article-embed",articleLink:"article-link",articleResponsive:"article-responsive",articleResponsiveAlt:"article-responsive-alt",assignment:"assignment",assignmentList:"assignment-list",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",audioTranscript:"audio-transcript",bitAlias:"bit-alias",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",book:"book",bookAcknowledgements:"book-acknowledgements",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAlias:"book-alias",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookClose:"book-close",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookCover:"book-cover",bookDedication:"book-dedication",bookDiff:"book-diff",bookEnd:"book-end",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",bookReference:"book-reference",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",botActionResponse:"bot-action-response",botActionSave:"bot-action-save",botActionSend:"bot-action-send",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",browserImage:"browser-image",bug:"bug",bugAlt:"bug-alt",bugCollapsible:"bug-collapsible",buttonCopyText:"button-copy-text",callToAction:"call-to-action",callToActionBookNow:"call-to-action-book-now",callToActionContact:"call-to-action-contact",callToActionCreateAccount:"call-to-action-create-account",callToActionDownload:"call-to-action-download",callToActionGetNow:"call-to-action-get-now",callToActionGetOffer:"call-to-action-get-offer",callToActionJoin:"call-to-action-join",callToActionLearnMore:"call-to-action-learn-more",callToActionMail:"call-to-action-mail",callToActionSeeMore:"call-to-action-see-more",callToActionShopNow:"call-to-action-shop-now",callToActionStartNow:"call-to-action-start-now",callToActionSubscribe:"call-to-action-subscribe",callToActionWatch:"call-to-action-watch",card1:"card-1",chapter:"chapter",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",clozeInstructionGrouped:"cloze-instruction-grouped",clozeList:"cloze-list",clozeSeveral:"cloze-several",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",code:"code",codeRuntime:"code-runtime",collapsible:"collapsible",conclusion:"conclusion",conclusionAlt:"conclusion-alt",consoleLog:"console-log",container:"container",containerAccordionTabs:"container-accordion-tabs",containerBits2:"container-bits-2",containerCards:"container-cards",containerCarousel:"container-carousel",containerCookRecipe:"container-cook-recipe",containerFolder:"container-folder",containerFolderAll:"container-folder-all",containerGallery:"container-gallery",containerGrid:"container-grid",containerGroup:"container-group",containerNewsArticle:"container-news-article",containerNowrap:"container-nowrap",containerNowrapStretch:"container-nowrap-stretch",containerPreview:"container-preview",containerScroller:"container-scroller",containerSlides:"container-slides",containerStack:"container-stack",containerTabs:"container-tabs",containerWrap:"container-wrap",conversationLeft1:"conversation-left-1",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",clozeAndMultipleChoiceTextConversationLeft1:"cloze-and-multiple-choice-text-conversation-left-1",clozeAndMultipleChoiceTextConversationLeft1Scream:"cloze-and-multiple-choice-text-conversation-left-1-scream",clozeAndMultipleChoiceTextConversationLeft1Thought:"cloze-and-multiple-choice-text-conversation-left-1-thought",clozeAndMultipleChoiceTextConversationRight1:"cloze-and-multiple-choice-text-conversation-right-1",clozeAndMultipleChoiceTextConversationRight1Scream:"cloze-and-multiple-choice-text-conversation-right-1-scream",clozeAndMultipleChoiceTextConversationRight1Thought:"cloze-and-multiple-choice-text-conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookNoteOnQuantity:"cook-note-on-quantity",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",dangerAlt:"danger-alt",dangerCollapsible:"danger-collapsible",definitionList:"definition-list",definitionTerm:"definition-term",deleted:"deleted",details:"details",details1:"details-1",detailsImage:"details-image",diff:"diff",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",essay:"essay",example:"example",exampleAlt:"example-alt",exampleCollapsible:"example-collapsible",exampleList:"example-list",extractorAiChat:"extractor-ai-chat",extractorBlock:"extractor-block",extractorConfiguration:"extractor-configuration",extractorInformation:"extractor-information",extractorPage:"extractor-page",extractorPageCollapsible:"extractor-page-collapsible",extractorPageFooter:"extractor-page-footer",extractorPageFooterCollapsible:"extractor-page-footer-collapsible",extractorPageHeader:"extractor-page-header",extractorPageHeaderCollapsible:"extractor-page-header-collapsible",extractorPageNumber:"extractor-page-number",extractorPageNumberCollapsible:"extractor-page-number-collapsible",extractorPageWithBlocks:"extractor-page-with-blocks",extractorPageWithBlocksCollapsible:"extractor-page-with-blocks-collapsible",extractorRepeatedText:"extractor-repeated-text",featured:"featured",feedback:"feedback",figure:"figure",flashcard:"flashcard",flashcard1:"flashcard-1",focusImage:"focus-image",footNote:"foot-note",formula:"formula",gapText:"gap-text",gapTextInstructionGrouped:"gap-text-instruction-grouped",glossaryTerm:"glossary-term",groupBorn:"group-born",groupDied:"group-died",handInAudio:"hand-in-audio",handInContact:"hand-in-contact",handInDocument:"hand-in-document",handInFeedbackExpert:"hand-in-feedback-expert",handInFeedbackSelf:"hand-in-feedback-self",handInFile:"hand-in-file",handInLocation:"hand-in-location",handInPhoto:"hand-in-photo",handInScan:"hand-in-scan",handInSubmit:"hand-in-submit",handInVideo:"hand-in-video",handInVoice:"hand-in-voice",help:"help",helpAlt:"help-alt",highlightText:"highlight-text",hint:"hint",hintAlt:"hint-alt",hintCollapsible:"hint-collapsible",image:"image",imageBanner:"image-banner",imageFigure:"image-figure",imageFigureAlt:"image-figure-alt",imageLandscape:"image-landscape",imageLink:"image-link",imageMood:"image-mood",imageOnDevice:"image-on-device",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageResponsive:"image-responsive",imageScreenshot:"image-screenshot",imageSeparator:"image-separator",imageSeparatorAlt:"image-separator-alt",imagesLogoGrave:"images-logo-grave",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",indexTerm:"index-term",info:"info",infoAlt:"info-alt",infoCollapsible:"info-collapsible",internalLink:"internal-link",interview:"interview",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",learningDocumentationFeedback:"learning-documentation-feedback",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",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",leAssignment:"le-assignment",leClassroomEvent:"le-classroom-event",leCompletion:"le-completion",leExternalLink:"le-external-link",leFinishingTask:"le-finishing-task",leFollowUpTask:"le-follow-up-task",leMultiDayEvent:"le-multi-day-event",legend:"legend",leDocumentDownload:"le-document-download",leLearningObjectives:"le-learning-objectives",leLearningStep:"le-learning-step",leListenAudioEmbed:"le-listen-audio-embed",lePreparationTask:"le-preparation-task",leRead:"le-read",leReadBook:"le-read-book",leTask:"le-task",leTodo:"le-todo",leVideoCall:"le-video-call",leWatchVideoEmbed:"le-watch-video-embed",lifeSkillSticker:"life-skill-sticker",list:"list",listItem:"list-item",mark:"mark",match:"match",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",metalevelExplanation:"metalevel-explanation",metaSearchDefaultTerms:"meta-search-default-terms",metaSearchDefaultTopics:"meta-search-default-topics",milestone:"milestone",module:"module",moduleProduct:"module-product",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",noteAlt:"note-alt",notebookArticle:"notebook-article",noteCollapsible:"note-collapsible",output:"output",page:"page",pageAcademy:"page-academy",pageArticle:"page-article",pageArticleAlt:"page-article-alt",pageArticleResponsive:"page-article-responsive",pageBanner:"page-banner",pageBuyButton:"page-buy-button",pageBuyButtonAlt:"page-buy-button-alt",pageBuyButtonPromotion:"page-buy-button-promotion",pageCategory:"page-category",pageCollapsible:"page-collapsible",pageContainer:"page-container",pageContainerFolder:"page-container-folder",pageContainerGroup:"page-container-group",pageContainerNowrap:"page-container-nowrap",pageContainerNowrapStretch:"page-container-nowrap-stretch",pageContainerWrap:"page-container-wrap",pageCoverImage:"page-cover-image",pageFooter:"page-footer",pageHero:"page-hero",pageOpenBook:"page-open-book",pageOpenBookList:"page-open-book-list",pagePerson:"page-person",pageProduct:"page-product",pageProductList:"page-product-list",pageProductVideo:"page-product-video",pageProductVideoList:"page-product-video-list",pagePromotion:"page-promotion",pageSectionFolder:"page-section-folder",pageShopInShop:"page-shop-in-shop",pageSpecial:"page-special",pageSubpage:"page-subpage",pageSubscribe:"page-subscribe",parameters:"parameters",photo:"photo",platformPath:"platform-path",preparationNote:"preparation-note",pronunciationTable:"pronunciation-table",prototypeImages:"prototype-images",qAndA:"q-and-a",qAndACard:"q-and-a-card",question1:"question-1",quote:"quote",rating:"rating",recipe:"recipe",recordAudio:"record-audio",recordVideo:"record-video",releaseNote:"release-note",releaseNotesSummary:"release-notes-summary",remark:"remark",remarkAlt:"remark-alt",remarkCollapsible:"remark-collapsible",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewCustomerNote:"review-customer-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",sampleSolution:"sample-solution",scorm:"scorm",screenshot:"screenshot",selfAssessment:"self-assessment",separator:"separator",separatorAlt:"separator-alt",sequence:"sequence",sideNote:"side-note",sideNoteCollapsible:"side-note-collapsible",smartStandardArticleNonNormative:"smart-standard-article-non-normative",smartStandardArticleNonNormativeCollapsible:"smart-standard-article-non-normative-collapsible",smartStandardArticleNormative:"smart-standard-article-normative",smartStandardArticleNormativeCollapsible:"smart-standard-article-normative-collapsible",smartStandardExampleNonNormative:"smart-standard-example-non-normative",smartStandardExampleNonNormativeCollapsible:"smart-standard-example-non-normative-collapsible",smartStandardExampleNormative:"smart-standard-example-normative",smartStandardExampleNormativeCollapsible:"smart-standard-example-normative-collapsible",smartStandardFormula:"smart-standard-formula",smartStandardFormulaNonNormative:"smart-standard-formula-non-normative",smartStandardFormulaNormative:"smart-standard-formula-normative",smartStandardImageFigureNonNormative:"smart-standard-image-figure-non-normative",smartStandardImageFigureNonNormativeCollapsible:"smart-standard-image-figure-non-normative-collapsible",smartStandardImageFigureNormative:"smart-standard-image-figure-normative",smartStandardImageFigureNormativeCollapsible:"smart-standard-image-figure-normative-collapsible",smartStandardLegend:"smart-standard-legend",smartStandardLegendNonNormative:"smart-standard-legend-non-normative",smartStandardLegendNormative:"smart-standard-legend-normative",smartStandardList:"smart-standard-list",smartStandardListCollapsible:"smart-standard-list-collapsible",smartStandardListItem:"smart-standard-list-item",smartStandardListItemCollapsible:"smart-standard-list-item-collapsible",smartStandardNoteNonNormative:"smart-standard-note-non-normative",smartStandardNoteNonNormativeCollapsible:"smart-standard-note-non-normative-collapsible",smartStandardNoteNormative:"smart-standard-note-normative",smartStandardNoteNormativeCollapsible:"smart-standard-note-normative-collapsible",smartStandardRemarkLegend:"smart-standard-remark-legend",smartStandardRemarkLegendNonNormative:"smart-standard-remark-legend-non-normative",smartStandardRemarkLegendNormative:"smart-standard-remark-legend-normative",smartStandardRemarkFormula:"smart-standard-remark-formula",smartStandardRemarkFormulaNonNormative:"smart-standard-remark-formula-non-normative",smartStandardRemarkFormulaNormative:"smart-standard-remark-formula-normative",smartStandardRemarkNonNormative:"smart-standard-remark-non-normative",smartStandardRemarkNonNormativeCollapsible:"smart-standard-remark-non-normative-collapsible",smartStandardRemarkNormative:"smart-standard-remark-normative",smartStandardRemarkNormativeCollapsible:"smart-standard-remark-normative-collapsible",smartStandardRemarkTableImageNonNormative:"smart-standard-remark-table-image-non-normative",smartStandardRemarkTableImageNonNormativeCollapsible:"smart-standard-remark-table-image-non-normative-collapsible",smartStandardRemarkTableImageNormative:"smart-standard-remark-table-image-normative",smartStandardRemarkTableImageNormativeCollapsible:"smart-standard-remark-table-image-normative-collapsible",smartStandardRemarkTableNonNormative:"smart-standard-remark-table-non-normative",smartStandardRemarkTableNonNormativeCollapsible:"smart-standard-remark-table-non-normative-collapsible",smartStandardRemarkTableNormative:"smart-standard-remark-table-normative",smartStandardRemarkTableNormativeCollapsible:"smart-standard-remark-table-normative-collapsible",smartStandardTableImageNonNormative:"smart-standard-table-image-non-normative",smartStandardTableImageNonNormativeCollapsible:"smart-standard-table-image-non-normative-collapsible",smartStandardTableImageNormative:"smart-standard-table-image-normative",smartStandardTableImageNormativeCollapsible:"smart-standard-table-image-normative-collapsible",smartStandardTableNonNormative:"smart-standard-table-non-normative",smartStandardTableNonNormativeCollapsible:"smart-standard-table-non-normative-collapsible",smartStandardTableNormative:"smart-standard-table-normative",smartStandardTableNormativeCollapsible:"smart-standard-table-normative-collapsible",standardArticleNonNormative:"standard-article-non-normative",standardArticleNormative:"standard-article-normative",standardExampleNonNormative:"standard-example-non-normative",standardExampleNormative:"standard-example-normative",standardImageFigureNonNormative:"standard-image-figure-non-normative",standardImageFigureNormative:"standard-image-figure-normative",standardList:"standard-list",standardListItem:"standard-list-item",standardNoteNonNormative:"standard-note-non-normative",standardNoteNormative:"standard-note-normative",standardRemarkNonNormative:"standard-remark-non-normative",standardRemarkNormative:"standard-remark-normative",standardRemarkTableImageNonNormative:"standard-remark-table-image-non-normative",standardRemarkTableImageNormative:"standard-remark-table-image-normative",standardRemarkTableNonNormative:"standard-remark-table-non-normative",standardRemarkTableNormative:"standard-remark-table-normative",standardTableImageNonNormative:"standard-table-image-non-normative",standardTableImageNormative:"standard-table-image-normative",standardTableNonNormative:"standard-table-non-normative",standardTableNormative:"standard-table-normative",statement:"statement",stdout:"stdout",step:"step",stepImageScreenshot:"step-image-screenshot",stepImageScreenshotWithPointer:"step-image-screenshot-with-pointer",sticker:"sticker",stickyNote:"sticky-note",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",summary:"summary",summaryAi:"summary-ai",survey:"survey",survey1:"survey-1",surveyAnonymous:"survey-anonymous",surveyAnonymous1:"survey-anonymous-1",surveyMatrix:"survey-matrix",surveyMatrixMe:"survey-matrix-me",surveyRating:"survey-rating",surveyRatingDisplay:"survey-rating-display",surveyRatingOnce:"survey-rating-once",table:"table",tableAlt:"table-alt",tableImage:"table-image",tableImageAlt:"table-image-alt",takePicture:"take-picture",toc:"toc",tocChapter:"toc-chapter",tocInline:"toc-inline",tocResource:"toc-resource",tocContent:"toc-content",trueFalse:"true-false",trueFalse1:"true-false-1",vendorAmcharts5Chart:"vendor-amcharts-5-chart",vendorDatadogDashboardEmbed:"vendor-datadog-dashboard-embed",vendorFormbricksEmbed:"vendor-formbricks-embed",vendorFormbricksLink:"vendor-formbricks-link",vendorFormbricksEmbedAnonymous:"vendor-formbricks-embed-anonymous",vendorFormbricksLinkAnonymous:"vendor-formbricks-link-anonymous",vendorHighchartsChart:"vendor-highcharts-chart",vendorIframelyCard:"vendor-iframely-card",vendorIframelyEmbed:"vendor-iframely-embed",vendorIframelyPreview:"vendor-iframely-preview",vendorIframelyPreviewMini:"vendor-iframely-preview-mini",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",vendorJupyterOutput:"vendor-jupyter-output",vendorPadletEmbed:"vendor-padlet-embed",vendorStripePricingTable:"vendor-stripe-pricing-table",vendorStripePricingTableExternal:"vendor-stripe-pricing-table-external",video:"video",videoEmbed:"video-embed",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLandscape:"video-landscape",videoLink:"video-link",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",warningAlt:"warning-alt",warningCollapsible:"warning-collapsible",websiteLink:"website-link",workbookArticle:"workbook-article"}),g=(0,d(u(),1).superenum)({infinity:"infinity"}),b=(0,d(u(),1).superenum)({none:"none",string:"string",boolean:"boolean"}),f={tag_title:"#",tag_anchor:"▼",tag_reference:"►",tag_property:"@",tag_item:"%",tag_instruction:"!",tag_hint:"?",tag_true:"+",tag_false:"-",tag_sampleSolution:"$",tag_gap:"_",tag_mark:"=",tag_resource:"&"},y=(0,d(u(),1).superenum)(f),k=(0,d(u(),1).superenum)({none:"none",plainText:"plainText",bitmarkText:"bitmarkText",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"}),T=(0,d(u(),1).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkText:"bitmark++"}),v=(0,d(u(),1).superenum)({flashcard:"flashcard",definitionList:"definitionList",elements:"elements",statements:"statements",quiz:"quiz",feedback:"feedback",questions:"questions",matchPairs:"matchPairs",matchAudioPairs:"matchAudioPairs",matchImagePairs:"matchImagePairs",matchMatrix:"matchMatrix",table:"table",pronunciationTable:"pronunciationTable",botActionResponses:"botActionResponses",exampleBitList:"exampleBitList",clozeList:"clozeList",ingredients:"ingredients",bookReferenceList:"bookReferenceList"}),x=(0,d(u(),1).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"}),_=(0,d(u(),1).superenum)({unknown:"unknown",tag:"tag",property:"property",resource:"resource",group:"group"}),w=class{constructor(e){p(this,"type"),p(this,"configKey"),p(this,"tag"),p(this,"maxCount"),p(this,"minCount"),p(this,"chain"),p(this,"jsonKey"),p(this,"deprecated"),this.type=e.type,this.configKey=e.configKey,this.tag=e.tag,this.maxCount=e.maxCount,this.minCount=e.minCount,this.chain=e.chain,this.jsonKey=e.jsonKey,this.deprecated=e.deprecated}},C=class extends w{constructor(e){super({type:_.tag,jsonKey:void 0,...e}),p(this,"type",_.tag)}toString(e){const t=Object.assign({},e);let i=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},A=class extends w{constructor(e){super({type:_.property,...e}),p(this,"type",_.property),p(this,"array"),p(this,"format"),p(this,"defaultValue"),this.array=e.maxCount===g.infinity||e.maxCount>1,this.format=e.format,this.defaultValue=e.defaultValue}toString(e){const t=Object.assign({},e);let i=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.array&&(i+=`, arr=${this.array}`),null!=this.format&&(i+=`, fmt=${this.format}`),null!=this.defaultValue&&(i+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},B=class extends w{constructor(e){super({type:_.resource,...e}),p(this,"type",_.resource)}toString(e){const t=Object.assign({},e);let i=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},S=class{constructor(e,t,i,r){p(this,"tags"),p(this,"bodyAllowed"),p(this,"bodyRequired"),p(this,"repeatCount"),this.tags=e,this.bodyAllowed=t??!0,this.bodyRequired=i,this.repeatCount=r}toString(e){const t=Object.assign({},e);let i="";const r=[];this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),null!=this.repeatCount&&r.push(`repeatCount=${this.repeatCount}`),i+=`[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))i+=`\n${e.toString(t)}`;return i}},P=class{constructor(e,t){p(this,"configKey"),p(this,"variants"),this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let i="",r=0,o=0;for(const e of this.variants){for(const a of e)i+=`[Card - Side ${r}, Variant ${o}]`,i+=`\n${a.toString(t)}`,o++;r++}return i}},I=class{constructor(e){p(this,"since"),p(this,"bitType"),p(this,"inheritedBitTypes"),p(this,"inheritedBitTypesSet"),p(this,"textFormatDefault"),p(this,"tags",{}),p(this,"cardSet"),p(this,"quizBit"),p(this,"deprecated"),p(this,"bodyAllowed"),p(this,"bodyRequired"),p(this,"footerAllowed"),p(this,"footerRequired"),p(this,"resourceAttachmentAllowed"),p(this,"rootExampleType"),p(this,"comboResourceConfigKey");const{since:t,bitType:i,inheritedBitTypes:r,textFormatDefault:o,tags:a,cardSet:n,quizBit:s,deprecated:l,bodyAllowed:c,bodyRequired:d,footerAllowed:u,footerRequired:h,resourceAttachmentAllowed:m,rootExampleType:g,comboResourceConfigKey:b}=e;this.since=t,this.bitType=i,this.inheritedBitTypes=r,this.inheritedBitTypesSet=new Set(r),this.textFormatDefault=o,this.tags=a,this.cardSet=n,this.quizBit=s,this.deprecated=l,this.bodyAllowed=c??!0,this.bodyRequired=d,this.footerAllowed=u??!0,this.footerRequired=h,this.resourceAttachmentAllowed=m??!0,this.rootExampleType=g,this.comboResourceConfigKey=b}toString(e){const t=Object.assign({},e);let i=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(i+="\n\n[Inheritance]",i+=`\n${this.inheritedBitTypes.join(" => ")}`),i+=`\n\n[Default text format]\n${this.textFormatDefault}`;const r=[];null!=this.since&&r.push(`since=${this.since}`),null!=this.deprecated&&r.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),this.footerAllowed&&r.push("footerAllowed"),this.footerRequired&&r.push("footerRequired"),this.resourceAttachmentAllowed&&r.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&r.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceConfigKey&&r.push(`comboResourceConfigKey=${this.comboResourceConfigKey}`),i+=`\n\n[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===g.infinity||e.maxCount>0)&&(i+=`\n${e.toString(t)}`);return this.cardSet&&(i+=`\n\n${this.cardSet.toString(t)}`),i}},L=d(u(),1),E={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_technicalTerm:"group_technicalTerm",group_person:"group_person",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_quizCommon:"group_quizCommon",group_resourceBitTags:"group_resourceBitTags",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceIcon:"group_resourceIcon",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"},V=((0,d(u(),1).superenum)(E),{property_action:"@action",property_activityType:"@activityType",property_additionalSolutions:"@additionalSolutions",property_ageRange:"@ageRange",property_aiGenerated:"@aiGenerated",property_allowedBit:"@allowedBit",property_allowSubtitles:"@allowSubtitles",property_alt:"@alt",property_altLangTag:"@altLangTag",property_analyticsTag:"@analyticsTag",property_author:"@author",property_autoplay:"@autoplay",property_availableClassifications:"@availableClassifications",property_blockId:"@blockId",property_book:"@book",property_bookAlias:"@bookAlias",property_bookDiff:"@bookDiff",property_bot:"@bot",property_bubbleTag:"@bubbleTag",property_buttonCaption:"@buttonCaption",property_callToActionUrl:"@callToActionUrl",property_caption:"@caption",property_categoryTag:"@categoryTag",property_chatWithBook:"@chatWithBook",property_chatWithBookBrainKey:"@chatWithBookBrainKey",property_citationStyle:"@citationStyle",property_classification:"@classification",property_codeLineNumbers:"@codeLineNumbers",property_codeMinimap:"@codeMinimap",property_color:"@color",property_colorTag:"@colorTag",property_computerLanguage:"@computerLanguage",property_content2Buy:"@content2Buy",property_copyright:"@copyright",property_coverColor:"@coverColor",property_coverImage:"@coverImage",property_customerExternalId:"@customerExternalId",property_customerId:"@customerId",property_date:"@date",property_dateEnd:"@dateEnd",property_decimalPlaces:"@decimalPlaces",property_deeplink:"@deeplink",property_diffContext:"@diffContext",property_diffOp:"@diffOp",property_diffRef:"@diffRef",property_diffTime:"@diffTime",property_diffTo:"@diffTo",property_disableCalculation:"@disableCalculation",property_disableFeedback:"@disableFeedback",property_duration:"@duration",property_emphasis:"@emphasis",property_example:"@example",property_externalId:"@externalId",property_externalLink:"@externalLink",property_externalLinkText:"@externalLinkText",property_feedbackEngine:"@feedbackEngine",property_feedbackType:"@feedbackType",property_flashcardSet:"@flashcardSet",property_focusX:"@focusX",property_focusY:"@focusY",property_format:"@format",property_groupTag:"@groupTag",property_handInAcceptFileType:"@handInAcceptFileType",property_handInInstruction:"@handInInstruction",property_handInRequirement:"@handInRequirement",property_hasBookNavigation:"@hasBookNavigation",property_hasMarkAsDone:"@hasMarkAsDone",property_height:"@height",property_icon:"@icon",property_iconTag:"@iconTag",property_id:"@id",property_imageFirst:"@imageFirst",property_imageSource:"@imageSource",property_index:"@index",property_internalComment:"@internalComment",property_isCaseSensitive:"@isCaseSensitive",property_isInfoOnly:"@isInfoOnly",property_isPublic:"@isPublic",property_isTemplate:"@isTemplate",property_isTemplateStripTheme:"@isTemplateStripTheme",property_isTracked:"@isTracked",property_jupyterExecutionCount:"@jupyterExecutionCount",property_jupyterId:"@jupyterId",property_kind:"@kind",property_label:"@label",property_labelFalse:"@labelFalse",property_labelTrue:"@labelTrue",property_lang:"@lang",property_language:"@language",property_layer:"@layer",property_layerRole:"@layerRole",property_levelACTFL:"@levelACTFL",property_levelCEFR:"@levelCEFR",property_levelCEFRp:"@levelCEFRp",property_levelILR:"@levelILR",property_license:"@license",property_list:"@list",property_listItemIndent:"@listItemIndent",property_location:"@location",property_machineTranslated:"@machineTranslated",property_mailingList:"@mailingList",property_mark:"@mark",property_maxCreatedBits:"@maxCreatedBits",property_maxDisplayLevel:"@maxDisplayLevel",property_maxTocChapterLevel:"@maxTocChapterLevel",property_mockupId:"@mockupId",property_mute:"@mute",property_padletId:"@padletId",property_page:"@page",property_pageNo:"@pageNo",property_partialAnswer:"@partialAnswer",property_partner:"@partner",property_path:"@path",property_person:"@person",property_pointerLeft:"@pointerLeft",property_pointerTop:"@pointerTop",property_posterImage:"@posterImage",property_processHandIn:"@processHandIn",property_processHandInLocation:"@processHandInLocation",property_product:"@product",property_productFolder:"@productFolder",property_productId:"@productId",property_productVideo:"@productVideo",property_progress:"@progress",property_publications:"@publications",property_publisher:"@publisher",property_publisherName:"@publisherName",property_quizCountItems:"@quizCountItems",property_quizStrikethroughSolutions:"@quizStrikethroughSolutions",property_quotedPerson:"@quotedPerson",property_ratingLevelEnd:"@ratingLevelEnd",property_ratingLevelSelected:"@ratingLevelSelected",property_ratingLevelStart:"@ratingLevelStart",property_reaction:"@reaction",property_reasonableNumOfChars:"@reasonableNumOfChars",property_reductionTag:"@reductionTag",property_refAuthor:"@refAuthor",property_refBookTitle:"@refBookTitle",property_reference:"@reference",property_refPublicationYear:"@refPublicationYear",property_refPublisher:"@refPublisher",property_releaseDate:"@releaseDate",property_releaseKind:"@releaseKind",property_releaseVersion:"@releaseVersion",property_reportTag:"@reportTag",property_resolved:"@resolved",property_resolvedBy:"@resolvedBy",property_resolvedDate:"@resolvedDate",property_revealSolutions:"@revealSolutions",property_sampleSolution:"@sampleSolution",property_scormSource:"@scormSource",property_search:"@search",property_searchIndex:"@searchIndex",property_servings:"@servings",property_showInIndex:"@showInIndex",property_showSubtitles:"@showSubtitles",property_siteName:"@siteName",property_size:"@size",property_slug:"@slug",property_spaceId:"@spaceId",property_src1x:"@src1x",property_src2x:"@src2x",property_src3x:"@src3x",property_src4x:"@src4x",property_stripePricingTableId:"@stripePricingTableId",property_stripePublishableKey:"@stripePublishableKey",property_subject:"@subject",property_subtype:"@subtype",property_tableAutoWidth:"@tableAutoWidth",property_tableColumnMinWidth:"@tableColumnMinWidth",property_tableFixedHeader:"@tableFixedHeader",property_tableHeaderWhitespaceNoWrap:"@tableHeaderWhitespaceNoWrap",property_tableHeight:"@tableHeight",property_tablePagination:"@tablePagination",property_tablePaginationLimit:"@tablePaginationLimit",property_tableResizableColumns:"@tableResizableColumns",property_tableSearch:"@tableSearch",property_tableSort:"@tableSort",property_tableWhitespaceNoWrap:"@tableWhitespaceNoWrap",property_tag:"@tag",property_target:"@target",property_technicalTerm:"@technicalTerm",property_textReference:"@textReference",property_theme:"@theme",property_thumbImage:"@thumbImage",property_title:"@title",property_toc:"@toc",property_tocContent:"@tocContent",property_tocResource:"@tocResource",property_topicTag:"@topicTag",property_trim:"@trim",property_unit:"@unit",property_unitAbbr:"@unitAbbr",property_vendorDashboardId:"@vendorDashboardId",property_vendorSurveyId:"@vendorSurveyId",property_vendorUrl:"@vendorUrl",property_videoCallLink:"@videoCallLink",property_width:"@width",property_x:"@x",property_y:"@y",property_zoomDisabled:"@zoomDisabled"}),N=(0,d(u(),1).superenum)(V),R={resource_image:"&image",resource_imageResponsive:"&imageResponsive",resource_imagePortrait:"&imagePortrait",resource_imageLandscape:"&imageLandscape",resource_imageEmbed:"&imageEmbed",resource_imageLink:"&imageLink",resource_audio:"&audio",resource_audioEmbed:"&audioEmbed",resource_audioLink:"&audioLink",resource_video:"&video",resource_videoEmbed:"&videoEmbed",resource_videoLink:"&videoLink",resource_stillImageFilm:"&stillImageFilm",resource_stillImageFilmEmbed:"&stillImageFilmEmbed",resource_stillImageFilmLink:"&stillImageFilmLink",resource_article:"&article",resource_articleEmbed:"&articleEmbed",resource_articleLink:"&articleLink",resource_document:"&document",resource_documentEmbed:"&documentEmbed",resource_documentLink:"&documentLink",resource_documentDownload:"&documentDownload",resource_appLink:"&appLink",resource_websiteLink:"&websiteLink",resource_icon:"&icon",resource_backgroundWallpaper:"&backgroundWallpaper",resource_imagePlaceholder:"&imagePlaceholder"},F=((0,d(u(),1).superenum)(R),d(u(),1)),O=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}countOccurrences(e,t){return e.split(t).length-1}countOccurrencesAtStart(e,t){let i=0;for(;e.startsWith(t);)i++,e=e.substring(t.length);return i}countOccurrencesAtEnd(e,t){let i=0;for(;e.endsWith(t);)i++,e=e.substring(0,e.length-t.length);return i}splitPlaceholders(e,t){let i=[e];const r=(e,t)=>{const i=[];for(const r of e){const e=r.split(t);for(let r=0,o=e.length;r<o;r++){const a=e[r],n=r===o-1;i.push(a),n||i.push(t)}}return i};for(const e of t)i=r(i,e);return i}firstLine(e,t){const i=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return i;const r=e.split("\n");return r.length>0?r[0].substring(0,t):i}wordWrap(e,t){const i=[];if(t<1||null==e||e.length<=t)return i;const r=e.length,o=r-t;let a,n=0;for(;n<o;){let r;const o=n+t,s=e.indexOf("\n",n);if(s>-1&&s>n&&s<o){r=s-n,a=e.substr(n,r),n=n+r+1,i.push(a);continue}const l=e.lastIndexOf(" ",o);let c=0;l>-1&&l!=n-1?(r=l-n,r>0&&(c=n+r+1)):(r=t,c=n+t),a=e.substr(n,r),n=c,i.push(a.trim())}return n<r&&(a=e.substr(n),i.push(a)),i}kebabToCamel(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}},D=(0,F.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",icon:"icon",backgroundWallpaper:"backgroundWallpaper",imagePlaceholder:"imagePlaceholder"});function z(e){return`&${O.kebabToCamel(e)}`}var q=(0,L.superenum)({_unknown:"_unknown",...f,...R,...V,...E});function M(e){return e?e.startsWith("@")?_.property:e.startsWith("&")?_.resource:e.startsWith("group_")?_.group:_.tag:_.unknown}function $(e){return e.replace(/^@/,"")}function J(e){return D.fromKey(e.replace(/^&/,""))}var j=class{constructor(e,t,i,r){p(this,"tags"),p(this,"resourceAttachmentAllowed"),p(this,"resourceAttachmentConfigKey"),p(this,"comboResourceConfigKeysMap"),this.tags=e,this.resourceAttachmentAllowed=t??!1,this.resourceAttachmentConfigKey=i,this.comboResourceConfigKeysMap=r}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.configKey,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.configKey,t.maxCount);return e}},W=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)}getViaPath(e,t){if(!e)return;if(!t)return;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let i=e;for(const e of t){if(null==i)return;i=i[e]}return i}setViaPath(e,t,i,r){if(!e)return!1;if(!t)return!1;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let o=e;for(let e=0;e<t.length-1;e++){const i=t[e];if(null==o[i]){if(!r)return!1;o[i]={}}o=o[i]}return o[t[t.length-1]]=i,!0}flatMapPath(e,t){if(!e)return[];if(!t)return[];Array.isArray(t)||(t=[t]);const i=e,r=t.shift();if(null==r)return i;const o=i[r];return o?Array.isArray(o)?o.flatMap(e=>this.flatMapPath(e,t.slice())):[this.flatMapPath(o,t)].flat():[]}orderProperties(e,t){const i=e,r=Object.assign({},i);for(const e of Object.keys(i))delete i[e];for(const e of t)Object.prototype.hasOwnProperty.call(r,e)&&(i[e]=r[e])}removeUndefinedProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||null==r&&delete i[e]}removeFalseProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||!1===r&&delete i[e]}removeEmptyStringProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||""===r&&delete i[e]}removeEmptyArrayProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||Array.isArray(r)&&0===r.length&&delete i[e]}removeEmptyObjectProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||this.isObject(r)&&0===Object.keys(r).length&&delete i[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 i=e;if(null==i[t])return;let r=i[t];if(Array.isArray(r)){if(0===r.length)return;r=r[r.length-1]}return r}deepMerge(...e){return function e(...t){function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function r(t,r){for(const[o,a]of Object.entries(r)){const r=i(a);void 0!==t[o]&&i(t[o])===r&&["array","object"].includes(r)?t[o]=e(t[o],a):t[o]=structuredClone(a)}}let o=structuredClone(t.shift());for(const e of t){const t=i(e);i(o)===t?"array"===t?o=[...o,...structuredClone(e)]:"object"===t?r(o,e):o=e:o=structuredClone(e)}return o}(...e)}},H={[v.definitionList]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the definition.",format:k.plainText},{key:q.tag_title,description:"Title of the definition."},{key:q.group_resourceIcon,description:"Icon resource for the definition."}],repeatCount:g.infinity}]]},[v.flashcard]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the flashcard.",format:k.plainText},{key:q.tag_title,description:"Title of the flashcard."},{key:q.group_resourceIcon,description:"Icon resource for the flashcard."}],repeatCount:g.infinity}]]},[v.elements]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the element.",format:k.plainText}],repeatCount:g.infinity}]]},[v.statements]:{variants:[[{tags:[{key:q.tag_true,description:"Tag for true statements.",maxCount:1},{key:q.tag_false,description:"Tag for false statements.",maxCount:1},{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the statement.",format:k.plainText}],bodyAllowed:!1}]]},[v.quiz]:{variants:[[{tags:[{key:q.group_trueFalse,description:"Group for true/false questions."},{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the quiz question.",format:k.plainText}],bodyAllowed:!1}]]},[v.feedback]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.group_trueFalse,description:"Group for true/false feedback."},{key:q.tag_title,description:"Title of the feedback."}],bodyAllowed:!1}],[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k.number},{key:q.property_example,description:"Example text for the feedback.",format:k.plainText},{key:q.tag_title,description:"Title of the feedback."}],bodyAllowed:!0}]]},[v.questions]:{variants:[[{tags:[{key:q.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k.number},{key:q.tag_sampleSolution,description:"Sample solution for the question."},{key:q.property_sampleSolution,description:"Property for sample solution text.",format:k.plainText},{key:q.property_additionalSolutions,description:"Property for additional solutions.",format:k.plainText,maxCount:g.infinity},{key:q.property_partialAnswer,description:"Property for partial answer text.",format:k.plainText},{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the question.",format:k.plainText}],repeatCount:g.infinity}]]},[v.matchPairs]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the match pair.",format:k.plainText},{key:q.tag_title,description:"Title of the match pair."},{key:q.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:k.boolean}],repeatCount:g.infinity}]]},[v.matchAudioPairs]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the audio match pair.",format:k.plainText},{key:q.tag_title,description:"Title of the audio match pair."},{key:q.resource_audio,description:"Audio resource for the match pair."}],repeatCount:g.infinity}]]},[v.matchImagePairs]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the image match pair.",format:k.plainText},{key:q.tag_title,description:"Title of the image match pair."},{key:q.resource_image,description:"Image resource for the match pair."}],repeatCount:g.infinity}]]},[v.matchMatrix]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the match matrix.",format:k.plainText},{key:q.tag_title,description:"Title of the match matrix."},{key:q.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:k.boolean}],repeatCount:g.infinity}]]},[v.table]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.tag_title,description:"Title of the table."}],repeatCount:g.infinity}]]},[v.pronunciationTable]:{variants:[[{tags:[{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.tag_title,description:"Title of the pronunciation table."},{key:q.resource_audio,description:"Audio resource for the pronunciation table."}],repeatCount:g.infinity}]]},[v.botActionResponses]:{variants:[[{tags:[{key:q.property_reaction,description:"Reaction to the bot action.",format:k.plainText},{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_example,description:"Example text for the bot action response.",format:k.plainText}]}]]},[v.clozeList]:{variants:[[{tags:[{key:q.group_standardTags,description:"Standard tags for cloze items."},{key:q.group_gap,description:"Group for gap tags in cloze items."}]}]]},[v.exampleBitList]:{variants:[[{tags:[{key:q.group_standardTags,description:"Standard tags for example bits."},{key:q.tag_title,description:"Title of the example bit."}],repeatCount:g.infinity}]]},[v.ingredients]:{variants:[[{tags:[{key:q.tag_title,description:"Title of the ingredient."},{key:q.group_trueFalse,description:"Group for true/false properties of the ingredient."},{key:q.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:q.property_unit,description:"Unit of measurement for the ingredient.",format:k.plainText},{key:q.property_unitAbbr,description:"Abbreviation for the unit of measurement.",format:k.plainText},{key:q.property_decimalPlaces,description:"Number of decimal places for the ingredient quantity.",format:k.number,defaultValue:"1"},{key:q.property_disableCalculation,description:"Disable calculation for the ingredient.",format:k.boolean}],repeatCount:g.infinity}]]},[v.bookReferenceList]:{variants:[[{tags:[{key:q.group_standardTags,description:"Standard tags for book references."},{key:q.property_refAuthor,description:"Author of the book.",format:k.plainText,maxCount:g.infinity},{key:q.property_refBookTitle,description:"Title of the book.",format:k.plainText},{key:q.property_refPublisher,description:"Publisher of the book.",format:k.plainText,maxCount:g.infinity},{key:q.property_refPublicationYear,description:"Year of publication of the book.",format:k.plainText},{key:q.property_citationStyle,description:"Citation style for the book reference.",format:k.plainText}],repeatCount:g.infinity}]]}},U={[q.group_standardAllBits]:{name:"Standard",description:"Standard tags which apply to all bits",type:x.standard,tags:[{key:q.property_id,description:"The unique identifier(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_customerId,description:"The customer-specific identifier for the bit",format:k.plainText},{key:q.property_externalId,description:"The external identifier for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_isTemplate,description:"If true, the bit is a template",format:k.boolean,defaultValue:"false"},{key:q.property_isTemplateStripTheme,description:"If true, the bit is a template strip theme",format:k.boolean,defaultValue:"false"},{key:q.property_aiGenerated,description:"If true, the bit is AI-generated",format:k.boolean},{key:q.property_machineTranslated,description:"If true, the bit is machine-translated",format:k.plainText},{key:q.property_searchIndex,description:"The search index(es) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_analyticsTag,description:"The analytics tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_categoryTag,description:"The category tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_topicTag,description:"The topic tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_reportTag,description:"The report tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_altLangTag,description:"The alternative language tag for the bit",format:k.plainText},{key:q.property_feedbackEngine,description:"The feedback engine for the bit",format:k.plainText},{key:q.property_feedbackType,description:"The feedback type for the bit",format:k.plainText},{key:q.property_disableFeedback,description:"If true, feedback is disabled for the bit",format:k.boolean},{key:q.property_diffTo,description:"The diff to version for the bit",format:k.plainText},{key:q.property_diffOp,description:"The diff operation for the bit",format:k.plainText},{key:q.property_diffRef,description:"The diff reference for the bit",format:k.plainText},{key:q.property_diffContext,description:"The diff context for the bit",format:k.plainText},{key:q.property_diffTime,description:"The diff time for the bit",format:k.number},{key:q.property_ageRange,description:"The age range for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_lang,description:"The language for the bit",format:k.plainText},{key:q.property_publisher,description:"The publisher(s) of the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_publisherName,description:"The name of the publisher of the bit",format:k.plainText},{key:q.property_theme,description:"The theme(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_target,description:"The target(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_tag,description:"The tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_groupTag,description:"The group tag(s) for the bit",format:k.plainText,maxCount:g.infinity,chain:[{key:q.property_tag,description:"The tag(s) for the group",format:k.plainText,maxCount:g.infinity}]},{key:q.property_reductionTag,description:"The reduction tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_bubbleTag,description:"The bubble tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_levelCEFRp,description:"The CEFRp level for the bit",format:k.plainText},{key:q.property_levelCEFR,description:"The CEFR level for the bit",format:k.plainText},{key:q.property_levelILR,description:"The ILR level for the bit",format:k.plainText},{key:q.property_levelACTFL,description:"The ACTFL level for the bit",format:k.plainText},{key:q.property_icon,description:"The icon for the bit",format:k.plainText},{key:q.property_iconTag,description:"The icon tag for the bit",format:k.plainText},{key:q.property_colorTag,description:"The color tag(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.tag_anchor,name:"Anchor",description:"The anchor for the bit"},{key:q.property_search,description:"The search text for the bit",format:k.plainText},{key:q.property_showInIndex,description:"If true, the bit is shown in the index",format:k.boolean,defaultValue:"false"},{key:q.property_layer,description:"The layer(s) for the bit",format:k.plainText,maxCount:g.infinity},{key:q.property_layerRole,description:"The layer role(s) for the bit",format:k.plainText,maxCount:g.infinity}]},[q.group_standardItemLeadInstructionHint]:{type:x.standard,description:"Standard group for item, lead, page number, margin number, instruction and hint tags",tags:[{key:q.tag_item,description:"The item for the bit",chain:[{key:q.tag_item,description:"The lead, page number, and margin number for the bit",maxCount:3}]},{key:q.tag_instruction,name:"Instruction",description:"The instruction for the bit"},{key:q.tag_hint,name:"Hint",description:"The hint for the bit"}]},[q.group_standardTags]:{type:x.standard,description:"Standard tags which apply to MOST (but not all) bits",tags:[{key:q.group_standardAllBits,description:"All standard tags which apply to all bits"},{key:q.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:q.property_example,description:"The example(s) for the bit",format:k.plainText}]},[q.group_imageSource]:{type:x.standard,description:"Image source chain",tags:[{key:q.property_imageSource,description:"The source of an image",format:k.plainText,chain:[{key:q.property_mockupId,description:"The mockup ID for the image",format:k.plainText},{key:q.property_size,description:"The size of the image",format:k.number},{key:q.property_format,description:"The format of the image",format:k.plainText},{key:q.property_trim,description:"If true, the image is trimmed",format:k.boolean}]}]},[q.group_technicalTerm]:{type:x.standard,description:"Technical term chain",tags:[{key:q.property_technicalTerm,description:"The technical term",format:k.plainText,chain:[{key:q.property_lang,description:"The language of the technical term",format:k.plainText}]}]},[q.group_person]:{type:x.standard,description:"Person chain",tags:[{key:q.property_person,description:"A person",format:k.plainText,chain:[{key:q.property_title,description:"The person's title",format:k.plainText},{key:q.group_resourceImage,description:"The image of the person"}]},{key:q.property_partner,description:"A partner",format:k.plainText,chain:[{key:q.property_title,description:"The partner's title",format:k.plainText},{key:q.group_resourceImage,description:"The image of the partner"}]}]},[q.group_gap]:{type:x.standard,description:"Gap chain",tags:[{key:q.tag_gap,description:"The value of a gap in the content",maxCount:g.infinity,chain:[{key:q.tag_gap,description:"Alternative values for the gaps in the content",maxCount:g.infinity},{key:q.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:q.property_example,description:"An example for the gap",format:k.plainText},{key:q.property_isCaseSensitive,description:"If true, the gap text is case sensitive",format:k.boolean}]}]},[q.group_trueFalse]:{type:x.standard,description:"True/False chain",tags:[{key:q.tag_true,description:"True value for a true/false statement/question",maxCount:g.infinity,chain:[{key:q.tag_true,description:"True values for a true/false statement/question",maxCount:g.infinity},{key:q.tag_false,description:"False values for a true/false statement/question",maxCount:g.infinity},{key:q.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:q.property_example,description:"An example for the true/false statement/question",format:k.plainText}]},{key:q.tag_false,description:"False value for a true/false statement/question",maxCount:g.infinity,chain:[{key:q.tag_true,description:"True values for a true/false statement/question",maxCount:g.infinity},{key:q.tag_false,description:"False values for a true/false statement/question",maxCount:g.infinity},{key:q.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:q.property_example,description:"An example for the true/false statement/question",format:k.plainText}]}]},[q.group_markConfig]:{type:x.standard,description:"Mark configuration chain",tags:[{key:q.property_mark,description:"The mark configuration",format:k.plainText,maxCount:g.infinity,chain:[{key:q.property_color,description:"The color of the mark",format:k.plainText},{key:q.property_emphasis,description:"The emphasis of the mark",format:k.plainText}]}]},[q.group_mark]:{type:x.standard,description:"Mark chain",tags:[{key:q.tag_mark,description:"The marked content",maxCount:g.infinity,chain:[{key:q.property_mark,description:"The mark configuration",format:k.plainText},{key:q.property_example,description:"An example for the marked content",format:k.plainText}]}]},[q.group_bookCommon]:{type:x.standard,description:"Common book tags",tags:[{key:q.property_language,description:"The language of the book",format:k.plainText,maxCount:g.infinity},{key:q.property_customerExternalId,description:"The customer-specific external identifier for the book",format:k.plainText},{key:q.property_spaceId,description:"The space ID for the book",format:k.plainText,maxCount:g.infinity},{key:q.property_kind,description:"The kind of the book",format:k.plainText},{key:q.property_hasMarkAsDone,description:'If true, the book has a "Mark as done" feature',format:k.boolean,defaultValue:"false"},{key:q.property_processHandIn,description:"If true, the book will be processed when upon hand-in",format:k.boolean,defaultValue:"false"},{key:q.property_processHandInLocation,description:"The location where the book was handed-in",format:k.plainText},{key:q.property_isPublic,description:"If true, the book is public",format:k.boolean,defaultValue:"false"},{key:q.property_isTemplate,description:"If true, the book is a template",format:k.boolean,defaultValue:"false"},{key:q.property_isTemplateStripTheme,description:"If true, the book is a template strip theme",format:k.boolean,defaultValue:"false"},{key:q.property_chatWithBook,description:"If true, the user can chat about the book with an AI assistant",format:k.boolean,defaultValue:"false"},{key:q.property_chatWithBookBrainKey,description:"The BookBrain key for the book chat",format:k.plainText},{key:q.tag_title,name:"Title",description:"The title of the book",maxCount:2},{key:q.property_subtype,description:"The subtype of the book",format:k.plainText},{key:q.property_coverImage,description:"The cover image(s) of the book",format:k.plainText,maxCount:g.infinity},{key:q.property_coverColor,description:"The cover color of the book",format:k.plainText},{key:q.property_subject,description:"The subject(s) of the book",format:k.plainText,maxCount:g.infinity},{key:q.property_author,description:"The author(s) of the book",format:k.plainText,maxCount:g.infinity},{key:q.property_publications,description:"The publication(s) of the book",format:k.plainText,maxCount:g.infinity},{key:q.property_duration,description:"The duration of the book",format:k.plainText},{key:q.property_maxTocChapterLevel,description:"The maximum table of contents chapter level",format:k.number}]},[q.group_learningPathCommon]:{type:x.standard,description:"Common learning path tags",tags:[{key:q.property_action,description:"The action for the learning path",format:k.plainText},{key:q.property_duration,description:"The duration of the learning path",format:k.plainText},{key:q.property_date,description:"The date of the learning path",format:k.plainText},{key:q.property_dateEnd,description:"The end date of the learning path",format:k.plainText},{key:q.property_location,description:"The location of the learning path",format:k.plainText},{key:q.property_list,description:"The list of items in the learning path",format:k.plainText,maxCount:g.infinity},{key:q.property_textReference,description:"The text reference for the learning path",format:k.plainText},{key:q.property_isTracked,description:"If true, the learning path is tracked",format:k.boolean},{key:q.property_isInfoOnly,description:"If true, the learning path is info only",format:k.boolean},{key:q.property_deeplink,description:"The deeplink(s) for the learning path",format:k.plainText,maxCount:g.infinity},{key:q.property_buttonCaption,description:"The caption for the button of the learning path",format:k.plainText},{key:q.property_book,description:"The book(s) associated with the learning path",format:k.plainText,chain:[{key:q.tag_reference,description:"The reference(s) for the book(s) in the learning path",maxCount:2}]}]},[q.group_quizCommon]:{type:x.standard,description:"Common quiz tags",tags:[{key:q.property_revealSolutions,description:"If true, the quiz solutions are revealed",format:k.boolean}]},[q.group_resourceBitTags]:{type:x.standard,description:"Resource bit tags",tags:[{key:q.resource_imagePlaceholder,description:"Placeholder image for the resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the placeholder image"}],maxCount:1}]},[q.group_resourceCommon]:{type:x.standard,description:"Common resource properties",tags:[{key:q.property_license,description:"The license for the resource",format:k.plainText},{key:q.property_copyright,description:"The copyright information for the resource",format:k.plainText},{key:q.property_caption,description:"The caption for the resource",format:k.bitmarkText},{key:q.property_showInIndex,description:"If true, the resource is shown in the index",format:k.boolean,defaultValue:"false"},{key:q.property_search,description:"The search text for the resource",format:k.plainText}]},[q.group_resourceImageCommon]:{type:x.standard,description:"Common properties for image resources",tags:[{key:q.group_resourceCommon,description:"Common resource properties"},{key:q.property_src1x,description:"The source URL for the image at 1x resolution",format:k.plainText},{key:q.property_src2x,description:"The source URL for the image at 2x resolution",format:k.plainText},{key:q.property_src3x,description:"The source URL for the image at 3x resolution",format:k.plainText},{key:q.property_src4x,description:"The source URL for the image at 4x resolution",format:k.plainText},{key:q.property_width,description:"The width of the image",format:k.number},{key:q.property_height,description:"The height of the image",format:k.number},{key:q.property_alt,description:"The alternative text for the image",format:k.plainText},{key:q.property_zoomDisabled,description:"If true, zooming is disabled for the image",format:k.boolean}]},[q.group_resourceAudioCommon]:{type:x.standard,description:"Common properties for audio resources",tags:[{key:q.group_resourceCommon,description:"Common resource properties"},{key:q.property_duration,description:"The duration of the audio resource",format:k.plainText},{key:q.property_mute,description:"If true, the audio is muted",format:k.boolean},{key:q.property_autoplay,description:"If true, the audio plays automatically",format:k.boolean}]},[q.group_resourceVideoCommon]:{type:x.standard,description:"Common properties for video resources",tags:[{key:q.group_resourceCommon,description:"Common resource properties"},{key:q.property_width,description:"The width of the video",format:k.number},{key:q.property_height,description:"The height of the video",format:k.number},{key:q.property_duration,description:"The duration of the video",format:k.plainText},{key:q.property_mute,description:"If true, the video is muted",format:k.boolean},{key:q.property_autoplay,description:"If true, the video plays automatically",format:k.boolean},{key:q.property_allowSubtitles,description:"If true, subtitles are allowed for the video",format:k.boolean},{key:q.property_showSubtitles,description:"If true, subtitles are shown in the video",format:k.boolean},{key:q.property_alt,description:"The alternative text for the video",format:k.plainText},{key:q.property_posterImage,description:"The poster image for the video",format:k.plainText,chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the poster image"}]},{key:q.property_src1x,description:"The source URL for the video at 1x resolution",format:k.plainText},{key:q.property_src2x,description:"The source URL for the video at 2x resolution",format:k.plainText},{key:q.property_src3x,description:"The source URL for the video at 3x resolution",format:k.plainText},{key:q.property_src4x,description:"The source URL for the video at 4x resolution",format:k.plainText}]},[q.group_resourceIcon]:{type:x.standard,description:"Common properties for icon resources",tags:[{key:q.resource_icon,description:"The icon resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the icon resource"}]}]},[q.group_resourceImage]:{type:x.resource,description:"Common properties for image resources",tags:[{key:q.resource_image,description:"The image resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[q.group_resourceImagePortrait]:{type:x.resource,description:"Portrait image resource",tags:[{key:q.resource_imagePortrait,description:"The portrait image resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the portrait image resource"}]}]},[q.group_resourceImageLandscape]:{type:x.resource,description:"Landscape image resource",tags:[{key:q.resource_imageLandscape,description:"The landscape image resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the landscape image resource"}]}]},[q.group_resourceImageEmbed]:{type:x.resource,description:"Embedded image resource",tags:[{key:q.resource_imageEmbed,description:"The embedded image resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the embedded image resource"}]}]},[q.group_resourceImageLink]:{type:x.resource,description:"Link to an image resource",tags:[{key:q.resource_imageLink,description:"The link to the image resource",chain:[{key:q.group_resourceImageCommon,description:"Common image properties for the linked image resource"}]}]},[q.group_resourceAudio]:{type:x.resource,description:"Audio resource",tags:[{key:q.resource_audio,description:"The audio resource",chain:[{key:q.group_resourceAudioCommon,description:"Common audio properties for the audio resource"}]}]},[q.group_resourceAudioEmbed]:{type:x.resource,description:"Embedded audio resource",tags:[{key:q.resource_audioEmbed,description:"The embedded audio resource",chain:[{key:q.group_resourceAudioCommon,description:"Common audio properties for the embedded audio resource"}]}]},[q.group_resourceAudioLink]:{type:x.resource,description:"Link to an audio resource",tags:[{key:q.resource_audioLink,description:"The link to the audio resource",chain:[{key:q.group_resourceAudioCommon,description:"Common audio properties for the linked audio resource"}]}]},[q.group_resourceVideo]:{type:x.resource,description:"Video resource",tags:[{key:q.resource_video,description:"The video resource",chain:[{key:q.group_resourceVideoCommon,description:"Common video properties for the video resource"}]}]},[q.group_resourceVideoEmbed]:{type:x.resource,description:"Embedded video resource",tags:[{key:q.resource_videoEmbed,description:"The embedded video resource",chain:[{key:q.group_resourceVideoCommon,description:"Common video properties for the embedded video resource"}]}]},[q.group_resourceVideoLink]:{type:x.resource,description:"Link to a video resource",tags:[{key:q.resource_videoLink,description:"The link to the video resource",chain:[{key:q.group_resourceVideoCommon,description:"Common video properties for the linked video resource"}]}]},[q.group_resourceStillImageFilmEmbed]:{type:x.resource,description:"Embedded still image film resource",tags:[{key:q.resource_stillImageFilmEmbed,description:"The embedded still image film resource",chain:[{key:q.group_resourceVideoCommon,description:"Common video properties for the embedded still image film resource"}]}]},[q.group_resourceStillImageFilmLink]:{type:x.resource,description:"Link to a still image film resource",tags:[{key:q.resource_stillImageFilmLink,description:"The link to the still image film resource",chain:[{key:q.group_resourceVideoCommon,description:"Common video properties for the linked still image film resource"}]}]},[q.group_resourceArticle]:{type:x.resource,description:"Article resource",tags:[{key:q.resource_article,description:"The article resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the article resource"}]}]},[q.group_resourceArticleEmbed]:{type:x.resource,description:"Embedded article resource",tags:[{key:q.resource_articleEmbed,description:"The embedded article resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the embedded article resource"}]}]},[q.group_resourceArticleLink]:{type:x.resource,description:"Link to an article resource",tags:[{key:q.resource_articleLink,description:"The link to the article resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the linked article resource"}]}]},[q.group_resourceDocument]:{type:x.resource,description:"Document resource",tags:[{key:q.resource_document,description:"The document resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the document resource"}]}]},[q.group_resourceDocumentEmbed]:{type:x.resource,description:"Embedded document resource",tags:[{key:q.resource_documentEmbed,description:"The embedded document resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the embedded document resource"}]}]},[q.group_resourceDocumentLink]:{type:x.resource,description:"Link to a document resource",tags:[{key:q.resource_documentLink,description:"The link to the document resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the linked document resource"}]}]},[q.group_resourceDocumentDownload]:{type:x.resource,description:"Downloadable document resource",tags:[{key:q.resource_documentDownload,description:"The downloadable document resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the downloadable document resource"}]}]},[q.group_resourceAppLink]:{type:x.resource,description:"Link to an app resource",tags:[{key:q.resource_appLink,description:"The link to the app resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the linked app resource"}]}]},[q.group_resourceWebsiteLink]:{type:x.resource,description:"Link to a website resource",tags:[{key:q.resource_websiteLink,description:"The link to the website resource",chain:[{key:q.group_resourceCommon,description:"Common resource properties for the linked website resource"}]}]},[q.group_resourceStillImageFilm]:{type:x.comboResource,description:"Resource for still image film",comboResourceConfigKey:q.resource_stillImageFilm,tags:[{key:q.group_resourceImage,description:"The image resource for the still image film",maxCount:1,minCount:1},{key:q.group_resourceAudio,description:"The audio resource for the still image film",maxCount:1,minCount:1}]},[q.group_resourceImageResponsive]:{type:x.comboResource,description:"Responsive image resource",comboResourceConfigKey:q.resource_imageResponsive,tags:[{key:q.group_resourceImagePortrait,description:"The portrait image resource",maxCount:1,minCount:1},{key:q.group_resourceImageLandscape,description:"The landscape image resource",maxCount:1,minCount:1}]}},G=new class{hydrateTagsConfig(e){const t={tags:{}};for(const i of e){let e;switch(M(i.key)){case _.tag:e=this.hydrateTagConfig(i);break;case _.property:e=this.hydratePropertyTagConfig(i);break;case _.resource:e=this.hydrateResourceTagConfig(i);break;case _.group:e=this.hydrateTagGroupConfig(i);break;default:throw new Error(`Unknown tag type for config key '${i.key}'`)}e&&(t.tags={...t.tags,...e.tags},t.info=Object.assign(t.info??{},e.info))}return t}hydrateCardSetConfig(e){if(!e)return;const t=H[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const i=[];for(const e of t.variants){const t=[];for(const i of e){const e=this.hydrateCardVariantConfig(i);t.push(e)}i.push(t)}return new P(e,i)}hydrateTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a}=e,n=q.fromValue(t)||q._unknown;if(!n)throw new Error(`No tag key found for config key '${n}'`);const s=y.fromValue(n);if(!s)throw new Error(`No tag found for tag config key '${n}'`);let l;o&&(l=this.hydrateTagsConfig(o).tags);const c=new C({configKey:n,tag:s,maxCount:i??1,minCount:r??0,chain:l,deprecated:a});return{tags:{[n]:c}}}hydratePropertyTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a,format:n,defaultValue:s,jsonKey:l}=e,c=q.fromValue(t)||q._unknown;if(!c)throw new Error(`No property key found for config key '${c}'`);const d=t.substring(1);let p;o&&(p=this.hydrateTagsConfig(o).tags);const u=new A({configKey:c,tag:d,maxCount:i??1,minCount:r??0,chain:p,jsonKey:l,format:n,defaultValue:s,deprecated:a});return{tags:{[c]:u}}}hydrateResourceTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a,jsonKey:n}=e,s=q.fromValue(t)||q._unknown;if(!s)throw new Error(`No resource key found for config key '${s}'`);const l=t.substring(1);let c;o&&(c=this.hydrateTagsConfig(o).tags);const d=new B({configKey:s,tag:l,maxCount:i??1,minCount:r??0,chain:c,jsonKey:n,deprecated:a});return{tags:{[s]:d}}}hydrateTagGroupConfig(e){const{key:t}=e,i=q.fromValue(t)||q._unknown;if(!i)throw new Error(`No group key found for config key '${i}'`);const r=U[i];if(!r)throw new Error(`No config found for group config key '${t}'`);const{tags:o}=r,a=this.hydrateTagsConfig(o).tags,n=Object.values(a);if(n.length>0){const t=n[0],i=t;i.maxCount=e.maxCount??t.maxCount,i.minCount=e.minCount??t.minCount}return{tags:a,info:{comboResourceConfigKey:r.comboResourceConfigKey}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:i,bodyRequired:r,repeatCount:o}=e,a=this.hydrateTagsConfig(t);return new S(a.tags,i,r,o)}},K={[m._error]:{since:"1.3.0",description:"An error bit, rendered when the bit cannot be interpreted"},[m._comment]:{since:"1.4.12",description:"A comment bit, used when a bit is commented out by adding | between the . and the bit name, e.g [.|article]"},[m._standard]:{since:"3.2.0",description:"The standard bit type, used as a base for other bits, should not be used directly",tags:[{key:q.group_standardTags,description:"Standard tags for (almost) all bits"}]},[m.appFlashcards]:{since:"1.3.0",baseBitType:m._standard,description:"App flashcards bit, used for flashcard quizzes in the app",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"},{key:q.tag_title,description:"The title of the flashcard quiz"},{key:q.property_flashcardSet,description:"The flashcard set to use for the app flashcards",format:k.plainText,maxCount:g.infinity}],rootExampleType:b.string},[m.appFlashcardsQuiz]:{since:"1.3.0",baseBitType:m.appFlashcards,description:"App flashcards quiz bit"},[m.appFlashcardsLearn]:{since:"1.3.0",baseBitType:m.appFlashcards,description:"App flashcards learn bit"},[m.appLink]:{since:"1.3.0",baseBitType:m._standard,description:"App link bit, used to link to other bits in the app",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceAppLink,description:"Tags for the app link resource",minCount:1}],resourceAttachmentAllowed:!1},[m.article]:{since:"1.3.0",baseBitType:m._standard,description:"Article bit, used for articles / paragraphs",tags:[{key:q.tag_title,description:"The title of the article"}]},[m.articleAlt]:{since:"1.15.0",baseBitType:m.article,description:"Alternative article bit"},[m.articleResponsive]:{since:"1.21.0",baseBitType:m.article,description:"Responsive article bit, used for articles that adapt to the screen size",tags:[{key:q.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:k.boolean,defaultValue:"true"}]},[m.articleResponsiveAlt]:{since:"2.0.0",baseBitType:m.articleResponsive,description:"Alternative responsive article bit"},[m.standardArticleNormative]:{since:"1.16.0",baseBitType:m.article,description:"Standard normative article bit"},[m.standardArticleNonNormative]:{since:"1.16.0",baseBitType:m.article,description:"Standard non-normative article bit"},[m.smartStandardArticleNormative]:{since:"1.28.0",baseBitType:m.standardArticleNormative,description:"Smart standard normative article bit"},[m.smartStandardArticleNonNormative]:{since:"1.28.0",baseBitType:m.standardArticleNonNormative,description:"Smart standard non-normative article bit"},[m.smartStandardArticleNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardArticleNormative,description:"Smart standard normative article bit that is collapsible"},[m.smartStandardArticleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardArticleNonNormative,description:"Smart standard non-normative article bit that is collapsible"},[m.statement]:{since:"1.3.0",baseBitType:m.article,description:"Statement bit, used for statements in documents"},[m.pageArticle]:{since:"1.15.0",baseBitType:m.article,description:"Page article bit"},[m.pageArticleAlt]:{since:"1.15.0",baseBitType:m.article,description:"Alternative page article bit"},[m.pageArticleResponsive]:{since:"1.21.0",baseBitType:m.article,description:"Responsive page article bit, used for articles that adapt to the screen size",tags:[{key:q.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:k.boolean,defaultValue:"true"}]},[m.buttonCopyText]:{since:"1.4.3",baseBitType:m.article,description:"Button copy text bit, used to create a button that copies text to the clipboard",tags:[{key:q.property_buttonCaption,description:"The caption of the button",format:k.plainText}]},[m.callToAction]:{since:"1.15.0",baseBitType:m._standard,description:"Call to action bit, used to create a call to action button",tags:[{key:q.property_buttonCaption,description:"The caption of the call to action button",format:k.plainText},{key:q.property_callToActionUrl,description:"The URL to navigate to when the call to action button is clicked",format:k.plainText,minCount:1}]},[m.callToActionSubscribe]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action subscribe bit"},[m.callToActionContact]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action contact bit"},[m.callToActionJoin]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action join bit"},[m.callToActionMail]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action mail bit"},[m.callToActionLearnMore]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action learn more bit"},[m.callToActionSeeMore]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action see more bit"},[m.callToActionWatch]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action watch bit"},[m.callToActionStartNow]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action start now bit"},[m.callToActionGetOffer]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action get offer bit"},[m.callToActionBookNow]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action book now bit"},[m.callToActionShopNow]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action shop now bit"},[m.callToActionGetNow]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action get now bit"},[m.callToActionDownload]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action download bit"},[m.callToActionCreateAccount]:{since:"1.15.0",baseBitType:m.callToAction,description:"Call to action create account bit"},[m.appBitmarkFromJavascript]:{since:"1.4.5",baseBitType:m._standard,description:"App bitmark from JavaScript, used to create bits from JavaScript in the app",tags:[{key:q.property_maxCreatedBits,description:"The maximum number of bits that can be created from this bit",format:k.number}],textFormatDefault:T.plainText},[m.appBitmarkFromEditor]:{since:"1.4.5",baseBitType:m.appBitmarkFromJavascript,description:"App bitmark from editor, used to create bits from the editor in the app"},[m.articleEmbed]:{since:"1.3.0",baseBitType:m._standard,description:"Article embed bit, used to embed articles from other sources",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceArticleEmbed,description:"Tags for the article embed resource",minCount:1}],resourceAttachmentAllowed:!1},[m.articleLink]:{since:"1.3.0",baseBitType:m._standard,description:"Article link bit, used to link to articles from other sources",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceArticleLink,description:"Tags for the article link resource",minCount:1}],resourceAttachmentAllowed:!1},[m.audio]:{since:"1.3.0",baseBitType:m._standard,description:"Audio bit, used for audio files",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceAudio,description:"Tags for the audio resource",minCount:1}],resourceAttachmentAllowed:!1},[m.audioEmbed]:{since:"1.3.0",baseBitType:m._standard,description:"Audio embed bit, used to embed audio files from other sources",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceAudioEmbed,description:"Tags for the audio embed resource",minCount:1}],resourceAttachmentAllowed:!1},[m.audioLink]:{since:"1.3.0",baseBitType:m._standard,description:"Audio link bit, used to link to audio files from other sources",tags:[{key:q.group_resourceBitTags,description:"Tags for the resource bit"},{key:q.group_resourceAudioLink,description:"Tags for the audio link resource",minCount:1}],resourceAttachmentAllowed:!1},[m.bitAlias]:{since:"1.3.0",baseBitType:m._standard,description:"Bit alias, used to create an alias for a bit",tags:[{key:q.tag_reference,description:"The reference to the bit that this alias points to"},{key:q.tag_anchor,description:"The anchor for the bit alias, used for linking"}]},[m.diff]:{since:"3.13.0",baseBitType:m._standard,description:"Diff bit, used to show differences between two bits",tags:[{key:q.property_diffTo,description:"The reference to the bit that this diff compares to",format:k.plainText}]},[m.book]:{since:"1.3.0",baseBitType:m._standard,description:"Book bit, used to represent a book",tags:[{key:q.group_bookCommon,description:"Common tags for book bits"}]},[m.bookEnd]:{since:"3.27.0",baseBitType:m.article,description:"End of book bit"},[m.bookAcknowledgements]:{since:"1.17.0",baseBitType:m.article,description:"Acknowledgements section of a book"},[m.bookAddendum]:{since:"1.3.0",baseBitType:m.article,description:"Addendum section of a book"},[m.bookAfterword]:{since:"1.3.0",baseBitType:m.article,description:"Afterword section of a book"},[m.bookAppendix]:{since:"1.3.0",baseBitType:m.article,description:"Appendix section of a book"},[m.bookArticle]:{since:"1.3.0",baseBitType:m.article,description:"Article section of a book"},[m.bookAutherBio]:{since:"1.3.0",baseBitType:m.article,description:"Author biography section of a book"},[m.bookBibliography]:{since:"1.3.0",baseBitType:m.article,description:"Bibliography section of a book"},[m.bookComingSoon]:{since:"1.3.0",baseBitType:m.article,description:"Coming soon section of a book"},[m.bookConclusion]:{since:"1.3.0",baseBitType:m.article,description:"Conclusion section of a book"},[m.bookCopyright]:{since:"1.3.0",baseBitType:m.article,description:"Copyright section of a book"},[m.bookCopyrightPermissions]:{since:"1.3.0",baseBitType:m.article,description:"Copyright permissions section of a book"},[m.bookDedication]:{since:"1.3.0",baseBitType:m.article,description:"Dedication section of a book"},[m.bookEndnotes]:{since:"1.3.0",baseBitType:m.article,description:"Endnotes section of a book"},[m.bookEpigraph]:{since:"1.3.0",baseBitType:m.article,description:"Epigraph section of a book"},[m.bookEpilogue]:{since:"1.3.0",baseBitType:m.article,description:"Epilogue section of a book"},[m.bookForword]:{since:"1.3.0",baseBitType:m.article,description:"Foreword section of a book"},[m.bookFrontispiece]:{since:"1.3.0",baseBitType:m.article,description:"Frontispiece section of a book"},[m.bookImprint]:{since:"1.3.0",baseBitType:m.article,description:"Imprint section of a book"},[m.bookIncitingIncident]:{since:"1.3.0",baseBitType:m.article,description:"Inciting incident section of a book"},[m.bookIntroduction]:{since:"1.3.0",baseBitType:m.article,description:"Introduction section of a book"},[m.bookListOfContributors]:{since:"1.3.0",baseBitType:m.article,description:"List of contributors section of a book"},[m.bookNotes]:{since:"1.3.0",baseBitType:m.article,description:"Notes section of a book"},[m.bookPostscript]:{since:"1.3.0",baseBitType:m.article,description:"Postscript section of a book"},[m.bookPreface]:{since:"1.3.0",baseBitType:m.article,description:"Preface section of a book"},[m.bookPrologue]:{since:"1.3.0",baseBitType:m.article,description:"Prologue section of a book"},[m.bookReadMore]:{since:"1.3.0",baseBitType:m.article,description:"Read more section of a book"},[m.bookReferenceList]:{since:"3.2.0",baseBitType:m._standard,description:"Book reference list, used to list references in a book",cardSet:v.bookReferenceList},[m.bookRequestForABookReview]:{since:"1.3.0",baseBitType:m.article,description:"Request for a book review section of a book"},[m.bookSummary]:{since:"1.3.0",baseBitType:m.article,description:"Summary section of a book"},[m.bookTeaser]:{since:"1.3.0",baseBitType:m.article,description:"Teaser section of a book"},[m.bookTitle]:{since:"1.3.0",baseBitType:m.article,description:"Title section of a book"},[m.bookCover]:{since:"3.27.0",baseBitType:m.image,description:"Cover image of a book",tags:[{key:q.tag_title,description:"The title of the book cover",maxCount:2},{key:q.property_coverColor,description:"The color of the book cover",format:k.plainText}]},[m.bookAlias]:{since:"1.4.3",baseBitType:m.book,description:"Book alias, used to create an alias for a book",tags:[{key:q.property_bookAlias,description:"The alias for the book",format:k.plainText,maxCount:g.infinity}]},[m.bookDiff]:{since:"3.10.0",baseBitType:m.book,description:"Book diff, used to show differences between two book versions",tags:[{key:q.property_bookDiff,description:"The reference to the book that this diff compares to",format:k.plainText}]},[m.bookClose]:{since:"1.18.0",baseBitType:m.article,description:"Close section of a book, used to close the book",tags:[{key:q.property_buttonCaption,description:"The caption of the close button",format:k.plainText}]},[m.bookReference]:{since:"2.2.0",baseBitType:m.article,description:"Book reference, used to reference a book in another book",tags:[{key:q.property_refAuthor,description:"The author of the referenced book",format:k.plainText,maxCount:g.infinity},{key:q.property_refBookTitle,description:"The title of the referenced book",format:k.plainText},{key:q.property_refPublisher,description:"The publisher of the referenced book",format:k.plainText,maxCount:g.infinity},{key:q.property_refPublicationYear,description:"The publication year of the referenced book",format:k.plainText},{key:q.property_citationStyle,description:"The citation style to use for the book reference",format:k.plainText}]},[m.botActionResponse]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action response bit, used to define responses for bot actions",cardSet:v.botActionResponses},[m.botActionSend]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action send bit, used to define actions for sending messages",tags:[{key:q.property_date,description:"The date when the message should be sent",format:k.plainText}]},[m.browserImage]:{since:"1.3.0",baseBitType:m.image,description:"Browser image bit, used to display images in the browser",tags:[{key:q.property_focusX,description:"The X coordinate for focusing the image in the browser",format:k.number},{key:q.property_focusY,description:"The Y coordinate for focusing the image in the browser",format:k.number}]},[m.card1]:{since:"1.3.0",baseBitType:m._standard,description:"Card bit, used for cards in quizzes",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"}]},[m.question1]:{since:"1.3.0",baseBitType:m.card1,description:"Question card bit"},[m.survey1]:{since:"1.3.0",baseBitType:m.card1,description:"Survey card bit"},[m.surveyAnonymous1]:{since:"1.3.0",baseBitType:m.card1,description:"Anonymous survey card bit"},[m.chapter]:{since:"1.3.0",baseBitType:m._standard,description:"Chapter bit, used to define chapters in books or articles",tags:[{key:q.tag_anchor,description:"The anchor for the chapter, used for linking"},{key:q.tag_title,description:"The title of the chapter"},{key:q.property_toc,description:"If the chapter should be included in the table of contents",format:k.boolean,defaultValue:"true"},{key:q.property_progress,description:"The progress of the chapter, used for tracking reading progress",format:k.boolean,defaultValue:"true"}]},[m.clozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:m._standard,description:"Cloze and multiple choice text bit, used for quizzes with cloze and multiple choice questions",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"},{key:q.group_gap,description:"Tags for gaps in cloze and multiple choice text bits"},{key:q.group_trueFalse,description:"Tags for true/false questions in cloze and multiple choice text bits"}]},[m.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:m.clozeAndMultipleChoiceText,description:"Coach call to action cloze and multiple choice text bit"},[m.cloze]:{since:"1.3.0",baseBitType:m._standard,description:"Cloze bit, used for fill-in-the-blank questions in quizzes",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"},{key:q.property_isCaseSensitive,description:"If the cloze answers are case sensitive",format:k.boolean},{key:q.property_quizCountItems,description:"The number of items in the cloze quiz",format:k.boolean},{key:q.property_quizStrikethroughSolutions,description:"If the cloze solutions should be strikethrough",format:k.boolean},{key:q.property_additionalSolutions,description:"Additional solutions for the cloze quiz",format:k.plainText,maxCount:g.infinity},{key:q.group_gap,description:"Tags for gaps in cloze bits"}]},[m.clozeInstructionGrouped]:{since:"1.3.0",baseBitType:m.cloze,description:"Cloze instruction grouped bit, used for cloze questions with grouped instructions"},[m.clozeSolutionGrouped]:{since:"1.3.0",baseBitType:m.cloze,description:"Cloze solution grouped bit, used for cloze questions with grouped solutions"},[m.clozeSeveral]:{since:"3.5.0",baseBitType:m.cloze,description:"Cloze several bit, used for cloze questions with multiple answers"},[m.gapText]:{since:"1.5.15",baseBitType:m.cloze,description:"Gap text bit, used for fill-in-the-blank questions in quizzes with text gaps"},[m.gapTextInstructionGrouped]:{since:"1.5.15",baseBitType:m.clozeInstructionGrouped,description:"Gap text instruction grouped bit, used for fill-in-the-blank questions with grouped instructions"},[m.coachSelfReflectionCloze]:{since:"1.3.0",baseBitType:m.cloze,description:"Coach self-reflection cloze bit, used for self-reflection questions in coaching"},[m.coachCallToActionCloze]:{since:"1.3.0",baseBitType:m.cloze,description:"Coach call to action cloze bit, used for call to action questions in coaching"},[m.clozeList]:{since:"1.4.13",baseBitType:m._standard,description:"Cloze list bit, used for lists of cloze questions in quizzes",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"}],cardSet:v.clozeList},[m.code]:{since:"1.3.0",baseBitType:m._standard,description:"Code bit, used for code snippets in articles or documents",tags:[{key:q.property_computerLanguage,description:"The programming language of the code snippet",format:k.plainText},{key:q.property_codeLineNumbers,description:"If line numbers should be displayed for the code snippet",format:k.boolean},{key:q.property_codeMinimap,description:"If a minimap should be displayed for the code snippet",format:k.boolean}],textFormatDefault:T.plainText},[m.formula]:{since:"1.35.0",baseBitType:m._standard,description:"Formula bit, used for mathematical formulas in articles or documents",textFormatDefault:T.latex},[m.smartStandardFormula]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard formula bit, used for mathematical formulas in smart standards"},[m.smartStandardFormulaNonNormative]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard non-normative formula bit, used for mathematical formulas in smart standards that are non-normative"},[m.smartStandardFormulaNormative]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard normative formula bit, used for mathematical formulas in smart standards that are normative"},[m.smartStandardRemarkFormula]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard remark formula bit, used for mathematical formulas in smart standards remarks"},[m.smartStandardRemarkFormulaNonNormative]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard non-normative remark formula bit, used for mathematical formulas in smart standards remarks that are non-normative"},[m.smartStandardRemarkFormulaNormative]:{since:"3.11.0",baseBitType:m.formula,description:"Smart standard normative remark formula bit, used for mathematical formulas in smart standards remarks that are normative"},[m.appCodeCell]:{since:"1.4.3",baseBitType:m.code,description:"App code cell, used to create code cells in the app editor"},[m.appCodeEditor]:{since:"1.4.3",baseBitType:m.code,description:"App code editor, used to create code editors in the app editor"},[m.appCodeIde]:{since:"1.4.3",baseBitType:m.code,description:"App code IDE, used to create code IDEs in the app editor"},[m.codeRuntime]:{since:"1.4.3",baseBitType:m.code,description:"Code runtime, used to define the runtime environment for code snippets"},[m.consoleLog]:{since:"1.4.3",baseBitType:m.code,description:"Console log, used to log messages to the console in code snippets"},[m.output]:{since:"1.4.3",baseBitType:m.code,description:"Output bit, used to display output from code snippets"},[m.stdout]:{since:"1.4.3",baseBitType:m.code,description:"Standard output bit, used to display standard output from code snippets"},[m.step]:{since:"1.5.1",baseBitType:m.article,description:"Step bit, used to define steps in a process or guide"},[m.stepImageScreenshot]:{since:"1.5.1",baseBitType:m.image,description:"Step image screenshot bit, used to display screenshots in steps"},[m.stepImageScreenshotWithPointer]:{since:"1.5.1",baseBitType:m.image,description:"Step image screenshot with pointer bit, used to display screenshots with pointers in steps",tags:[{key:q.property_pointerTop,description:"The top position of the pointer in the screenshot",format:k.plainText,minCount:1,maxCount:1},{key:q.property_pointerLeft,description:"The left position of the pointer in the screenshot",format:k.plainText,minCount:1,maxCount:1}]},[m.milestone]:{since:"1.20.0",baseBitType:m.step,description:"Milestone bit, used to define milestones in a process or guide"},[m.conversationLeft1]:{since:"1.3.0",baseBitType:m._standard,description:"Conversation left bit, used to create a conversation on the left side of the screen",tags:[{key:q.group_person,description:"Tags for the person in the conversation"}]},[m.conversationLeft1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Conversation left scream bit, used to create a conversation with a scream on the left side of the screen"},[m.conversationLeft1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Conversation left thought bit, used to create a conversation with a thought on the left side of the screen"},[m.conversationRight1]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Conversation right bit, used to create a conversation on the right side of the screen"},[m.conversationRight1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Conversation right scream bit, used to create a conversation with a scream on the right side of the screen"},[m.conversationRight1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Conversation right thought bit, used to create a conversation with a thought on the right side of the screen"},[m.clozeAndMultipleChoiceTextConversationLeft1]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation left bit, used for conversations with cloze and multiple choice text on the left side of the screen"},[m.clozeAndMultipleChoiceTextConversationLeft1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation left scream bit, used for conversations with cloze and multiple choice text and a scream on the left side of the screen"},[m.clozeAndMultipleChoiceTextConversationLeft1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation left thought bit, used for conversations with cloze and multiple choice text and a thought on the left side of the screen"},[m.clozeAndMultipleChoiceTextConversationRight1]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation right bit, used for conversations with cloze and multiple choice text on the right side of the screen"},[m.clozeAndMultipleChoiceTextConversationRight1Scream]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation right scream bit, used for conversations with cloze and multiple choice text and a scream on the right side of the screen"},[m.clozeAndMultipleChoiceTextConversationRight1Thought]:{since:"1.3.0",baseBitType:m.conversationLeft1,description:"Cloze and multiple choice text conversation right thought bit, used for conversations with cloze and multiple choice text and a thought on the right side of the screen"},[m.cookPreparation]:{since:"1.3.0",baseBitType:m.article,description:"Cook preparation bit"},[m.cookStep]:{since:"1.3.0",baseBitType:m.article,description:"Cook step bit"},[m.cookIngredients]:{since:"1.5.16",baseBitType:m._standard,description:"Cook ingredients bit, used to define ingredients for recipes",tags:[{key:q.group_technicalTerm,description:"Tags for technical terms related to ingredients"},{key:q.property_servings,description:"The number of servings for the ingredients",format:k.number,chain:[{key:q.property_unit,description:"The unit of measurement for the ingredients",format:k.plainText},{key:q.property_unitAbbr,description:"The abbreviation for the unit of measurement",format:k.plainText},{key:q.property_decimalPlaces,description:"The number of decimal places for the ingredient quantity",format:k.number,defaultValue:"1"},{key:q.property_disableCalculation,description:"If the ingredient quantity calculation should be disabled",format:k.boolean},{key:q.tag_hint,description:"Hint for the ingredient, used to provide additional information"}]}],cardSet:v.ingredients},[m.recipe]:{since:"1.5.24",baseBitType:m.cookIngredients,description:"Recipe bit, used to define a recipe"},[m.cookRemark]:{since:"1.3.0",baseBitType:m.article,description:"Cook remark bit, used to add remarks to recipes"},[m.cookVariation]:{since:"1.3.0",baseBitType:m.article,description:"Cook variation bit, used to define variations of recipes"},[m.cookInsert]:{since:"1.3.0",baseBitType:m.article,description:"Cook insert bit, used to insert additional content in recipes"},[m.cookNoteOnQuantity]:{since:"3.27.0",baseBitType:m.article,description:"Cook note on quantity bit, used to add notes on ingredient quantities in recipes"},[m.cookArrangement]:{since:"1.3.0",baseBitType:m.article,description:"Cook arrangement bit, used to arrange ingredients or steps in recipes"},[m.cookPracticeAdvise]:{since:"1.3.0",baseBitType:m.article,description:"Cook practice advice bit, used to provide practical advice in recipes"},[m.cookPlate]:{since:"1.3.0",baseBitType:m.article,description:"Cook plate bit, used to define the presentation of a dish"},[m.cookRecommendation]:{since:"1.3.0",baseBitType:m.article,description:"Cook recommendation bit, used to recommend dishes or ingredients"},[m.cookPersonalRecommendation]:{since:"1.3.0",baseBitType:m.article,description:"Cook personal recommendation bit, used to provide personal recommendations for dishes or ingredients"},[m.cookSideDrink]:{since:"1.3.0",baseBitType:m.article,description:"Cook side drink bit, used to define side drinks for dishes"},[m.cookSideDish]:{since:"1.3.0",baseBitType:m.article,description:"Cook side dish bit, used to define side dishes for main courses"},[m.cookTimer]:{since:"1.3.0",baseBitType:m.article,description:"Cook timer bit, used to set timers for cooking steps"},[m.document]:{since:"1.3.0",baseBitType:m._standard,description:"Document bit, used to define documents in articles or books",tags:[{key:q.group_resourceBitTags,description:"Tags for resource bits, used to categorize documents"},{key:q.group_resourceDocument,description:"Tags for document resources, used to define documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[m.documentDownload]:{since:"1.3.0",baseBitType:m._standard,description:"Document download bit, used to define downloadable documents in articles or books",tags:[{key:q.group_resourceBitTags,description:"Tags for resource bits, used to categorize downloadable documents"},{key:q.group_resourceDocumentDownload,description:"Tags for downloadable document resources, used to define downloadable documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[m.leDocumentDownload]:{since:"3.18.0",baseBitType:m.documentDownload,description:"LE Document download bit, used to define downloadable documents in learning experiences"},[m.documentEmbed]:{since:"1.3.0",baseBitType:m._standard,description:"Document embed bit, used to embed documents in articles or books",tags:[{key:q.group_resourceBitTags,description:"Tags for resource bits, used to categorize embedded documents"},{key:q.group_resourceDocumentEmbed,description:"Tags for embedded document resources, used to define embedded documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[m.documentLink]:{since:"1.3.0",baseBitType:m._standard,description:"Document link bit, used to link to documents in articles or books",tags:[{key:q.group_resourceBitTags,description:"Tags for resource bits, used to categorize document links"},{key:q.group_resourceDocumentLink,description:"Tags for document link resources, used to define links to documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[m.essay]:{since:"1.3.0",baseBitType:m._standard,description:"Essay bit, used to define essays in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common tags for quiz bits"},{key:q.property_reasonableNumOfChars,description:"The reasonable number of characters for the essay",format:k.number},{key:q.property_sampleSolution,description:"Sample solution for the essay, used as a reference answer",format:k.plainText},{key:q.property_additionalSolutions,description:"Additional solutions for the essay, used for alternative answers",format:k.plainText,maxCount:g.infinity},{key:q.property_partialAnswer,description:"Partial answer for the essay, used to indicate incomplete answers",format:k.plainText},{key:q.property_reference,description:"Reference for the essay, used to link to external resources",format:k.plainText,maxCount:g.infinity}],rootExampleType:b.string},[m.coachSelfReflectionEssay]:{since:"1.3.0",baseBitType:m.essay,description:"Coach self-reflection essay bit"},[m.coachCallToActionEssay]:{since:"1.3.0",baseBitType:m.essay,description:"Coach call to action essay bit"},[m.example]:{since:"1.3.0",baseBitType:m._standard,description:"Example bit, used to provide examples in articles or books",tags:[{key:q.tag_title,description:"The title of the example"}],rootExampleType:b.string},[m.exampleAlt]:{since:"1.16.0",baseBitType:m.example,description:"Alternative example bit, used to provide alternative examples in articles or books"},[m.standardExampleNormative]:{since:"1.16.0",baseBitType:m.example,description:"Standard normative example bit, used to provide normative examples in articles or books"},[m.standardExampleNonNormative]:{since:"1.16.0",baseBitType:m.example,description:"Standard non-normative example bit, used to provide non-normative examples in articles or books"},[m.smartStandardExampleNormative]:{since:"1.28.0",baseBitType:m.standardExampleNormative,description:"Smart standard normative example bit, used to provide normative examples in smart standards"},[m.smartStandardExampleNonNormative]:{since:"1.28.0",baseBitType:m.standardExampleNonNormative,description:"Smart standard non-normative example bit, used to provide non-normative examples in smart standards"},[m.smartStandardExampleNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardExampleNormative,description:"Smart standard normative example collapsible bit, used to provide normative examples in smart standards that can be collapsed"},[m.smartStandardExampleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardExampleNonNormative,description:"Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"},[m.appAiPrompt]:{since:"1.3.0",baseBitType:m.article,description:"App AI prompt bit, used to create AI prompts in the app editor"},[m.aiPrompt]:{since:"1.3.0",baseBitType:m.article,description:"AI prompt bit, used to create AI prompts in articles or books"},[m.articleAi]:{since:"1.3.0",baseBitType:m.article,description:"Article AI bit, used to create AI-generated articles"},[m.articleAttachment]:{since:"1.3.0",baseBitType:m.article,description:"Article attachment bit, used to attach files to articles"},[m.assignment]:{since:"1.3.0",baseBitType:m.essay,description:"Assignment bit, used to define assignments in articles or books"},[m.audioTranscript]:{since:"1.3.0",baseBitType:m.article,description:"Audio transcript bit, used to provide transcripts for audio files in articles or books"},[m.bitmarkExample]:{since:"1.3.0",baseBitType:m.example,description:"Bitmark example bit, used to provide examples for bitmarks in articles or books"},[m.blogArticle]:{since:"1.3.0",baseBitType:m.article,description:"Blog article bit, used to define blog articles in articles or books"},[m.bug]:{since:"1.3.0",baseBitType:m.article,description:"Bug bit, used to report bugs in articles or books"},[m.bugAlt]:{since:"1.16.0",baseBitType:m.bug,description:"Alternative bug bit, used to report bugs in articles or books with alternative styling"},[m.checklist]:{since:"1.3.0",baseBitType:m.article,description:"Checklist bit, used to create checklists in articles or books"},[m.coachAudioTranscript]:{since:"1.3.0",baseBitType:m.article,description:"Coach audio transcript bit, used to provide transcripts for audio files in coaching articles or books"},[m.coachCallToActionChecklist]:{since:"1.3.0",baseBitType:m.article,description:"Coach call to action checklist bit, used to create checklists in coaching articles or books"},[m.coachHomeRules]:{since:"1.3.0",baseBitType:m.article,description:"Coach home rules bit, used to define home rules in coaching articles or books"},[m.coachVideoTranscript]:{since:"1.3.0",baseBitType:m.article,description:"Coach video transcript bit, used to provide transcripts for video files in coaching articles or books"},[m.correction]:{since:"1.3.0",baseBitType:m.article,description:"Correction bit, used to provide corrections in articles or books"},[m.danger]:{since:"1.3.0",baseBitType:m.article,description:"Danger bit, used to highlight dangerous or critical information in articles or books"},[m.dangerAlt]:{since:"1.16.0",baseBitType:m.article,description:"Alternative danger bit, used to highlight dangerous or critical information in articles or books with alternative styling"},[m.definitionTerm]:{since:"1.34.0",baseBitType:m.article,description:"Definition term bit, used to define terms in articles or books"},[m.deleted]:{since:"3.9.0",baseBitType:m.article,description:"Deleted bit, used to indicate deleted content in articles or books"},[m.details1]:{since:"1.3.0",baseBitType:m.article,description:"Details bit, used to provide additional details in articles or books"},[m.details]:{since:"1.3.0",baseBitType:m.article,description:"Details bit, used to provide additional details in articles or books"},[m.qAndA]:{since:"3.5.0",baseBitType:m.article,description:"Q&A bit, used to create question and answer sections in articles or books"},[m.editorial]:{since:"1.3.0",baseBitType:m.article,description:"Editorial bit, used to provide editorial content in articles or books"},[m.editorNote]:{since:"1.3.0",baseBitType:m.article,description:"Editor note bit, used to provide notes from the editor in articles or books"},[m.featured]:{since:"1.3.0",baseBitType:m.article,description:"Featured bit, used to highlight featured content in articles or books"},[m.glossaryTerm]:{since:"1.33.0",baseBitType:m.article,description:"Glossary term bit, used to define glossary terms in articles or books"},[m.help]:{since:"1.3.0",baseBitType:m.article,description:"Help bit, used to provide help or support information in articles or books"},[m.helpAlt]:{since:"1.16.0",baseBitType:m.help,description:"Alternative help bit, used to provide help or support information in articles or books with alternative styling"},[m.hint]:{since:"1.3.0",baseBitType:m.article,description:"Hint bit, used to provide hints or tips in articles or books"},[m.hintAlt]:{since:"1.16.0",baseBitType:m.hint,description:"Alternative hint bit, used to provide hints or tips in articles or books with alternative styling"},[m.indexTerm]:{since:"1.33.0",baseBitType:m.article,description:"Index term bit, used to define index terms in articles or books"},[m.info]:{since:"1.3.0",baseBitType:m.article,description:"Info bit, used to provide informational content in articles or books"},[m.infoAlt]:{since:"1.16.0",baseBitType:m.info,description:"Alternative info bit, used to provide informational content in articles or books with alternative styling"},[m.langLearningOutcomes]:{since:"1.3.0",baseBitType:m.article,description:"Language learning outcomes bit, used to define learning outcomes in language articles or books"},[m.langEnablingLanguageSkills]:{since:"1.3.0",baseBitType:m.article,description:"Language enabling skills bit, used to define enabling language skills in language articles or books"},[m.langLifeSkills]:{since:"1.3.0",baseBitType:m.article,description:"Language life skills bit, used to define life skills in language articles or books"},[m.langEnglishAroundWorld]:{since:"1.3.0",baseBitType:m.article,description:"Language English around the world bit, used to provide information about English usage around the world in language articles or books"},[m.langGoodToKnow]:{since:"1.3.0",baseBitType:m.article,description:"Language good to know bit, used to provide useful information in language articles or books"},[m.langLearningGoal]:{since:"1.3.0",baseBitType:m.article,description:"Language learning goal bit, used to define learning goals in language articles or books"},[m.langLearningStrategy]:{since:"1.3.0",baseBitType:m.article,description:"Language learning strategy bit, used to define learning strategies in language articles or books"},[m.langLikeALocal]:{since:"1.3.0",baseBitType:m.article,description:"Language like a local bit, used to provide tips for speaking like a local in language articles or books"},[m.langMaterial]:{since:"1.3.0",baseBitType:m.article,description:"Language material bit, used to provide language learning materials in language articles or books"},[m.langUsefulPhrases]:{since:"1.3.0",baseBitType:m.article,description:"Language useful phrases bit, used to provide useful phrases in language articles or books"},[m.langLevelDown]:{since:"1.3.0",baseBitType:m.article,description:"Language level down bit, used to provide information about lower language levels in language articles or books"},[m.langLevelUp]:{since:"1.3.0",baseBitType:m.article,description:"Language level up bit, used to provide information about higher language levels in language articles or books"},[m.langExtraActivity]:{since:"1.3.0",baseBitType:m.article,description:"Language extra activity bit, used to provide additional activities in language articles or books"},[m.langVideoScript]:{since:"1.3.0",baseBitType:m.article,description:"Language video script bit, used to provide scripts for language learning videos in articles or books"},[m.langAudioScript]:{since:"1.3.0",baseBitType:m.article,description:"Language audio script bit, used to provide scripts for language learning audio files in articles or books"},[m.langVocabulary]:{since:"1.3.0",baseBitType:m.article,description:"Language vocabulary bit, used to provide vocabulary lists in language articles or books"},[m.langHomework]:{since:"1.3.0",baseBitType:m.article,description:"Language homework bit, used to define homework assignments in language articles or books"},[m.langTeacherNote]:{since:"1.3.0",baseBitType:m.article,description:"Language teacher note bit, used to provide notes for teachers in language articles or books"},[m.langTeacherPronunciation]:{since:"1.3.0",baseBitType:m.article,description:"Language teacher pronunciation bit, used to provide pronunciation guidance for teachers in language articles or books"},[m.list]:{since:"1.22.0",baseBitType:m.article,description:"List bit, used to create lists in articles or books"},[m.standardList]:{since:"1.22.0",baseBitType:m.article,description:"Standard list bit, used to create standard lists in articles or books"},[m.smartStandardList]:{since:"1.28.0",baseBitType:m.standardList,description:"Smart standard list bit, used to create smart standard lists in articles or books"},[m.smartStandardListCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardList,description:"Smart standard list collapsible bit, used to create collapsible smart standard lists in articles or books"},[m.message]:{since:"1.3.0",baseBitType:m.article,description:"Message bit, used to create messages in articles or books"},[m.newspaperArticle]:{since:"1.3.0",baseBitType:m.article,description:"Newspaper article bit, used to define newspaper articles in articles or books"},[m.note]:{since:"1.3.0",baseBitType:m.article,description:"Note bit, used to provide notes in articles or books"},[m.noteAlt]:{since:"1.16.0",baseBitType:m.note,description:"Alternative note bit, used to provide notes in articles or books with alternative styling"},[m.standardNoteNormative]:{since:"1.16.0",baseBitType:m.note,description:"Standard normative note bit, used to provide normative notes in articles or books"},[m.standardNoteNonNormative]:{since:"1.16.0",baseBitType:m.note,description:"Standard non-normative note bit, used to provide non-normative notes in articles or books"},[m.smartStandardNoteNormative]:{since:"1.28.0",baseBitType:m.standardNoteNormative,description:"Smart standard normative note bit, used to provide normative notes in smart standards"},[m.smartStandardNoteNonNormative]:{since:"1.28.0",baseBitType:m.standardNoteNonNormative,description:"Smart standard non-normative note bit, used to provide non-normative notes in smart standards"},[m.smartStandardNoteNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardNoteNormative,description:"Smart standard normative note collapsible bit, used to provide normative notes in smart standards that can be collapsed"},[m.smartStandardNoteNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardNoteNonNormative,description:"Smart standard non-normative note collapsible bit, used to provide non-normative notes in smart standards that can be collapsed"},[m.noteAi]:{since:"1.3.0",baseBitType:m.note,description:"Note AI bit, used to create AI-generated notes in articles or books"},[m.notebookArticle]:{since:"1.3.0",baseBitType:m.article,description:"Notebook article bit, used to define notebook articles in articles or books"},[m.preparationNote]:{since:"1.3.0",baseBitType:m.article,description:"Preparation note bit, used to provide preparation notes in articles or books"},[m.releaseNotesSummary]:{since:"1.3.0",baseBitType:m.article,description:"Release notes summary bit, used to summarize release notes in articles or books"},[m.remark]:{since:"1.3.0",baseBitType:m.article,description:"Remark bit, used to provide remarks in articles or books"},[m.remarkAlt]:{since:"1.16.0",baseBitType:m.remark,description:"Alternative remark bit, used to provide remarks in articles or books with alternative styling"},[m.standardRemarkNormative]:{since:"1.16.0",baseBitType:m.article,description:"Standard normative remark bit, used to provide normative remarks in articles or books"},[m.standardRemarkNonNormative]:{since:"1.16.0",baseBitType:m.article,description:"Standard non-normative remark bit, used to provide non-normative remarks in articles or books"},[m.smartStandardRemarkNormative]:{since:"1.28.0",baseBitType:m.standardRemarkNormative,description:"Smart standard normative remark bit, used to provide normative remarks in smart standards"},[m.smartStandardRemarkNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkNonNormative,description:"Smart standard non-normative remark bit, used to provide non-normative remarks in smart standards"},[m.smartStandardRemarkNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkNormative,description:"Smart standard normative remark collapsible bit, used to provide normative remarks in smart standards that can be collapsed"},[m.smartStandardRemarkNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkNonNormative,description:"Smart standard non-normative remark collapsible bit, used to provide non-normative remarks in smart standards that can be collapsed"},[m.selfAssessment]:{since:"1.3.0",baseBitType:m.article,description:"Self-assessment bit, used to create self-assessment sections in articles or books"},[m.separator]:{since:"1.4.15",baseBitType:m.article,description:"Separator bit, used to create visual separators in articles or books"},[m.separatorAlt]:{since:"1.16.0",baseBitType:m.separator,description:"Alternative separator bit, used to create visual separators in articles or books with alternative styling"},[m.sticker]:{since:"1.5.28",baseBitType:m.article,description:"Sticker bit, used to create stickers in articles or books"},[m.sideNote]:{since:"1.3.0",baseBitType:m.article,description:"Side note bit, used to provide side notes in articles or books"},[m.summary]:{since:"1.3.0",baseBitType:m.article,description:"Summary bit, used to provide summaries in articles or books"},[m.summaryAi]:{since:"1.3.0",baseBitType:m.summary,description:"AI-generated summary bit"},[m.videoTranscript]:{since:"1.3.0",baseBitType:m.article,description:"Video transcript bit, used to provide transcripts for video files in articles or books"},[m.warning]:{since:"1.3.0",baseBitType:m.article,description:"Warning bit, used to highlight warnings in articles or books"},[m.warningAlt]:{since:"1.16.0",baseBitType:m.warning,description:"Alternative warning bit, used to highlight warnings in articles or books with alternative styling"},[m.workbookArticle]:{since:"1.3.0",baseBitType:m.article,description:"Workbook article bit, used to define workbook articles in articles or books"},[m.collapsible]:{since:"1.21.0",baseBitType:m.article,description:"Collapsible bit, used to create collapsible sections in articles or books"},[m.sideNoteCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Side note collapsible bit, used to create collapsible side notes in articles or books"},[m.infoCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Info collapsible bit, used to create collapsible informational sections in articles or books"},[m.remarkCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Remark collapsible bit, used to create collapsible remarks in articles or books"},[m.warningCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Warning collapsible bit, used to create collapsible warnings in articles or books"},[m.dangerCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Danger collapsible bit, used to create collapsible danger sections in articles or books"},[m.noteCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Note collapsible bit, used to create collapsible notes in articles or books"},[m.exampleCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Example collapsible bit, used to create collapsible examples in articles or books"},[m.hintCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Hint collapsible bit, used to create collapsible hints in articles or books"},[m.bugCollapsible]:{since:"1.21.0",baseBitType:m.article,description:"Bug collapsible bit, used to create collapsible bug reports in articles or books"},[m.platformPath]:{since:"3.14.1",baseBitType:m._standard,description:"Platform path bit, used to define paths in the platform",tags:[{key:q.property_path,description:"The path for the platform, used to define navigation paths",format:k.plainText}]},[m.container]:{since:"1.9.0",baseBitType:m.article,description:"Container bit, used to group bits together in articles or books",tags:[{key:q.property_allowedBit,description:"Allowed bits in the container, used to define which bits can be placed inside",format:k.plainText,maxCount:g.infinity}]},[m.containerWrap]:{since:"1.9.0",baseBitType:m.container,description:"Container wrap bit, used to wrap content in a container"},[m.containerNowrap]:{since:"1.9.0",baseBitType:m.container,description:"Container nowrap bit, used to prevent wrapping of content in a container"},[m.containerNowrapStretch]:{since:"1.9.0",baseBitType:m.container,description:"Container nowrap stretch bit, used to stretch content without wrapping in a container"},[m.containerGroup]:{since:"1.9.0",baseBitType:m.container,description:"Container group bit, used to group multiple containers together"},[m.containerFolder]:{since:"1.9.0",baseBitType:m.container,description:"Container folder bit, used to create folders for organizing bits"},[m.containerCarousel]:{since:"1.11.0",baseBitType:m.container,description:"Container carousel bit, used to create carousels for displaying bits"},[m.containerCards]:{since:"1.11.0",baseBitType:m.container,description:"Container cards bit, used to create card layouts for displaying bits"},[m.containerGrid]:{since:"1.11.0",baseBitType:m.container,description:"Container grid bit, used to create grid layouts for displaying bits"},[m.containerStack]:{since:"1.11.0",baseBitType:m.container,description:"Container stack bit, used to create stacked layouts for displaying bits"},[m.containerSlides]:{since:"1.11.0",baseBitType:m.container,description:"Container slides bit, used to create slide presentations for displaying bits"},[m.containerGallery]:{since:"1.11.0",baseBitType:m.container,description:"Container gallery bit, used to create galleries for displaying bits"},[m.containerScroller]:{since:"1.11.0",baseBitType:m.container,description:"Container scroller bit, used to create scrolling sections for displaying bits"},[m.containerTabs]:{since:"1.11.0",baseBitType:m.container,description:"Container tabs bit, used to create tabbed sections for displaying bits"},[m.containerAccordionTabs]:{since:"1.11.0",baseBitType:m.container,description:"Container accordion tabs bit, used to create accordion-style tabbed sections for displaying bits"},[m.containerFolderAll]:{since:"1.11.0",baseBitType:m.container,description:"Container folder all bit, used to create folders that can contain all types of bits"},[m.containerBits2]:{since:"1.11.0",baseBitType:m.container,description:"Container bits 2 bit, used to create a container for bits with additional features"},[m.containerCookRecipe]:{since:"1.11.0",baseBitType:m.container,description:"Container cook recipe bit, used to create recipe containers for displaying cooking recipes"},[m.containerNewsArticle]:{since:"1.11.0",baseBitType:m.container,description:"Container news article bit, used to create containers for news articles"},[m.containerPreview]:{since:"1.11.0",baseBitType:m.container,description:"Container preview bit, used to create preview sections for displaying bits"},[m.pageContainer]:{since:"1.9.0",baseBitType:m.container,description:"Page container bit, used to create containers for pages in articles or books"},[m.pageContainerWrap]:{since:"1.9.0",baseBitType:m.pageContainer,description:"Page container wrap bit, used to wrap content in a page container"},[m.pageContainerNowrap]:{since:"1.9.0",baseBitType:m.pageContainer,description:"Page container nowrap bit, used to prevent wrapping of content in a page container"},[m.pageContainerNowrapStretch]:{since:"1.9.0",baseBitType:m.pageContainer,description:"Page container nowrap stretch bit, used to stretch content without wrapping in a page container"},[m.pageContainerFolder]:{since:"1.9.0",baseBitType:m.pageContainer,description:"Page container folder bit, used to create folders for organizing bits in a page container"},[m.pageContainerGroup]:{since:"1.9.0",baseBitType:m.pageContainer,description:"Page container group bit, used to group multiple page containers together"},[m.metalevelExplanation]:{since:"1.10.0",baseBitType:m.article,description:"Metalevel explanation bit, used to provide explanations for metalevels in articles or books"},[m.module]:{since:"1.5.26",baseBitType:m.article,description:"Module bit, used to define modules in articles or books",tags:[{key:q.property_hasBookNavigation,description:"Indicates if the module has book navigation",format:k.boolean,defaultValue:"true"},{key:q.property_productId,description:"Product ID for the module, used to link to a specific product",format:k.plainText,minCount:1,maxCount:g.infinity},{key:q.property_duration,description:"Duration of the module, used to indicate how long it takes to complete",format:k.plainText}]},[m.moduleProduct]:{since:"1.9.0",baseBitType:m.module,description:"Module product bit, used to define products in modules",tags:[{key:q.property_productId,description:"Product ID for the module product, used to link to a specific product",format:k.plainText,minCount:1,maxCount:g.infinity}]},[m.exampleList]:{since:"1.4.13",baseBitType:m.example,description:"Example list bit, used to create lists of examples in articles or books",cardSet:v.exampleBitList,rootExampleType:b.string},[m.extractorPage]:{since:"1.5.17",baseBitType:m.image,description:"Extractor page bit, used to extract pages from images"},[m.extractorPageCollapsible]:{since:"1.30.0",baseBitType:m.extractorPage,description:"Collapsible extractor page bit, used to extract pages from images with collapsible functionality"},[m.extractorPageWithBlocks]:{since:"1.5.21",baseBitType:m.image,description:"Extractor page with blocks bit, used to extract pages with blocks from images"},[m.extractorPageWithBlocksCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageWithBlocks,description:"Collapsible extractor page with blocks bit, used to extract pages with blocks from images with collapsible functionality"},[m.extractorConfiguration]:{since:"1.7.1",baseBitType:m._standard,description:"Extractor configuration bit, used to configure extractors in articles or books",textFormatDefault:T.plainText},[m.extractorInformation]:{since:"3.8.0",baseBitType:m._standard,description:"Extractor information bit, used to provide information about extractors in articles or books",textFormatDefault:T.json},[m.extractorAiChat]:{since:"3.19.0",baseBitType:m._standard,description:"Extractor AI chat bit, used to create AI chat interfaces for extractors in articles or books"},[m.extractorBlock]:{since:"1.5.16",baseBitType:m._standard,description:"Extractor block bit, used to define blocks within extractor pages",tags:[{key:q.property_blockId,description:"Unique identifier for the block, used to reference the block in extractor pages",format:k.plainText},{key:q.property_pageNo,description:"Page number for the block, used to indicate the page on which the block appears",format:k.number},{key:q.property_x,description:"X-coordinate for the block, used to position the block on the page",format:k.number},{key:q.property_y,description:"Y-coordinate for the block, used to position the block on the page",format:k.number},{key:q.property_width,description:"Width of the block, used to define the size of the block on the page",format:k.number},{key:q.property_height,description:"Height of the block, used to define the size of the block on the page",format:k.number},{key:q.property_index,description:"Index of the block, used to order blocks within the extractor page",format:k.number},{key:q.property_classification,description:"Classification for the block, used to categorize the block within the extractor",format:k.plainText},{key:q.property_availableClassifications,description:"Available classifications for the block, used to define possible classifications",format:k.plainText,maxCount:g.infinity},{key:q.group_resourceImage,description:"Resource image for the block, used to attach images to the block",minCount:1}],resourceAttachmentAllowed:!1},[m.extractorRepeatedText]:{since:"1.5.21",baseBitType:m.article,description:"Extractor repeated text bit, used to define repeated text in extractor pages"},[m.extractorPageNumber]:{since:"1.5.21",baseBitType:m.article,description:"Extractor page number bit, used to define page numbers in extractor pages"},[m.extractorPageNumberCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageNumber,description:"Collapsible extractor page number bit, used to define page numbers in extractor pages with collapsible functionality"},[m.extractorPageHeader]:{since:"1.5.21",baseBitType:m.article,description:"Extractor page header bit, used to define headers in extractor pages"},[m.extractorPageHeaderCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageHeader,description:"Collapsible extractor page header bit, used to define headers in extractor pages with collapsible functionality"},[m.extractorPageFooter]:{since:"1.5.21",baseBitType:m.article,description:"Extractor page footer bit, used to define footers in extractor pages"},[m.extractorPageFooterCollapsible]:{since:"1.30.0",baseBitType:m.extractorPageFooter,description:"Collapsible extractor page footer bit, used to define footers in extractor pages with collapsible functionality"},[m.pageOpenBook]:{since:"1.5.10",baseBitType:m.article,description:"Page open book bit, used to create pages that open books in articles or books",tags:[{key:q.property_slug,description:"Slug for the book, used to identify the book in the system",format:k.plainText},{key:q.property_book,description:"Book reference for the page, used to link to a specific book",format:k.plainText,chain:[{key:q.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:q.tag_reference,description:"Reference tag for the book, used to link to the book in the system"},{key:q.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button"}]},[m.pageOpenBookList]:{since:"2.1.0",baseBitType:m.article,description:"Page open book list bit, used to create pages that open lists of books in articles or books",tags:[{key:q.property_book,description:"Book reference for the page, used to link to a specific book",maxCount:g.infinity,chain:[{key:q.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:q.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button",format:k.plainText}]},[m.pageSubscribe]:{since:"1.5.10",baseBitType:m.article,description:"Page subscribe bit, used to create pages that allow users to subscribe to content",tags:[{key:q.property_slug,description:"Slug for the subscription page, used to identify the page in the system",format:k.plainText},{key:q.property_buttonCaption,description:"Caption for the subscription button, used to define the text displayed on the button",format:k.plainText},{key:q.property_mailingList,description:"Mailing list for the subscription, used to link to a specific mailing list",format:k.plainText}]},[m.assignmentList]:{since:"1.4.13",baseBitType:m.exampleList,description:"Assignment list bit, used to create lists of assignments in articles or books"},[m.pageFooter]:{since:"1.4.13",baseBitType:m.article,description:"Page footer bit, used to create footers in articles or books",tags:[{key:q.property_slug,description:"Slug for the footer, used to identify the footer in the system",format:k.plainText}],cardSet:v.exampleBitList},[m.legend]:{since:"3.12.0",baseBitType:m._standard,description:"Legend bit, used to provide legends in articles or books",cardSet:v.definitionList},[m.smartStandardLegend]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard legend bit, used to provide smart standard legends in articles or books"},[m.smartStandardLegendNonNormative]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard non-normative legend bit, used to provide non-normative smart standard legends in articles or books"},[m.smartStandardLegendNormative]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard normative legend bit, used to provide normative smart standard legends in articles or books"},[m.smartStandardRemarkLegend]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard remark legend bit, used to provide smart standard remarks in legends"},[m.smartStandardRemarkLegendNonNormative]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard non-normative remark legend bit, used to provide non-normative smart standard remarks in legends"},[m.smartStandardRemarkLegendNormative]:{since:"3.12.0",baseBitType:m.legend,description:"Smart standard normative remark legend bit, used to provide normative smart standard remarks in legends"},[m.definitionList]:{since:"1.34.0",baseBitType:m._standard,description:"Definition list bit, used to create lists of definitions in articles or books",cardSet:v.definitionList},[m.metaSearchDefaultTerms]:{since:"3.12.0",baseBitType:m._standard,description:"Meta search default terms bit, used to define default search terms in articles",cardSet:v.definitionList},[m.metaSearchDefaultTopics]:{since:"3.12.0",baseBitType:m.metaSearchDefaultTerms,description:"Meta search default topics bit, used to define default search topics in articles"},[m.flashcard]:{since:"1.3.0",baseBitType:m._standard,description:"Flashcard bit, used to create flashcards in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for flashcards"}],cardSet:v.flashcard},[m.flashcard1]:{since:"1.3.0",baseBitType:m.flashcard,description:"Flashcard 1 bit"},[m.qAndACard]:{since:"3.25.0",baseBitType:m.flashcard1,description:"Q&A card bit, used to create question and answer cards in articles or books"},[m.focusImage]:{since:"1.3.0",baseBitType:m.image,description:"Focus image bit, used to create images with focus points in articles or books",tags:[{key:q.property_focusX,description:"X-coordinate for the focus point, used to define the focus area in the image",format:k.number},{key:q.property_focusY,description:"Y-coordinate for the focus point, used to define the focus area in the image",format:k.number}]},[m.highlightText]:{since:"1.3.0",baseBitType:m._standard,description:"Highlight text bit, used to create highlighted text in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for highlighted text"},{key:q.group_trueFalse,description:"True/False quiz tags for highlighted text"}]},[m.image]:{since:"1.3.0",baseBitType:m._standard,description:"Image bit, used to create images in articles or books",tags:[{key:q.resource_backgroundWallpaper,description:"Background wallpaper for the image, used to set a background for the image",chain:[{key:q.group_resourceImageCommon,description:"Common resource image tags for images"}]},{key:q.group_resourceBitTags,description:"Resource bit tags for images, used to define additional properties for images"},{key:q.group_resourceImage,description:"Resource image tags for images, used to attach images to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.appCreateBitsFromImage]:{since:"1.3.0",baseBitType:m.image,description:"App create bits from image bit, used to create bits from images in the app"},[m.appGetScreenshot]:{since:"1.3.0",baseBitType:m.image,description:"App get screenshot bit, used to capture screenshots in the app"},[m.detailsImage]:{since:"1.3.0",baseBitType:m.image,description:"Details image bit, used to create detailed images in articles or books"},[m.figure]:{since:"1.3.0",baseBitType:m.image,description:"Figure bit, used to create figures in articles or books",cardSet:v.definitionList},[m.imageBanner]:{since:"1.3.0",baseBitType:m.image,description:"Image banner bit, used to create banners in articles or books"},[m.imageFigure]:{since:"1.3.0",baseBitType:m.image,description:"Image figure bit, used to create figures with images in articles or books",cardSet:v.definitionList},[m.imageFigureAlt]:{since:"1.16.0",baseBitType:m.imageFigure,description:"Alternative image figure bit, used to create figures with alternative images in articles or books"},[m.standardImageFigureNormative]:{since:"1.16.0",baseBitType:m.imageFigure,description:"Standard normative image figure bit, used to create normative image figures in articles or books"},[m.standardImageFigureNonNormative]:{since:"1.16.0",baseBitType:m.imageFigure,description:"Standard non-normative image figure bit, used to create non-normative image figures in articles or books"},[m.smartStandardImageFigureNormative]:{since:"1.28.0",baseBitType:m.standardImageFigureNormative,description:"Smart standard normative image figure bit, used to create smart standard normative image figures in articles or books"},[m.smartStandardImageFigureNonNormative]:{since:"1.28.0",baseBitType:m.standardImageFigureNonNormative,description:"Smart standard non-normative image figure bit, used to create smart standard non-normative image figures in articles or books"},[m.smartStandardImageFigureNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardImageFigureNormative,description:"Collapsible smart standard normative image figure bit, used to create collapsible smart standard normative image figures in articles or books"},[m.smartStandardImageFigureNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardImageFigureNonNormative,description:"Collapsible smart standard non-normative image figure bit, used to create collapsible smart standard non-normative image figures in articles or books"},[m.imageLandscape]:{since:"1.3.0",baseBitType:m.image,description:"Image landscape bit, used to create landscape images in articles or books"},[m.imageMood]:{since:"1.3.0",baseBitType:m.image,description:"Image mood bit, used to create mood images in articles or books"},[m.imagePortrait]:{since:"1.3.0",baseBitType:m.image,description:"Image portrait bit, used to create portrait images in articles or books"},[m.imagePrototype]:{since:"1.3.0",baseBitType:m.image,description:"Image prototype bit, used to create prototype images in articles or books"},[m.imageSeparator]:{since:"1.4.15",baseBitType:m.image,description:"Image separator bit, used to create separators in articles or books"},[m.imageSeparatorAlt]:{since:"1.16.0",baseBitType:m.imageSeparator,description:"Alternative image separator bit, used to create alternative separators in articles or books"},[m.imageScreenshot]:{since:"1.3.0",baseBitType:m.image,description:"Image screenshot bit, used to create screenshots in articles or books"},[m.imageStyled]:{since:"1.3.0",baseBitType:m.image,description:"Image styled bit, used to create styled images in articles or books"},[m.imageSuperWide]:{since:"1.3.0",baseBitType:m.image,description:"Image super wide bit, used to create super wide images in articles or books"},[m.imageZoom]:{since:"1.3.0",baseBitType:m.image,description:"Image zoom bit, used to create zoomable images in articles or books"},[m.langLifeSkillIcon]:{since:"1.3.0",baseBitType:m.image,description:"Language life skill icon bit, used to create icons for life skills in articles or books"},[m.lifeSkillSticker]:{since:"1.3.0",baseBitType:m.image,description:"Life skill sticker bit, used to create stickers for life skills in articles or books"},[m.pageBanner]:{since:"1.4.3",baseBitType:m.image,description:"Page banner bit, used to create banners for pages in articles or books",tags:[{key:q.property_slug,description:"Slug for the page banner, used to identify the banner in the system",format:k.plainText}]},[m.pageHero]:{since:"1.11.0",baseBitType:m.pageBanner,description:"Page hero bit, used to create hero sections in articles or books"},[m.screenshot]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:m.image,description:"Screenshot bit, used to create screenshots in articles or books"},[m.tableImage]:{since:"1.5.15",baseBitType:m.image,description:"Table image bit, used to create images in tables in articles or books",tags:[{key:q.property_caption,description:"Caption for the table image, used to provide a description for the image",format:k.bitmarkText}]},[m.tableImageAlt]:{since:"1.16.0",baseBitType:m.tableImage,description:"Alternative table image bit, used to create alternative images in tables in articles or books"},[m.standardTableImageNormative]:{since:"1.16.0",baseBitType:m.tableImage,description:"Standard normative table image bit, used to create normative images in tables in articles or books"},[m.standardTableImageNonNormative]:{since:"1.16.0",baseBitType:m.tableImage,description:"Standard non-normative table image bit, used to create non-normative images in tables in articles or books"},[m.standardRemarkTableImageNormative]:{since:"1.17.0",baseBitType:m.tableImage,description:"Standard normative remark table image bit, used to create normative remark images in tables in articles or books"},[m.standardRemarkTableImageNonNormative]:{since:"1.17.0",baseBitType:m.tableImage,description:"Standard non-normative remark table image bit, used to create non-normative remark images in tables in articles or books"},[m.smartStandardTableImageNormative]:{since:"1.28.0",baseBitType:m.standardTableImageNormative,description:"Smart standard normative table image bit, used to create smart standard normative images in tables in articles or books"},[m.smartStandardTableImageNonNormative]:{since:"1.28.0",baseBitType:m.standardTableImageNonNormative,description:"Smart standard non-normative table image bit, used to create smart standard non-normative images in tables in articles or books"},[m.smartStandardRemarkTableImageNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableImageNormative,description:"Smart standard normative remark table image bit, used to create smart standard normative remark images in tables in articles or books"},[m.smartStandardRemarkTableImageNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableImageNonNormative,description:"Smart standard non-normative remark table image bit, used to create smart standard non-normative remark images in tables in articles or books"},[m.smartStandardTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableImageNormative,description:"Collapsible smart standard normative table image bit, used to create collapsible smart standard normative images in tables in articles or books"},[m.smartStandardTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableImageNonNormative,description:"Collapsible smart standard non-normative table image bit, used to create collapsible smart standard non-normative images in tables in articles or books"},[m.smartStandardRemarkTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableImageNormative,description:"Collapsible smart standard normative remark table image bit, used to create collapsible smart standard normative remark images in tables in articles or books"},[m.smartStandardRemarkTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableImageNonNormative,description:"Collapsible smart standard non-normative remark table image bit, used to create collapsible smart standard non-normative remark images in tables in articles or books"},[m.imageLink]:{since:"1.3.0",baseBitType:m._standard,description:"Image link bit, used to create links with images in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for image links, used to define additional properties"},{key:q.group_resourceImageLink,description:"Resource image link tags, used to attach images to the link",minCount:1}],resourceAttachmentAllowed:!1},[m.imageOnDevice]:{since:"1.3.0",baseBitType:m._standard,description:"Image on device bit, used to create images stored on the device in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for images on device, used to define additional properties"},{key:q.group_resourceImage,description:"Resource image tags for images on device, used to attach images"},{key:q.group_imageSource,description:"Image source tags for images on device, used to define the source of the image"}],resourceAttachmentAllowed:!1},[m.imageResponsive]:{since:"1.3.0",baseBitType:m._standard,description:"Responsive image bit, used to create responsive images in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for responsive images, used to define additional properties"},{key:q.group_resourceImageResponsive,description:"Resource image responsive tags, used to attach responsive images"}],resourceAttachmentAllowed:!1},[m.imagesLogoGrave]:{since:"1.5.11",baseBitType:m._standard,description:"Logo grave images bit, used to create logo grave images in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:q.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:g.infinity}],resourceAttachmentAllowed:!1},[m.prototypeImages]:{since:"1.6.1",baseBitType:m.imagesLogoGrave,description:"Prototype images bit, used to create prototype images in articles or books"},[m.internalLink]:{since:"1.3.0",baseBitType:m._standard,description:"Internal link bit, used to create links to other bits in articles or books",tags:[{key:q.tag_reference,description:"Reference tag for the internal link, used to link to the target bit"}]},[m.interview]:{since:"1.3.0",baseBitType:m._standard,description:"Interview bit, used to create interviews in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for interviews"},{key:q.property_reasonableNumOfChars,description:"Reasonable number of characters for the interview, used to limit input size",format:k.number}],cardSet:v.questions},[m.interviewInstructionGrouped]:{since:"1.3.0",baseBitType:m.interview,description:"Grouped interview instruction bit"},[m.botInterview]:{since:"1.3.0",baseBitType:m.interview,description:"Bot interview bit, used to create bot interviews in articles or books"},[m.learningPathBook]:{since:"1.3.0",baseBitType:m._standard,description:"Learning path book bit, used to create learning paths in articles or books",tags:[{key:q.group_learningPathCommon,description:"Common tags for learning path books, used to define properties of learning paths"}]},[m.bookLink]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Book link bit, used to create links to books in learning paths"},[m.bookLinkNext]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Next book link bit, used to create links to the next book in learning paths"},[m.bookLinkPrev]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Previous book link bit, used to create links to the previous book in learning paths"},[m.learningPathClassroomEvent]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path classroom event bit, used to create classroom events in learning paths"},[m.learningPathClassroomTraining]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path classroom training bit, used to create classroom training in learning paths"},[m.learningPathClosing]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path closing bit, used to close learning paths"},[m.learningPathFeedback]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path feedback bit, used to provide feedback in learning paths"},[m.learningPathLearningGoal]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path learning goal bit, used to define learning goals in learning paths"},[m.learningPathLti]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path LTI bit, used to integrate LTI tools in learning paths"},[m.learningPathSign]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path sign bit, used to create signs in learning paths"},[m.learningPathStep]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path step bit, used to create steps in learning paths"},[m.learningPathBotTraining]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path bot training bit, used to create bot training in learning paths",tags:[{key:q.property_bot,description:"Bot reference for the training, used to link to a specific bot",format:k.plainText}]},[m.learningPathExternalLink]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path external link bit, used to create external links in learning paths",tags:[{key:q.property_externalLink,description:"External link for the learning path, used to link to external resources",format:k.plainText},{key:q.property_externalLinkText,description:"Text for the external link, used to define the link text displayed",format:k.plainText}]},[m.learningPathVideoCall]:{since:"1.3.0",baseBitType:m.learningPathBook,description:"Learning path video call bit, used to create video calls in learning paths",tags:[{key:q.property_videoCallLink,description:"Video call link for the learning path, used to link to video calls",format:k.plainText}]},[m.leLearningObjectives]:{since:"1.25.0",baseBitType:m.learningPathLearningGoal,description:"Learning objectives bit, used to define learning objectives in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the learning objectives, used to categorize the activity",format:k.plainText}]},[m.leVideoCall]:{since:"1.25.0",baseBitType:m.learningPathVideoCall,description:"Video call bit, used to create video calls in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the video call, used to categorize the activity",format:k.plainText}]},[m.leClassroomEvent]:{since:"1.25.0",baseBitType:m.learningPathClassroomEvent,description:"Classroom event bit, used to create classroom events in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the classroom event, used to categorize the activity",format:k.plainText}]},[m.leMultiDayEvent]:{since:"3.32.0",baseBitType:m.leClassroomEvent,description:"Multi-day event bit, used to create multi-day events in learning paths"},[m.leCompletion]:{since:"1.25.0",baseBitType:m.learningPathClosing,description:"Completion bit, used to mark the completion of learning paths",tags:[{key:q.property_activityType,description:"Activity type for the completion, used to categorize the activity",format:k.plainText}]},[m.leExternalLink]:{since:"1.25.0",baseBitType:m.learningPathExternalLink,description:"External link bit, used to create external links in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the external link, used to categorize the activity",format:k.plainText}]},[m.leReadBook]:{since:"1.25.0",baseBitType:m.learningPathBook,description:"Read book bit, used to create reading tasks in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the reading task, used to categorize the activity",format:k.plainText}]},[m.leLearningStep]:{since:"1.25.0",baseBitType:m.learningPathStep,description:"Learning step bit, used to create steps in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the learning step, used to categorize the activity",format:k.plainText}]},[m.lePreparationTask]:{since:"1.26.0",baseBitType:m.learningPathBook,description:"Preparation task bit, used to create preparation tasks in learning paths",tags:[{key:q.property_activityType,format:k.plainText,description:"Activity type for the preparation task, used to categorize the activity"}]},[m.leRead]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Read task bit, used to create reading tasks in learning paths"},[m.leTask]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Task bit, used to create tasks in learning paths"},[m.leTodo]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Todo bit, used to create todo tasks in learning paths"},[m.leFollowUpTask]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Follow-up task bit, used to create follow-up tasks in learning paths"},[m.leFinishingTask]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Finishing task bit, used to create finishing tasks in learning paths"},[m.leAssignment]:{since:"1.27.0",baseBitType:m.lePreparationTask,description:"Assignment bit, used to create assignments in learning paths"},[m.leWatchVideoEmbed]:{since:"1.27.0",baseBitType:m.learningPathBook,description:"Watch video embed bit, used to embed videos in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the video embed, used to categorize the activity",format:k.plainText},{key:q.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:q.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.leListenAudioEmbed]:{since:"1.27.0",baseBitType:m.learningPathBook,description:"Listen audio embed bit, used to embed audio in learning paths",tags:[{key:q.property_activityType,description:"Activity type for the audio embed, used to categorize the activity",format:k.plainText},{key:q.group_resourceBitTags,description:"Resource bit tags for audio embeds, used to define additional properties"},{key:q.group_resourceAudioEmbed,description:"Resource audio embed tags, used to attach audio embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.listItem]:{since:"1.22.0",baseBitType:m.article,description:"List item bit, used to create list items in articles or books",tags:[{key:q.property_listItemIndent,description:"Indentation level for the list item, used to define the hierarchy of the list",format:k.number,defaultValue:"0"}]},[m.standardListItem]:{since:"1.22.0",baseBitType:m.listItem,description:"Standard list item bit, used to create standard list items in articles or books"},[m.smartStandardListItem]:{since:"1.28.0",baseBitType:m.standardListItem,description:"Smart standard list item bit, used to create smart standard list items in articles or books"},[m.smartStandardListItemCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardListItem,description:"Collapsible smart standard list item bit, used to create collapsible smart standard list items in articles or books"},[m.mark]:{since:"1.3.0",baseBitType:m._standard,description:"Mark bit, used to create marks in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for marks"},{key:q.group_markConfig,description:"Configuration tags for marks, used to define properties of marks"},{key:q.group_mark,description:"Mark tags, used to define the content of marks"}]},[m.match]:{since:"1.3.0",baseBitType:m._standard,description:"Match bit, used to create matching pairs in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for matching pairs"},{key:q.property_isCaseSensitive,description:"Case sensitivity for matching pairs, used to define if matches are case-sensitive",format:k.boolean}],cardSet:v.matchPairs},[m.matchAll]:{since:"1.3.0",baseBitType:m.match,description:"Match all bit, used to create matching pairs with all options in articles or books"},[m.matchReverse]:{since:"1.3.0",baseBitType:m.match,description:"Match reverse bit, used to create matching pairs with reversed options in articles or books"},[m.matchAllReverse]:{since:"1.3.0",baseBitType:m.match,description:"Match all reverse bit, used to create matching pairs with all options and reversed in articles or books"},[m.matchSolutionGrouped]:{since:"1.3.0",baseBitType:m.match,description:"Grouped match solution bit, used to create grouped matching solutions in articles or books"},[m.matchMatrix]:{since:"1.3.0",baseBitType:m.match,description:"Match matrix bit, used to create matching pairs in a matrix format in articles or books",cardSet:v.matchMatrix},[m.matchAudio]:{since:"1.3.0",baseBitType:m.match,description:"Match audio bit, used to create matching pairs with audio in articles or books",cardSet:v.matchAudioPairs},[m.matchPicture]:{since:"1.3.0",baseBitType:m.match,description:"Match picture bit, used to create matching pairs with pictures in articles or books",cardSet:v.matchImagePairs},[m.feedback]:{since:"3.13.0",baseBitType:m._standard,description:"Feedback bit, used to provide feedback in articles or books",tags:[{key:q.property_reasonableNumOfChars,description:"Reasonable number of characters for feedback, used to limit input size",format:k.number}],cardSet:v.feedback},[m.learningDocumentationFeedback]:{since:"3.13.0",baseBitType:m.feedback,description:"Feedback for learning documentation"},[m.handInFeedbackExpert]:{since:"3.30.0",baseBitType:m.feedback,description:"Feedback for expert hand-in"},[m.handInFeedbackSelf]:{since:"3.30.0",baseBitType:m.feedback,description:"Self-feedback for hand-in"},[m.multipleChoice1]:{since:"1.3.0",baseBitType:m._standard,description:"Multiple choice 1 bit, used to create single-choice questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for multiple choice 1 questions"},{key:q.group_trueFalse,description:"True/False tags for multiple choice 1 questions"}]},[m.coachSelfReflectionMultipleChoice1]:{since:"1.3.0",baseBitType:m.multipleChoice1,description:"Coach self-reflection multiple choice 1 bit, used for self-reflection in coaching"},[m.multipleChoice]:{since:"1.3.0",baseBitType:m._standard,description:"Multiple choice bit, used to create multiple-choice questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for multiple choice questions"},{key:q.group_trueFalse,description:"True/False tags for multiple choice questions"}],cardSet:v.quiz},[m.coachSelfReflectionMultipleChoice]:{since:"1.3.0",baseBitType:m.multipleChoice,description:"Coach self-reflection multiple choice bit, used for self-reflection in coaching"},[m.multipleChoiceText]:{since:"1.3.0",baseBitType:m._standard,description:"Multiple choice text bit, used to create multiple-choice questions with text in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for multiple choice text questions"},{key:q.group_trueFalse,description:"True/False tags for multiple choice text questions"}]},[m.coachCallToActionMultipleChoiceText]:{since:"1.3.0",baseBitType:m.multipleChoiceText,description:"Coach call to action multiple choice text bit, used for self-reflection in coaching"},[m.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0",baseBitType:m.multipleChoiceText,description:"Coach self-reflection multiple choice text bit, used for self-reflection in coaching"},[m.multipleResponse1]:{since:"1.3.0",baseBitType:m._standard,description:"Multiple response 1 bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for multiple response 1 questions"},{key:q.group_trueFalse,description:"True/False tags for multiple response 1 questions"}]},[m.coachSelfReflectionMultipleResponse1]:{since:"1.3.0",baseBitType:m.multipleResponse1,description:"Coach self-reflection multiple response 1 bit, used for self-reflection in coaching"},[m.multipleResponse]:{since:"1.3.0",baseBitType:m._standard,description:"Multiple response bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for multiple response questions"},{key:q.group_trueFalse,description:"True/False tags for multiple response questions"}],cardSet:v.quiz},[m.coachSelfReflectionMultipleResponse]:{since:"1.3.0",baseBitType:m.multipleResponse,description:"Coach self-reflection multiple response bit, used for self-reflection in coaching"},[m.page]:{since:"1.3.0",baseBitType:m._standard,description:"Page bit, used to create pages in articles or books",tags:[{key:q.tag_title,description:"Title of the page, used to display the page title"},{key:q.property_thumbImage,description:"Thumbnail image for the page, used to display a small image representation",format:k.plainText}]},[m.pageCollapsible]:{since:"1.30.0",baseBitType:m.page,description:"Collapsible page bit, used to create collapsible sections in pages"},[m.pageCoverImage]:{since:"1.22.0",baseBitType:m.page,description:"Page cover image bit, used to create cover images for pages"},[m.pageBuyButton]:{since:"1.4.3",baseBitType:m._standard,description:"Page buy button bit, used to create buy buttons on pages",tags:[{key:q.property_slug,description:"Slug for the page, used to identify the page in URLs",format:k.plainText},{key:q.property_content2Buy,description:"Content to buy for the page, used to define what is being sold",format:k.plainText},{key:q.property_buttonCaption,description:"Caption for the buy button, used to define the text displayed on the button",format:k.plainText}]},[m.pageBuyButtonAlt]:{since:"1.31.0",baseBitType:m.pageBuyButton,description:"Alternative page buy button bit, used to create alternative buy buttons on pages"},[m.pageBuyButtonPromotion]:{since:"1.5.11",baseBitType:m.pageBuyButton,description:"Page buy button for promotions, used to create buy buttons on promotional pages"},[m.pageSubpage]:{since:"1.6.6",baseBitType:m._standard,description:"Page subpage bit, used to create subpages in articles or books",tags:[{key:q.property_slug,description:"Slug for the subpage, used to identify the subpage in URLs",format:k.plainText},{key:q.property_page,description:"Page reference for the subpage, used to link to the parent page",format:k.plainText}]},[m.pageShopInShop]:{since:"1.6.6",baseBitType:m.pageSubpage,description:"Page shop-in-shop bit, used to create shop-in-shop pages in articles or books"},[m.pageCategory]:{since:"1.6.6",baseBitType:m.pageSubpage,description:"Page category bit, used to create category pages in articles or books"},[m.pageAcademy]:{since:"1.6.6",baseBitType:m.pageSubpage,description:"Page academy bit, used to create academy pages in articles or books"},[m.pagePromotion]:{since:"1.6.6",baseBitType:m.pageSubpage,description:"Page promotion bit, used to create promotional pages in articles or books"},[m.pageSpecial]:{since:"1.6.6",baseBitType:m.pageSubpage,description:"Page special bit, used to create special pages in articles or books"},[m.pagePerson]:{since:"1.5.16",baseBitType:m._standard,description:"Page person bit, used to create person pages in articles or books",tags:[{key:q.property_slug,description:"Slug for the person page, used to identify the person in URLs",format:k.plainText},{key:q.group_person,description:"Person tags, used to define properties of the person"},{key:q.property_buttonCaption,description:"Caption for the button on the person page, used to define the text displayed",format:k.plainText}]},[m.pageProduct]:{since:"1.4.17",baseBitType:m._standard,description:"Page product bit, used to create product pages in articles or books",tags:[{key:q.property_slug,description:"Slug for the product page, used to identify the product in URLs",format:k.plainText},{key:q.property_product,description:"Product reference for the product page, used to link to the product",format:k.plainText}]},[m.pageProductList]:{since:"1.4.17",baseBitType:m._standard,description:"Page product list bit, used to create product lists in articles or books",tags:[{key:q.property_slug,description:"Slug for the product list page, used to identify the product list in URLs",format:k.plainText},{key:q.property_product,description:"Product reference for the product list, used to link to the product",format:k.plainText,maxCount:g.infinity}]},[m.pageProductVideo]:{since:"1.4.17",baseBitType:m._standard,description:"Page product video bit, used to create product video pages in articles or books",tags:[{key:q.property_slug,description:"Slug for the product video page, used to identify the product video in URLs",format:k.plainText},{key:q.property_productVideo,description:"Product video reference for the product video page, used to link to the video",format:k.plainText}]},[m.pageProductVideoList]:{since:"1.4.17",baseBitType:m._standard,description:"Page product video list bit, used to create product video lists in articles or books",tags:[{key:q.property_slug,description:"Slug for the product video list page, used to identify the product video list in URLs",format:k.plainText},{key:q.property_productVideo,description:"Product video reference for the product video list, used to link to the video",format:k.plainText,maxCount:g.infinity}]},[m.pageSectionFolder]:{since:"1.4.17",baseBitType:m._standard,description:"Page section folder bit, used to create section folders in articles or books",tags:[{key:q.property_slug,description:"Slug for the section folder page, used to identify the section in URLs",format:k.plainText},{key:q.property_productFolder,description:"Product folder reference for the section folder page, used to link to the folder",format:k.plainText}]},[m.photo]:{since:"1.3.0",baseBitType:m.image,description:"Photo bit, used to create photo bits in articles or books"},[m.quote]:{since:"1.3.0",baseBitType:m._standard,description:"Quote bit, used to create quotes in articles or books",tags:[{key:q.property_quotedPerson,description:"Quoted person for the quote, used to define who is being quoted",format:k.plainText}]},[m.rating]:{since:"1.3.0",baseBitType:m._standard,description:"Rating bit, used to create rating bits in articles or books"},[m.coachSelfReflectionRating]:{since:"1.3.0",baseBitType:m.rating,description:"Coach self-reflection rating bit, used for self-reflection in coaching"},[m.releaseNote]:{since:"1.3.0",baseBitType:m._standard,description:"Release note bit, used to create release notes in articles or books",tags:[{key:q.property_releaseVersion,description:"Release version for the release note, used to define the version of the release",format:k.plainText},{key:q.property_releaseKind,description:"Release kind for the release note, used to define the type of release",format:k.plainText},{key:q.property_releaseDate,description:"Release date for the release note, used to define when the release was made",format:k.plainText}]},[m.reviewNote]:{since:"1.3.0",baseBitType:m._standard,description:"Review note bit, used to create review notes in articles or books",tags:[{key:q.tag_title,description:"Title of the review note, used to display the note title"},{key:q.property_resolved,description:"Resolved status for the review note, used to indicate if the note is resolved",format:k.boolean},{key:q.property_resolvedDate,description:"Resolved date for the review note, used to define when the note was resolved",format:k.plainText},{key:q.property_resolvedBy,description:"Resolved by for the review note, used to define who resolved the note",format:k.plainText}],rootExampleType:b.string},[m.reviewAuthorNote]:{since:"1.3.0",baseBitType:m.reviewNote,description:"Author review note bit, used to create author notes in reviews"},[m.reviewCustomerNote]:{since:"3.5.0",baseBitType:m.reviewNote,description:"Customer review note bit, used to create customer notes in reviews"},[m.reviewReviewerNote]:{since:"1.3.0",baseBitType:m.reviewNote,description:"Reviewer review note bit, used to create reviewer notes in reviews"},[m.reviewRequestForReviewNote]:{since:"1.3.0",baseBitType:m.reviewNote,description:"Request for review note bit, used to create notes requesting reviews"},[m.reviewApprovedNote]:{since:"1.3.0",baseBitType:m.reviewNote,description:"Approved review note bit, used to create notes for approved reviews"},[m.sampleSolution]:{since:"1.3.0",baseBitType:m._standard,description:"Sample solution bit, used to create sample solutions in articles or books",tags:[{key:q.tag_anchor,description:"Anchor for the sample solution, used to link to the solution"},{key:q.tag_reference,description:"Reference for the sample solution, used to link to the source of the solution"}]},[m.sequence]:{since:"1.3.0",baseBitType:m._standard,description:"Sequence bit, used to create sequences in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for sequences"}],cardSet:v.elements,rootExampleType:b.boolean},[m.stillImageFilm]:{since:"1.3.0",baseBitType:m._standard,description:"Still image film bit, used to create still image films in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:q.group_resourceStillImageFilm,description:"Resource still image film tags, used to attach still image films to the bit"}],resourceAttachmentAllowed:!1},[m.stillImageFilmEmbed]:{since:"1.3.0",baseBitType:m._standard,description:"Still image film embed bit, used to embed still image films in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:q.group_resourceStillImageFilmEmbed,description:"Resource still image film embed tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.stillImageFilmLink]:{since:"1.3.0",baseBitType:m._standard,description:"Still image film link bit, used to create still image film links in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:q.group_resourceStillImageFilmLink,description:"Resource still image film link tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.surveyAnonymous]:{since:"1.3.0",baseBitType:m._standard,description:"Anonymous survey bit, used to create anonymous surveys in articles or books"},[m.survey]:{since:"1.3.0",baseBitType:m._standard,description:"Survey bit, used to create surveys in articles or books"},[m.surveyMatrix]:{since:"1.6.2",baseBitType:m.image,description:"Survey matrix bit, used to create survey matrices in articles or books",tags:[{key:q.property_pointerTop,description:"Pointer for the top of the survey matrix, used to define the top label",format:k.plainText,minCount:1,maxCount:1},{key:q.property_pointerLeft,description:"Pointer for the left of the survey matrix, used to define the left label",format:k.plainText,minCount:1,maxCount:1},{key:q.property_buttonCaption,description:"Caption for the button in the survey matrix, used to define the button text",format:k.plainText,minCount:1,maxCount:1}]},[m.surveyMatrixMe]:{since:"1.6.2",baseBitType:m.surveyMatrix,description:"Survey matrix me bit, used to create personal survey matrices in articles or books"},[m.surveyRating]:{since:"1.6.0",baseBitType:m._standard,description:"Survey rating bit, used to create rating surveys in articles or books",tags:[{key:q.property_ratingLevelStart,description:"Start level for the rating survey, used to define the lowest rating",format:k.number,chain:[{key:q.property_label,description:"Label for the start level of the rating survey, used to define the text displayed",format:k.bitmarkText}]},{key:q.property_ratingLevelEnd,description:"End level for the rating survey, used to define the highest rating",format:k.number,chain:[{key:q.property_label,description:"Label for the end level of the rating survey, used to define the text displayed",format:k.bitmarkText}]},{key:q.property_ratingLevelSelected,description:"Selected level for the rating survey, used to define the default rating",format:k.number},{key:q.property_buttonCaption,description:"Caption for the button in the rating survey, used to define the button text",format:k.plainText}]},[m.surveyRatingOnce]:{since:"1.6.0",baseBitType:m.surveyRating,description:"Survey rating once bit, used to create one-time rating surveys in articles or books"},[m.surveyRatingDisplay]:{since:"1.6.0",baseBitType:m.surveyRating,description:"Survey rating display bit, used to display rating surveys in articles or books"},[m.scorm]:{since:"1.5.11",baseBitType:m._standard,description:"SCORM bit, used to embed SCORM content in articles or books",tags:[{key:q.property_scormSource,description:"Source for the SCORM content, used to define the SCORM package URL",format:k.plainText},{key:q.property_posterImage,description:"Poster image for the SCORM content, used to display a preview image",format:k.plainText}]},[m.pronunciationTable]:{since:"3.1.0",baseBitType:m._standard,description:"Pronunciation table bit, used to create pronunciation tables in articles or books",cardSet:v.pronunciationTable},[m.table]:{since:"1.5.19",baseBitType:m._standard,description:"Table bit, used to create tables in articles or books",tags:[{key:q.property_caption,description:"Caption for the table, used to define the title of the table",format:k.bitmarkText},{key:q.property_tableFixedHeader,description:"Fixed header for the table, used to keep the header visible while scrolling",format:k.boolean},{key:q.property_tableHeaderWhitespaceNoWrap,description:"No wrap for table header whitespace, used to prevent header text wrapping",format:k.boolean},{key:q.property_tableSearch,description:"Search functionality for the table, used to enable searching within the table",format:k.boolean},{key:q.property_tableSort,description:"Sorting functionality for the table, used to enable sorting of table columns",format:k.boolean},{key:q.property_tablePagination,description:"Pagination for the table, used to limit the number of rows displayed at once",format:k.boolean},{key:q.property_tablePaginationLimit,description:"Pagination limit for the table, used to define the number of rows per page",format:k.number,defaultValue:"0"},{key:q.property_tableHeight,description:"Height for the table, used to define the height of the table in pixels",format:k.number,defaultValue:"0"},{key:q.property_tableWhitespaceNoWrap,description:"No wrap for table whitespace, used to prevent text wrapping in table cells",format:k.boolean},{key:q.property_tableAutoWidth,description:"Auto width for table columns, used to automatically adjust column widths",format:k.boolean},{key:q.property_tableResizableColumns,description:"Resizable columns for the table, used to allow users to resize table columns",format:k.boolean},{key:q.property_tableColumnMinWidth,description:"Minimum width for table columns, used to define the minimum width of columns",format:k.number}],cardSet:v.table},[m.tableAlt]:{since:"1.16.0",baseBitType:m.table,description:"Alternative table bit, used to create alternative tables in articles or books"},[m.standardTableNormative]:{since:"1.16.0",baseBitType:m.table,description:"Standard normative table bit, used to create standard normative tables in articles or books"},[m.standardTableNonNormative]:{since:"1.16.0",baseBitType:m.table,description:"Standard non-normative table bit, used to create standard non-normative tables in articles or books"},[m.standardRemarkTableNormative]:{since:"1.17.0",baseBitType:m.table,description:"Standard normative remark table bit, used to create standard normative remark tables in articles or books"},[m.standardRemarkTableNonNormative]:{since:"1.17.0",baseBitType:m.table,description:"Standard non-normative remark table bit, used to create standard non-normative remark tables in articles or books"},[m.smartStandardTableNormative]:{since:"1.28.0",baseBitType:m.standardTableNormative,description:"Smart standard normative table bit, used to create smart standard normative tables in articles or books"},[m.smartStandardTableNonNormative]:{since:"1.28.0",baseBitType:m.standardTableNonNormative,description:"Smart standard non-normative table bit, used to create smart standard non-normative tables in articles or books"},[m.smartStandardRemarkTableNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableNormative,description:"Smart standard normative remark table bit, used to create smart standard normative remark tables in articles or books"},[m.smartStandardRemarkTableNonNormative]:{since:"1.28.0",baseBitType:m.standardRemarkTableNonNormative,description:"Smart standard non-normative remark table bit, used to create smart standard non-normative remark tables in articles or books"},[m.smartStandardTableNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableNormative,description:"Collapsible smart standard normative table bit, used to create collapsible smart standard normative tables in articles or books"},[m.smartStandardTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardTableNonNormative,description:"Collapsible smart standard non-normative table bit, used to create collapsible smart standard non-normative tables in articles or books"},[m.smartStandardRemarkTableNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableNormative,description:"Collapsible smart standard normative remark table bit, used to create collapsible smart standard normative remark tables in articles or books"},[m.smartStandardRemarkTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:m.smartStandardRemarkTableNonNormative,description:"Collapsible smart standard non-normative remark table bit, used to create collapsible smart standard non-normative remark tables in articles or books"},[m.parameters]:{since:"1.18.0",baseBitType:m.table,description:"Parameters bit, used to create parameter tables in articles or books"},[m.toc]:{since:"1.3.0",baseBitType:m._standard,description:"Table of contents bit, used to create a table of contents in articles or books"},[m.tocChapter]:{since:"1.5.5",baseBitType:m.toc,description:"Table of contents chapter bit, used to create chapters in the table of contents",tags:[{key:q.property_maxDisplayLevel,description:"Maximum display level for the chapter in the table of contents",format:k.number}]},[m.tocInline]:{since:"3.24.0",baseBitType:m.toc,description:"Inline table of contents bit, used to create inline tables of contents in articles or books",tags:[{key:q.property_maxTocChapterLevel,description:"Maximum chapter level for the inline table of contents",format:k.number}]},[m.tocResource]:{since:"3.31.0",baseBitType:m.toc,description:"Table of contents resource bit, used to create resources in the table of contents",tags:[{key:q.property_tocResource,description:"Resource content for the table of contents, used to define the resource",format:k.plainText,maxCount:g.infinity},{key:q.property_buttonCaption,description:"Caption for the button in the table of contents resource, used to define the text displayed on the button",format:k.plainText}]},[m.tocContent]:{since:"3.31.0",baseBitType:m.toc,description:"Table of contents content bit, used to create content sections in the table of contents",tags:[{key:q.property_tocContent,description:"Content for the table of contents, used to define the content section",format:k.plainText,maxCount:g.infinity},{key:q.property_buttonCaption,description:"Caption for the button in the table of contents content, used to define the text displayed on the button",format:k.plainText}]},[m.anchor]:{since:"1.3.0",baseBitType:m._standard,description:"Anchor bit, used to create anchors in articles or books"},[m.bitBookEnding]:{since:"1.3.0",baseBitType:m._standard,description:"Bit book ending bit, used to create endings in articles or books"},[m.bitBookSummary]:{since:"1.3.0",baseBitType:m._standard,description:"Bit book summary bit, used to create summaries in articles or books"},[m.botActionAnnounce]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action announce bit, used to create announcements in articles or books"},[m.botActionRatingNumber]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action rating number bit, used to create rating number actions in articles or books"},[m.botActionRemind]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action remind bit, used to create reminders in articles or books"},[m.botActionSave]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action save bit, used to create save actions in articles or books"},[m.botActionTrueFalse]:{since:"1.3.0",baseBitType:m._standard,description:"Bot action true/false bit, used to create true/false actions in articles or books"},[m.chapterSubjectMatter]:{since:"1.3.0",baseBitType:m._standard,description:"Chapter subject matter bit, used to create subject matter chapters in articles or books"},[m.chat]:{since:"1.3.0",baseBitType:m._standard,description:"Chat bit, used to create chat sections in articles or books"},[m.conclusion]:{since:"1.3.0",baseBitType:m._standard,description:"Conclusion bit, used to create conclusions in articles or books"},[m.conclusionAlt]:{since:"1.16.0",baseBitType:m.conclusion,description:"Alternative conclusion bit, used to create alternative conclusions in articles or books"},[m.documentUpload]:{since:"1.3.0",baseBitType:m._standard,description:"Document upload bit, used to create document upload sections in articles or books"},[m.footNote]:{since:"1.3.0",baseBitType:m._standard,description:"Footnote bit, used to create footnotes in articles or books"},[m.groupBorn]:{since:"1.3.0",baseBitType:m._standard,description:"Group born bit, used to create group born sections in articles or books"},[m.groupDied]:{since:"1.3.0",baseBitType:m._standard,description:"Group died bit, used to create group died sections in articles or books"},[m.recordAudio]:{since:"1.3.0",baseBitType:m._standard,description:"Record audio bit, used to create audio recording sections in articles or books"},[m.recordVideo]:{since:"1.5.24",baseBitType:m._standard,description:"Record video bit, used to create video recording sections in articles or books"},[m.stickyNote]:{since:"1.3.0",baseBitType:m._standard,description:"Sticky note bit, used to create sticky notes in articles or books"},[m.takePicture]:{since:"1.3.0",baseBitType:m._standard,description:"Take picture bit, used to create picture taking sections in articles or books"},[m.handInAudio]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in audio bit, used to create audio submission sections in articles or books"},[m.handInContact]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in contact bit, used to create contact submission sections in articles or books"},[m.handInDocument]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in document bit, used to create document submission sections in articles or books"},[m.handInFile]:{since:"3.2.0",baseBitType:m._standard,description:"Hand in file bit, used to create file submission sections in articles or books",tags:[{key:q.property_handInAcceptFileType,description:"Accepted file types for the hand-in file, used to define allowed file formats",format:k.plainText,maxCount:g.infinity}]},[m.handInLocation]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in location bit, used to create location submission sections in articles or books"},[m.handInPhoto]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in photo bit, used to create photo submission sections in articles or books"},[m.handInScan]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in scan bit, used to create scan submission sections in articles or books"},[m.handInSubmit]:{since:"3.2.0",baseBitType:m._standard,description:"Hand in submit bit, used to create submission sections in articles or books",tags:[{key:q.property_handInRequirement,description:"Requirement for the hand-in submission, used to define what is needed",format:k.plainText,maxCount:g.infinity},{key:q.property_handInInstruction,description:"Instruction for the hand-in submission, used to guide the user",format:k.plainText},{key:q.property_buttonCaption,description:"Caption for the button in the hand-in submission, used to define the button text",format:k.plainText}]},[m.handInVideo]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in video bit, used to create video submission sections in articles or books"},[m.handInVoice]:{since:"1.5.15",baseBitType:m._standard,description:"Hand in voice bit, used to create voice submission sections in articles or books"},[m.trueFalse1]:{since:"1.3.0",baseBitType:m._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:q.property_labelTrue,description:"Label for the true option in the true/false question",format:k.plainText},{key:q.property_labelFalse,description:"Label for the false option in the true/false question",format:k.plainText},{key:q.tag_true,description:"Tag for the true option in the true/false question"},{key:q.tag_false,description:"Tag for the false option in the true/false question"}],rootExampleType:b.boolean},[m.trueFalse]:{since:"1.3.0",baseBitType:m._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:q.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:q.property_labelTrue,description:"Label for the true option in the true/false question",format:k.plainText},{key:q.property_labelFalse,description:"Label for the false option in the true/false question",format:k.plainText}],cardSet:v.statements},[m.vendorAmcharts5Chart]:{since:"1.5.8",baseBitType:m.code,description:"AmCharts 5 chart bit, used to embed AmCharts 5 charts in articles or books",textFormatDefault:T.json},[m.vendorDatadogDashboardEmbed]:{since:"3.12.0",baseBitType:m.code,description:"Datadog dashboard embed bit, used to embed Datadog dashboards in articles or books",tags:[{key:q.property_vendorDashboardId,description:"Dashboard ID for the Datadog dashboard, used to define which dashboard to embed",format:k.plainText}],textFormatDefault:T.plainText},[m.vendorFormbricksEmbed]:{since:"3.8.0",baseBitType:m.code,description:"Formbricks embed bit, used to embed Formbricks surveys in articles or books",tags:[{key:q.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to embed",format:k.plainText}],textFormatDefault:T.plainText},[m.vendorFormbricksEmbedAnonymous]:{since:"3.9.0",baseBitType:m.vendorFormbricksEmbed,description:"Anonymous Formbricks embed bit, used to embed anonymous Formbricks surveys in articles or books"},[m.vendorFormbricksLink]:{since:"3.8.0",baseBitType:m.code,description:"Formbricks link bit, used to create links to Formbricks surveys in articles or books",tags:[{key:q.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to link to",format:k.plainText}],textFormatDefault:T.plainText},[m.vendorFormbricksLinkAnonymous]:{since:"3.9.0",baseBitType:m.vendorFormbricksLink,description:"Anonymous Formbricks link bit, used to create links to anonymous Formbricks surveys in articles or books"},[m.vendorHighchartsChart]:{since:"1.5.28",baseBitType:m.vendorAmcharts5Chart,description:"Highcharts chart bit, used to embed Highcharts charts in articles or books"},[m.vendorIframelyEmbed]:{since:"1.5.10",baseBitType:m.code,description:"Iframely embed bit, used to embed content from various sources in articles or books",tags:[{key:q.property_width,description:"Width for the embedded content, used to define the width in pixels",format:k.number},{key:q.property_height,description:"Height for the embedded content, used to define the height in pixels",format:k.number},{key:q.property_vendorUrl,description:"URL for the content to be embedded, used to define the source URL",format:k.plainText}],textFormatDefault:T.plainText},[m.vendorIframelyCard]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed,description:"Iframely card bit, used to create cards for embedded content in articles or books"},[m.vendorIframelyPreview]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed,description:"Iframely preview bit, used to create previews for embedded content in articles or books"},[m.vendorIframelyPreviewMini]:{since:"1.5.10",baseBitType:m.vendorIframelyEmbed,description:"Iframely preview mini bit, used to create mini previews for embedded content in articles or books"},[m.vendorJupyterOutput]:{since:"1.4.3",baseBitType:m.code,description:"Jupyter output bit, used to embed Jupyter notebook outputs in articles or books",tags:[{key:q.property_jupyterId,description:"Jupyter ID for the notebook, used to define which notebook to embed",format:k.plainText},{key:q.property_jupyterExecutionCount,description:"Execution count for the Jupyter output, used to define the execution order",format:k.number}],textFormatDefault:T.plainText},[m.vendorJupyterCellCode]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput,description:"Jupyter cell code bit, used to embed Jupyter notebook cell code in articles or books"},[m.vendorJupyterCellMarkdown]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput,description:"Jupyter cell markdown bit, used to embed Jupyter notebook cell markdown in articles or books"},[m.vendorJupyterCellRaw]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput,description:"Jupyter cell raw bit, used to embed Jupyter notebook cell raw content in articles or books"},[m.vendorJupyterIpynb]:{since:"1.4.3",baseBitType:m.vendorJupyterOutput,description:"Jupyter IPYNB bit, used to embed Jupyter notebook files in articles or books"},[m.vendorPadletEmbed]:{since:"1.3.0",baseBitType:m.code,description:"Padlet embed bit, used to embed Padlet boards in articles or books",tags:[{key:q.property_padletId,description:"Padlet ID for the board, used to define which Padlet to embed",format:k.plainText}],textFormatDefault:T.plainText},[m.vendorStripePricingTable]:{since:"1.20.0",baseBitType:m.article,description:"Stripe pricing table bit, used to embed Stripe pricing tables in articles or books",tags:[{key:q.property_stripePricingTableId,description:"Stripe pricing table ID, used to define which pricing table to embed",format:k.plainText,minCount:1},{key:q.property_stripePublishableKey,description:"Stripe publishable key, used to authenticate the Stripe pricing table",format:k.plainText,minCount:1}]},[m.vendorStripePricingTableExternal]:{since:"3.13.0",baseBitType:m.vendorStripePricingTable,description:"External Stripe pricing table bit, used to embed external Stripe pricing tables in articles or books"},[m.video]:{since:"1.3.0",baseBitType:m._standard,description:"Video bit, used to embed videos in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for videos, used to define additional properties"},{key:q.group_resourceVideo,description:"Resource video tags, used to attach videos to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.videoLandscape]:{since:"1.3.0",baseBitType:m.video,description:"Landscape video bit, used to embed landscape videos in articles or books"},[m.videoPortrait]:{since:"1.3.0",baseBitType:m.video,description:"Portrait video bit, used to embed portrait videos in articles or books"},[m.videoEmbed]:{since:"1.3.0",baseBitType:m._standard,description:"Video embed bit, used to embed videos from external sources in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:q.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.videoEmbedLandscape]:{since:"1.3.0",baseBitType:m.videoEmbed,description:"Landscape video embed bit, used to embed landscape videos from external sources in articles or books"},[m.videoEmbedPortrait]:{since:"1.3.0",baseBitType:m.videoEmbed,description:"Portrait video embed bit, used to embed portrait videos from external sources in articles or books"},[m.videoLink]:{since:"1.3.0",baseBitType:m._standard,description:"Video link bit, used to create links to videos in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for video links, used to define additional properties"},{key:q.group_resourceVideoLink,description:"Resource video link tags, used to attach video links to the bit",minCount:1}],resourceAttachmentAllowed:!1},[m.videoLinkLandscape]:{since:"1.3.0",baseBitType:m.videoLink,description:"Landscape video link bit, used to create links to landscape videos in articles or books"},[m.videoLinkPortrait]:{since:"1.3.0",baseBitType:m.videoLink,description:"Portrait video link bit, used to create links to portrait videos in articles or books"},[m.websiteLink]:{since:"1.3.0",baseBitType:m._standard,description:"Website link bit, used to create links to websites in articles or books",tags:[{key:q.group_resourceBitTags,description:"Resource bit tags for website links, used to define additional properties"},{key:q.group_resourceWebsiteLink,description:"Resource website link tags, used to attach website links to the bit",minCount:1}],resourceAttachmentAllowed:!1}},Y=new class{constructor(){p(this,"bitLevelMin",1),p(this,"bitLevelMax",7),p(this,"bitCache",new Map),p(this,"allResourcesCache"),p(this,"comboResourcesCache",new Map)}getBitType(e){return e?.startsWith("|")&&(e=e.substring(1)),m.fromValue(e)??m._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const i=this.getBitConfig(e);if(!i)return!1;if(Array.isArray(t)){for(const e of t)if(i.inheritedBitTypesSet.has(e))return!0;return!1}return i.inheritedBitTypesSet.has(t)}isBitTypeCommented(e){return!!e?.startsWith("|")}getBitConfig(e){let t=this.bitCache.get(e);if(!t){const i=()=>{throw new Error(`No config found for bit: ${e}`)},r=[],o=[];let a=e;for(;a;){const e=K[a];e||i(),r.push(a),o.push(e),a=e.baseBitType}o.reverse();const n=o.reduce((e,t)=>e=W.deepMerge(e,t),{}),{since:s,textFormatDefault:l,quizBit:c,tags:d,cardSet:p,deprecated:u,bodyAllowed:h,bodyRequired:m,footerAllowed:b,footerRequired:f,resourceAttachmentAllowed:y,rootExampleType:v}=n;d?.push({key:q.property_internalComment,description:"Internal comment for the bit.",format:k.plainText,maxCount:g.infinity,minCount:0});const x=this.getAllResourcesTagsWithZeroCounts(),_=G.hydrateTagsConfig(d??[]),w=G.hydrateCardSetConfig(p),C=_.info?.comboResourceConfigKey,A={..._.tags};for(const[e,t]of Object.entries(x))A[e]||(A[e]=t);t=new I({since:s,bitType:e,inheritedBitTypes:r,textFormatDefault:l??T.bitmarkText,tags:A,cardSet:w,quizBit:c,deprecated:u,bodyAllowed:h,bodyRequired:m,footerAllowed:b,footerRequired:f,resourceAttachmentAllowed:y,rootExampleType:v,comboResourceConfigKey:C}),this.bitCache.set(e,t)}return t}getTagConfigForTag(e,t){if(e)return e[t]}getTagsConfigForCardSet(e,t,i){const r=this.getCardSetVariantConfig(e,t,i);if(r)return r.tags}getCardSetVariantConfig(e,t,i){let r;const o=this.getBitConfig(e);if(!o)return;const a=o.cardSet?.variants;if(!a)return;const n=a[Math.min(t,a.length-1)],s=n.length-1;return r=i>s?n[s]:n[i],r}getBitResourcesConfig(e,t){let i={};const r=new Map,o=t?z(t):void 0,a=this.getBitConfig(e),n={};for(const[e,t]of Object.entries(a.tags))t.type===_.resource&&(n[e]=t);const s=a.comboResourceConfigKey??(a.resourceAttachmentAllowed?o:void 0);if(s){const e=new Map,o=this.getComboResource(s);if(o){const t=Object.values(o).filter(e=>e.type===_.resource);t.map(e=>e.configKey).forEach(i=>{const r=t.find(e=>e.configKey===i);r&&e.set(i,r)});const i=this.getComboResourceConfigKeys(s);i&&i.length>0&&r.set(s,i)}if(t)for(const[t,r]of Object.entries(n)){const o=s===r.configKey,a=!!e&&e.has(r.configKey);if(o){const e=new B({configKey:r.configKey,tag:r.tag,minCount:1,maxCount:1,chain:r.chain,jsonKey:r.jsonKey,deprecated:r.deprecated});i[t]=e}else if(a){if(e){const o=e.get(r.configKey);o&&(i[t]=o)}}else i[t]=r}else i=n}else i=n;return new j(i,a.resourceAttachmentAllowed,o,r)}getComboResourceConfigKeys(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter(e=>e.type===_.resource).map(e=>e.configKey)}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(U).filter(t=>t.type===x.comboResource&&t.comboResourceConfigKey===e).forEach(e=>{t={...t,...G.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(U).filter(e=>e.type===x.resource).forEach(t=>{e={...e,...G.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}},Q="@gmb/bitmark-parser-generator",X="3.37.0",Z="ISC",ee=(0,d(u(),1).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"}),te=(0,d(u(),1).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});function ie(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:ee.unknown,os:te.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce((e,t)=>(t&&e.push(t),e),[]),i={keys:new Set,versions:{}};let r="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let a=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){a=!0;break}a?i.versions[r]=o.replace("_","."):i.keys.add(o),r=o}return i}(window.navigator.userAgent),i=t.keys.has("firefox"),r=t.keys.has("chrome"),o=t.keys.has("chromium"),a=t.keys.has("safari"),n=r,s=i,l=t.keys.has("macintosh");return a&&!r&&!o?(e.browser=ee.safari,e.browserVersion=t.versions.version):n?(e.browser=ee.chrome,e.browserVersion=t.versions.chrome):s&&(e.browser=ee.firefox,e.browserVersion=t.versions.firefox),l&&(e.os=te.macos,e.osVersion=t.versions.x),e}var re={full:"",major:"",minor:"",patch:"",build:""},oe=new class{constructor(){p(this,"bootTimestamp"),p(this,"app"),p(this,"appVersion"),p(this,"environment"),p(this,"environmentVersion"),p(this,"os"),p(this,"osVersion"),p(this,"isBrowser"),p(this,"isNode"),p(this,"isCI"),p(this,"NODE_ENV"),p(this,"userAgentInfo"),Object.defineProperty(this,"userAgentInfo",{value:ie(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=re,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===ee.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?ee.node:ee.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):re}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,te.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):re}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 re;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let i="",r="",o="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?i=n:1===e?r=n:2===e?a=n:3===e&&(o=n)}return{full:e,major:i,minor:r,patch:a,build:o}}},ae=oe.init.bind(oe),ne=!1;function se(){ne||(ae(Q,X),ne=!0)}var le=(0,d(u(),1).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"}),ce=(0,d(u(),1).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",subscript:"subscript",superscript:"superscript",ins:"ins",del:"del",underline:"underline",doubleUnderline:"doubleUnderline",circle:"circle",languageEmRed:"languageEmRed",languageEmOrange:"languageEmOrange",languageEmYellow:"languageEmYellow",languageEmGreen:"languageEmGreen",languageEmBlue:"languageEmBlue",languageEmPurple:"languageEmPurple",languageEmPink:"languageEmPink",languageEmBrown:"languageEmBrown",languageEmBlack:"languageEmBlack",languageEmWhite:"languageEmWhite",languageEmGray:"languageEmGray",languageEm:"languageEm",userUnderline:"userUnderline",userDoubleUnderline:"userDoubleUnderline",userStrike:"userStrike",userCircle:"userCircle",userHighlight:"userHighlight",notranslate:"notranslate",link:"link",ref:"ref",xref:"xref",extref:"extref",footnote:"footnote",footnoteStar:"footnote*",symbol:"symbol",var:"var",code:"code",timer:"timer",duration:"duration",color:"color",comment:"comment"}),de=(0,d(u(),1).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",noBulletList:"noBulletList",bulletList:"bulletList",orderedList:"orderedList",orderedListRoman:"orderedListRoman",orderedListRomanLower:"orderedListRomanLower",letteredList:"letteredList",letteredListLower:"letteredListLower",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",imageInline:"imageInline",codeBlock:"codeBlock",latex:"latex",gap:"gap",select:"select",highlight:"highlight",mark:"mark"}),pe=(0,d(u(),1).superenum)({unknown:"unknown",__isDefaultExample:"__isDefaultExample",__typeAlias:"__typeAlias",action:"action",actionValue:"actionValue",activityType:"activityType",activityTypeValue:"activityTypeValue",additionalSolutions:"additionalSolutions",additionalSolutionsValue:"additionalSolutionsValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",alias:"alias",alignment:"alignment",allowedBit:"allowedBit",allowedBitValue:"allowedBitValue",alt:"alt",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",alternativeDefinitions:"alternativeDefinitions",alternativeDefinitionsValue:"alternativeDefinitionsValue",altLangTag:"altLangTag",altLangTagValue:"altLangTagValue",analyticsTag:"analyticsTag",analyticsTagValue:"analyticsTagValue",anchor:"anchor",answer:"answer",appLink:"appLink",attrs:"attrs",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",author:"author",authorValue:"authorValue",availableClassifications:"availableClassifications",availableClassificationsValue:"availableClassificationsValue",avatarImage:"avatarImage",backgroundWallpaper:"backgroundWallpaper",backgroundWallpaperValue:"backgroundWallpaperValue",bitLevel:"bitLevel",bitmarkAst:"bitmarkAst",bitmarkVersion:"bitmarkVersion",bits:"bits",bitsValue:"bitsValue",bitType:"bitType",blockId:"blockId",blockIdValue:"blockIdValue",body:"body",bodyBit:"bodyBit",bodyBits:"bodyBits",bodyJson:"bodyJson",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",bodyText:"bodyText",bodyValue:"bodyValue",book:"book",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",bookDiff:"bookDiff",bookDiffValue:"bookDiffValue",bookValue:"bookValue",bot:"bot",botResponses:"botResponses",botResponsesValue:"botResponsesValue",botValue:"botValue",bubbleTag:"bubbleTag",bubbleTagValue:"bubbleTagValue",buttonCaption:"buttonCaption",buttonCaptionValue:"buttonCaptionValue",callToActionUrl:"callToActionUrl",callToActionUrlValue:"callToActionUrlValue",caption:"caption",captionDefinitionList:"captionDefinitionList",captionValue:"captionValue",cardBits:"cardBits",cardBitsValue:"cardBitsValue",cardNode:"cardNode",categoryTag:"categoryTag",categoryTagValue:"categoryTagValue",cells:"cells",cellsValue:"cellsValue",chatWithBook:"chatWithBook",chatWithBookBrainKey:"chatWithBookBrainKey",chatWithBookBrainKeyValue:"chatWithBookBrainKeyValue",chatWithBookValue:"chatWithBookValue",checked:"checked",choice:"choice",choices:"choices",choicesValue:"choicesValue",citationStyle:"citationStyle",citationStyleValue:"citationStyleValue",class:"class",classification:"classification",classificationValue:"classificationValue",codeLineNumbers:"codeLineNumbers",codeLineNumbersValue:"codeLineNumbersValue",codeMinimap:"codeMinimap",codeMinimapValue:"codeMinimapValue",color:"color",colorTag:"colorTag",colorTagValue:"colorTagValue",column:"column",columns:"columns",columnsValue:"columnsValue",comment:"comment",commentedBitType:"commentedBitType",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",content:"contentValue",content2Buy:"content2Buy",contentValue:"contentValue",contentValueValue:"contentValueValue",copyright:"copyright",coverColor:"coverColor",coverColorValue:"coverColorValue",coverImage:"coverImage",coverImageValue:"coverImageValue",customerExternalId:"customerExternalId",customerId:"customerId",customerIdValue:"customerIdValue",data:"data",dataValue:"dataValue",dataValueValue:"dataValueValue",date:"date",dateEnd:"dateEnd",dateEndValue:"dateEndValue",dateValue:"dateValue",decimalPlaces:"decimalPlaces",deeplink:"deeplink",deeplinkValue:"deeplinkValue",definition:"definition",definitions:"definitions",definitionsValue:"definitionsValue",diffContext:"diffContext",diffContextValue:"diffContextValue",diffOp:"diffOp",diffOpValue:"diffOpValue",diffRef:"diffRef",diffRefValue:"diffRefValue",diffTime:"diffTime",diffTimeValue:"diffTimeValue",diffTo:"diffTo",diffToValue:"diffToValue",disableCalculation:"disableCalculation",disableFeedback:"disableFeedback",disableFeedbackValue:"disableFeedbackValue",document:"document",documentDownload:"documentDownload",documentEmbed:"documentEmbed",documentLink:"documentLink",duration:"duration",durationValue:"durationValue",elements:"elements",elementsValue:"elementsValue",emphasis:"emphasis",end:"end",errors:"errors",errorsValue:"errorsValue",example:"example",exampleValue:"exampleValue",externalId:"externalId",externalIdValue:"externalIdValue",externalLink:"externalLink",externalLinkText:"externalLinkText",extraProperties:"extraProperties",feedback:"feedback",feedbackEngine:"feedbackEngine",feedbackEngineValue:"feedbackEngineValue",feedbacks:"feedbacks",feedbacksValue:"feedbacksValue",feedbackType:"feedbackType",flashcards:"flashcards",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",flashcardsValue:"flashcardsValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",footer:"footer",footerText:"footerText",forKeys:"forKeys",format:"format",forValues:"forValues",forValuesValue:"forValuesValue",gap:"gap",groupTag:"groupTag",groupTagValue:"groupTagValue",handInAcceptFileType:"handInAcceptFileType",handInAcceptFileTypeValue:"handInAcceptFileTypeValue",handInInstruction:"handInInstruction",handInInstructionValue:"handInInstructionValue",handInRequirement:"handInRequirement",handInRequirementValue:"handInRequirementValue",hasBookNavigation:"hasBookNavigation",hasBookNavigationValue:"hasBookNavigationValue",hasMarkAsDone:"hasMarkAsDone",hasMarkAsDoneValue:"hasMarkAsDoneValue",heading:"heading",height:"height",heightValue:"heightValue",highlight:"highlight",hint:"hint",href:"href",icon:"icon",iconTag:"iconTag",iconTagValue:"iconTagValue",iconValue:"iconValue",id:"id",idValue:"idValue",image:"image",imageFirst:"imageFirst",imageFirstValue:"imageFirstValue",imageLandscape:"imageLandscape",imageLink:"imageLink",imagePlaceholder:"imagePlaceholder",imagePlaceholderValue:"imagePlaceholderValue",imagePortrait:"imagePortrait",imageSource:"imageSource",index:"index",indexValue:"indexValue",ingredients:"ingredients",ingredientsValue:"ingredientsValue",instruction:"instruction",internalComment:"internalComment",internalCommentValue:"internalCommentValue",isCaseSensitive:"isCaseSensitive",isCommented:"isCommented",isCorrect:"isCorrect",isExample:"isExample",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",isPlain:"isPlain",isPublic:"isPublic",isPublicValue:"isPublicValue",isTemplate:"isTemplate",isTemplateStripTheme:"isTemplateStripTheme",isTemplateStripThemeValue:"isTemplateStripThemeValue",isTemplateValue:"isTemplateValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",item:"item",itemLead:"itemLead",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",key:"key",keyAudio:"keyAudio",keyImage:"keyImage",kind:"kind",kindValue:"kindValue",label:"label",labelFalse:"labelFalse",labelFalseValue:"labelFalseValue",labelTrue:"labelTrue",labelTrueValue:"labelTrueValue",lang:"lang",language:"language",languageValue:"languageValue",langValue:"langValue",layer:"layer",layerRole:"layerRole",layerRoleValue:"layerRoleValue",layerValue:"layerValue",lead:"lead",level:"level",levelACTFL:"levelACTFL",levelACTFLValue:"levelACTFLValue",levelCEFR:"levelCEFR",levelCEFRp:"levelCEFRp",levelCEFRpValue:"levelCEFRpValue",levelCEFRValue:"levelCEFRValue",levelILR:"levelILR",levelILRValue:"levelILRValue",license:"license",line:"line",list:"list",listItemIndent:"listItemIndent",listItemIndentValue:"listItemIndentValue",listValue:"listValue",location:"location",locationValue:"locationValue",machineTranslated:"machineTranslated",machineTranslatedValue:"machineTranslatedValue",mailingList:"mailingList",marginNumber:"marginNumber",mark:"mark",markConfig:"markConfig",markConfigValue:"markConfigValue",marks:"marks",marksValue:"marksValue",markup:"markup",matrix:"matrix",matrixValue:"matrixValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",maxDisplayLevel:"maxDisplayLevel",maxDisplayLevelValue:"maxDisplayLevelValue",maxTocChapterLevel:"maxTocChapterLevel",maxTocChapterLevelValue:"maxTocChapterLevelValue",message:"message",mockupId:"mockupId",name:"name",offset:"offset",options:"options",optionsValue:"optionsValue",original:"original",padletId:"padletId",padletIdValue:"padletIdValue",page:"page",pageNo:"pageNo",pageNoValue:"pageNoValue",pageNumber:"pageNumber",pageValue:"pageValue",pairs:"pairs",pairsValue:"pairsValue",parent:"parent",parser:"parser",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",path:"path",pathValue:"pathValue",person:"person",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",posterImage:"posterImage",posterImageValue:"posterImageValue",postfix:"postfix",prefix:"prefix",processHandIn:"processHandIn",processHandInLocation:"processHandInLocation",processHandInLocationValue:"processHandInLocationValue",processHandInValue:"processHandInValue",product:"product",productFolder:"productFolder",productFolderValue:"productFolderValue",productId:"productId",productIdValue:"productIdValue",productList:"productList",productListValue:"productListValue",productValue:"productValue",productVideo:"productVideo",productVideoList:"productVideoList",productVideoListValue:"productVideoListValue",productVideoValue:"productVideoValue",progress:"progress",progressValue:"progressValue",pronunciationTable:"pronunciationTable",properties:"properties",property:"property",propertyKey:"propertyKey",propertyValue:"propertyValue",propertyValues:"propertyValues",provider:"provider",publications:"publications",publicationsValue:"publicationsValue",publisher:"publisher",publisherName:"publisherName",publisherNameValue:"publisherNameValue",publisherValue:"publisherValue",quantity:"quantity",question:"question",questions:"questions",questionsValue:"questionsValue",quizCountItems:"quizCountItems",quizCountItemsValue:"quizCountItemsValue",quizStrikethroughSolutions:"quizStrikethroughSolutions",quizStrikethroughSolutionsValue:"quizStrikethroughSolutionsValue",quizzes:"quizzes",quizzesValue:"quizzesValue",quotedPerson:"quotedPerson",ratingLevelEnd:"ratingLevelEnd",ratingLevelSelected:"ratingLevelSelected",ratingLevelSelectedValue:"ratingLevelSelectedValue",ratingLevelStart:"ratingLevelStart",reaction:"reaction",reason:"reason",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",reductionTag:"reductionTag",reductionTagValue:"reductionTagValue",refAuthor:"refAuthor",refBookTitle:"refBookTitle",reference:"reference",referenceEnd:"referenceEnd",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",refPublicationYear:"refPublicationYear",refPublisher:"refPublisher",releaseDate:"releaseDate",releaseDateValue:"releaseDateValue",releaseKind:"releaseKind",releaseKindValue:"releaseKindValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",reportTag:"reportTag",reportTagValue:"reportTagValue",resolved:"resolved",resolvedBy:"resolvedBy",resolvedByValue:"resolvedByValue",resolvedDate:"resolvedDate",resolvedDateValue:"resolvedDateValue",resolvedValue:"resolvedValue",resources:"resources",resourcesValue:"resourcesValue",resourceType:"resourceType",response:"response",responses:"responses",responsesValue:"responsesValue",revealSolutions:"revealSolutions",root:"root",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",scormSource:"scormSource",scormSourceValue:"scormSourceValue",search:"search",searchIndex:"searchIndex",searchIndexValue:"searchIndexValue",searchValue:"searchValue",section:"section",select:"select",servings:"servings",servingsValue:"servingsValue",showInIndex:"showInIndex",showInIndexValue:"showInIndexValue",size:"size",slug:"slug",slugValue:"slugValue",solution:"solution",solutions:"solutions",solutionsValue:"solutionsValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",start:"start",statement:"statement",statements:"statements",statementsValue:"statementsValue",statementText:"statementText",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",stripePricingTableId:"stripePricingTableId",stripePricingTableIdValue:"stripePricingTableIdValue",stripePublishableKey:"stripePublishableKey",stripePublishableKeyValue:"stripePublishableKeyValue",subject:"subject",subjectValue:"subjectValue",subtitle:"subtitle",subtype:"subtype",subtypeValue:"subtypeValue",table:"table",tableAutoWidth:"tableAutoWidth",tableAutoWidthValue:"tableAutoWidthValue",tableColumnMinWidth:"tableColumnMinWidth",tableColumnMinWidthValue:"tableColumnMinWidthValue",tableFixedHeader:"tableFixedHeader",tableFixedHeaderValue:"tableFixedHeaderValue",tableHeaderWhitespaceNoWrap:"tableHeaderWhitespaceNoWrap",tableHeaderWhitespaceNoWrapValue:"tableHeaderWhitespaceNoWrapValue",tableHeight:"tableHeight",tableHeightValue:"tableHeightValue",tablePagination:"tablePagination",tablePaginationLimit:"tablePaginationLimit",tablePaginationLimitValue:"tablePaginationLimitValue",tablePaginationValue:"tablePaginationValue",tableResizableColumns:"tableResizableColumns",tableResizableColumnsValue:"tableResizableColumnsValue",tableSearch:"tableSearch",tableSearchValue:"tableSearchValue",tableSort:"tableSort",tableSortValue:"tableSortValue",tableWhitespaceNoWrap:"tableWhitespaceNoWrap",tableWhitespaceNoWrapValue:"tableWhitespaceNoWrapValue",tag:"tag",tagValue:"tagValue",target:"target",targetValue:"targetValue",technicalTerm:"technicalTerm",technicalTermValue:"technicalTermValue",term:"term",text:"text",textAlign:"textAlign",textAst:"textAst",textAstValue:"textAstValue",textFormat:"textFormat",textReference:"textReference",textReferenceValue:"textReferenceValue",texts:"texts",textsValue:"textsValue",theme:"theme",themeValue:"themeValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",title:"title",toc:"toc",tocContent:"tocContent",tocContentValue:"tocContentValue",tocResource:"tocResource",tocResourceValue:"tocResourceValue",tocValue:"tocValue",topicTag:"topicTag",topicTagValue:"topicTagValue",trim:"trim",type:"type",unit:"unit",unitAbbr:"unitAbbr",url:"url",value:"value",values:"values",valuesValue:"valuesValue",vendorDashboardId:"vendorDashboardId",vendorDashboardIdValue:"vendorDashboardIdValue",vendorSurveyId:"vendorSurveyId",vendorSurveyIdValue:"vendorSurveyIdValue",vendorUrl:"vendorUrl",vendorUrlValue:"vendorUrlValue",version:"version",video:"video",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",videoEmbed:"videoEmbed",videoLink:"videoLink",warnings:"warnings",warningsValue:"warningsValue",websiteLink:"websiteLink",width:"width",widthValue:"widthValue",x:"x",xValue:"xValue",y:"y",yValue:"yValue",zoomDisabled:"zoomDisabled"}),ue=class{constructor(){se()}walk(e,t,i,r){this.walkRecursive(e,[{index:0,key:t,value:e}],i,r)}getRouteKey(e){return e.reduce((t,i,r)=>(+i.key!==i.index&&(t+=`${i.key}`,r<e.length-1&&(t+="_")),t),"")}printTree(e,t=pe.bitmarkAst){this.walkRecursive(e,[{index:0,key:t,value:e}],{enter:(e,t)=>(console.log("Enter: "+this.getRouteKey(t)),t[t.length-1].key!==pe.bodyJson),between:(e,t,i,r)=>{console.log("Between: "+this.getRouteKey(r))},exit:(e,t)=>{console.log("Exit: "+this.getRouteKey(t))},leaf:(e,t)=>{console.log("Leaf: "+this.getRouteKey(t))}},void 0)}preprocessAst(e){if(O.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,i,r){const{enter:o,between:a,exit:n,leaf:s}=i,l=t[t.length-1].key,c=!this.isValue(e),d=t[t.length-1];if(c){if(o){if(!1===o(d,t,r))return}}else s&&s(d,t,r);if(c){const o=this.isArray(e),n=Object.keys(e);for(let s=0,c=n.length;s<c;s++){const p=n[s],u=s===c-1,h=e,m=h[p];if(null!=m){const e={key:this.getAstKey(p,l,o),index:s,value:m},c=t.slice();if(c.push(e),this.walkRecursive(m,c,i,r),!u){const i=n[s+1],c=h[i],p={key:this.getAstKey(i,l,o),index:s+1,value:c};if(a){if(!1===a(d,e,p,t,r))break}}}}}c&&n&&n(d,t,r)}getAstKey(e,t,i){let r=e;return i&&t&&(r=`${t}Value`),pe.fromKey(r)||`unknown(${r})`}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)}},he=(0,d(u(),1).superenum)({tag:"tag",body:"body"}),me=(0,d(u(),1).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"}),ge=/([*`_!=])(?=\1)/,be=/(\^*])/,fe=/(\^+)/,ye=`${be.source}|${fe.source}`,ke=`${ge.source}|${/^(\|)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([^\S\r\n]+)/.source}|${/^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([.@#▼►%!?+\-$_=&])/.source}|${/^(~)(~~~[ \t]*)$/.source}|${/^(\$)(\$\$\$[ \t]*)$/.source}|${fe.source}`,Te=`${/^(\[)(\^*)(\.)/.source}`,ve=new RegExp(`${ge.source}|${be.source}|${fe.source}`,"gm"),xe=new RegExp(ye,"gm"),_e=new RegExp(ke,"gm"),we=new RegExp(Te,"gm"),Ce=new RegExp("^(?:(\\[)(\\^*)(\\.))|(\\^+)","gm"),Ae=new RegExp("\\^([\\^]*)","gm"),Be=new RegExp("^(\\[)\\^(\\^*)(\\.)","gm"),Se=new RegExp("^(\\||•|#)","gm"),Pe={format:me.bitmarkPlusPlus,location:he.body,v2:!1};function Ie(e){return"string"==typeof e||e instanceof String}var Le={format:T.bitmarkText,location:he.body,inPlaceArray:!1,v2:!1},Ee=new class{constructor(){p(this,"EMPTY_STRING","")}breakscape(e,t={}){if(null==e)return;const i=Object.assign({},Pe,t);if(Array.isArray(e))return e.map(e=>this.breakscape(e,i));if(!Ie(e))return e;const{regex:r,replacer:o}=function(e,t,i=!1){return t===he.tag?i||e!==me.bitmarkPlusPlus?{regex:xe,replacer:"$2^$1"}:{regex:ve,replacer:"$1$3^$2"}:e===me.bitmarkPlusPlus?i?{regex:Ce,replacer:"$1$4^$2$3"}:{regex:_e,replacer:"$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14"}:{regex:we,replacer:"$1^$2$3"}}(i.format,i.location,i.v2);let a=e;return a=a.replace(r,o),a}unbreakscape(e,t={}){if(null==e)return;const i=Object.assign({},Pe,t);if(Array.isArray(e))return e.map(e=>this.unbreakscape(e,i));if(!Ie(e))return e;const{regex:r,replacer:o}=function(e,t){const i=e!==me.bitmarkPlusPlus;return t===he.body&&i?{regex:Be,replacer:"$1$2$3"}:{regex:Ae,replacer:"$1"}}(i.format,i.location);let a=e;return a=a.replace(r,o),a}breakscapeCode(e,t){if(null==e)return e;const i=Object.assign({},Pe,t),r=e=>e?e.replace(Se,"$1^"):e;if(Array.isArray(e)){const t=i.inPlaceArray?e:[e.length];for(let t=0,i=e.length;t<i;t++){const i=e[t];Ie(i)&&(e[t]=r(i))}e=t}else Ie(e)&&(e=r(e));return e}version(){return X}license(){return Z}},Ve=new class{constructor(){p(this,"EMPTY_STRING","")}breakscape(e,t){const i=Object.assign({},Le,t);return Ee.breakscape(e,{format:i.format,location:i.location,inPlaceArray:i.inPlaceArray,v2:i.v2})}unbreakscape(e,t){const i=Object.assign({},Le,t);return Ee.unbreakscape(e,i)}breakscapeCode(e,t){const i=Object.assign({},Le,t);return Ee.breakscapeCode(e,i)}concatenate(e,t){return e+t}},Ne=(0,d(u(),1).superenum)({bitmarkMinusMinus:"bitmark--"}),Re=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}removeDuplicates(e,t){const i=new Set;for(const r of e){const o=t?t(r):r;if(i.has(o)){const t=e.lastIndexOf(r);-1!==t&&e.splice(t,1)}i.add(o)}return e}},Fe=(d(u(),1),(0,d(u(),1).superenum)({v2:2,v3:3})),Oe=Fe.v3,De=class{constructor(){p(this,"ast",new ue),p(this,"debugGenerationInline",!1),p(this,"printed",!1)}enter(e,t,i){let r;const o=this,a=`enter_${e.key}`;return this.printed||(this.printed=!0),this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[a]&&(r=o[a](e,t,i)),r}between(e,t,i,r,o){let a;const n=this,s=`between_${e.key}`;return this.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[s]&&(a=n[s](e,t,i,r,o)),a}exit(e,t,i){const r=this,o=`exit_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof r[o]&&r[o](e,t,i)}leaf(e,t,i){const r=this,o=`leaf_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof r[o]&&r[o](e,t,i),this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}getParentNode(e,t=1){if(e.length>t)return e[e.length-t-1]}},ze={bodyBitCallback:void 0,debugGenerationInline:!1},qe="==",Me=["*","`","_","!","="],$e={[ce.bold]:"**",[ce.light]:"``",[ce.italic]:"__",[ce.highlight]:"!!"},Je=[ce.bold,ce.light,ce.italic,ce.highlight],je=[ce.strike,ce.subscript,ce.superscript,ce.ins,ce.del,ce.underline,ce.doubleUnderline,ce.circle,ce.languageEmRed,ce.languageEmOrange,ce.languageEmYellow,ce.languageEmGreen,ce.languageEmBlue,ce.languageEmPurple,ce.languageEmPink,ce.languageEmBrown,ce.languageEmBlack,ce.languageEmWhite,ce.languageEmGray,ce.languageEm,ce.userUnderline,ce.userDoubleUnderline,ce.userStrike,ce.userCircle,ce.userHighlight,ce.notranslate,ce.link,ce.ref,ce.xref,ce.extref,ce.footnote,ce.footnoteStar,ce.symbol,ce.var,ce.code,ce.timer,ce.duration,ce.color,ce.comment],We=new RegExp(/(\n|\r\n)/,"g"),He=new RegExp(/https?:\/\/|mailto:(.*)/,"g"),Ue=new RegExp(/\]/,"g"),Ge="enter",Ke="between",Ye="exit",Qe=class extends De{constructor(e,t){super(),p(this,"ast",new ue),p(this,"bitmarkVersion"),p(this,"options"),p(this,"generateOptions",{}),p(this,"textFormat",T.bitmarkText),p(this,"textLocation",he.body),p(this,"writerText",""),p(this,"nodeIndex",0),p(this,"currentIndent",0),p(this,"prevIndent",0),p(this,"indentationStringCache",""),p(this,"inParagraph",!1),p(this,"inHeading",!1),p(this,"inCodeBlock",!1),p(this,"exitedCodeBlock",!1),p(this,"inBulletList",!1),p(this,"inInline",!1),p(this,"textDepth",0),p(this,"placeholderIndex",0),p(this,"placeholders",{}),p(this,"rootParagraphNodeContentIndex",0),p(this,"previousRootParagraphContextType",de.text),p(this,"inPreText",!1),p(this,"thisNodeIsPreText",!1),p(this,"preTextIndexTemp",-1),p(this,"havePreText",!1),p(this,"preTextIndex",-1),this.bitmarkVersion=Fe.fromValue(e)??Oe,this.options={...ze,...t},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion,Fe.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)}async generate(e,t,i,r){return this.generateSync(e,t,i,r)}generateSync(e,t,i,r){if(this.generateOptions=Object.assign({},r),this.validateGenerateOptions(e),this.generateOptions.plainTextDividerAllowed){const r=this.options.writeCallback,o=this.options.bodyBitCallback;this.options.writeCallback=void 0,this.options.bodyBitCallback=void 0,this.resetState(t,i),this.walkAndWrite(e),this.options.writeCallback=r,this.options.bodyBitCallback=o;const a=this.havePreText,n=this.preTextIndex;this.resetState(t,i),this.havePreText=a,this.preTextIndex=n,this.walkAndWrite(e)}else this.resetState(t,i),this.walkAndWrite(e);return this.writerText}getPlaceholders(){return this.placeholders}resetState(e,t){this.printed=!1,this.textFormat=e??T.bitmarkText,this.textLocation=t,this.writerText="",this.nodeIndex=0,this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inParagraph=!1,this.inHeading=!1,this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.inBulletList=!1,this.inInline=!1,this.textDepth=0,this.placeholderIndex=0,this.placeholders={},this.rootParagraphNodeContentIndex=0,this.previousRootParagraphContextType=de.hardBreak,this.inPreText=!1,this.thisNodeIsPreText=!1,this.preTextIndexTemp=-1,this.havePreText=!1,this.preTextIndex=-1}walkAndWrite(e){this.ast.walk(e,pe.textAst,this,void 0)}enter_textAstValue(e,t){return this.handleEnterNode(e.value,t)}between_textAstValue(e,t,i,r){return this.handleBetweenNode(e.value,t,i,r)}exit_textAstValue(e,t){return this.handleExitNode(e.value,t)}enter_contentValue(e,t){return this.handleEnterContentValueNode(e,t)}between_contentValue(e,t,i,r){this.handleBetweenContentValueNode(e,t,i,r)}exit_contentValue(e,t){this.handleExitContentValueNode(e,t)}enter_contentValueValue(e,t){return this.handleEnterNode(e.value,t)}between_contentValueValue(e,t,i,r){this.handleBetweenNode(e.value,t,i,r)}exit_contentValueValue(e,t){return this.handleExitNode(e.value,t)}handleEnterNode(e,t){switch(this.handleEnterNodePreTextCheck(e,t),this.handleIndent(e),e.type){case de.paragraph:this.inParagraph=!0,this.writeParagraph(e);break;case de.hardBreak:this.writeHardBreak(e);break;case de.text:this.writeMarks(e,Ge),this.writeText(e),this.writeMarks(e,Ke),0===this.textDepth&&(this.inInline=!0),this.textDepth++;break;case de.heading:this.writeHeading(e),this.inHeading=!0;break;case de.section:this.writeSection(e);break;case de.listItem:case de.taskItem:this.writeBullet(e,t);break;case de.image:case de.imageInline:this.writeImage(e);break;case de.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case de.latex:this.writeLatex(e);break;case de.noBulletList:case de.bulletList:case de.orderedList:case de.orderedListRoman:case de.orderedListRomanLower:case de.letteredList:case de.letteredListLower:case de.taskList:this.inBulletList=!0;break;case de.gap:case de.select:case de.highlight:case de.mark:return this.writeBodyBit(e,t),!1}this.exitedCodeBlock=!1}handleBetweenNode(e,t,i,r){e.type}handleExitNode(e,t){switch(e.type){case de.text:this.textDepth--,0===this.textDepth&&(this.inInline=!1),this.writeMarks(e,Ye);break;case de.paragraph:this.writeNL(),this.inParagraph=!1;break;case de.heading:this.inHeading=!1;case de.section:case de.image:this.inParagraph||(this.writeNL(),this.writeNL());break;case de.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case de.noBulletList:case de.bulletList:case de.orderedList:case de.orderedListRoman:case de.orderedListRomanLower:case de.letteredList:case de.letteredListLower:case de.taskList:this.currentIndent<=1&&(this.writeNL(),this.inBulletList=!1)}this.handleDedent(e),this.nodeIndex++}handleIndent(e){switch(e.type){case de.noBulletList:case de.bulletList:case de.orderedList:case de.orderedListRoman:case de.orderedListRomanLower:case de.letteredList:case de.letteredListLower:case de.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case de.noBulletList:case de.bulletList:case de.orderedList:case de.orderedListRoman:case de.orderedListRomanLower:case de.letteredList:case de.letteredListLower:case de.taskList:this.currentIndent--}}handleEnterContentValueNode(e,t){3===t.length&&(this.thisNodeIsPreText=!0,this.inPreText=!1,this.previousRootParagraphContextType=de.hardBreak)}handleBetweenContentValueNode(e,t,i,r){if(3===r.length){const e=t.value;this.updatePreTextState(),this.thisNodeIsPreText=!0,this.previousRootParagraphContextType=e.type,this.rootParagraphNodeContentIndex++}}handleExitContentValueNode(e,t){3===t.length&&(this.updatePreTextState(),this.thisNodeIsPreText=!1,this.generateOptions.plainTextDividerAllowed&&this.inPreText&&(this.havePreText=!0,this.preTextIndex=this.preTextIndexTemp),this.inPreText=!1)}updatePreTextState(){!this.inPreText&&this.thisNodeIsPreText&&this.previousRootParagraphContextType===de.hardBreak?(this.inPreText=!0,this.preTextIndexTemp=this.rootParagraphNodeContentIndex):this.inPreText&&!this.thisNodeIsPreText&&(this.inPreText=!1,this.preTextIndexTemp=-1)}handleEnterNodePreTextCheck(e,t){if(4===t.length){if(this.inPreText&&e.type===de.hardBreak)return;if(e.type===de.text)return}this.thisNodeIsPreText=!1}getLinkHref(e){if(e.type===de.text&&e.marks){const t=e.marks.reduce((e,t)=>{if(t.type===ce.link){const e=t,i=e.attrs?.href;if(i)return i}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,t){const i=`[!${this.placeholderIndex}]`;if(this.placeholders[i]=e,this.options.bodyBitCallback){const i=this.options.bodyBitCallback(e,this.placeholderIndex,t);this.write(i)}else this.write(i);this.placeholderIndex++}writeText(e){if(null==e.text)return;const t=this.inCodeBlock;let i=e.text;const r=this.getLinkText(e);if(r&&(i=r),i=r||this.breakscape(i,{format:this.textFormat,location:this.textLocation}),this.currentIndent>1){const e=this.getIndentationString();i=i.replace(We,`$1${e}`)}if(this.havePreText&&this.rootParagraphNodeContentIndex===this.preTextIndex&&(this.writePlainTextDivider(),this.writeNL()),this.havePreText&&this.rootParagraphNodeContentIndex>=this.preTextIndex){const t=this.breakscape(e.text,{format:T.plainText,location:this.textLocation});this.write(t)}else this.write(i);(this.currentIndent>1||t)&&(this.thisNodeIsPreText=!1),this.inPreText||e.text!==i||(this.thisNodeIsPreText=!1)}isSimpleLink(e){if(null==e.text)return!1;if(1!==e.marks?.length)return!1;const t=this.getLinkHref(e);if(t){return t.replace(He,"$1")===e.text}return!1}getLinkText(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let i;return i=t.replace(He,"$1")===e.text?t:e.text,i=(i??"").replace(Ue,"^]"),i}return!1}getInterTextBreakscape(e){if(this.bitmarkVersion===Fe.v2)return"";if(this.textFormat===T.plainText)return"";const t=this.writerText.slice(-1),i=e.slice(0,1);return t===i&&-1!==Me.indexOf(t)||this.textLocation===he.body&&"["===t&&-1!=="@#▼►%!?+-$_=&".indexOf(i)?"^":""}validateGenerateOptions(e){this.generateOptions.plainTextDividerAllowed&&(1!==e.length||1===e.length&&e[0].type!==de.paragraph)&&(this.generateOptions.plainTextDividerAllowed=!1)}writeMarks(e,t){if(e.marks){const i=!(!this.inInline&&!this.inHeading);this.thisNodeIsPreText=!1;if(0===e.marks.length)return void this.writeMarkTextWrapper(qe);const r=1===e.marks.length&&i,o=e.marks.reduce((e,t)=>e||(-1!==Je.indexOf(t.type)?r?$e[t.type]:qe:-1!==je.indexOf(t.type)?qe:e),void 0),a=this.isSimpleLink(e);if(null!=o&&!a){if(t!=Ge&&t!=Ke||this.writeMarkTextWrapper(o),t==Ke)for(const t of e.marks)-1!==Je.indexOf(t.type)?r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(t)):ce.comment===t.type?(this.writeInlineMarkStartEnd(),this.writeCommentMark(t)):ce.link===t.type?(this.writeInlineMarkStartEnd(),this.writeLinkMark(t)):ce.ref===t.type?(this.writeInlineMarkStartEnd(),this.writeRefMark(t)):ce.xref===t.type?(this.writeInlineMarkStartEnd(),this.writeXRefMark(t)):ce.extref===t.type?(this.writeInlineMarkStartEnd(),this.writeExtRefMark(t)):ce.footnote===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteMark(t)):ce.footnoteStar===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteStarMark(t)):ce.symbol===t.type?(this.writeInlineMarkStartEnd(),this.writeSymbolMark(t)):-1!==je.indexOf(t.type)&&(this.writeInlineMarkStartEnd(),this.writeInlineMark(t));if(t==Ye){let t=!1;for(const i of e.marks)-1!==Je.indexOf(i.type)?r||(t=!0):ce.comment!==i.type&&ce.link!==i.type&&ce.ref!==i.type&&ce.xref!==i.type&&ce.footnote!==i.type&&ce.footnoteStar!==i.type&&-1===je.indexOf(i.type)||(t=!0);t&&this.writeInlineMarkStartEnd()}}}}writeParagraph(e){if(this.textFormat===T.bitmarkText){if(this.inBulletList)return;const t=e.content?.length??0;if(0===this.nodeIndex){if(1===t){const t=e.content?.[0].type===de.text,i=e.content?.[0].text??"";if(!t||""!==i)return}if(t>1)return}this.write("|"),this.writeNL(),this.exitedCodeBlock&&this.writeNL()}}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){let t="";const i=e.attrs?.level??1;for(let e=0;e<+i;e++)t+="#";t+=" ",this.write(t)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e,t){let i=this.getIndentationString();const r=this.getParentNode(t,2),o=r?.value,a=o?.type,n=o?.attrs?.start??1;if(a===de.bulletList)i+="• ";else if(a===de.noBulletList)i+="•_ ";else if(a===de.orderedList)i+=`•${n} `;else if(a===de.orderedListRoman)i+=`•${n}I `;else if(a===de.orderedListRomanLower)i+=`•${n}i `;else if(a===de.letteredList)i+="•A ";else if(a===de.letteredListLower)i+="•a ";else if(a===de.taskList){const t=e;i+=t.attrs?.checked??!1?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs,i=e.type===de.imageInline,r=this.getMediaAttrs(i?"imageInline":"image",t,{ignoreAttributes:i?new Set(["alt","zoomDisabled","title"]):void 0});let o="";i&&(o=`==${t.alt??""}==`),o+=r?`|${r}|`:"",this.write(o)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeLatex(e){if(null==e.attrs||!e.attrs.formula)return;const t=e.attrs,i=`==${this.breakscape(t.formula,{format:this.textFormat,location:this.textLocation})}==|latex|`;this.write(i)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[i,r]of Object.entries(e.attrs))("language"===i&&"plain text"!==r||"color"===i||"name"===i||"duration"===i)&&(t=`${t}:${r}`);this.write(t)}writeCommentMark(e){const t=`#${e.comment||""}`;this.write(t)}writeLinkMark(e){const t=`link:${((e.attrs?.href||"")??"").replace(Ue,"^]")}`;this.write(t)}writeRefMark(e){const t=`►${e.attrs?.reference??""}`;this.write(t)}writeXRefMark(e){const t=e.attrs?.xref??"",i=e.attrs?.reference??"";let r=`xref:${t}`;i&&(r+=`|►${i}`),this.write(r)}writeExtRefMark(e){const t=e.attrs?.extref??"",i=e.attrs?.references??[],r=e.attrs?.provider??"";let o=`extref:${t}`;for(const e of i)o+=`|►${e??""}`;o+=`|provider:${r}`,this.write(o)}writeFootnoteMark(e){this.write("footnote:")}writeFootnoteStarMark(e){this.write("footnote*:")}writeSymbolMark(e){if(null==e.attrs)return;const t=e.attrs,i=this.getMediaAttrs("symbol",t)??"";this.write(i)}writeInlineMarkStartEnd(){this.write("|")}writePlainTextDivider(){this.write("==== text ====")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}getMediaAttrs(e,t,i){if(!e)return;const r=Object.assign({},i).ignoreAttributes??new Set;let o=`${e}:${t?.src??""}`;const a=Object.entries(t).filter(([e,t])=>"src"!==e);for(let e=0;e<a.length;e++){const[t,i]=a[e];if(!r.has(t))switch(t){case"textAlign":"left"!==i&&(o+=`|captionAlign:${i}`);break;case"alignment":"center"!==i&&i&&(o+=`|alignment:${i}`);break;case"title":i&&(o+=`|caption:${i}`);break;case"class":"center"!==i&&i&&(o+=`|align:${i}`);break;case"comment":i&&(o+=`|#${i}`);break;case"":O.isString(i)?o+=`|:${i}`:o+="|";break;case"zoomDisabled":i||(o+="|zoomDisabled:false");break;default:t&&i&&(o+=`|${t}:${i}`)}}return o}breakscape(e,t){return this.generateOptions.noBreakscaping?e:Ve.breakscape(e,t)}getBitType(e){for(const t of e)if(t.key===pe.bitsValue){const e=t.value;return e?.bitType}}write(e){return e=this.getInterTextBreakscape(e)+e,this.options.writeCallback&&this.options.writeCallback(e),this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const i of e)this.write(`${i}${t??""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}};function Xe(e){return"string"!=typeof e?null:Ve.unbreakscape(e)}function Ze(e){e&&"object"==typeof e&&(delete e._tempParsingParent,delete e._tempListStart,Object.keys(e).forEach(t=>{Ze(e[t])}))}function et(e){const t=e=>e&&"text"===e.type&&!e.text;function i(e){for(let r=e.length-1;r>=0;r--){const o=e[r];t(o)?e.splice(r,1):o&&Array.isArray(o.content)&&i(o.content)}}return Array.isArray(e)?i(e):e&&Array.isArray(e.content)&&i(e.content),e}function tt(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):rt(e,{startRule:"bitmarkPlusString"})}var it=class extends SyntaxError{constructor(e,t,i,r){super(e),this.expected=t,this.found=i,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let i=null;const r=e.find(e=>e.source===this.location.source);r&&(i=r.text.split(/\r\n|\n|\r/g));const o=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+a.line+":"+a.column;if(i){const e=this.location.end,r="".padEnd(a.line.toString().length," "),s=i[o.line-1],l=(o.line===e.line?e.column:s.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+r+" |\n"+a.line+" | "+s+"\n"+r+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+n}return t}static buildMessage(e,t){function i(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return r?e.replace(r,e=>"\\u{"+i(e)+"}"):e}function a(e){return o(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,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}function n(e){return o(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,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}const s={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let i=1;i<t.length;i++)t[i-1]!==t[i]&&(t[e]=t[i],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+(((c=t)?'"'+a(c)+'"':"end of input")+" found.");var c}};function rt(e,t){const i={},r=(t=void 0!==t?t:{}).grammarSource,o={version:Fo,bitmarkPlusPlus:function(){let e,t;if(So++,e=[],t=Oo(),t!==i)for(;t!==i;)e.push(t),t=Oo();else e=i;e===i&&(e=function(){let e,t;return e=xo,t="",_o=e,t=[],e=t,e}());So--,e===i&&(t=i,0===So&&No(Mt));return e},bitmarkPlus:function(){let e,t;return So++,e=xo,t=pa(),_o=e,t=To(t),e=t,So--,e},bitmarkMinusMinus:function(){let e,t;return So++,e=xo,t=Ta(),_o=e,t=vo(t),e=t,So--,e},bitmarkPlusString:function(){let e;return So++,e=pa(),So--,e},bitmarkMinusMinusString:Ta};let a=Fo;const n="|",s="### ",l="## ",c="# ",d="code",p=":",u="bitmark++",h="bitmark--",m="JavaScript",g="• ",b="•_ ",f="•",y=" ",k="I ",T="i ",v="•A ",x="•a ",_="•+ ",w="•- ",C="\t",A="image",B="#",S="@",P="width",I="height",L="alignment",E="captionAlign",V="left",N="center",R="right",F="alt",O="caption",D="zoomDisabled",z="true",q="false",M="=",$="|latex|",J="|imageInline:",j="alignmentVertical",W="size",H="top",U="middle",G="bottom",K="baseline",Y="sub",Q="super",X="text-bottom",Z="text-top",ee="line-height",te="font-height",ie="explicit",re="link:",oe="extref:",ae="provider:",ne="xref:",se="►",le="symbol:",ce="footnote:",de="footnote*:",pe="var:",ue="code:",he="timer",me="timer:",ge="duration:",be="P",fe="color:",ye="|►",ke="bold",Te="italic",ve="light",xe="highlight",_e="strike",we="subscript",Ce="superscript",Ae="ins",Be="del",Se="underline",Pe="doubleUnderline",Ie="circle",Le="languageEmRed",Ee="languageEmOrange",Ve="languageEmYellow",Ne="languageEmGreen",Re="languageEmBlue",Fe="languageEmPurple",Oe="languageEmPink",De="languageEmBrown",ze="languageEmBlack",qe="languageEmWhite",Me="languageEmGray",$e="languageEm",Je="userUnderline",je="userDoubleUnderline",We="userStrike",He="userCircle",Ue="userHighlight",Ge="notranslate",Ke="aqua",Ye="black",Qe="blue",rt="brown",ot="fuchsia",at="lightgrey",nt="gray",st="darkgray",lt="green",ct="lime",dt="magenta",pt="maroon",ut="navy",ht="olive",mt="orange",gt="pink",bt="purple",ft="red",yt="silver",kt="teal",Tt="violet",vt="white",xt="yellow",_t="*",wt="_",Ct="`",At="!",Bt="[!",St="]",Pt="\n",It="\r\n",Lt="http",Et="s",Vt="://",Nt="mailto:",Rt=/^[ \t]/,Ft=/^[0-9]/,Ot=/^[\r\u2028-\u2029]/,Dt=/^[^\n\r\u2028\u2029]/,zt=/^[!#-;=?-[\]-_a-{}-~]/,qt={type:"any"},Mt=Lo("StyledText"),$t=Po("|",!1),Jt=Po("### ",!1),jt=Po("## ",!1),Wt=Po("# ",!1),Ht=Po("code",!1),Ut=Io([" ","\t"],!1,!1,!1),Gt=Po(":",!1),Kt=Po("bitmark++",!1),Yt=Po("bitmark--",!1),Qt=Po("JavaScript",!1),Xt=Po("• ",!1),Zt=Po("•_ ",!1),ei=Po("•",!1),ti=Io([["0","9"]],!1,!1,!1),ii=Po(" ",!1),ri=Po("I ",!1),oi=Po("i ",!1),ai=Po("•A ",!1),ni=Po("•a ",!1),si=Po("•+ ",!1),li=Po("•- ",!1),ci=Po("\t",!1),di=Po("image",!1),pi=Po("#",!1),ui=Po("@",!1),hi=Po("width",!1),mi=Po("height",!1),gi=Po("alignment",!1),bi=Po("captionAlign",!1),fi=Po("left",!1),yi=Po("center",!1),ki=Po("right",!1),Ti=Po("alt",!1),vi=Po("caption",!1),xi=Po("zoomDisabled",!1),_i=Po("true",!1),wi=Po("false",!1),Ci=Po("=",!1),Ai=Po("|latex|",!1),Bi=Po("|imageInline:",!1),Si=Po("alignmentVertical",!1),Pi=Po("size",!1),Ii=Po("top",!1),Li=Po("middle",!1),Ei=Po("bottom",!1),Vi=Po("baseline",!1),Ni=Po("sub",!1),Ri=Po("super",!1),Fi=Po("text-bottom",!1),Oi=Po("text-top",!1),Di=Po("line-height",!1),zi=Po("font-height",!1),qi=Po("explicit",!1),Mi=Po("link:",!1),$i=Po("extref:",!1),Ji=Po("provider:",!1),ji=Po("xref:",!1),Wi=Po("►",!1),Hi=Po("symbol:",!1),Ui=Po("footnote:",!1),Gi=Po("footnote*:",!1),Ki=Po("var:",!1),Yi=Po("code:",!1),Qi=Po("timer",!1),Xi=Po("timer:",!1),Zi=Po("duration:",!1),er=Po("P",!1),tr=Po("color:",!1),ir=Po("|►",!1),rr=Po("bold",!1),or=Po("italic",!1),ar=Po("light",!1),nr=Po("highlight",!1),sr=Po("strike",!1),lr=Po("subscript",!1),cr=Po("superscript",!1),dr=Po("ins",!1),pr=Po("del",!1),ur=Po("underline",!1),hr=Po("doubleUnderline",!1),mr=Po("circle",!1),gr=Po("languageEmRed",!1),br=Po("languageEmOrange",!1),fr=Po("languageEmYellow",!1),yr=Po("languageEmGreen",!1),kr=Po("languageEmBlue",!1),Tr=Po("languageEmPurple",!1),vr=Po("languageEmPink",!1),xr=Po("languageEmBrown",!1),_r=Po("languageEmBlack",!1),wr=Po("languageEmWhite",!1),Cr=Po("languageEmGray",!1),Ar=Po("languageEm",!1),Br=Po("userUnderline",!1),Sr=Po("userDoubleUnderline",!1),Pr=Po("userStrike",!1),Ir=Po("userCircle",!1),Lr=Po("userHighlight",!1),Er=Po("notranslate",!1),Vr=Po("aqua",!1),Nr=Po("black",!1),Rr=Po("blue",!1),Fr=Po("brown",!1),Or=Po("fuchsia",!1),Dr=Po("lightgrey",!1),zr=Po("gray",!1),qr=Po("darkgray",!1),Mr=Po("green",!1),$r=Po("lime",!1),Jr=Po("magenta",!1),jr=Po("maroon",!1),Wr=Po("navy",!1),Hr=Po("olive",!1),Ur=Po("orange",!1),Gr=Po("pink",!1),Kr=Po("purple",!1),Yr=Po("red",!1),Qr=Po("silver",!1),Xr=Po("teal",!1),Zr=Po("violet",!1),eo=Po("white",!1),to=Po("yellow",!1),io=Po("*",!1),ro=Po("_",!1),oo=Po("`",!1),ao=Po("!",!1),no=Po("[!",!1),so=Po("]",!1),lo=Lo("Line Terminator"),co=Po("\n",!1),po=Po("\r\n",!1),uo=Io(["\r",["\u2028","\u2029"]],!1,!1,!1),ho=Io(["\n","\r","\u2028","\u2029"],!0,!1,!1),mo=Po("http",!1),go=Po("s",!1),bo=Po("://",!1),fo=Po("mailto:",!1),yo=Io(["!",["#",";"],"=",["?","["],["]","_"],["a","{"],["}","~"]],!1,!1,!1);function ko(e){let t={...e};Ze(t);return et(t)}function To(e){return[{type:"paragraph",content:e,attrs:{}}]}function vo(e){return[{type:"paragraph",content:e,attrs:{}}]}let xo=0|t.peg$currPos,_o=xo;const wo=[{line:1,column:1}];let Co,Ao=xo,Bo=t.peg$maxFailExpected||[],So=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=o[t.startRule]}function Po(e,t){return{type:"literal",text:e,ignoreCase:t}}function Io(e,t,i,r){return{type:"class",parts:e,inverted:t,ignoreCase:i,unicode:r}}function Lo(e){return{type:"other",description:e}}function Eo(t){let i,r=wo[t];if(r)return r;if(t>=wo.length)i=wo.length-1;else for(i=t;!wo[--i];);for(r=wo[i],r={line:r.line,column:r.column};i<t;)10===e.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return wo[t]=r,r}function Vo(e,t,i){const o=Eo(e),a=Eo(t),n={source:r,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:a.line,column:a.column}};return i&&r&&"function"==typeof r.offset&&(n.start=r.offset(n.start),n.end=r.offset(n.end)),n}function No(e){xo<Ao||(xo>Ao&&(Ao=xo,Bo=[]),Bo.push(e))}function Ro(e,t,i){return new it(it.buildMessage(e,t),e,t,i)}function Fo(){let t,r,o;for(t=xo,r=[],e.length>xo?(o=e.charAt(xo),xo++):(o=i,0===So&&No(qt));o!==i;)r.push(o),e.length>xo?(o=e.charAt(xo),xo++):(o=i,0===So&&No(qt));return _o=t,r="8.34.3",t=r,t}function Oo(){let t,r;var o;return t=xo,r=function(){let t,r,o,a,n;if(t=xo,r=qo(),r!==i){for(o=xo,a=[],n=Ra();n!==i;)a.push(n),n=Ra();o=e.substring(o,xo),a=Fa(),a!==i?(n=Na(),n===i&&(n=null),_o=t,s=r,t={type:"heading",content:tt(o),attrs:{level:s.length-1}}):(xo=t,t=i)}else xo=t,t=i;var s;return t}(),r!==i&&(_o=t,o=r,r=et({...o})),t=r,t===i&&(t=xo,r=function(){let e,t,r,o;if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=jo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"bulletList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,a=t,n=r,e={...a,content:n,attrs:{}}):(xo=e,e=i)}else xo=e,e=i;var a,n;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Wo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"noBulletList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Ho(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Uo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedListRoman"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Go(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedListRomanLower"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Ko(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"letteredList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Yo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"letteredListLower"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i)if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Qo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"taskList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i}}}}}}return e}(),r!==i&&(_o=t,r=ko(r)),t=r,t===i&&(t=xo,r=na(),r!==i&&(_o=t,r=function(e){return{...e}}(r)),t=r,t===i&&(t=xo,r=function(){let t,r,o;t=xo,r=$o(),r!==i?(o=function(){let t,r,o,a;t=xo,r=xo,o=[],a=Jo();for(;a!==i;)o.push(a),a=Jo();return r=e.substring(r,xo),_o=t,r=function(e){return[{type:"text",text:Xe(e.trim())}]}(r),t=r,t}(),_o=t,t=function(e,t){return{...e,content:t}}(r,o)):(xo=t,t=i);return t}(),r!==i&&(_o=t,r=function(e){return{...e}}(r)),t=r,t===i&&(t=xo,r=function(){let e,t,r;e=xo,t=xo,So++,r=Do(),So--,r===i?t=void 0:(xo=t,t=i);t!==i?(r=ia(),r!==i?(_o=e,e={type:"paragraph",content:tt(r.trim()),attrs:{}}):(xo=e,e=i)):(xo=e,e=i);e===i&&(e=xo,t=oa(),t!==i?(r=ia(),r!==i?(_o=e,e=function(e){return{type:"paragraph",content:tt(e.trim()),attrs:{}}}(r)):(xo=e,e=i)):(xo=e,e=i),e===i&&(e=xo,t=oa(),t!==i?(r="",_o=e,e=function(e){return{type:"paragraph",content:tt(e.trim()),attrs:{}}}(r)):(xo=e,e=i)));return e}(),r!==i&&(_o=t,r=function(e){return et({...e})}(r)),t=r)))),t}function Do(){let e;return e=qo(),e===i&&(e=Xo(),e===i&&(e=na(),e===i&&(e=$o(),e===i&&(e=oa())))),e}function zo(){let t;return 124===e.charCodeAt(xo)?(t=n,xo++):(t=i,0===So&&No($t)),t}function qo(){let t;return e.substr(xo,4)===s?(t=s,xo+=4):(t=i,0===So&&No(Jt)),t===i&&(e.substr(xo,3)===l?(t=l,xo+=3):(t=i,0===So&&No(jt)),t===i&&(e.substr(xo,2)===c?(t=c,xo+=2):(t=i,0===So&&No(Wt)))),t}function Mo(){let t,r,o;return t=xo,r=zo(),r!==i?(o=function(){let t;return e.substr(xo,4)===d?(t=d,xo+=4):(t=i,0===So&&No(Ht)),t}(),o!==i?(_o=t,t=o):(xo=t,t=i)):(xo=t,t=i),t}function $o(){let t,r,o,a,n,s,l,c;if(t=xo,r=Mo(),r!==i){for(o=xo,a=xo,n=[],s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Ut));s!==i;)n.push(s),s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Ut));s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(_o=t,t={type:"codeBlock",language:""}):(xo=t,t=i)}else xo=t,t=i;if(t===i)if(t=xo,r=Mo(),r!==i)if(58===e.charCodeAt(xo)?(o=p,xo++):(o=i,0===So&&No(Gt)),o!==i)if(a=function(){let t,r,o;e.substr(xo,9)===u?(t=u,xo+=9):(t=i,0===So&&No(Kt));if(t===i&&(e.substr(xo,9)===h?(t=h,xo+=9):(t=i,0===So&&No(Yt)),t===i&&(e.substr(xo,10)===m?(t=m,xo+=10):(t=i,0===So&&No(Qt)),t===i))){if(t=xo,r=[],o=Ra(),o!==i)for(;o!==i;)r.push(o),o=Ra();else r=i;t=r!==i?e.substring(t,xo):r,t===i&&(t="")}return t}(),a!==i){for(n=xo,s=xo,l=[],c=e.charAt(xo),Rt.test(c)?xo++:(c=i,0===So&&No(Ut));c!==i;)l.push(c),c=e.charAt(xo),Rt.test(c)?xo++:(c=i,0===So&&No(Ut));c=Fa(),c!==i?(l=[l,c],s=l):(xo=s,s=i),n=s!==i?e.substring(n,xo):s,n!==i?(_o=t,t={type:"codeBlock",attrs:{language:a.trim().toLowerCase()}}):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function Jo(){let t,r,o,a,n,s;if(t=xo,r=xo,So++,o=Do(),So--,o===i?r=void 0:(xo=r,r=i),r!==i){if(o=xo,a=xo,n=[],s=Ra(),s!==i)for(;s!==i;)n.push(s),s=Ra();else n=i;n!==i?(s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(_o=t,t=o):(xo=t,t=i)}else xo=t,t=i;return t===i&&(t=Na()),t}function jo(){let t;return e.substr(xo,2)===g?(t=g,xo+=2):(t=i,0===So&&No(Xt)),t}function Wo(){let t;return e.substr(xo,3)===b?(t=b,xo+=3):(t=i,0===So&&No(Zt)),t}function Ho(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Uo(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(e.substr(xo,2)===k?(n=k,xo+=2):(n=i,0===So&&No(ri)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Go(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(e.substr(xo,2)===T?(n=T,xo+=2):(n=i,0===So&&No(oi)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Ko(){let t;return e.substr(xo,3)===v?(t=v,xo+=3):(t=i,0===So&&No(ai)),t}function Yo(){let t;return e.substr(xo,3)===x?(t=x,xo+=3):(t=i,0===So&&No(ni)),t}function Qo(){let t;return e.substr(xo,3)===_?(t=_,xo+=3):(t=i,0===So&&No(si)),t===i&&(e.substr(xo,3)===w?(t=w,xo+=3):(t=i,0===So&&No(li))),t}function Xo(){let e;return e=jo(),e===i&&(e=Wo(),e===i&&(e=Ho(),e===i&&(e=Uo(),e===i&&(e=Go(),e===i&&(e=Ko(),e===i&&(e=Yo(),e===i&&(e=Qo()))))))),e}function Zo(){let t,r,o,a,n,s,l,c,d;if(t=xo,r=ta(),r!==i)if(o=Xo(),o!==i){for(a=xo,n=xo,s=[],l=xo,c=xo,So++,d=Na(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(e.length>xo?(d=e.charAt(xo),xo++):(d=i,0===So&&No(qt)),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);l!==i;)s.push(l),l=xo,c=xo,So++,d=Na(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(e.length>xo?(d=e.charAt(xo),xo++):(d=i,0===So&&No(qt)),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);for(l=Na(),l===i&&(l=null),s=[s,l],n=s,a=e.substring(a,xo),n=[],s=ea();s!==i;)n.push(s),s=ea();if(s=xo,l=function(){let t,r,o,a;t=xo,So++,r=xo,o=[],9===e.charCodeAt(xo)?(a=C,xo++):(a=i,0===So&&No(ci));if(a!==i)for(;a!==i;)o.push(a),9===e.charCodeAt(xo)?(a=C,xo++):(a=i,0===So&&No(ci));else o=i;o!==i?(_o=xo,a=o.length>qa.length,a=a?void 0:i,a!==i?(_o=r,r=function(e){za.push(qa),qa=e.join("")}(o)):(xo=r,r=i)):(xo=r,r=i);So--,r!==i?(xo=t,t=void 0):t=i;return t}(),l!==i){for(c=[],d=Zo();d!==i;)c.push(d),d=Zo();d=function(){let e;_o=xo,e=function(){return qa=za.pop(),!0}(),e=e?void 0:i;return e}(),d!==i?(_o=s,s=c):(xo=s,s=i)}else xo=s,s=i;s===i&&(s=null),_o=t,t=function(e,t,i,r){let o="bulletList";const a=e.match(/•([0-9]+)([Ii]?) /);let n=1;if(a&&(o="orderedList",a.length>1&&(n=Number(a[1])),a.length>2)){let e=a[2];"I"==e&&(o="orderedListRoman"),"i"==e&&(o="orderedListRomanLower")}"•_ "==e&&(o="noBulletList"),"•A "==e&&(o="letteredList"),"•a "==e&&(o="letteredListLower"),"•+ "!=e&&"•- "!=e||(o="taskList");let s=[{type:"paragraph",attrs:{},content:tt((t+i.join("")).trim())}];if(r&&r[0]&&r[0]._tempParsingParent){let e={type:r[0]._tempParsingParent,attrs:{start:n},content:r};if((e.type.startsWith("orderedList")||e.type.startsWith("letteredList"))&&r[0]._tempListStart){const t=r[0]._tempListStart;t>1&&(e.attrs.start=t)}s.push(e)}let l="listItem",c=null;if("taskList"==o){l="taskItem";let t=!1;"•+ "==e&&(t=!0),c={checked:t}}return c?{type:l,attrs:c,content:s,_tempParsingParent:o,_tempListStart:n}:{type:l,content:s,_tempParsingParent:o,_tempListStart:n}}(o,a,n,s)}else xo=t,t=i;else xo=t,t=i;return t}function ea(){let t,r,o,a,n,s,l,c,d,p;if(t=xo,r=xo,So++,o=function(){let t,r,o;t=xo,r=[],o=e.charAt(xo),Rt.test(o)?xo++:(o=i,0===So&&No(Ut));for(;o!==i;)r.push(o),o=e.charAt(xo),Rt.test(o)?xo++:(o=i,0===So&&No(Ut));o=Na(),o!==i?(r=[r,o],t=r):(xo=t,t=i);return t}(),So--,o===i?r=void 0:(xo=r,r=i),r!==i)if(o=ta(),o!==i)if(a=xo,So++,n=Xo(),So--,n===i?a=void 0:(xo=a,a=i),a!==i){if(n=xo,s=xo,l=[],c=xo,d=xo,So++,p=Na(),So--,p===i?d=void 0:(xo=d,d=i),d!==i?(e.length>xo?(p=e.charAt(xo),xo++):(p=i,0===So&&No(qt)),p!==i?(d=[d,p],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,p=Na(),So--,p===i?d=void 0:(xo=d,d=i),d!==i?(e.length>xo?(p=e.charAt(xo),xo++):(p=i,0===So&&No(qt)),p!==i?(d=[d,p],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;l!==i?(c=Fa(),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i),n=s!==i?e.substring(n,xo):s,n!==i?(_o=t,t=n):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function ta(){let t,r,o;for(t=xo,r=[],9===e.charCodeAt(xo)?(o=C,xo++):(o=i,0===So&&No(ci));o!==i;)r.push(o),9===e.charCodeAt(xo)?(o=C,xo++):(o=i,0===So&&No(ci));return _o=xo,o=r.join("")===qa,o=o?void 0:i,o!==i?(r=[r,o],t=r):(xo=t,t=i),t}function ia(){let t,r,o;if(t=xo,r=[],o=ra(),o!==i)for(;o!==i;)r.push(o),o=ra();else r=i;return t=r!==i?e.substring(t,xo):r,t}function ra(){let t,r,o,a,n,s;if(t=xo,r=xo,So++,o=Do(),So--,o===i?r=void 0:(xo=r,r=i),r!==i){if(o=xo,a=xo,n=[],s=Ra(),s!==i)for(;s!==i;)n.push(s),s=Ra();else n=i;n!==i?(s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(r=[r,o],t=r):(xo=t,t=i)}else xo=t,t=i;return t===i&&(t=Na()),t}function oa(){let t,r,o,a,n,s;if(t=xo,r=zo(),r!==i){for(o=xo,a=xo,n=[],s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Ut));s!==i;)n.push(s),s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Ut));s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(a=Na(),a===i&&(a=null),r=[r,o,a],t=r):(xo=t,t=i)}else xo=t,t=i;return t}function aa(){let t,r,o;return t=xo,r=zo(),r!==i?(o=function(){let t;return e.substr(xo,5)===A?(t=A,xo+=5):(t=i,0===So&&No(di)),t}(),o!==i?(_o=t,t=o):(xo=t,t=i)):(xo=t,t=i),t}function na(){let t,r,o,a,n,s,l,c,d,u,h,m;if(t=xo,r=aa(),r!==i)if(58===e.charCodeAt(xo)?(o=p,xo++):(o=i,0===So&&No(Gt)),o!==i)if(32===e.charCodeAt(xo)?(a=y,xo++):(a=i,0===So&&No(ii)),a===i&&(a=null),n=function(){let t,r,o,a,n,s,l,c,d;t=xo,r=xo,e.substr(xo,4)===Lt?(o=Lt,xo+=4):(o=i,0===So&&No(mo));if(o!==i)if(115===e.charCodeAt(xo)?(a=Et,xo++):(a=i,0===So&&No(go)),a===i&&(a=null),e.substr(xo,3)===Vt?(n=Vt,xo+=3):(n=i,0===So&&No(bo)),n!==i){for(s=[],l=xo,c=xo,So++,d=zo(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(d=Da(),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);l!==i;)s.push(l),l=xo,c=xo,So++,d=zo(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(d=Da(),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);o=[o,a,n,s],r=o}else xo=r,r=i;else xo=r,r=i;t=r!==i?e.substring(t,xo):r;return t}(),n!==i){for(s=[],32===e.charCodeAt(xo)?(l=y,xo++):(l=i,0===So&&No(ii));l!==i;)s.push(l),32===e.charCodeAt(xo)?(l=y,xo++):(l=i,0===So&&No(ii));if(l=zo(),l!==i){for(c=sa(),d=xo,u=xo,h=[],m=e.charAt(xo),Rt.test(m)?xo++:(m=i,0===So&&No(Ut));m!==i;)h.push(m),m=e.charAt(xo),Rt.test(m)?xo++:(m=i,0===So&&No(Ut));m=Fa(),m!==i?(h=[h,m],u=h):(xo=u,u=i),d=u!==i?e.substring(d,xo):u,d!==i?(u=Na(),u===i&&(u=null),_o=t,t=function(e,t,i){const r=Object.assign({},...i);let o=r.alignment||"center";delete r.alignment;let a=r.captionAlign||"left";delete r.captionAlign;let n=r.alt||null;delete r.alt;let s=r.caption||null;delete r.caption;let l=r.align||"center";delete r.align;let c=void 0===r.zoomDisabled||("boolean"==typeof r.zoomDisabled?r.zoomDisabled:"true"===String(r.zoomDisabled).toLowerCase());return delete r.zoomDisabled,{type:e,attrs:{alignment:o,textAlign:a,src:t,alt:Xe(n),title:Xe(s),class:l,zoomDisabled:c,...r}}}(r,n,c)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function sa(){let e,t,r;for(e=xo,t=[],r=la();r!==i;)t.push(r),r=la();return _o=e,e=t,e}function la(){let t,r,o,a,n,s,l,c,d,u;if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={comment:o.trim()}):(xo=t,t=i)}else xo=t,t=i;var h,m;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;if(s=l!==i?e.substring(s,xo):l,s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,h=o,m=s,t={[h]:parseInt(m)}):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=function(){let t;e.substr(xo,3)===F?(t=F,xo+=3):(t=i,0===So&&No(Ti));t===i&&(e.substr(xo,7)===O?(t=O,xo+=7):(t=i,0===So&&No(vi)));return t}(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));for(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t.trim()}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=function(){let t;e.substr(xo,9)===L?(t=L,xo+=9):(t=i,0===So&&No(gi));t===i&&(e.substr(xo,12)===E?(t=E,xo+=12):(t=i,0===So&&No(bi)));return t}(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=function(){let t;e.substr(xo,4)===V?(t=V,xo+=4):(t=i,0===So&&No(fi));t===i&&(e.substr(xo,6)===N?(t=N,xo+=6):(t=i,0===So&&No(yi)),t===i&&(e.substr(xo,5)===R?(t=R,xo+=5):(t=i,0===So&&No(ki))));return t}(),s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=da(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=function(){let t;e.substr(xo,4)===z?(t=z,xo+=4):(t=i,0===So&&No(_i));t===i&&(e.substr(xo,5)===q?(t=q,xo+=5):(t=i,0===So&&No(wi)));return t}(),s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=da(),o!==i){for(a=[],32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii));n!==i;)a.push(n),32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii));n=zo(),n!==i?(_o=t,t=function(e){return{[e]:!0}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=zo(),o!==i?(_o=t,t=void 0):(xo=t,t=i),t===i)){for(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{error:"Found unknown property or invalid value: "+e}}(o)):(xo=t,t=i)}}}}}}return t}function ca(){let t;return e.substr(xo,5)===P?(t=P,xo+=5):(t=i,0===So&&No(hi)),t===i&&(e.substr(xo,6)===I?(t=I,xo+=6):(t=i,0===So&&No(mi))),t}function da(){let t;return e.substr(xo,12)===D?(t=D,xo+=12):(t=i,0===So&&No(xi)),t}function pa(){let e,t,r,o;for(e=xo,t=ua(),t===i&&(t=null),r=[],o=ga(),o===i&&(o=ua());o!==i;)r.push(o),o=ga(),o===i&&(o=ua());var a,n;return _o=e,n=r,e=et((a=t)?[a,...n.flat()]:n.flat()),e}function ua(){let t,r,o,a,n,s,l;if(t=xo,r=Na(),r!==i&&(_o=t,r={type:"hardBreak"}),t=r,t===i){if(t=xo,r=xo,o=[],a=xo,n=ba(),n===i&&(n=null),s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=ba(),n!==i?(s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i)),a!==i)for(;a!==i;)o.push(a),a=xo,n=ba(),n===i&&(n=null),s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=ba(),n!==i?(s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i));else o=i;r=o!==i?e.substring(r,xo):o,r!==i&&(_o=t,r={text:Xe(r),type:"text"}),t=r}return t}function ha(){let t;return 61===e.charCodeAt(xo)?(t=M,xo++):(t=i,0===So&&No(Ci)),t}function ma(){let e,t,r;return e=xo,t=ha(),t!==i?(r=ha(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function ga(){let t,r,o,a,s,l,c,d;if(t=xo,r=Ia(),r!==i){if(o=xo,a=[],s=e.charAt(xo),Ft.test(s)?xo++:(s=i,0===So&&No(ti)),s!==i)for(;s!==i;)a.push(s),s=e.charAt(xo),Ft.test(s)?xo++:(s=i,0===So&&No(ti));else a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=La(),a!==i?(_o=t,t={index:+o,type:"bit"}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;var p,u;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(e.substr(xo,7)===$?(s=$,xo+=7):(s=i,0===So&&No(Ai)),s!==i?(_o=t,t=function(e){return{attrs:{formula:Xe(e)},type:"latex"}}(o)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(e.substr(xo,13)===J?(s=J,xo+=13):(s=i,0===So&&No(Bi)),s!==i?(l=Oa(),l!==i?(124===e.charCodeAt(xo)?(c=n,xo++):(c=i,0===So&&No($t)),c!==i?(d=function(){let e,t,r;e=xo,t=[],r=fa();for(;r!==i;)t.push(r),r=fa();return _o=e,e=t,e}(),_o=t,u=d,t={attrs:{alt:o,src:((p=l).pr+p.t).trim(),...Object.assign({},...u),zoomDisabled:!0},type:"imageInline"}):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(s=function(){let t,r,o,a;t=xo,124===e.charCodeAt(xo)?(r=n,xo++):(r=i,0===So&&No($t));if(r!==i){if(o=[],a=ya(),a!==i)for(;a!==i;)o.push(a),a=ya();else o=i;o!==i?(_o=t,t=o):(xo=t,t=i)}else xo=t,t=i;return t}(),s!==i?(_o=t,t=function(e,t){return t||(t=[]),{marks:t,text:Xe(e),type:"text"}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Aa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Aa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Aa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Aa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"bold"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Ba(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Ba(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Ba(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Ba(),a!==i?(_o=t,t=function(e){return{marks:[{type:"italic"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Sa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Sa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Sa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Sa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"light"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Pa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Pa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Pa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Pa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"highlight"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;t===i&&(t=xo,r=Oa(),r!==i&&(_o=t,r=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}}(r)),t=r)}}}}}}}return t}function ba(){let t,r,o,a,n;if(t=xo,r=xo,o=ma(),o!==i){if(a=[],n=ha(),n!==i)for(;n!==i;)a.push(n),n=ha();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Sa(),o!==i){if(a=[],n=wa(),n!==i)for(;n!==i;)a.push(n),n=wa();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Pa(),o!==i){if(a=[],n=Ca(),n!==i)for(;n!==i;)a.push(n),n=Ca();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;t=r!==i?e.substring(t,xo):r}}return t}function fa(){let t,r,o,a,n,s,l,c,d,u;if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={comment:o}):(xo=t,t=i)}else xo=t,t=i;var h,m;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;s=l!==i?e.substring(s,xo):l,s!==i?(l=zo(),l!==i?(_o=t,h=o,m=s,t={[h]:parseInt(m)}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));for(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{type:"error",msg:e+" must be a positive integer.",found:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),e.substr(xo,17)===j?(o=j,xo+=17):(o=i,0===So&&No(Si)),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s=function(){let t;e.substr(xo,3)===H?(t=H,xo+=3):(t=i,0===So&&No(Ii));t===i&&(e.substr(xo,6)===U?(t=U,xo+=6):(t=i,0===So&&No(Li)),t===i&&(e.substr(xo,6)===G?(t=G,xo+=6):(t=i,0===So&&No(Ei)),t===i&&(e.substr(xo,8)===K?(t=K,xo+=8):(t=i,0===So&&No(Vi)),t===i&&(e.substr(xo,3)===Y?(t=Y,xo+=3):(t=i,0===So&&No(Ni)),t===i&&(e.substr(xo,5)===Q?(t=Q,xo+=5):(t=i,0===So&&No(Ri)),t===i&&(e.substr(xo,11)===X?(t=X,xo+=11):(t=i,0===So&&No(Fi)),t===i&&(e.substr(xo,8)===Z?(t=Z,xo+=8):(t=i,0===So&&No(Oi)))))))));return t}(),s!==i?(l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i)if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),e.substr(xo,4)===W?(o=W,xo+=4):(o=i,0===So&&No(Pi)),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Gt)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s=function(){let t;e.substr(xo,11)===ee?(t=ee,xo+=11):(t=i,0===So&&No(Di));t===i&&(e.substr(xo,11)===te?(t=te,xo+=11):(t=i,0===So&&No(zi)),t===i&&(e.substr(xo,5)===Q?(t=Q,xo+=5):(t=i,0===So&&No(Ri)),t===i&&(e.substr(xo,3)===Y?(t=Y,xo+=3):(t=i,0===So&&No(Ni)),t===i&&(e.substr(xo,8)===ie?(t=ie,xo+=8):(t=i,0===So&&No(qi))))));return t}(),s!==i?(l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}}}return t}function ya(){let t,r,o,a,n,s,l,c,p,u,h;if(t=xo,e.substr(xo,5)===re?(r=re,xo+=5):(r=i,0===So&&No(Mi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={type:"link",attrs:{href:o.trim(),target:"_blank"}}):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,7)===oe?(r=oe,xo+=7):(r=i,0===So&&No($i)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);if(o=e.substring(o,xo),a=function(){let e,t;e=[],t=ka();for(;t!==i;)e.push(t),t=ka();return e}(),n=zo(),n!==i)if(e.substr(xo,9)===ae?(s=ae,xo+=9):(s=i,0===So&&No(Ji)),s!==i){for(l=xo,c=[],p=xo,u=xo,So++,h=zo(),So--,h===i?u=void 0:(xo=u,u=i),u!==i?(h=Ra(),h!==i?(u=[u,h],p=u):(xo=p,p=i)):(xo=p,p=i);p!==i;)c.push(p),p=xo,u=xo,So++,h=zo(),So--,h===i?u=void 0:(xo=u,u=i),u!==i?(h=Ra(),h!==i?(u=[u,h],p=u):(xo=p,p=i)):(xo=p,p=i);l=e.substring(l,xo),c=zo(),c!==i?(_o=t,t=function(e,t,i){return{type:"extref",attrs:{extref:e.trim(),references:t,provider:i.trim()}}}(o,a,l)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,5)===ne?(r=ne,xo+=5):(r=i,0===So&&No(ji)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);if(o=e.substring(o,xo),a=zo(),a!==i)if(9658===e.charCodeAt(xo)?(n=se,xo++):(n=i,0===So&&No(Wi)),n!==i){for(s=xo,l=[],c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{type:"xref",attrs:{xref:e.trim(),reference:t.trim()}}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,5)===ne?(r=ne,xo+=5):(r=i,0===So&&No(ji)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"xref",attrs:{xref:e.trim(),reference:""}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,9658===e.charCodeAt(xo)?(r=se,xo++):(r=i,0===So&&No(Wi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"ref",attrs:{reference:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,7)===le?(r=le,xo+=7):(r=i,0===So&&No(Hi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(n=sa(),_o=t,t=function(e,t){const i=Object.assign({},...t);return{type:"symbol",attrs:{src:e.trim(),...i}}}(o,n)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,9)===ce?(r=ce,xo+=9):(r=i,0===So&&No(Ui)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"footnote",attrs:{content:tt(e.trim())}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,10)===de?(r=de,xo+=10):(r=i,0===So&&No(Gi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"footnote*",attrs:{content:tt(e.trim())}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,4)===pe?(r=pe,xo+=4):(r=i,0===So&&No(Ki)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"var",attrs:{name:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,4)===d?(r=d,xo+=4):(r=i,0===So&&No(Ht)),r!==i?(o=zo(),o!==i?(_o=t,t={type:"code",attrs:{language:"plain text"}}):(xo=t,t=i)):(xo=t,t=i),t===i)){if(t=xo,e.substr(xo,5)===ue?(r=ue,xo+=5):(r=i,0===So&&No(Yi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={type:"code",attrs:{language:o.trim().toLowerCase()}}):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,5)===he?(r=he,xo+=5):(r=i,0===So&&No(Qi)),r!==i?(o=zo(),o!==i?(_o=t,t={type:"timer",attrs:{name:""}}):(xo=t,t=i)):(xo=t,t=i),t===i)){if(t=xo,e.substr(xo,6)===me?(r=me,xo+=6):(r=i,0===So&&No(Xi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"timer",attrs:{name:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,9)===ge?(r=ge,xo+=9):(r=i,0===So&&No(Zi)),r!==i){if(o=xo,a=xo,80===e.charCodeAt(xo)?(n=be,xo++):(n=i,0===So&&No(er)),n!==i){for(s=xo,l=[],c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),n=[n,s],a=n}else xo=a,a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=zo(),a!==i?(_o=t,t=function(e){return{type:"duration",attrs:{duration:e}}}(o)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,6)===fe?(r=fe,xo+=6):(r=i,0===So&&No(tr)),r!==i?(o=function(){let t;e.substr(xo,4)===Ke?(t=Ke,xo+=4):(t=i,0===So&&No(Vr));t===i&&(e.substr(xo,5)===Ye?(t=Ye,xo+=5):(t=i,0===So&&No(Nr)),t===i&&(e.substr(xo,4)===Qe?(t=Qe,xo+=4):(t=i,0===So&&No(Rr)),t===i&&(e.substr(xo,5)===rt?(t=rt,xo+=5):(t=i,0===So&&No(Fr)),t===i&&(e.substr(xo,7)===ot?(t=ot,xo+=7):(t=i,0===So&&No(Or)),t===i&&(e.substr(xo,9)===at?(t=at,xo+=9):(t=i,0===So&&No(Dr)),t===i&&(e.substr(xo,4)===nt?(t=nt,xo+=4):(t=i,0===So&&No(zr)),t===i&&(e.substr(xo,8)===st?(t=st,xo+=8):(t=i,0===So&&No(qr)),t===i&&(e.substr(xo,5)===lt?(t=lt,xo+=5):(t=i,0===So&&No(Mr)),t===i&&(e.substr(xo,4)===ct?(t=ct,xo+=4):(t=i,0===So&&No($r)),t===i&&(e.substr(xo,7)===dt?(t=dt,xo+=7):(t=i,0===So&&No(Jr)),t===i&&(e.substr(xo,6)===pt?(t=pt,xo+=6):(t=i,0===So&&No(jr)),t===i&&(e.substr(xo,4)===ut?(t=ut,xo+=4):(t=i,0===So&&No(Wr)),t===i&&(e.substr(xo,5)===ht?(t=ht,xo+=5):(t=i,0===So&&No(Hr)),t===i&&(e.substr(xo,6)===mt?(t=mt,xo+=6):(t=i,0===So&&No(Ur)),t===i&&(e.substr(xo,4)===gt?(t=gt,xo+=4):(t=i,0===So&&No(Gr)),t===i&&(e.substr(xo,6)===bt?(t=bt,xo+=6):(t=i,0===So&&No(Kr)),t===i&&(e.substr(xo,3)===ft?(t=ft,xo+=3):(t=i,0===So&&No(Yr)),t===i&&(e.substr(xo,6)===yt?(t=yt,xo+=6):(t=i,0===So&&No(Qr)),t===i&&(e.substr(xo,4)===kt?(t=kt,xo+=4):(t=i,0===So&&No(Xr)),t===i&&(e.substr(xo,6)===Tt?(t=Tt,xo+=6):(t=i,0===So&&No(Zr)),t===i&&(e.substr(xo,5)===vt?(t=vt,xo+=5):(t=i,0===So&&No(eo)),t===i&&(e.substr(xo,6)===xt?(t=xt,xo+=6):(t=i,0===So&&No(to))))))))))))))))))))))));return t}(),o!==i?(a=zo(),a!==i?(_o=t,t={type:"color",attrs:{color:o}}):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i),t===i&&(t=xo,r=function(){let t;e.substr(xo,4)===ke?(t=ke,xo+=4):(t=i,0===So&&No(rr));t===i&&(e.substr(xo,6)===Te?(t=Te,xo+=6):(t=i,0===So&&No(or)),t===i&&(e.substr(xo,5)===ve?(t=ve,xo+=5):(t=i,0===So&&No(ar)),t===i&&(e.substr(xo,9)===xe?(t=xe,xo+=9):(t=i,0===So&&No(nr)),t===i&&(e.substr(xo,6)===_e?(t=_e,xo+=6):(t=i,0===So&&No(sr)),t===i&&(e.substr(xo,9)===we?(t=we,xo+=9):(t=i,0===So&&No(lr)),t===i&&(e.substr(xo,11)===Ce?(t=Ce,xo+=11):(t=i,0===So&&No(cr)),t===i&&(e.substr(xo,3)===Ae?(t=Ae,xo+=3):(t=i,0===So&&No(dr)),t===i&&(e.substr(xo,3)===Be?(t=Be,xo+=3):(t=i,0===So&&No(pr)),t===i&&(e.substr(xo,9)===Se?(t=Se,xo+=9):(t=i,0===So&&No(ur)),t===i&&(e.substr(xo,15)===Pe?(t=Pe,xo+=15):(t=i,0===So&&No(hr)),t===i&&(e.substr(xo,6)===Ie?(t=Ie,xo+=6):(t=i,0===So&&No(mr)),t===i&&(e.substr(xo,13)===Le?(t=Le,xo+=13):(t=i,0===So&&No(gr)),t===i&&(e.substr(xo,16)===Ee?(t=Ee,xo+=16):(t=i,0===So&&No(br)),t===i&&(e.substr(xo,16)===Ve?(t=Ve,xo+=16):(t=i,0===So&&No(fr)),t===i&&(e.substr(xo,15)===Ne?(t=Ne,xo+=15):(t=i,0===So&&No(yr)),t===i&&(e.substr(xo,14)===Re?(t=Re,xo+=14):(t=i,0===So&&No(kr)),t===i&&(e.substr(xo,16)===Fe?(t=Fe,xo+=16):(t=i,0===So&&No(Tr)),t===i&&(e.substr(xo,14)===Oe?(t=Oe,xo+=14):(t=i,0===So&&No(vr)),t===i&&(e.substr(xo,15)===De?(t=De,xo+=15):(t=i,0===So&&No(xr)),t===i&&(e.substr(xo,15)===ze?(t=ze,xo+=15):(t=i,0===So&&No(_r)),t===i&&(e.substr(xo,15)===qe?(t=qe,xo+=15):(t=i,0===So&&No(wr)),t===i&&(e.substr(xo,14)===Me?(t=Me,xo+=14):(t=i,0===So&&No(Cr)),t===i&&(e.substr(xo,10)===$e?(t=$e,xo+=10):(t=i,0===So&&No(Ar)),t===i&&(e.substr(xo,13)===Je?(t=Je,xo+=13):(t=i,0===So&&No(Br)),t===i&&(e.substr(xo,19)===je?(t=je,xo+=19):(t=i,0===So&&No(Sr)),t===i&&(e.substr(xo,10)===We?(t=We,xo+=10):(t=i,0===So&&No(Pr)),t===i&&(e.substr(xo,10)===He?(t=He,xo+=10):(t=i,0===So&&No(Ir)),t===i&&(e.substr(xo,13)===Ue?(t=Ue,xo+=13):(t=i,0===So&&No(Lr)),t===i&&(e.substr(xo,11)===Ge?(t=Ge,xo+=11):(t=i,0===So&&No(Er)))))))))))))))))))))))))))))));return t}(),r!==i?(o=zo(),o!==i?(_o=t,t={type:r}):(xo=t,t=i)):(xo=t,t=i),t===i)))if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"comment",comment:e}}(o)):(xo=t,t=i)}else xo=t,t=i}}}}}}}}}}}return t}function ka(){let t,r,o,a,n,s,l;if(t=xo,e.substr(xo,2)===ye?(r=ye,xo+=2):(r=i,0===So&&No(ir)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),_o=t,t=o.trim()}else xo=t,t=i;return t}function Ta(){let e,t,r,o;for(So++,e=xo,t=va(),t===i&&(t=null),r=[],o=Ea(),o===i&&(o=va());o!==i;)r.push(o),o=Ea(),o===i&&(o=va());var a,n;return _o=e,n=r,e=et((a=t)?[a,...n.flat()]:n.flat()),So--,e}function va(){let t,r,o,a,n,s,l;if(t=xo,r=Na(),r!==i&&(_o=t,r={type:"hardBreak"}),t=r,t===i){if(t=xo,r=xo,o=[],a=xo,n=Va(),n===i&&(n=null),s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=Va(),n!==i?(s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i)),a!==i)for(;a!==i;)o.push(a),a=xo,n=Va(),n===i&&(n=null),s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=Va(),n!==i?(s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i));else o=i;r=o!==i?e.substring(r,xo):o,r!==i&&(_o=t,r={text:Xe(r),type:"text"}),t=r}return t}function xa(){let t;return 42===e.charCodeAt(xo)?(t=_t,xo++):(t=i,0===So&&No(io)),t}function _a(){let t;return 95===e.charCodeAt(xo)?(t=wt,xo++):(t=i,0===So&&No(ro)),t}function wa(){let t;return 96===e.charCodeAt(xo)?(t=Ct,xo++):(t=i,0===So&&No(oo)),t}function Ca(){let t;return 33===e.charCodeAt(xo)?(t=At,xo++):(t=i,0===So&&No(ao)),t}function Aa(){let e,t,r;return e=xo,t=xa(),t!==i?(r=xa(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Ba(){let e,t,r;return e=xo,t=_a(),t!==i?(r=_a(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Sa(){let e,t,r;return e=xo,t=wa(),t!==i?(r=wa(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Pa(){let e,t,r;return e=xo,t=Ca(),t!==i?(r=Ca(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Ia(){let t;return e.substr(xo,2)===Bt?(t=Bt,xo+=2):(t=i,0===So&&No(no)),t}function La(){let t;return 93===e.charCodeAt(xo)?(t=St,xo++):(t=i,0===So&&No(so)),t}function Ea(){let t,r,o,a,n,s,l;if(t=xo,r=Ia(),r!==i){if(o=xo,a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=La(),a!==i?(_o=t,t={index:+o,type:"bit"}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Aa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Aa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Aa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Aa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"bold"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Ba(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Ba(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Ba(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Ba(),a!==i?(_o=t,t=function(e){return{marks:[{type:"italic"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Sa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Sa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Sa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Sa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"light"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i)if(t=xo,r=Pa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Pa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Pa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Pa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"highlight"}],text:Xe(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i}}}return t}function Va(){let t,r,o,a,n;if(t=xo,r=xo,o=Sa(),o!==i){if(a=[],n=wa(),n!==i)for(;n!==i;)a.push(n),n=wa();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Pa(),o!==i){if(a=[],n=Ca(),n!==i)for(;n!==i;)a.push(n),n=Ca();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;t=r!==i?e.substring(t,xo):r}return t}function Na(){let t,r;return So++,10===e.charCodeAt(xo)?(t=Pt,xo++):(t=i,0===So&&No(co)),t===i&&(e.substr(xo,2)===It?(t=It,xo+=2):(t=i,0===So&&No(po)),t===i&&(t=e.charAt(xo),Ot.test(t)?xo++:(t=i,0===So&&No(uo)))),So--,t===i&&(r=i,0===So&&No(lo)),t}function Ra(){let t;return t=e.charAt(xo),Dt.test(t)?xo++:(t=i,0===So&&No(ho)),t}function Fa(){let t,r;return t=Na(),t===i&&(t=xo,So++,e.length>xo?(r=e.charAt(xo),xo++):(r=i,0===So&&No(qt)),So--,r===i?t=void 0:(xo=t,t=i)),t}function Oa(){let t,r,o,a,n,s,l;if(t=xo,r=xo,o=xo,e.substr(xo,4)===Lt?(a=Lt,xo+=4):(a=i,0===So&&No(mo)),a!==i?(115===e.charCodeAt(xo)?(n=Et,xo++):(n=i,0===So&&No(go)),n===i&&(n=null),e.substr(xo,3)===Vt?(s=Vt,xo+=3):(s=i,0===So&&No(bo)),s!==i?(a=[a,n,s],o=a):(xo=o,o=i)):(xo=o,o=i),o===i&&(e.substr(xo,7)===Nt?(o=Nt,xo+=7):(o=i,0===So&&No(fo))),r=o!==i?e.substring(r,xo):o,r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Da(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Da(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),_o=t,t={pr:r,t:o}}else xo=t,t=i;return t}function Da(){let t;return t=e.charAt(xo),zt.test(t)?xo++:(t=i,0===So&&No(yo)),t}var za=[],qa="";e=e.trimStart(),Co=a();const Ma=Co!==i&&xo===e.length;function $a(){throw Co!==i&&xo<e.length&&No({type:"end"}),Ro(Bo,Ao<e.length?function(t=xo){const i=e.codePointAt(t);return void 0===i?"":String.fromCodePoint(i)}(Ao):null,Ao<e.length?Vo(Ao,Ao+1):Vo(Ao,Ao))}return t.peg$library?{peg$result:Co,peg$currPos:xo,peg$FAILED:i,peg$maxFailExpected:Bo,peg$maxFailPos:Ao,peg$success:Ma,peg$throw:Ma?void 0:$a}:Ma?Co:void $a()}var ot=rt,at=class{version(){return ot("",{startRule:"version"})}preprocessAst(e){if(O.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;let i=e??"";if(!i)return[];let r="bitmarkPlusPlus";return Object.assign({},t).location===he.tag&&(r="bitmarkPlus"),i=i.trim(),ot(i,{startRule:r})}extractBodyBits(e){if(!Array.isArray(e))return[];const t=[],i=e;for(const e of i)switch(e.type){case de.gap:case de.select:case de.highlight:case de.mark:t.push(e);break;default:{const i=this.extractBodyBits(e.content);for(const e of i)t.push(e)}}return t}walkBodyBits(e,t){if(!Array.isArray(e))return;const i=e;for(let e=0;e<i.length;e++){const r=i[e];switch(r.type){case de.gap:case de.select:case de.highlight:case de.mark:t(i,e,r);break;default:this.walkBodyBits(r.content,t)}}}},nt=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}},st=new class{asNumber(e,t){if(null==e)return t??void 0;const i=+e;return Number.isNaN(i)||!isFinite(i)?t??void 0:i}isNumeric(e){if(null==e)return!1;const t=+e;return!Number.isNaN(t)&&isFinite(t)}},lt=class{constructor(){p(this,"textParser"),p(this,"textGenerator"),this.textParser=new at,this.textGenerator=new Qe}toExample(e,t,i){if(null!=t){let e;return e=nt.isBoolean(i)?nt.toBoolean(t):t,{isExample:!0,example:e,__defaultExample:i??null}}return e?{isExample:!0,example:i??null,__defaultExample:i??null}:{isExample:!1,example:null,__defaultExample:i??null}}toAstProperty(e,t,i,r){if(null==i)return;let o=Y.getBitConfig(e).tags;if(r?.cardSet){const{sideNo:t,variantNo:i}=r.cardSet;o=Y.getTagsConfigForCardSet(e,t,i)??o}const a=Y.getTagConfigForTag(o,t);a?.array&&!Array.isArray(i)?i=[i]:!a?.array&&Array.isArray(i)&&(i=i[i.length-1]);const n=e=>{if(null==e)return;switch(a?.format??k.plainText){case k.plainText:return null!=st.asNumber(e)&&(e=`${e}`),O.isString(e)?O.trimmedString(e):void 0;case k.number:return st.asNumber(e);case k.boolean:return nt.toBoolean(e,!0);case k.invertedBoolean:return!nt.toBoolean(e,!0)}return e};if(Array.isArray(i)){const e=i;for(let t=0,i=e.length;t<i;t++)e[t]=n(e[t])}else i=n(i);return i}getEmptyTextAst(e){return this.handleJsonText(e,he.tag," ")}handleJsonText(e,t,i){let r;const{textFormat:o}=e;if(null==i)r=[];else if(this.textParser.isAst(i))r=i;else{if(Array.isArray(i)){const e=[];for(let r=0,a=i.length;r<a;r++){const a=i[r];this.textParser.isAst(a)?e[r]=a:O.isString(a)?(e[r]=this.textParser.toAst(Ve.breakscape(a,{format:o,location:t}),{format:o,location:t}),e[r].__tag="text"):e[r]=[]}return e}r=O.isString(i)?this.textParser.toAst(Ve.breakscape(i,{format:o,location:t,v2:!0}),{format:o,location:t}):[]}return r.__tag="text",r}},ct=new at,dt=new class{fillStringExample(e,t,i,r,o){if(t){Array.isArray(t)||(t=[t]);for(const a of t)if(!a.isExample&&(i?(a.example=a.__defaultExample,a.isExample=!0):a.example=r?ct.toAst(r,{format:e,location:he.tag}):void 0,o))break}}fillBooleanExample(e,t,i,r){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!r||o.isCorrect)&&(t?(o.example=o.__defaultExample,o.isExample=!0):o.example=nt.toBoolean(i),r))break}}},pt=new class{fileExtensionFromUrl(e){let t;if(e)try{const i=new URL(e).pathname.split(".");i.length>1&&(t=i[i.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}},ut=new class{validateBit(e){if(!e)return e;return e}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;let t=e,i=!1;switch(e.type){case D.image:i=!!e.image.src;break;case D.imageLink:i=!!e.imageLink.url;break;case D.audio:i=!!e.audio.src;break;case D.audioEmbed:i=!!e.audioEmbed.src;break;case D.audioLink:i=!!e.audioLink.url;break;case D.video:i=!!e.video.src;break;case D.videoEmbed:i=!!e.videoEmbed.url;break;case D.videoLink:i=!!e.videoLink.url;break;case D.stillImageFilm:i=!!e.image.src&&!!e.audio.src;break;case D.stillImageFilmEmbed:i=!!e.stillImageFilmEmbed.url;break;case D.stillImageFilmLink:i=!!e.stillImageFilmLink.url;break;case D.article:i=!!e.article.body;break;case D.document:i=!!e.document.url;break;case D.documentEmbed:i=!!e.documentEmbed.url;break;case D.documentLink:i=!!e.documentLink.url;break;case D.documentDownload:i=!!e.documentDownload.url;break;case D.appLink:i=!!e.appLink.url;break;case D.websiteLink:i=!!e.websiteLink.url;break;default:i=!1}return i||e.type&&(t={type: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(!O.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!O.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!O.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!O.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(!O.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`)}},ht=class extends lt{resourceFromResourceJson(e,t){if(!t)return;const i=[];Array.isArray(t)||(t=[t]);for(const r of t){let t=D.fromValue(r.type);if(!t)return;const o=D.keyFromValue(t);if(!o)return;let a;if(t=D.fromValue(r.__typeAlias)??t,t===D.imageResponsive){const t=r,o=this.resourceFromResourceDataJson(e,D.imagePortrait,t.imagePortrait),a=this.resourceFromResourceDataJson(e,D.imageLandscape,t.imageLandscape);o&&i.push(o),a&&i.push(a)}else if(t===D.stillImageFilm){const t=r,o=this.resourceFromResourceDataJson(e,D.image,t.image),a=this.resourceFromResourceDataJson(e,D.audio,t.audio);o&&i.push(o),a&&i.push(a)}else{if(a=r[o],!a)return;const n=this.resourceFromResourceDataJson(e,t,a);n&&i.push(n)}}return 0!==i.length?1===i.length?i[0]:i:void 0}resourceFromResourceDataJson(e,t,i){if(!i)return;if(!(t=D.fromValue(t)))return;const r=O.isString(i)?i:void 0,o=i.url||i.src||i.body||r,a=i.posterImage?this.resourceFromResourceDataJson(e,D.image,i.posterImage)?.image:void 0,n=i.thumbnails?i.thumbnails.map(t=>this.resourceFromResourceDataJson(e,D.image,t)?.image):void 0;return this.resource(e,{type:t,value:o,format:i.format,src1x:i.src1x,src2x:i.src2x,src3x:i.src3x,src4x:i.src4x,caption:this.handleJsonText(e,he.tag,i.caption),width:i.width??void 0,height:i.height??void 0,alt:i.alt,zoomDisabled:i.zoomDisabled,duration:i.duration,mute:i.mute,autoplay:i.autoplay,allowSubtitles:i.allowSubtitles,showSubtitles:i.showSubtitles,posterImage:a,thumbnails:n,siteName:void 0,license:i.license,copyright:i.copyright,showInIndex:i.showInIndex,search:i.search})}resource(e,t){let i;const{type:r,value:o,format:a,...n}=t,s={type:r,value:o??Ve.EMPTY_STRING,format:a??Ve.EMPTY_STRING,...n};switch(r){case D.video:case D.videoEmbed:case D.videoLink:case D.stillImageFilmEmbed:case D.stillImageFilmLink:{const i=["src1x","src2x","src3x","src4x"],r=[];for(const o of i){const i=t[o];if(i){const t=this.resource(e,{type:D.image,value:i});t&&r.push(t.image)}}s.thumbnails=[...s.thumbnails||[],...r]}}switch(r){case D.image:case D.imagePortrait:case D.imageLandscape:case D.backgroundWallpaper:case D.imagePlaceholder:case D.icon:i=this.imageResource(e,s,r);break;case D.imageLink:i=this.imageLinkResource(e,s);break;case D.audio:i=this.audioResource(e,s);break;case D.audioEmbed:i=this.audioEmbedResource(e,s);break;case D.audioLink:i=this.audioLinkResource(e,s);break;case D.video:i=this.videoResource(e,s);break;case D.videoEmbed:i=this.videoEmbedResource(e,s);break;case D.videoLink:i=this.videoLinkResource(e,s);break;case D.stillImageFilmEmbed:i=this.stillImageFilmEmbedResource(e,s);break;case D.stillImageFilmLink:i=this.stillImageFilmLinkResource(e,s);break;case D.article:i=this.articleResource(e,s);break;case D.document:i=this.documentResource(e,s);break;case D.documentEmbed:i=this.documentEmbedResource(e,s);break;case D.documentLink:i=this.documentLinkResource(e,s);break;case D.documentDownload:i=this.documentDownloadResource(e,s);break;case D.appLink:i=this.appLinkResource(e,s);break;case D.websiteLink:i=this.websiteLinkResource(e,s)}return i}imageResource(e,t,i){const{value:r,src1x:o,src2x:a,src3x:n,src4x:s,width:l,height:c,alt:d,zoomDisabled:p,license:u,copyright:h,showInIndex:g,caption:b,search:f}=t,{bitType:y}=e;let k=!1;Y.isOfBitType(y,[m.imageSeparator,m.pageBanner,m.imagesLogoGrave,m.prototypeImages])&&(k=!0);const T={type:D.image,__typeAlias:i??D.image,__configKey:z(i??D.image),image:{format:pt.fileExtensionFromUrl(r)??void 0,provider:pt.domainFromUrl(r)??void 0,src:r??"",src1x:o??void 0,src2x:a??void 0,src3x:n??void 0,src4x:s??void 0,width:l??null,height:c??null,alt:d??"",zoomDisabled:p??k,license:u??"",copyright:h??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0}};return W.removeUnwantedProperties(T.image,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","alt","license","copyright"]}),ut.validateResource(T)}imageLinkResource(e,t){const{value:i,src1x:r,src2x:o,src3x:a,src4x:n,width:s,height:l,alt:c,zoomDisabled:d,license:p,copyright:u,showInIndex:h,caption:m,search:g}=t,b={type:D.imageLink,__typeAlias:D.imageLink,__configKey:z(D.imageLink),imageLink:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",src1x:r??void 0,src2x:o??void 0,src3x:a??void 0,src4x:n??void 0,width:s??null,height:l??null,alt:c??"",zoomDisabled:d??!1,license:p??"",copyright:u??"",showInIndex:h??!1,caption:this.handleJsonText(e,he.tag,m),search:g??void 0}};return W.removeUnwantedProperties(b.imageLink,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","alt","license","copyright"]}),ut.validateResource(b)}audioResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:D.audio,__typeAlias:D.audio,__configKey:z(D.audio),audio:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,he.tag,c),search:d??void 0}};return W.removeUnwantedProperties(p.audio,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(p)}audioEmbedResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:D.audioEmbed,__typeAlias:D.audioEmbed,__configKey:z(D.audioEmbed),audioEmbed:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,he.tag,c),search:d??void 0}};return W.removeUnwantedProperties(p.audioEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(p)}audioLinkResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:D.audioLink,__typeAlias:D.audioLink,__configKey:z(D.audioLink),audioLink:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,he.tag,c),search:d??void 0}};return W.removeUnwantedProperties(p.audioLink,{ignoreEmptyString:["url"]}),ut.validateResource(p)}videoResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:D.video,__typeAlias:D.video,__configKey:z(D.video),video:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,src:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0,posterImage:p??void 0,thumbnails:u??void 0}};return W.removeUnwantedProperties(y.video,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(y)}videoEmbedResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:D.videoEmbed,__typeAlias:D.videoEmbed,__configKey:z(D.videoEmbed),videoEmbed:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0}};return W.removeUnwantedProperties(y.videoEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(y)}videoLinkResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:D.videoLink,__typeAlias:D.videoLink,__configKey:z(D.videoLink),videoLink:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0}};return W.removeUnwantedProperties(y.videoLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(y)}stillImageFilmEmbedResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:D.stillImageFilmEmbed,__typeAlias:D.stillImageFilmEmbed,__configKey:z(D.stillImageFilmEmbed),stillImageFilmEmbed:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0}};return W.removeUnwantedProperties(y.stillImageFilmEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(y)}stillImageFilmLinkResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:D.stillImageFilmLink,__typeAlias:D.stillImageFilmLink,__configKey:z(D.stillImageFilmLink),stillImageFilmLink:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,he.tag,b),search:f??void 0}};return W.removeUnwantedProperties(y.stillImageFilmLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(y)}articleResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.article,__typeAlias:D.article,__configKey:z(D.article),article:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,body:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.article,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["body","alt","license","copyright"]}),ut.validateResource(l)}documentResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.document,__typeAlias:D.document,__configKey:z(D.document),document:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.document,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}documentEmbedResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.documentEmbed,__typeAlias:D.documentEmbed,__configKey:z(D.documentEmbed),documentEmbed:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.documentEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}documentLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.documentLink,__typeAlias:D.documentLink,__configKey:z(D.documentLink),documentLink:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.documentLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}documentDownloadResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.documentDownload,__typeAlias:D.documentDownload,__configKey:z(D.documentDownload),documentDownload:{format:pt.fileExtensionFromUrl(i)??void 0,provider:pt.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.documentDownload,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}appLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.appLink,__typeAlias:D.appLink,__configKey:z(D.appLink),appLink:{provider:void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.appLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}websiteLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:D.websiteLink,__typeAlias:D.websiteLink,__configKey:z(D.websiteLink),websiteLink:{provider:void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,he.tag,n),search:s??void 0}};return W.removeUnwantedProperties(l.websiteLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),ut.validateResource(l)}},mt=class extends lt{constructor(){super(...arguments),p(this,"resourceBuilder",new ht)}buildBitmark(e){const{bits:t,errors:i}=e,r={bits:t,errors:i};return W.removeUnwantedProperties(r),r}buildBit(e,t){const i=e.bitType,r=Y.getBitConfig(i),o=Ne.fromValue(e.textFormat);let a=T.fromValue(e.textFormat)??r.textFormatDefault;o===Ne.bitmarkMinusMinus&&(a=T.bitmarkText);const n={bitConfig:r,bitType:i,textFormat:a},s=this.buildCardNode(n,e),l=Y.isOfBitType(e.bitType,m.essay)?this.toAstProperty(i,q.property_reasonableNumOfChars,e.reasonableNumOfChars,t):void 0,c={...this.toExample(e.__isDefaultExample,e.example)},d={bitType:i,bitLevel:e.bitLevel,textFormat:a,resourceType:D.fromValue(e.resourceType),isCommented:e.isCommented,id:this.toAstProperty(i,q.property_id,e.id,t),internalComment:this.toAstProperty(i,q.property_internalComment,e.internalComment,t),customerId:this.toAstProperty(i,q.property_customerId,e.customerId,t),customerExternalId:this.toAstProperty(i,q.property_customerExternalId,e.customerExternalId,t),externalId:this.toAstProperty(i,q.property_externalId,e.externalId,t),spaceId:this.toAstProperty(i,q.property_spaceId,e.spaceId,t),padletId:this.toAstProperty(i,q.property_padletId,e.padletId,t),jupyterId:this.toAstProperty(i,q.property_jupyterId,e.jupyterId,t),jupyterExecutionCount:this.toAstProperty(i,q.property_jupyterExecutionCount,e.jupyterExecutionCount,t),isPublic:this.toAstProperty(i,q.property_isPublic,e.isPublic,t),isTemplate:this.toAstProperty(i,q.property_isTemplate,e.isTemplate,t),isTemplateStripTheme:this.toAstProperty(i,q.property_isTemplateStripTheme,e.isTemplateStripTheme,t),aiGenerated:this.toAstProperty(i,q.property_aiGenerated,e.aiGenerated,t),machineTranslated:this.toAstProperty(i,q.property_machineTranslated,e.machineTranslated,t),searchIndex:this.toAstProperty(i,q.property_searchIndex,e.searchIndex,t),analyticsTag:this.toAstProperty(i,q.property_analyticsTag,e.analyticsTag,t),categoryTag:this.toAstProperty(i,q.property_categoryTag,e.categoryTag,t),topicTag:this.toAstProperty(i,q.property_topicTag,e.topicTag,t),reportTag:this.toAstProperty(i,q.property_reportTag,e.reportTag,t),altLangTag:this.toAstProperty(i,q.property_altLangTag,e.altLangTag,t),feedbackEngine:this.toAstProperty(i,q.property_feedbackEngine,e.feedbackEngine,t),feedbackType:this.toAstProperty(i,q.property_feedbackType,e.feedbackType,t),disableFeedback:this.toAstProperty(i,q.property_disableFeedback,e.disableFeedback,t),diffTo:this.toAstProperty(i,q.property_diffTo,e.diffTo,t),diffOp:this.toAstProperty(i,q.property_diffOp,e.diffOp,t),diffRef:this.toAstProperty(i,q.property_diffRef,e.diffRef,t),diffContext:this.toAstProperty(i,q.property_diffContext,e.diffContext,t),diffTime:this.toAstProperty(i,q.property_diffTime,e.diffTime,t),path:this.toAstProperty(i,q.property_path,e.path,t),releaseVersion:this.toAstProperty(i,q.property_releaseVersion,e.releaseVersion,t),releaseKind:this.toAstProperty(i,q.property_releaseKind,e.releaseKind,t),releaseDate:this.toAstProperty(i,q.property_releaseDate,e.releaseDate,t),book:this.buildBooks(n,e.book),ageRange:this.toAstProperty(i,q.property_ageRange,e.ageRange,t),lang:this.toAstProperty(i,q.property_lang,e.lang,t),language:this.toAstProperty(i,q.property_language,e.language,t),publisher:this.toAstProperty(i,q.property_publisher,e.publisher,t),publisherName:this.toAstProperty(i,q.property_publisherName,e.publisherName,t),theme:this.toAstProperty(i,q.property_theme,e.theme,t),computerLanguage:this.toAstProperty(i,q.property_computerLanguage,e.computerLanguage,t),target:this.toAstProperty(i,q.property_target,e.target,t),slug:this.toAstProperty(i,q.property_slug,e.slug,t),tag:this.toAstProperty(i,q.property_tag,e.tag,t),groupTag:this.buildGroupTags(n,e.groupTag),reductionTag:this.toAstProperty(i,q.property_reductionTag,e.reductionTag,t),bubbleTag:this.toAstProperty(i,q.property_bubbleTag,e.bubbleTag,t),levelCEFRp:this.toAstProperty(i,q.property_levelCEFRp,e.levelCEFRp,t),levelCEFR:this.toAstProperty(i,q.property_levelCEFR,e.levelCEFR,t),levelILR:this.toAstProperty(i,q.property_levelILR,e.levelILR,t),levelACTFL:this.toAstProperty(i,q.property_levelACTFL,e.levelACTFL,t),icon:this.toAstProperty(i,q.property_icon,e.icon,t),iconTag:this.toAstProperty(i,q.property_iconTag,e.iconTag,t),colorTag:this.toAstProperty(i,q.property_colorTag,e.colorTag,t),flashcardSet:this.toAstProperty(i,q.property_flashcardSet,e.flashcardSet,t),subtype:this.toAstProperty(i,q.property_subtype,e.subtype,t),bookAlias:this.toAstProperty(i,q.property_bookAlias,e.bookAlias,t),bookDiff:this.toAstProperty(i,q.property_bookDiff,e.bookDiff,t),coverImage:this.toAstProperty(i,q.property_coverImage,e.coverImage,t),coverColor:this.toAstProperty(i,q.property_coverColor,e.coverColor,t),publications:this.toAstProperty(i,q.property_publications,e.publications,t),author:this.toAstProperty(i,q.property_author,e.author,t),subject:this.toAstProperty(i,q.property_subject,e.subject,t),date:this.toAstProperty(i,q.property_date,e.date,t),dateEnd:this.toAstProperty(i,q.property_dateEnd,e.dateEnd,t),location:this.toAstProperty(i,q.property_location,e.location,t),kind:this.toAstProperty(i,q.property_kind,e.kind,t),hasMarkAsDone:this.toAstProperty(i,q.property_hasMarkAsDone,e.hasMarkAsDone,t),processHandIn:this.toAstProperty(i,q.property_processHandIn,e.processHandIn,t),processHandInLocation:this.toAstProperty(i,q.property_processHandInLocation,e.processHandInLocation,t),chatWithBook:this.toAstProperty(i,q.property_chatWithBook,e.chatWithBook,t),chatWithBookBrainKey:this.toAstProperty(i,q.property_chatWithBookBrainKey,e.chatWithBookBrainKey,t),action:this.toAstProperty(i,q.property_action,e.action,t),showInIndex:this.toAstProperty(i,q.property_showInIndex,e.showInIndex,t),refAuthor:this.toAstProperty(i,q.property_refAuthor,e.refAuthor,t),refBookTitle:this.toAstProperty(i,q.property_refBookTitle,e.refBookTitle,t),refPublisher:this.toAstProperty(i,q.property_refPublisher,e.refPublisher,t),refPublicationYear:this.toAstProperty(i,q.property_refPublicationYear,e.refPublicationYear,t),citationStyle:this.toAstProperty(i,q.property_citationStyle,e.citationStyle,t),blockId:this.toAstProperty(i,q.property_blockId,e.blockId,t),pageNo:this.toAstProperty(i,q.property_pageNo,e.pageNo,t),x:this.toAstProperty(i,q.property_x,e.x,t),y:this.toAstProperty(i,q.property_y,e.y,t),width:this.toAstProperty(i,q.property_width,e.width,t),height:this.toAstProperty(i,q.property_height,e.height,t),index:this.toAstProperty(i,q.property_index,e.index,t),classification:this.toAstProperty(i,q.property_classification,e.classification,t),availableClassifications:this.toAstProperty(i,q.property_availableClassifications,e.availableClassifications,t),allowedBit:this.toAstProperty(i,q.property_allowedBit,e.allowedBit,t),tableFixedHeader:this.toAstProperty(i,q.property_tableFixedHeader,e.tableFixedHeader,t),tableHeaderWhitespaceNoWrap:this.toAstProperty(i,q.property_tableHeaderWhitespaceNoWrap,e.tableHeaderWhitespaceNoWrap,t),tableSearch:this.toAstProperty(i,q.property_tableSearch,e.tableSearch,t),tableSort:this.toAstProperty(i,q.property_tableSort,e.tableSort,t),tablePagination:this.toAstProperty(i,q.property_tablePagination,e.tablePagination,t),tablePaginationLimit:this.toAstProperty(i,q.property_tablePaginationLimit,e.tablePaginationLimit,t),tableHeight:this.toAstProperty(i,q.property_tableHeight,e.tableHeight,t),tableWhitespaceNoWrap:this.toAstProperty(i,q.property_tableWhitespaceNoWrap,e.tableWhitespaceNoWrap,t),tableAutoWidth:this.toAstProperty(i,q.property_tableAutoWidth,e.tableAutoWidth,t),tableResizableColumns:this.toAstProperty(i,q.property_tableResizableColumns,e.tableResizableColumns,t),tableColumnMinWidth:this.toAstProperty(i,q.property_tableColumnMinWidth,e.tableColumnMinWidth,t),quizCountItems:this.toAstProperty(i,q.property_quizCountItems,e.quizCountItems,t),quizStrikethroughSolutions:this.toAstProperty(i,q.property_quizStrikethroughSolutions,e.quizStrikethroughSolutions,t),codeLineNumbers:this.toAstProperty(i,q.property_codeLineNumbers,e.codeLineNumbers,t),codeMinimap:this.toAstProperty(i,q.property_codeMinimap,e.codeMinimap,t),stripePricingTableId:this.toAstProperty(i,q.property_stripePricingTableId,e.stripePricingTableId,t),stripePublishableKey:this.toAstProperty(i,q.property_stripePublishableKey,e.stripePublishableKey,t),thumbImage:this.toAstProperty(i,q.property_thumbImage,e.thumbImage,t),scormSource:this.toAstProperty(i,q.property_scormSource,e.scormSource,t),posterImage:this.toAstProperty(i,q.property_posterImage,e.posterImage,t),focusX:this.toAstProperty(i,q.property_focusX,e.focusX,t),focusY:this.toAstProperty(i,q.property_focusY,e.focusY,t),pointerLeft:this.toAstProperty(i,q.property_pointerLeft,e.pointerLeft,t),pointerTop:this.toAstProperty(i,q.property_pointerTop,e.pointerTop,t),listItemIndent:this.toAstProperty(i,q.property_listItemIndent,e.listItemIndent,t),backgroundWallpaper:this.toImageResource(n,e.backgroundWallpaper),hasBookNavigation:this.toAstProperty(i,q.property_hasBookNavigation,e.hasBookNavigation,t),duration:this.toAstProperty(i,q.property_duration,e.duration,t),deeplink:this.toAstProperty(i,q.property_deeplink,e.deeplink,t),externalLink:this.toAstProperty(i,q.property_externalLink,e.externalLink,t),externalLinkText:this.toAstProperty(i,q.property_externalLinkText,e.externalLinkText,t),videoCallLink:this.toAstProperty(i,q.property_videoCallLink,e.videoCallLink,t),vendorDashboardId:this.toAstProperty(i,q.property_vendorDashboardId,e.vendorDashboardId,t),vendorSurveyId:this.toAstProperty(i,q.property_vendorSurveyId,e.vendorSurveyId,t),vendorUrl:this.toAstProperty(i,q.property_vendorUrl,e.vendorUrl,t),search:this.toAstProperty(i,q.property_search,e.search,t),list:this.toAstProperty(i,q.property_list,e.list,t),layer:this.toAstProperty(i,q.property_layer,e.layer,t),layerRole:this.toAstProperty(i,q.property_layerRole,e.layerRole,t),textReference:this.toAstProperty(i,q.property_textReference,e.textReference,t),isTracked:this.toAstProperty(i,q.property_isTracked,e.isTracked,t),isInfoOnly:this.toAstProperty(i,q.property_isInfoOnly,e.isInfoOnly,t),imageFirst:this.toAstProperty(i,q.property_imageFirst,e.imageFirst,t),activityType:this.toAstProperty(i,q.property_activityType,e.activityType,t),labelTrue:this.toAstProperty(i,q.property_labelTrue,e.labelTrue,t),labelFalse:this.toAstProperty(i,q.property_labelFalse,e.labelFalse,t),content2Buy:this.toAstProperty(i,q.property_content2Buy,e.content2Buy,t),mailingList:this.toAstProperty(i,q.property_mailingList,e.mailingList,t),buttonCaption:this.toAstProperty(i,q.property_buttonCaption,e.buttonCaption,t),callToActionUrl:this.toAstProperty(i,q.property_callToActionUrl,e.callToActionUrl,t),caption:this.handleJsonText(n,he.tag,e.caption),quotedPerson:this.toAstProperty(i,q.property_quotedPerson,e.quotedPerson,t),reasonableNumOfChars:l,resolved:this.toAstProperty(i,q.property_resolved,e.resolved,t),resolvedDate:this.toAstProperty(i,q.property_resolvedDate,e.resolvedDate,t),resolvedBy:this.toAstProperty(i,q.property_resolvedBy,e.resolvedBy,t),handInAcceptFileType:this.toAstProperty(i,q.property_handInAcceptFileType,e.handInAcceptFileType,t),handInRequirement:this.toAstProperty(i,q.property_handInRequirement,e.handInRequirement,t),handInInstruction:this.toAstProperty(i,q.property_handInInstruction,e.handInInstruction,t),maxCreatedBits:this.toAstProperty(i,q.property_maxCreatedBits,e.maxCreatedBits,t),maxDisplayLevel:this.toAstProperty(i,q.property_maxDisplayLevel,e.maxDisplayLevel,t),maxTocChapterLevel:this.toAstProperty(i,q.property_maxTocChapterLevel,e.maxTocChapterLevel,t),tocResource:this.toAstProperty(i,q.property_tocResource,e.tocResource,t),tocContent:this.toAstProperty(i,q.property_tocContent,e.tocContent,t),page:this.toAstProperty(i,q.property_page,e.page,t),productId:this.toAstProperty(i,q.property_productId,e.productId,t),product:this.toAstProperty(i,q.property_product,e.product,t),productVideo:this.toAstProperty(i,q.property_productVideo,e.productVideo,t),productFolder:this.toAstProperty(i,q.property_productFolder,e.productFolder,t),technicalTerm:this.buildTechnicalTerm(n,e.technicalTerm),servings:this.buildServings(n,e.servings),ratingLevelStart:this.buildRatingLevelStartEnd(n,e.ratingLevelStart),ratingLevelEnd:this.buildRatingLevelStartEnd(n,e.ratingLevelEnd),ratingLevelSelected:this.toAstProperty(i,q.property_ratingLevelSelected,e.ratingLevelSelected,t),markConfig:this.buildMarkConfigs(n,e.markConfig),imageSource:this.buildImageSource(n,e.imageSource),person:this.buildPerson(n,e.person),bot:this.toAstProperty(i,q.property_bot,e.bot,t),referenceProperty:this.toAstProperty(i,q.property_reference,e.referenceProperty,t),title:this.handleJsonText(n,he.tag,e.title),subtitle:this.handleJsonText(n,he.tag,e.subtitle),level:st.asNumber(e.level),toc:this.toAstProperty(i,q.property_toc,e.toc,t),progress:this.toAstProperty(i,q.property_progress,e.progress,t),anchor:e.anchor,reference:e.reference,referenceEnd:e.referenceEnd,revealSolutions:this.toAstProperty(i,q.property_revealSolutions,e.revealSolutions,t),item:this.handleJsonText(n,he.tag,e.item),lead:this.handleJsonText(n,he.tag,e.lead),pageNumber:this.handleJsonText(n,he.tag,e.pageNumber),marginNumber:this.handleJsonText(n,he.tag,e.marginNumber),hint:this.handleJsonText(n,he.tag,e.hint),instruction:this.handleJsonText(n,he.tag,e.instruction),partialAnswer:this.toAstProperty(i,q.property_partialAnswer,e.partialAnswer,t),sampleSolution:this.toAstProperty(i,q.property_sampleSolution,e.sampleSolution,t),additionalSolutions:this.toAstProperty(i,q.property_additionalSolutions,e.additionalSolutions,t),...this.toExample(e.__isDefaultExample,e.example),imagePlaceholder:this.toImageResource(n,e.imagePlaceholder),resources:Re.asArray(this.resourceBuilder.resourceFromResourceJson(n,e.resources)),body:this.buildBody(n,e.body),cardNode:s,footer:this.buildFooter(n,e.footer),extraProperties:this.parseExtraProperties(e.extraProperties),markup:e.markup,parser:e.parser,__isDefaultExample:e.__isDefaultExample??!1};return Y.isOfBitType(d.bitType,m.interview)&&this.pushDownTree(n,void 0,void 0,s,"questions","reasonableNumOfChars",e.reasonableNumOfChars),Y.isOfBitType(d.bitType,m.feedback)&&this.pushDownTree(n,void 0,void 0,s,["feedbacks","reason"],"reasonableNumOfChars",e.reasonableNumOfChars),this.pushDownTree(n,[d.body,...s?.cardBits?.map(e=>e.body)||[]],[le.gap],void 0,void 0,"isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,s,"pairs","isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,s,["matrix","cells"],"isCaseSensitive",e.isCaseSensitive??!0),this.pushExampleDownTree(n,d.body,s,d.__isDefaultExample,c.example),this.setDefaultBitValues(d),this.setIsExampleFlags(d),this.addVersionToParserInfo(d),W.removeUnwantedProperties(d,{ignoreAllFalse:!0,ignoreUndefined:["example"],ignoreEmptyArrays:["item","lead","pageNumber","marginNumber","hint","instruction"]}),ut.validateBit(d)}buildBooks(e,t){if(O.isString(t))return t;if(!Array.isArray(t))return;const i=t.map(t=>this.buildBook(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildBook(e,t){if(!t)return;const i={book:t.book??"",reference:t.reference??"",referenceEnd:t.referenceEnd??void 0};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["book","reference"]}),i}buildGroupTags(e,t){if(!t)return;Array.isArray(t)||(t=[t]);let i=t.map(t=>this.buildGroupTag(e,t)).filter(e=>null!=e);const r={};for(const e of i)e&&(r[e.name]?r[e.name].tags=Re.removeDuplicates([...r[e.name].tags,...e.tags]):r[e.name]=e);return i=Object.values(r),i.length>0?i:void 0}buildGroupTag(e,t){if(!t)return;const i=Array.isArray(t.tags)?t.tags:[];return{name:t.name??"",tags:i.map(e=>e?.trim()??"")??[]}}buildFeedbackChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedbackChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedbackChoice(e,t){if(!t)return;const i={choice:t.choice??"",requireReason:!!t.requireReason,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildFeedbackReason(e,t){if(!t)return;const i=this.handleJsonText(e,he.tag,"true"),r={text:t.text??"",reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__textAst:t.__textAst};return W.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example","reasonableNumOfChars"]}),r}buildChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildChoice(e,t){if(!t)return;const i={choice:t.choice??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildResponse(e,t){if(!t)return;const i={response:t.response??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildBotResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.botResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}botResponse(e,t){if(!t)return;const i={response:t.response??"",reaction:t.reaction??"",feedback:t.feedback??"",item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint)};return W.removeUnwantedProperties(i,{ignoreEmptyString:["response","reaction","feedback"],ignoreAllFalse:!0,ignoreEmptyArrays:["item"],ignoreUndefined:["example"]}),i}buildFeedbacks(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedback(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedback(e,t){if(!t)return;let i,r;if(!t.choices)return;i=this.buildFeedbackChoices(e,t.choices),t.reason&&(r=this.buildFeedbackReason(e,t.reason));const o={item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),choices:i,reason:r};return W.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),o}buildQuizzes(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuiz(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuiz(e,t){if(!t)return;const i={...this.toExample(t.__isDefaultExample,t.__defaultExample)};let r,o;if(t.choices)r=this.buildChoices(e,t.choices),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!0,r);else{if(!t.responses)return;o=this.buildResponses(e,t.responses),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!1,o)}const a={item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),isExample:!!t.__defaultExample,choices:r,responses:o};return W.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),a}buildHeading(e,t){if(!t)return;if(null==t.forKeys)return;const i={forKeys:t.forKeys??"",forValues:t.forValues??t.__forValuesDefault??""};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["forKeys","forValues"],ignoreEmptyArrays:["forValues"]}),i}buildPairs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildPair(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildPair(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r=this.resourceBuilder.resourceFromResourceJson(e,t.keyAudio),o=this.resourceBuilder.resourceFromResourceJson(e,t.keyImage),a={key:t.key??"",keyAudio:r,keyImage:o,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),values:t.values||[],__valuesAst:t.__valuesAst};return W.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction","values"],ignoreUndefined:["example","isCaseSensitive"]}),a}buildMatricies(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMatrix(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMatrix(e,t){if(!t)return;let i=!1;for(const e of t.cells||[])t.__isDefaultExample&&!e.isExample&&(e.isExample=!0),i=!!e.isExample||i;const r={key:t.key??"",item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),isExample:i,cells:(t.cells||[]).map(t=>this.buildMatrixCell(e,t)).filter(e=>null!=e)};return W.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["hint","item","cells"],ignoreUndefined:["isCaseSensitive"]}),r}buildMatrixCell(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r={values:t.values||[],item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__valuesAst:t.__valuesAst};return W.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["instruction","item","values"],ignoreUndefined:["example","isCaseSensitive"]}),r}buildPronunciationTable(e,t){if(!t)return;return{data:(t.data||[]).map(t=>(t||[]).map(t=>{const i=this.resourceBuilder.resourceFromResourceJson(e,t.audio);return{title:this.handleJsonText(e,he.tag,t.title),body:this.handleJsonText(e,he.tag,t.body),audio:i}}))}}buildTable(e,t){if(!t)return;return{columns:(t.columns||[]).map(t=>this.handleJsonText(e,he.tag,t)),data:(t.data||[]).map(t=>(t||[]).map(t=>this.handleJsonText(e,he.tag,t)))}}buildQuestions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuestion(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuestion(e,t){if(!t)return;const i=t.__sampleSolutionAst,r={question:t.question??"",partialAnswer:t.partialAnswer??"",sampleSolution:t.sampleSolution??"",additionalSolutions:t.additionalSolutions??void 0,reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__sampleSolutionAst:t.__sampleSolutionAst};return W.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"],ignoreEmptyString:["question","partialAnswer","sampleSolution"]}),r}buildIngredients(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildIngredient(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildIngredient(e,t){if(!t)return;const i={title:this.handleJsonText(e,he.tag,t.title),checked:t.checked??!1,ingredient:this.handleJsonText(e,he.tag,t.ingredient),quantity:t.quantity??0,unit:t.unit??"",unitAbbr:t.unitAbbr??"",decimalPlaces:t.decimalPlaces??1,disableCalculation:t.disableCalculation??!1,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["item","unit"]}),i}buildBody(e,t){if(!t)return;let i;const r=[],o=t.placeholders,a=t.bodyString,{textFormat:n}=e,s=()=>{let a,s=t.body;const l={};if(O.isString(t.body)?(a=(t.body??"").trim(),s=[]):Array.isArray(t.body)||(s=[]),o)for(const[e,t]of Object.entries(o))l[e]=t;if(a){a=Ve.breakscape(a,{format:n,location:he.body,v2:!0});let e=0;const t=[];for(const[i,r]of Object.entries(l))if(a){const o=`[!${e}]`;a=a.replace(`${i}`,o),t.push(r),e++}s=this.textParser.toAst(a,{format:n,location:he.body});const i=e=>{for(let r=0,o=e.length;r<o;r++){const o=e[r];if("bit"===o.type){const i=o.index;null!=t[i]&&(e[r]=t[i])}else o.content&&i(o.content)}};i(s)}s=structuredClone(s),this.textParser.walkBodyBits(s,(t,i,o)=>{let a;switch(o.type){case le.gap:a=this.buildGap(e,o);break;case le.mark:a=this.buildMark(e,o);break;case le.select:a=this.buildSelect(e,o);break;case le.highlight:a=this.buildHighlight(e,o)}null!=a&&(t[i]=a,r.push(a))}),i=s,i.__tag="text"},l=n===T.bitmarkText;n===T.json?(()=>{if("string"==typeof t.body)try{i=JSON.parse(t.body)}catch(e){i=null}else i=t.body})():l?s():i=t.body;return{body:i,bodyBits:r,bodyString:a}}buildFooter(e,t){if(!t)return;return{footer:this.handleJsonText(e,he.body,t.footer)}}buildGap(e,t){if(!t)return;const i=Array.isArray(t.__solutionsAst)&&t.__solutionsAst.length>0?t.__solutionsAst[0]:null;t=this.bodyBitCopyFromAttrs(t);const r={type:le.gap,solutions:t.solutions||[],item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__solutionsAst:t.__solutionsAst,attrs:{}};return W.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example","isCaseSensitive"]}),r}buildMarkConfigs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMarkConfig(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMarkConfig(e,t){if(!t)return;const i={mark:t.mark??"unknown",color:t.color??"",emphasis:t.emphasis??""};return W.removeUnwantedProperties(i,{ignoreAllEmptyString:!0}),i}buildMark(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:le.mark,solution:t.solution??"",mark:t.mark??"",item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0),attrs:{}};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"],ignoreEmptyString:["solution","mark"]}),i}buildSelect(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:le.select,options:this.buildSelectOptions(e,t.options)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(!1,void 0,void 0),__hintString:t.__hintString,__instructionString:t.__instructionString,attrs:{}};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildSelectOptions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildSelectOption(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildSelectOption(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildHighlight(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:le.highlight,texts:this.buildHighlightTexts(e,t.texts)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(!1,void 0,void 0),attrs:{}};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildHighlightTexts(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildHighlightText(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildHighlightText(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,isHighlighted:!!t.isHighlighted,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildFlashcards(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFlashcard(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFlashcard(e,t){if(!t)return;const i={question:this.buildTextAndIcon(e,t.question),answer:this.buildTextAndIcon(e,t.answer),alternativeAnswers:(t.alternativeAnswers||[]).map(t=>this.buildTextAndIcon(e,t)).filter(e=>null!=e),item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeAnswers","item","hint","instruction"],ignoreUndefined:["example"]}),i}buildDefinitionList(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildDefinitionListItem(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildDefinitionListItem(e,t){if(!t)return;const{bitType:i}=e,r=Y.isOfBitType(i,[m.metaSearchDefaultTerms]),o={term:this.buildTextAndIcon(e,t.term,r),definition:this.buildTextAndIcon(e,t.definition,r),alternativeDefinitions:(t.alternativeDefinitions||[]).map(t=>this.buildTextAndIcon(e,t,r)).filter(e=>null!=e),item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return W.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeDefinitions","item","hint","instruction"],ignoreUndefined:["example"]}),o}buildTextAndIcon(e,t,i=!1){const r=this.resourceBuilder.resourceFromResourceJson(e,t?.icon);let o=this.handleJsonText(e,he.tag,t?.text||t);i&&(o=this.textGenerator.generateSync(o,T.plainText,he.body,{noBreakscaping:!0}).trim());const a={text:o,icon:r};return W.removeUnwantedProperties(a,{ignoreEmptyArrays:["text"],ignoreUndefined:["icon"]}),a}buildStatements(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildStatement(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildStatement(e,t){if(!t)return;const i={statement:t.statement??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,he.tag,t.item),lead:this.handleJsonText(e,he.tag,t.lead),hint:this.handleJsonText(e,he.tag,t.hint),instruction:this.handleJsonText(e,he.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return W.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),i}buildImageSource(e,t){if(!t)return;const{url:i,mockupId:r,size:o,format:a,trim:n}=t,s={url:i??"",mockupId:r??"",size:o??null,format:a??null,trim:nt.isBoolean(n)?n:null};return W.removeUnwantedProperties(s,{ignoreFalse:["trim"],ignoreEmptyString:["url","mockupId"],ignoreAllUndefined:!0}),s}buildPerson(e,t){if(!t)return;const{name:i,title:r,avatarImage:o}=t,a={name:i??"",title:r??void 0,avatarImage:this.resourceBuilder.resourceFromResourceJson(e,o)};return W.removeUnwantedProperties(a,{ignoreEmptyString:["name"],ignoreAllUndefined:!0}),a}buildTechnicalTerm(e,t){if(!t)return;const{technicalTerm:i,lang:r}=t,o={technicalTerm:i??"",lang:r??""};return W.removeUnwantedProperties(o,{ignoreEmptyString:["technicalTerm"]}),o}buildServings(e,t){if(!t)return;const{servings:i,unit:r,unitAbbr:o,decimalPlaces:a,disableCalculation:n,hint:s}=t,l={servings:i??0,unit:r??"",unitAbbr:o??"",decimalPlaces:a??1,disableCalculation:n??!1,hint:s??""};return W.removeUnwantedProperties(l,{ignoreEmptyString:["servings","unit"]}),l}buildRatingLevelStartEnd(e,t){if(!t)return;const{level:i,label:r}=t,o={level:i??0,label:this.handleJsonText(e,he.tag,r)};return W.removeUnwantedProperties(o,{}),o}buildCardBits(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildCardBit(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildCardBit(e,t){if(!t)return;const{bitType:i,textFormat:r}=e,o=this.buildBit({...t,bitType:i,textFormat:r},{cardSet:{sideNo:0,variantNo:0}});return W.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),ut.validateCardBit(o)}toImageResource(e,t){return Re.asSingle(this.resourceBuilder.resourceFromResourceDataJson(e,D.image,t?.image))}buildCardNode(e,t){const i={heading:this.buildHeading(e,t.heading),questions:this.buildQuestions(e,t.questions),elements:t.elements,flashcards:this.buildFlashcards(e,t.flashcards),definitions:this.buildDefinitionList(e,t.definitions??t.legend),statement:this.buildStatement(e,t.statement),statements:this.buildStatements(e,t.statements),choices:this.buildChoices(e,t.choices),responses:this.buildResponses(e,t.responses),feedbacks:this.buildFeedbacks(e,t.feedbacks),quizzes:this.buildQuizzes(e,t.quizzes),pairs:this.buildPairs(e,t.pairs),matrix:this.buildMatricies(e,t.matrix),pronunciationTable:this.buildPronunciationTable(e,t.pronunciationTable),table:this.buildTable(e,t.table),botResponses:this.buildBotResponses(e,t.botResponses),ingredients:this.buildIngredients(e,t.ingredients),cardBits:this.buildCardBits(e,t.cardBits)};return W.removeUnwantedProperties(i),Object.keys(i).length>0?i:void 0}bodyBitCopyFromAttrs(e){const t={...e};if(e.attrs)for(const[i,r]of Object.entries(e.attrs))t[i]=r;return t}pushExampleDownTree(e,t,i,r,o){if(r||null!=o){if(i){if(this.pushExampleDownTreeString(e,r,o,i.pairs),this.pushExampleDownTreeBoolean(e,r,o,!1,i.flashcards),this.pushExampleDownTreeBoolean(e,r,o,!1,i.definitions),this.pushExampleDownTreeBoolean(e,r,o,!0,i.choices),this.pushExampleDownTreeBoolean(e,r,o,!1,i.responses,i.statements,i.statement),i.quizzes)for(const t of i.quizzes)this.pushExampleDownTreeBoolean(e,r,o,!0,t.choices),this.pushExampleDownTreeBoolean(e,r,o,!1,t.responses);if(i.matrix)for(const t of i.matrix)this.pushExampleDownTreeString(e,r,o,t.cells)}t&&this.pushExampleDownTreeBodyBits(e,r,o,t)}}pushExampleDownTreeBoolean(e,t,i,r,...o){if((t||null!=i)&&Array.isArray(o))for(const e of o)if(e){const o=Array.isArray(e)?e:[e];dt.fillBooleanExample(o,t,i,r)}}pushExampleDownTreeString(e,t,i,...r){if((t||i)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];dt.fillStringExample(e.textFormat,r,t,i,!1)}}pushExampleDownTreeBodyBits(e,t,i,r){if(!t&&!i)return;const o=this.textParser.extractBodyBits(r?.body);for(const r of o)if(r)switch(r.type){case le.gap:{const o=r;dt.fillStringExample(e.textFormat,[o],t,i,!1);break}case le.mark:{const e=r;dt.fillBooleanExample([e],t,i,!1);break}case le.select:{const e=r;dt.fillBooleanExample(e.options,t,i,!0);break}case le.highlight:{const e=r;dt.fillBooleanExample(e.texts,t,i,!0);break}}}pushDownTree(e,t,i,r,o,a,n){if(void 0!==n){if(r&&o){Array.isArray(o)||(o=[o]);const e=W.flatMapPath(r,o);for(const t of e)null==t[a]&&(t[a]=n)}if(t){const e=Array.isArray(t)?t:[t];for(const t of e)if(t&&t.body&&i){const e=this.textParser.extractBodyBits(t.body);if(i&&e&&e.length>0)for(const t of e)if(t&&-1!==i.indexOf(t.type)){const e=t;null==e[a]&&(e[a]=n)}}}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const i={};for(const[e,r]of t)i[e]=Re.asArray(r)||[r];return i}setIsExampleFlags(e){const t=t=>!!t&&(t.isExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:i,cardNode:r}=e,o=this.textParser.extractBodyBits(i?.body);for(const e of o)switch(e.type){case le.gap:case le.mark:t(e);break;case le.select:{const i=e;let r=!1;for(const e of i.options)r=!!t(e)||r;i.isExample=r;break}case le.highlight:{const i=e;let r=!1;for(const e of i.texts)r=!!t(e)||r;i.isExample=r;break}}if(r){for(const e of r.flashcards||[])t(e);for(const e of r.definitions||[])t(e);for(const e of r.pairs||[])t(e);for(const e of r.matrix||[]){let i=!1;for(const r of e.cells||[])i=!!t(r)||i;e.isExample=i}for(const e of r.quizzes||[]){let i=!1;for(const r of e.responses||[])i=!!t(r)||i;for(const r of e.choices||[])i=!!t(r)||i;e.isExample=i}for(const e of r.responses||[])t(e);for(const e of r.choices||[])t(e);for(const e of r.statements||[])t(e);t(r.statement);for(const e of r.questions||[])t(e)}t(e.statement);for(const i of e.responses||[])t(i);for(const i of e.choices||[])t(i);t(e)}setDefaultBitValues(e){const{bitType:t}=e;switch(t){case m.articleAi:case m.noteAi:case m.summaryAi:e.aiGenerated=this.toAstProperty(t,q.property_aiGenerated,!0,void 0)}}addVersionToParserInfo(e){const t=e.parser??{};t.version=oe.appVersion.full,e.parser=t}},gt=class{constructor(){p(this,"_buffer"),p(this,"_string",""),p(this,"endOfLineString","\n"),p(this,"lastWrite","")}get isSync(){return!0}getString(){return this._string}async open(){return this.openSync(),Promise.resolve()}async close(){try{this.closeSync()}catch(e){return Promise.reject(e)}return 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.lastWrite=e+this.endOfLineString):(this._buffer.push(this.endOfLineString),this.lastWrite=this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;let i="";for(let r=0,o=e.length;r<o;r++){const a=e[r];this._buffer.push(a),i+=a,t&&r<o-1&&(this._buffer.push(t),i+=t),this._buffer.push(this.endOfLineString),i+=this.endOfLineString}return this.lastWrite=i,this}write(e){return this._buffer?(null==e||(e&&(this.lastWrite=e),this._buffer.push(e)),this):this}writeWhiteSpace(){return this.write(" "),this}getLastWrite(){return this.lastWrite}},bt=d(u(),1),ft=(0,d(u(),1).superenum)({v1:1,v2:2}),yt={debugGenerationInline:!1},kt=class extends De{constructor(e,t){super(),p(this,"ast",new ue),p(this,"textGenerator"),p(this,"bitmarkVersion"),p(this,"options"),p(this,"mainWriter"),p(this,"partWriter"),p(this,"writer"),p(this,"prettifySpace"),p(this,"spacesAroundValues"),p(this,"spacesAroundValuesStr"),p(this,"bitType",m._error),p(this,"textFormat",T.bitmarkText),p(this,"isBodyBitmarkText",!1),p(this,"isCardAllowed",!1),p(this,"firstBit",!0),p(this,"hasCardSet",!1),p(this,"hasFooter",!1),p(this,"inTag",!0),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.write=this.write.bind(this),this.bodyBitCallback=this.bodyBitCallback.bind(this),this.bitmarkVersion=Fe.fromValue(t?.bitmarkVersion)??Oe,this.options={...yt,...t?.bitmarkOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion===Fe.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=ft.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=ft.v2),this.prettifySpace=!0===this.options.prettifyJson?2:this.options.prettifyJson||void 0,this.spacesAroundValues=this.calcSpacesAroundValues(),this.spacesAroundValuesStr=" ".repeat(this.spacesAroundValues),this.textGenerator=new Qe(this.bitmarkVersion,{writeCallback:this.write,bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.mainWriter=e,this.partWriter=new gt,this.writer=this.mainWriter,this.generateResourceHandlers(),this.generatePropertyHandlers()}async generate(e){this.resetState(),await this.writer.open(),this.walkAndWrite(e),this.writeLine(),await this.writer.close()}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.bitType=m._error,this.textFormat=T.bitmarkText,this.isBodyBitmarkText=!1,this.isCardAllowed=!1,this.firstBit=!0,this.hasCardSet=!1,this.hasFooter=!1,this.inTag=!0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,pe.bitmarkAst,this,void 0),this.writeLine()}enter_bitsValue(e,t){const i=e.value,r=Y.getBitConfig(i.bitType),o=Y.getBitResourcesConfig(i.bitType,i.resourceType);if(this.bitType=i.bitType,this.textFormat=i.textFormat??r.textFormatDefault,this.isBodyBitmarkText=this.textFormat===T.bitmarkText,this.isCardAllowed=this.calculateIsCardAllowed(),this.hasCardSet=this.haveValidCardSet(i),this.hasFooter=this.haveValidFooter(i),this.firstBit||(this.writeNL(),this.writeNL(),this.writeNL()),this.writeOPD(i.bitLevel),i.isCommented&&this.writeString("|"),this.writeTagKey(i.bitType),i.textFormat){this.isWriteTextFormat(i.textFormat,r.textFormatDefault)&&(this.writeColon(),this.writeTagKey(i.textFormat))}let a;if(r.resourceAttachmentAllowed&&i.resources&&i.resources.length>0){const e=o.comboResourceConfigKeysMap;if(o.comboResourceConfigKeysMap.size>0)for(const t of e.keys())a=J(t);else a=i.resources[0].type}return a&&(this.writeAmpersand(),this.writeTagKey(a)),this.writeCL(),!0}exit_bitsValue(e,t){this.firstBit=!1}enter_internalComment(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;for(let e=0;e<i.length;e++){const r=i[e];this.writeNL(),this.writeProperty("internalComment",r,t,{format:k.plainText,array:!0})}return!1}enter_groupTag(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;for(const e of i){const{name:i,tags:r}=e;if(this.writeNL(),this.writeProperty("groupTag",i,t,{format:k.plainText,writeEmpty:!0}),r&&r.length>0)for(const e of r)this.writeProperty("tag",e,t,{format:k.plainText,writeEmpty:!0})}return!1}enter_labelTrue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const o=r?.value;if(o){const e=""!=i,r=o.labelFalse&&""!=o.labelFalse;(e||r)&&this.writeNL(),e&&this.writeProperty("labelTrue",i,t,{format:k.plainText}),r&&this.writeProperty("labelFalse",o.labelFalse,t,{format:k.plainText})}return!1}enter_labelFalse(e,t){return!0}enter_imageSource(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const{url:o,mockupId:a,size:n,format:s,trim:l}=i;return this.writeNL(),this.writeProperty("imageSource",o,t,{format:k.plainText}),o&&(a&&this.writeProperty("mockupId",a,t,{format:k.plainText}),n&&this.writeProperty("size",n,t,{format:k.plainText}),s&&this.writeProperty("format",s,t,{format:k.plainText}),nt.isBoolean(l)&&this.writeProperty("trim",l,t,{format:k.plainText})),!1}enter_technicalTerm(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const{technicalTerm:o,lang:a}=i;return this.writeNL(),this.writeProperty("technicalTerm",o,t,{format:k.plainText}),null!=a&&this.writeProperty("lang",a,t,{format:k.plainText}),!1}enter_servings(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const{servings:o,unit:a,unitAbbr:n,decimalPlaces:s,disableCalculation:l,hint:c}=i;return this.writeNL(),this.writeProperty("servings",o,t,{format:k.plainText}),null!=a&&this.writeProperty("unit",a,t,{format:k.plainText}),null!=n&&this.writeProperty("unitAbbr",n,t,{format:k.plainText}),null!=s&&this.writeProperty("decimalPlaces",s,t,{format:k.plainText}),null!=l&&this.writeProperty("disableCalculation",l,t,{format:k.plainText}),null!=c&&(this.writeOPQ(),this.writeTextOrValue(c,T.plainText,he.tag),this.writeCL()),!1}enter_person(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const{name:o,title:a,avatarImage:n}=i;return this.writeNL(),this.writeProperty("person",o,t,{format:k.plainText}),a&&this.writeProperty("title",a,t,{format:k.plainText}),n&&this.writeResource(D.image,n.image.src),!1}enter_text(e,t){const i=this.getParentNode(t);return!i||i.key!==pe.term&&i.key!==pe.definition&&i.key!==pe.alternativeDefinitionsValue&&i.key!==pe.question&&i.key!==pe.answer&&i.key!==pe.alternativeAnswersValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body)),!1)}leaf_text(e,t){const i=this.getParentNode(t);return!i||i.key!==pe.term&&i.key!==pe.definition&&i.key!==pe.alternativeDefinitionsValue&&i.key!==pe.question&&i.key!==pe.answer&&i.key!==pe.alternativeAnswersValue&&i.key!==pe.reason||(O.isString(e.value)&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body)),!1)}enter_icon(e,t){const i=e.value,r=this.getParentNode(t);return!r||(r.key!==pe.term&&r.key!==pe.definition&&r.key!==pe.alternativeDefinitionsValue&&r.key!==pe.question&&r.key!==pe.answer&&r.key!==pe.alternativeAnswersValue||(this.writeNL(),this.writeResource(D.icon,i.image.src)),!0)}leaf_iconValue(e,t){return this.writeNL(),this.writeProperty("icon",e.value,t,{format:k.plainText}),!1}enter_ratingLevelStart(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enter_ratingLevelEnd(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enterRatingLevelStartEndCommon(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;const{level:o,label:a}=i,n=e.key===pe.ratingLevelStart?"ratingLevelStart":"ratingLevelEnd";return this.writeNL(),this.writeProperty(n,o,t,{format:k.plainText}),a&&this.writeProperty("label",a,t,{format:k.bitmarkText}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.markConfig)return!0;const{mark:o,color:a,emphasis:n}=i;return o&&(this.writeNL(),this.writeProperty("mark",o,t,{format:k.plainText}),a&&this.writeProperty("color",a,t,{format:k.plainText}),n&&this.writeProperty("emphasis",n,t,{format:k.plainText})),!1}enter_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:k.plainText})),!1}leaf_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:k.plainText})),!1}enter_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:k.plainText})),!1}leaf_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:k.plainText})),!1}leaf_reasonableNumOfChars(e,t){this.writeNL(),this.writeProperty("reasonableNumOfChars",e.value,t,{format:k.plainText})}leaf_additionalSolutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===pe.questionsValue&&(this.writeNL(),this.writeProperty("additionalSolutions",e.value,t,{format:k.plainText,array:!0,writeEmpty:!0}))}enter_item(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.lead)||(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i,T.bitmarkText,he.tag),this.writeCL(),!0))))}enter_lead(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,T.bitmarkText,he.tag),this.writeCL(),!0)))}enter_pageNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i??"",T.bitmarkText,he.tag),this.writeCL(),!0))}enter_marginNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.pageNumber??"",T.bitmarkText,he.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,T.bitmarkText,he.tag),this.writeCL(),!0)}enter_body(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue&&i?.key!==pe.cardBitsValue)return!0;this.inTag=!1;const r=e.value;if(this.textFormat===T.json){const e=r.body??null;if(Array.isArray(e)||W.isObject(e)){const t=JSON.stringify(e,null,this.prettifySpace);t&&(this.writePlainTextDivider(),this.writeNL(),this.writeTextOrValue(t,T.plainText,he.body))}}else if(this.isBodyBitmarkText){const e=!(this.hasCardSet||this.hasFooter);this.writeNL();const t=Array.isArray(r.body)?r.body:[];this.writeTextOrValue(t,this.textFormat,he.body,{plainTextDividerAllowed:e})}else{this.writePlainTextDivider(),this.writeNL();const e=O.isString(r.body)?r.body:"";this.writeTextOrValue(`${e}`,T.plainText,he.body)}return!1}exit_body(e,t){this.inTag=!0}bodyBitCallback(e,t,i){const r=pe.fromValue(e.type)??pe.bodyBit;return this.ast.walk(e,r,this,void 0),""}enter_gap(e,t){const i=e.value;if(i.solutions&&0===i.solutions.length)this.writeOPU(),this.writeCL();else for(const e of i.solutions)this.writeOPU(),this.writeTextOrValue(e,T.plainText,he.tag),this.writeCL();return!0}enter_mark(e,t){const i=e.value;return this.writeOPE(),this.writeTextOrValue(i.solution,T.plainText,he.tag),this.writeCL(),!0}enter_select(e,t){return!0}enter_highlight(e,t){return!0}enter_footer(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return!0;const r=e.value;return this.textFormat===T.json||r.footer&&r.footer.length>0&&this.isBodyBitmarkText&&(this.writeNL(),this.writeTextOrValue("==== footer ====",T.plainText,he.body),this.writeNL(),this.writeTextOrValue(r.footer,this.textFormat,he.body,{plainTextDividerAllowed:!0})),!1}enter_solutions(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return!0;const r=e.value;return r&&0===r.length&&(this.writeOPU(),this.writeCL()),!0}leaf_solution(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return;const r=e.value,o=this.getParentNode(t,2)?.value;o?.type===le.mark&&r&&(this.writeOPE(),this.writeTextOrValue(r,T.plainText,he.tag),this.writeCL())}leaf_mark(e,t){const i=t[0];if(i?.key!==pe.mark)return;const r=e.value;r&&this.writeProperty("mark",r,t,{format:k.plainText})}enter_optionsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,T.plainText,he.tag),this.writeCL(),!0}enter_textsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,T.plainText,he.tag),this.writeCL(),!0}enter_cardNode(e,t){return!this.isCardAllowed||(this.writeCardSetStart(),!0)}between_cardNode(e,t,i,r){this.isCardAllowed&&this.writeCardSetCardDivider()}exit_cardNode(e,t){this.isCardAllowed&&(this.writeCardSetEnd(),this.options.cardSetVersion,ft.v1)}enter_elements(e,t){}between_elements(e,t,i,r){this.writeCardSetVariantDivider()}between_flashcards(e,t,i,r){this.writeCardSetCardDivider()}between_flashcardsValue(e,t,i,r){this.isCardAllowed&&(i.key===pe.answer?this.writeCardSetSideDivider():i.key===pe.alternativeAnswers&&0!==i.value?.length&&this.writeCardSetVariantDivider())}between_alternativeAnswers(e,t){this.writeCardSetVariantDivider()}between_alternativeDefinitions(e,t){this.writeCardSetVariantDivider()}enter_statements(e,t){}between_statements(e,t,i,r){this.isOfBitType(m.trueFalse1)||this.writeCardSetCardDivider()}enter_statementsValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.statement,T.plainText,he.tag),this.writeCL(),!0}enter_choicesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect||i.requireReason?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.choice,T.plainText,he.tag),this.writeCL(),!0}enter_responsesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.response,T.plainText,he.tag),this.writeCL(),!0}between_feedbacks(e,t,i,r){this.writeCardSetCardDivider()}enter_reason(e,t){return this.writeCardSetSideDivider(),!0}enter_quizzes(e,t){}between_quizzes(e,t,i,r){this.writeCardSetCardDivider()}enter_heading(e,t){}between_heading(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_forValues(e,t){}between_forValues(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_pairs(e,t){}between_pairs(e,t,i,r){this.writeCardSetCardDivider()}enter_keyAudio(e,t){const i=e.value;return this.writeNL(),this.writeResource(D.audio,i.audio.src),!1}enter_keyImage(e,t){const i=e.value;return this.writeNL(),this.writeResource(D.image,i.image.src),!1}enter_matrix(e,t){}between_matrix(e,t,i,r){this.writeCardSetCardDivider()}enter_values(e,t){this.isCardAllowed&&this.writeCardSetSideDivider()}between_values(e,t,i,r){this.isCardAllowed&&this.writeCardSetVariantDivider()}between_pronunciationTable(e,t,i,r){const o=this.getParentNode(r);o?.key===pe.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_table(e,t,i,r){const o=this.getParentNode(r);o?.key===pe.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_data(e,t,i,r){const o=this.getParentNode(r);o?.key!==pe.table&&o?.key!==pe.pronunciationTable||this.writeCardSetCardDivider()}between_columns(e,t,i,r){const o=this.getParentNode(r),a=o?.key;a!==pe.table&&a!==pe.captionDefinitionList||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL()}enter_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,T.bitmarkText,he.tag),this.writeCL()}between_dataValue(e,t,i,r){const o=this.getParentNode(r,2);o?.key!==pe.table&&o?.key!==pe.pronunciationTable||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_dataValueValue(e,t){const i=this.getParentNode(t,3);i?.key===pe.table&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body))}enter_dataValueValue(e,t){const i=this.getParentNode(t,3);if((i?.key===pe.table||i?.key===pe.pronunciationTable)&&e.value){if(i?.key===pe.pronunciationTable){const t=e.value;return t.title&&(this.writeNL(),this.writeOP(),this.writeHash(),this.writeTextOrValue(t.title,T.bitmarkText,he.tag),this.writeCL()),t.audio&&(this.writeNL(),this.writeResource(D.audio,t.audio.audio.src)),t.body&&(this.writeNL(),this.writeTextOrValue(t.body,this.textFormat,he.body)),!1}this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body)}}between_captionDefinitionList(e,t,i,r){const o=this.getParentNode(r);o?.key===pe.cardNode&&this.writeCardSetCardDivider()}leaf_term(e,t){const i=this.getParentNode(t);return i?.key!==pe.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body)),!1)}leaf_definition(e,t){const i=this.getParentNode(t);return i?.key!==pe.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body)),!1)}between_definitions(e,t,i,r){const o=this.getParentNode(r);o?.key!==pe.cardNode&&o?.key!==pe.captionDefinitionList||this.writeCardSetCardDivider()}between_definitionsValue(e,t,i,r){const o=this.getParentNode(r);o?.key===pe.definitions&&this.isCardAllowed&&(i.key===pe.definition?this.writeCardSetSideDivider():i.key===pe.alternativeDefinitions&&i.value?.length>0&&this.writeCardSetVariantDivider())}enter_questions(e,t){}between_questions(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredients(e,t){}between_ingredients(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredientsValue(e,t){const i=e.value;return null!=i.title&&(this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(i.title,T.bitmarkText,he.tag),this.writeCL()),null!=i.ingredient&&(this.writeNL(),i.checked?this.writeOPP():this.writeOPM(),this.writeCL(),null!=i.quantity&&(this.writeOPB(),this.writeTextOrValue(`${i.quantity}`,T.plainText,he.tag),this.writeCL()),null!=i.unit&&this.writeProperty("unit",i.unit,t,{format:k.plainText}),null!=i.unitAbbr&&this.writeProperty("unitAbbr",i.unitAbbr,t,{format:k.plainText}),null!=i.decimalPlaces&&this.writeProperty("decimalPlaces",i.decimalPlaces,t,{format:k.plainText}),i.disableCalculation&&this.writeProperty("disableCalculation",!0,t,{format:k.plainText}),this.writeNL(),this.writeTextOrValue(i.ingredient,this.textFormat,he.body)),!0}enter_botResponses(e,t){}between_botResponses(e,t,i,r){this.writeCardSetCardDivider()}enter_cardBits(e,t){}between_cardBits(e,t,i,r){this.writeCardSetCardDivider()}leaf_response(e,t){const i=this.getParentNode(t);i?.key===pe.botResponsesValue&&(this.writeNL(),this.writeOPB(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL())}leaf_reaction(e,t){const i=this.getParentNode(t);i?.key===pe.botResponsesValue&&(this.writeNL(),this.writeProperty("reaction",e.value,t,{format:k.plainText}))}leaf_feedback(e,t){const i=this.getParentNode(t);if(i?.key!==pe.botResponsesValue)return;const r=e.value;r&&(this.writeNL(),this.writeTextOrValue(r,this.textFormat,he.body))}enter_backgroundWallpaper(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}enter_imagePlaceholder(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}exit_imagePlaceholder(e,t){}enter_posterImage(e,t){const i=this.getParentNode(t);if(i?.key===pe.bitsValue){const i=e.value;i&&this.writeProperty("posterImage",i,t,{format:k.plainText})}else{const i=e.value;i&&i.src&&this.writeProperty("posterImage",i.src,t,{format:k.plainText})}return!0}enter_thumbnails(e,t){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let r=0;r<i.length&&r!==e.length;r++){const o=i[r],a=e[r];this.writeProperty(a,o.src,t,{format:k.plainText})}}return!1}leaf_level(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return!0;if(!Y.isOfBitType(this.bitType,[m.chapter]))return!0;const r=e.value,o=i?.value;if(r>0&&null==o.title){this.writeNL(),this.writeOP();for(let e=0;e<+r;e++)this.writeHash();this.writeCL()}return!1}enter_title(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return!0;const r=e.value,o=i?.value,a=o.level||1;if(a&&r){this.writeNL(),this.writeOP();for(let e=0;e<+a;e++)this.writeHash();this.writeTextOrValue(r,T.bitmarkText,he.tag),this.writeCL()}return!1}enter_subtitle(e,t){const i=this.getParentNode(t);if(i?.key!==pe.bitsValue)return!0;const r=e.value;if(r){this.writeNL(),this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeTextOrValue(r,T.bitmarkText,he.tag),this.writeCL()}return!1}enter_book(e,t){}enter_bookValue(e,t){const i=e.value;return i&&(this.writeNL(),this.writeProperty("book",i.book,t,{format:k.plainText,writeEmpty:!0}),i.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(i.reference,T.plainText,he.tag),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(i.referenceEnd,T.plainText,he.tag),this.writeCL()))),!1}leaf_book(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(this.writeNL(),this.writeProperty("book",e.value,t,{format:k.plainText,writeEmpty:!0}),r.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(r.reference,T.plainText,he.tag),this.writeCL(),r.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(r.referenceEnd,T.plainText,he.tag),this.writeCL())))}leaf_anchor(e,t){e.value&&(this.writeNL(),this.writeOPDANGLE(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL())}leaf_reference(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(r.book||(this.writeNL(),this.writeOPRANGLE(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL()))}enter_hint(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPQ(),this.writeTextOrValue(i,T.bitmarkText,he.tag),this.writeCL()),!1}enter_instruction(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPB(),this.writeTextOrValue(i,T.bitmarkText,he.tag),this.writeCL()),!1}leaf_lang(e,t){e.value&&(this.writeNL(),this.writeProperty("lang",e.value,t,{format:k.boolean}))}enter_refAuthor(e,t){e.value&&(this.writeNL(),this.writeProperty("refAuthor",e.value,t,{format:k.plainText,array:!0}))}leaf_refBookTitle(e,t){e.value&&(this.writeNL(),this.writeProperty("refBookTitle",e.value,t,{format:k.plainText,array:!0}))}enter_refPublisher(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublisher",e.value,t,{format:k.plainText,array:!0}))}leaf_refPublicationYear(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublicationYear",e.value,t,{format:k.plainText}))}leaf_citationStyle(e,t){e.value&&(this.writeNL(),this.writeProperty("citationStyle",e.value,t,{format:k.plainText}))}leaf_isExample(e,t){if(!e.value)return;const i=this.getParentNode(t),r=i?.value.example??null;null!=r&&""!==r&&(this.writeNL_IfNotChain(t),this.writeOPA(),this.writeString("example"),this.writeColon(),!0===r?this.writeString(" true "):!1===r?this.writeString(" false "):Array.isArray(r)?this.writeTextOrValue(r,T.bitmarkText,he.tag):this.writeTextOrValue(r,T.plainText,he.tag),this.writeCL())}leaf_elementsValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body))}leaf_solutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===pe.bitsValue&&null!=e.value&&(this.writeOPU(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL())}leaf_prefix(e,t){e.value&&(this.writeOPPRE(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL())}leaf_postfix(e,t){e.value&&(this.writeOPPOST(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL())}leaf_isCaseSensitive(e,t){this.writeProperty("isCaseSensitive",e.value,t,{format:k.boolean,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0})}leaf_forKeys(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL()}leaf_forValues(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL()}leaf_forValuesValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,T.plainText,he.tag),this.writeCL()}leaf_key(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body))}leaf_valuesValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body))}leaf_question(e,t){const i=this.getParentNode(t);i?.key!==pe.questionsValue&&i?.key!==pe.flashcardsValue||e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,he.body))}leaf_src1x(e,t){this.writeProperty("src1x",e.value,t,{format:k.plainText})}leaf_src2x(e,t){this.writeProperty("src2x",e.value,t,{format:k.plainText})}leaf_src3x(e,t){this.writeProperty("src3x",e.value,t,{format:k.plainText})}leaf_src4x(e,t){this.writeProperty("src4x",e.value,t,{format:k.plainText})}leaf_width(e,t){this.writeProperty("width",e.value,t,{format:k.plainText})}leaf_height(e,t){this.writeProperty("height",e.value,t,{format:k.plainText})}leaf_alt(e,t){this.writeProperty("alt",e.value,t,{format:k.plainText})}leaf_zoomDisabled(e,t){Y.isOfBitType(this.bitType,[m.imageSeparator,m.pageBanner,m.imagesLogoGrave,m.prototypeImages])?this.writeProperty("zoomDisabled",e.value,t,{format:k.boolean,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0}):this.writeProperty("zoomDisabled",e.value,t,{format:k.boolean,writeEmpty:!0,ignoreFalse:!0,ignoreTrue:!1})}leaf_license(e,t){this.writeProperty("license",e.value,t,{format:k.plainText})}leaf_copyright(e,t){this.writeProperty("copyright",e.value,t,{format:k.plainText})}leaf_provider(e,t){}leaf_showInIndex(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("showInIndex",e.value,t,{format:k.boolean,ignoreFalse:!0}))}enter_caption(e,t){const i=e.value;return this.writeNL_IfNotChain(t),this.writeProperty("caption",i,t,{format:k.bitmarkText}),!1}leaf_search(e,t){const i=e.value;i&&(this.writeNL_IfNotChain(t),this.writeProperty("search",i,t,{format:k.plainText}))}leaf_duration(e,t){const i=this.getParentNode(t);i?.key===pe.bitsValue&&this.writeNL(),this.writeProperty("duration",e.value,t,{format:k.plainText})}leaf_mute(e,t){this.writeProperty("mute",e.value,t,{format:k.boolean})}leaf_autoplay(e,t){this.writeProperty("autoplay",e.value,t,{format:k.boolean})}leaf_allowSubtitles(e,t){this.writeProperty("allowSubtitles",e.value,t,{format:k.boolean})}leaf_showSubtitles(e,t){this.writeProperty("showSubtitles",e.value,t,{format:k.boolean})}generateResourceHandlers(){for(const e of D.keys()){if(e===D.keyFromValue(D.unknown))continue;const t=`enter_${e}`;"function"!=typeof this[t]&&(this[t]=(e,t)=>{const i=e.value;if(null==i)return!1;const r=this.getParentNode(t);if(r?.key!==pe.resourcesValue)return!0;const o=D.fromValue(r.value.__typeAlias)??D.fromValue(r.value.type);if(!o)return!1;const a=i.url||i.src||i.body||"";return this.writeNL(),this.writeResource(o,a),!0},this[t]=this[t].bind(this))}}generatePropertyHandlers(){for(const e of N.values()){const t=$(e),i=[`enter_${t}`,`leaf_${t}`];for(const r of i)"function"!=typeof this[r]&&"example"!==t&&(this[r]=(t,i)=>{if(null==t.value)return;const r=this.getParentNode(i);if(r?.key!==pe.bitsValue)return;const o=this.getBitType(i);if(!o)return;const a=Y.getBitConfig(o),n=Y.getTagConfigForTag(a.tags,e);n&&(this.writeNL_IfNotChain(i),this.writeProperty(n.tag,t.value,i,{format:n.format??k.plainText,array:n.array??!1,writeEmpty:!0,ignoreFalse:"false"===n.defaultValue,ignoreTrue:"true"===n.defaultValue}))},this[r]=this[r].bind(this))}}getBitType(e){for(const t of e)if(t.key===pe.bitsValue){const e=t.value;return e?.bitType}}isChain(e){const t=this.getParentNode(e);return t?.key!==pe.bitsValue&&(t?.key!==pe.cardBitsValue&&(t?.key!==pe.feedbacksValue&&(t?.key!==pe.quizzesValue&&(t?.key!==pe.pairsValue&&(t?.key!==pe.matrixValue&&(t?.key!==pe.definitionsValue&&(t?.key!==pe.questionsValue&&t?.key!==pe.reason)))))))}haveValidCardSet(e){const t=Y.getBitConfig(e.bitType);return!!t&&!!t.cardSet}haveValidFooter(e){const t=e.footer;if(!t)return!1;return e.textFormat!==T.json&&(!!(t.footer&&t.footer.length>0)&&!!this.isBodyBitmarkText)}calcSpacesAroundValues(){const e=this.options.spacesAroundValues;let t=1;return null!=e&&(t=!0===e?1:!1===e?0:e),t=Math.min(Math.max(t,0),10),t}writeTagKey(e){null!=e&&this.write(Ve.breakscape(`${e}`,{format:T.plainText,location:he.tag}))}writeTextOrValue(e,t,i,r){const o=i===he.tag,a="string"==typeof e?e:void 0,n=Array.isArray(e)?e:void 0,s=o?this.spacesAroundValuesStr:"",l=t===T.bitmarkText?t:T.plainText,c=e=>o?`${s}${e}${s}`:e,d=e=>{const t=this.writer;this.writer=this.partWriter,this.partWriter.openSync(),e(),this.partWriter.closeSync();const i=this.partWriter.getString().trim();return this.writer=t,i};if(null!=a){const e=()=>this.write(Ve.breakscape(a,{format:l,location:i}));if(o){const t=d(e);t&&this.write(c(t))}else e();return}if(null!=n){const e=()=>this.textGenerator.generateSync(n,t,i,r);if(o){const t=d(e);t&&this.write(c(t))}else e()}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(e){this.write(`[${".".repeat(e)}`)}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(){0===this.spacesAroundValues&&this.writer.getLastWrite().endsWith("^")?this.write(" ]"):this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeSpacesAroundValues(){this.write(this.spacesAroundValuesStr)}writePlainTextDivider(){this.writeNL(),this.write("==== text ====")}writeCardSetStart(){this.writeNL(),this.options.cardSetVersion===ft.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.writeNL(),this.options.cardSetVersion===ft.v1&&this.write("===")}writeCardSetCardDivider(){this.writeNL(),this.options.cardSetVersion===ft.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.writeNL(),this.options.cardSetVersion===ft.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.writeNL(),this.options.cardSetVersion===ft.v1?this.write("--"):this.write("++")}writeNL_IfNotChain(e){this.isChain(e)||this.writeNL()}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writePropertyStyleResource(e,t,i=!1){if(e&&t){const r=t[D.keyFromValue(t.type)??""],o=r&&(r.src||r.url||r.body)||"";i?this.writeOPA():this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(o,T.plainText,he.tag),t.type,D.article,this.writeCL()}}writeResource(e,t){e&&(this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,T.plainText,he.tag),D.article,this.writeCL())}writeProperty(e,t,i,r){let o;if(void 0!==t){const a=r.format===k.bitmarkText;if(a){if(!r.writeEmpty&&a&&this.isEmptyText(t))return;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,T.bitmarkText,he.tag),this.writeCL()}else if(o=Array.isArray(t)?t:[t],o.length>0){r.array||(o=o.slice(o.length-1));let t=0;for(const a of o)if(void 0!==a){if(r.ignoreFalse&&!1===a)continue;if(r.ignoreTrue&&!0===a)continue;if(!r.writeEmpty&&""===a)continue;t>0&&this.writeNL_IfNotChain(i),this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${a}`,T.plainText,he.tag),this.writeCL(),t++}}}}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}isEmptyText(e){return!e||(!Array.isArray(e)||0===e.length)}isWriteTextFormat(e,t){return!!(!(T.fromValue(e)===t)||this.options.explicitTextFormat)}calculateIsCardAllowed(){return this.isBodyBitmarkText&&!this.isOfBitType1()}isOfBitType1(){return this.isOfBitType([m.trueFalse1,m.multipleChoice1,m.multipleResponse1])}isOfBitType(e){return Y.isOfBitType(this.bitType,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}},Tt=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new gt,this.generator=new kt(this.writer,e)}async generate(e){return await this.generator.generate(e),this.writer.getString()}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}},vt={},xt=class extends De{constructor(e,t){super(),p(this,"ast",new ue),p(this,"textGenerator"),p(this,"bitmarkVersion"),p(this,"textParserVersion"),p(this,"textParser",new at),p(this,"options"),p(this,"jsonPrettifySpace"),p(this,"writer"),p(this,"json",[]),p(this,"bitWrapperJson",{}),p(this,"bitJson",{}),p(this,"textDefault",Ve.EMPTY_STRING),p(this,"bodyDefault",Ve.EMPTY_STRING),p(this,"bodyJson",this.bodyDefault),p(this,"listItem"),p(this,"placeholderIndex",0),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.bodyBitCallback=this.bodyBitCallback.bind(this),this.bitmarkVersion=Fe.fromValue(t?.bitmarkVersion)??Oe,this.textParserVersion=this.textParser.version(),this.options={...vt,...t?.jsonOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===Fe.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.textGenerator=new Qe(Fe.v2,{bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.writer=e,this.generatePropertyHandlers()}async generate(e){this.resetState(),await this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),await 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?Ve.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?Ve.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.listItem=void 0,this.placeholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,pe.bitmarkAst,this,void 0)}enter_bitmarkAst(e,t){this.json=[]}exit_bitmarkAst(e,t){this.options.textAsPlainText&&this.convertAllBitmarkTextsToStringsForPlainText(this.json),this.removeTemporaryProperties(this.json)}enter_bitsValue(e,t){const i=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(i),this.bitWrapperJson.bit=this.bitJson;const r=Y.getBitConfig(i.bitType),o=this.getTextFormat(t),a=!!r.rootExampleType,n=r.rootExampleType===b.boolean;if(a){let e;n?(e=!0,Y.isOfBitType(i.bitType,m.trueFalse1)&&void 0!==i.cardNode?.statement?.isCorrect&&(e=i.cardNode.statement.isCorrect)):e="true";const t=this.toExample(i,{defaultExample:e,isBoolean:n,textFormat:o});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else i.isExample&&(this.bitJson.isExample=!0);this.placeholderIndex=0}exit_bitsValue(e,t){const i=this.bitJson.isExample,r=this.bitJson.example;delete this.bitJson.isExample,delete this.bitJson.example,this.bitJson.isExample=i,this.bitJson.example=r,this.cleanBitJson(this.bitJson)}enter_imageSource(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_person(e,t){const i=this.getBitType(t);let r="person";return Y.isOfBitType(i,m.conversationLeft1)&&(r="partner"),this.standardHandler(e,t,pe.bitsValue,{array:!1,keyOverride:r})}enter_ratingLevelStart(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_ratingLevelEnd(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_productId(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==pe.bitsValue)return!0;return this.getBitType(t)===m.module?this.addProperty(this.bitJson,"productId",i,{array:!0}):i.length>0&&this.addProperty(this.bitJson,"productId",i[i.length-1],{array:!1}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);return r?.key!==pe.markConfig||(this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(i),!1)}enter_item(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_lead(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_pageNumber(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_marginNumber(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_hint(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_instruction(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_title(e,t){return this.standardHandler(e,t,[pe.bitsValue,pe.cardNode],{array:!0})}enter_subtitle(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_caption(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}enter_width(e,t){let i=e.value;const r=this.getBitType(t),o=this.getParentNode(t);return o?.key===pe.bitsValue&&Y.isOfBitType(r,m.extractorBlock)&&(i=st.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_height(e,t){let i=e.value;const r=this.getBitType(t),o=this.getParentNode(t);return o?.key===pe.bitsValue&&Y.isOfBitType(r,m.extractorBlock)&&(i=st.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_extraProperties(e,t){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let i=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(i=`_${e}`),this.addProperty(this.bitJson,i,t,{array:!0})}}enter_cardBitsValue(e,t){const i=e.value,r=this.getBitType(t);if(!r)return;let o;if(r===m.bookReferenceList){this.bitJson.bookReferences||(this.bitJson.bookReferences=[]);const e={};this.addProperty(e,"lang",i.lang,{array:!1}),this.addProperty(e,"refAuthor",i.refAuthor??[],{array:!0}),this.addProperty(e,"refBookTitle",i.refBookTitle??[],{array:!1}),this.addProperty(e,"refPublisher",i.refPublisher??[],{array:!0}),this.addProperty(e,"refPublicationYear",i.refPublicationYear??[],{array:!1}),this.addProperty(e,"citationStyle",i.citationStyle??[],{array:!1}),this.bitJson.bookReferences.push(e)}else r===m.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),o=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),o=this.bitJson.listItems),this.listItem={item:i.item??[],lead:i.lead??[],hint:i.hint??[],instruction:i.instruction??[],body:this.bodyDefault},o.push(this.listItem)}exit_cardBitsValue(e,t){this.listItem=void 0}enter_body(e,t){const i=e.value,r=this.getParentNode(t);if(!r)return!1;const o=this.getTextFormat(t),a=o===T.bitmarkText;if(this.bodyJson=i.body,r.key===pe.bitsValue){this.bitJson.body=this.bodyJson;const e=a&&this.isBitmarkText(this.bodyJson);if(this.options.textAsPlainText&&e){const e=this.textGenerator.generateSync(this.bodyJson,o,he.body,{noBreakscaping:!0});this.bitJson.body=(e??"").trim()}else e&&(this.bitJson.body=this.moveBodyBitPropertiesToAttrs(this.bodyJson))}else r.key===pe.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson);return!1}bodyBitCallback(e,t,i){const r=`{${this.placeholderIndex}}`;return this.placeholderIndex++,this.bitJson.placeholders=this.bitJson.placeholders??{},this.bitJson.placeholders[r]=e,r}moveBodyBitPropertiesToAttrs(e,t=0){if(0===t)e=structuredClone(e);else if(t>5e3)throw new Error("Recursion limit exceeded");for(const i of e)if(i.type!==le.text&&le.values().includes(i.type)){const e=i;e.attrs={};for(const[t,i]of Object.entries(e))"type"!==t&&"attrs"!==t&&(e.attrs[t]=i,delete e[t])}else Array.isArray(i.content)&&(t++,this.moveBodyBitPropertiesToAttrs(i.content,t));return e}enter_footer(e,t){return this.standardHandler(e,t,void 0,{array:!0,valueOverride:e.value.footer})}enter_elements(e,t){return this.standardHandler(e,t,void 0,{array:!0})}enter_flashcards(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0,keyOverride:"cards"})}enter_definitions(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_statement(e,t){const i=e.value,r=this.getParentNode(t);r?.key===pe.cardNode&&i&&(this.bitJson.statement=i.statement??"",this.bitJson.isCorrect=i.isCorrect??!1,this.bitJson.example=i.example,this.bitJson.isExample=i.isExample)}enter_statements(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_choices(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_responses(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_feedbacks(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_quizzes(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_heading(e,t){return this.standardHandler(e,t,void 0,{array:!1})}enter_pairs(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_matrix(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_pronunciationTable(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!1})}enter_table(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!1})}enter_questions(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_botResponses(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0,keyOverride:"responses"})}enter_ingredients(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!0})}enter_captionDefinitionList(e,t){return this.standardHandler(e,t,pe.cardNode,{array:!1})}enter_backgroundWallpaper(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_imagePlaceholder(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_resources(e,t){const i=e.value,r=this.getBitType(t),o=this.getResourceType(t);if(!i||!r)return!0;let a;const n=Y.getBitConfig(r),s=Y.getBitResourcesConfig(r,o).comboResourceConfigKeysMap;if(s.size>0)for(const[e,t]of s.entries()){const r=J(e),o={type:r,__typeAlias:r,__configKey:e};for(const e of t){const t=i.find(t=>t.__configKey===e);if(t){const e=Y.getTagConfigForTag(n.tags,t.__configKey);if(e){const i=e.jsonKey??e.tag,r=e.configKey??t.__configKey,a=t.__configKey===r?t:void 0;if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(o[i]=t)}}}a=o}else if(Y.isOfBitType(r,[m.imagesLogoGrave,m.prototypeImages])){const e=[];for(const t of i)t.type===D.image&&e.push(t);r===m.imagesLogoGrave?this.bitJson.logos=e:this.bitJson.images=e}else i.length>=1&&(a=i[0]);return this.bitJson.resource=a,!1}leaf_level(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}enter_book(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!0})}leaf_book(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}leaf_anchor(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}leaf_reference(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}leaf_referenceEnd(e,t){return this.standardHandler(e,t,pe.bitsValue,{array:!1})}leaf_markup(e,t){const i=e.value;return i&&(this.bitWrapperJson.bitmark=i),!1}enter_internalComment(e,t){return!1}enter_parser(e,t){const i=e.value,r=this.getBitType(t),o=this.getParentNode(t);if(i&&r){const{version:e,excessResources:r,warnings:a,errors:n,...s}=i,l=`${this.bitmarkVersion}`,c=this.textParserVersion;let d;if(Array.isArray(r)&&r.length>0){d=[];for(const e of r)d.push(e)}const p=this.getInternalComments(t);o?.key===pe.bitsValue&&(this.bitWrapperJson.parser={version:e,bitmarkVersion:l,textParserVersion:c,internalComments:p,...s,warnings:a,errors:n,excessResources:d},this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){for(const e of N.values()){const t=$(e),i=[`enter_${t}`,`leaf_${t}`];for(const e of i)"function"!=typeof this[e]&&"example"!==t&&(this[e]=(e,i)=>{const r=e.value;if(null==r)return;const o=this.getParentNode(i);o?.key===pe.bitsValue&&(this.bitJson[t]=r)},this[e]=this[e].bind(this))}}standardHandler(e,t,i,r){if(i){const e=Array.isArray(i)?i:[i],r=this.getParentNode(t);if(!r?.key||!e.includes(r?.key))return!0}return this.addProperty(this.bitJson,r.keyOverride??e.key,r.valueOverride??e.value,r),!1}addProperty(e,t,i,r){if(void 0!==i){let o;Array.isArray(i)||(i=[i]);const a=i;o=!r.array&&a.length>=1?a[a.length-1]:a,(r.allowNull||null!=o)&&(e[t]=o)}}toExample(e,t){const{isExample:i,example:r,__isDefaultExample:o}=e,{defaultExample:a,isBoolean:n}=t;if(!i)return{isExample:!1,example:null};let s;return s=o?n?nt.toBoolean(a):this.convertBreakscapedStringToJsonText(a,t.textFormat,he.tag):n?nt.toBoolean(r):this.convertBreakscapedStringToJsonText(r,t.textFormat,he.tag),{isExample:!0,example:s}}getBitType(e){for(const t of e)if(t.key===pe.bitsValue){const e=t.value;return e?.bitType}}getTextFormat(e){const t=this.getBitType(e);if(t){const i=Y.getBitConfig(t);for(const t of e)if(t.key===pe.bitsValue){const e=t.value;return T.fromValue(e?.textFormat)??i.textFormatDefault}}return T.bitmarkText}getResourceType(e){for(const t of e)if(t.key===pe.bitsValue){const e=t.value;return e?.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===pe.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t,i){if(!e)return"";if(!(t===T.bitmarkText))return e||"";if(this.options.textAsPlainText)return e||"";return this.textParser.toAst(e,{format:t,location:i})}concatenatePlainTextWithJsonTexts(e,t,i){if(Array.isArray(e)){if(i=i.trim()){const r=i.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:de.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&o.push({text:t,type:de.text}),e<r.length-1&&o.push({type:de.hardBreak})}const a=e[e.length-1];a&&a.type===de.paragraph?a.content=[...a.content??[],...o]:e.push({type:de.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}isBitmarkText(e){return null!=e&&(!!Array.isArray(e)&&"text"===e.__tag)}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){const t=e.textFormat;return{type:e.isCommented?m._comment:e.bitType,originalType:e.isCommented?e.bitType:void 0,format:t,bitLevel:e.bitLevel}}cleanBitJson(e){const t=Y.getBitType(e.type),i=Y.getBitConfig(t);if(null==e.originalType&&(e.originalType=void 0),e.item||(e.item=void 0),Y.isOfBitType(t,[m._error,m._comment]))delete e.format,delete e.item,delete e.lead,delete e.pageNumber,delete e.marginNumber,delete e.hint,delete e.instruction;else{let r=!1,o=!1;Y.isOfBitType(t,[m.page])?(null!=e.item&&0!==e.item?.length||delete e.item,null!=e.lead&&0!==e.lead?.length||delete e.lead,null!=e.pageNumber&&0!==e.pageNumber?.length||delete e.pageNumber,null!=e.marginNumber&&0!==e.marginNumber?.length||delete e.marginNumber,null!=e.hint&&0!==e.hint?.length||delete e.hint,null!=e.instruction&&0!==e.instruction?.length||delete e.instruction):(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.pageNumber&&(e.pageNumber=this.textDefault),null==e.marginNumber&&(e.marginNumber=this.textDefault)),null==e.body&&(e.body=this.bodyDefault),Y.isOfBitType(t,[m.article]),Y.isOfBitType(t,[m.example])&&(r=!0,o=!0),Y.isOfBitType(t,[m.multipleChoice1,m.multipleResponse1,m.multipleChoiceText,m.highlightText,m.gapText,m.gapTextInstructionGrouped,m.clozeAndMultipleChoiceText,m.sequence,m.mark,m.flashcard,m.definitionList])&&(r=!0,null==e.body&&(e.body=this.bodyDefault)),Y.isOfBitType(t,[m.sequence])&&(r=!0,o=!0,null==e.body&&(e.body=this.bodyDefault)),Y.isOfBitType(t,m.cloze)&&(r=!0,Y.isOfBitType(t,m.clozeSolutionGrouped)?(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!0)):Y.isOfBitType(t,m.clozeInstructionGrouped)&&(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!1))),Y.isOfBitType(t,[m.multipleChoice,m.multipleResponse])&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault)),Y.isOfBitType(t,m.essay)&&(r=!0,o=!0,null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="")),Y.isOfBitType(t,m.trueFalse1)&&(r=!0,o=!0,null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault)),Y.isOfBitType(t,m.trueFalse)&&(r=!0,null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault)),Y.isOfBitType(t,m.chapter)&&(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)),Y.isOfBitType(t,m.interview)&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[])),t===m.matchMatrix&&(r=!0),Y.isOfBitType(t,m.match)&&(r=!0,null==e.heading&&(e.heading={})),Y.isOfBitType(t,m.learningPathBook)&&(null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1)),Y.isOfBitType(t,m.table)&&(null==e.tableFixedHeader&&(e.tableFixedHeader=!1),null==e.tableHeaderWhitespaceNoWrap&&(e.tableHeaderWhitespaceNoWrap=!0),null==e.tableSearch&&(e.tableSearch=!1),null==e.tableSort&&(e.tableSort=!1),null==e.tablePagination&&(e.tablePagination=!1),null==e.tablePaginationLimit&&(e.tablePaginationLimit=0),null==e.tableHeight&&(e.tableHeight=0),null==e.tableWhitespaceNoWrap&&(e.tableWhitespaceNoWrap=!1),null==e.tableAutoWidth&&(e.tableAutoWidth=!0),null==e.tableResizableColumns&&(e.tableResizableColumns=!1),null==e.tableColumnMinWidth&&(e.tableColumnMinWidth=0)),Y.isOfBitType(t,m.bookReference)&&(null==e.refAuthor&&(e.refAuthor=[]),null==e.refBookTitle&&(e.refBookTitle=""),null==e.refPublisher&&(e.refPublisher=[]),null==e.refPublicationYear&&(e.refPublicationYear="")),Y.isOfBitType(t,[m.pageBanner,m.pageBuyButton,m.pageBuyButtonAlt,m.pageBuyButtonPromotion,m.pageFooter,m.pageOpenBook,m.pagePerson,m.pageProduct,m.pageProductList,m.pageProductVideo,m.pageProductVideoList,m.pageSectionFolder,m.pageSubscribe,m.pageSubpage])&&(null==e.slug&&(e.slug=""),null==e.body&&(e.body=this.bodyDefault),Y.isOfBitType(t,m.pageBuyButton)&&null==e.content2Buy&&(e.content2Buy="")),Y.isOfBitType(t,m.tocResource)&&null==e.tocResource&&(e.tocResource=[]),Y.isOfBitType(t,m.tocContent)&&null==e.tocContent&&(e.tocContent=[]),Y.isOfBitType(t,m.book)&&(null==e.maxTocChapterLevel&&(e.maxTocChapterLevel=-1),null==e.hasMarkAsDone&&(e.hasMarkAsDone=!1),null==e.processHandIn&&(e.processHandIn=!1),null==e.isPublic&&(e.isPublic=!1),null==e.chatWithBook&&(e.chatWithBook=!1),null==e.chatWithBookBrainKey&&(e.chatWithBookBrainKey="")),t!==m.articleAi&&t!==m.noteAi&&t!==m.summaryAi||null==e.aiGenerated&&(e.aiGenerated=!0),Y.isOfBitType(t,[m.articleResponsive,m.pageArticleResponsive])&&null==e.imageFirst&&(e.imageFirst=!0),Y.isOfBitType(t,m.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy="")),Y.isOfBitType(t,[m.imagesLogoGrave,m.prototypeImages])&&(t===m.imagesLogoGrave?null==e.logos&&(e.logos=[]):null==e.images&&(e.images=[])),Y.isOfBitType(t,[m.stepImageScreenshotWithPointer,m.surveyMatrix])&&(null==e.pointerTop&&(e.pointerTop=""),null==e.pointerLeft&&(e.pointerLeft=""),Y.isOfBitType(t,[m.surveyMatrix])&&null==e.buttonCaption&&(e.buttonCaption="")),Y.isOfBitType(t,[m.listItem])&&null==e.listItemIndent&&(e.listItemIndent=0),Y.isOfBitType(t,m.surveyRating)&&(null==e.ratingLevelStart&&(e.ratingLevelStart={level:0}),null==e.ratingLevelEnd&&(e.ratingLevelEnd={level:0})),Y.isOfBitType(t,m.vendorStripePricingTable)&&(null==e.stripePricingTableId&&(e.stripePricingTableId=""),null==e.stripePublishableKey&&(e.stripePublishableKey="")),Y.isOfBitType(t,m.callToAction)&&(null==e.buttonCaption&&(e.buttonCaption=""),null==e.callToActionUrl&&(e.callToActionUrl="")),Y.isOfBitType(t,m.handInFile)&&null==e.handInAcceptFileType&&(e.handInAcceptFileType=[]),Y.isOfBitType(t,m.handInSubmit)&&(null==e.handInRequirement&&(e.handInRequirement=[]),null==e.handInInstruction&&(e.handInInstruction=""),null==e.buttonCaption&&(e.buttonCaption="")),Y.isOfBitType(t,m.module)&&null==e.hasBookNavigation&&(e.hasBookNavigation=!0),Y.isOfBitType(t,m.container)&&null==e.allowedBit&&(e.allowedBit=[]),i.quizBit&&null==e.revealSolutions&&(e.revealSolutions=!1),Y.isOfBitType(t,m.platformPath)&&null==e.path&&(e.path=""),r?null==e.isExample&&(e.isExample=!1):(delete e.isExample,delete e.example),o?null==e.example&&(e.example=null):delete e.example}return e}convertAllBitmarkTextsToStringsForPlainText(e){if(!this.options.textAsPlainText)return;const t=e;for(const e in t){const i=t[e];if(this.isBitmarkText(i)){const r=this.textGenerator.generateSync(i,T.bitmarkText,he.tag,{noBreakscaping:!0});t[e]=(r??"").trim()}else"object"==typeof t[e]&&this.convertAllBitmarkTextsToStringsForPlainText(t[e])}}removeTemporaryProperties(e){const t=e;for(const e in t)e.startsWith("__")?delete t[e]:"object"==typeof t[e]&&this.removeTemporaryProperties(t[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}},_t=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new gt,this.generator=new xt(this.writer,e)}async generate(e){return await this.generator.generate(e),JSON.parse(this.writer.getString())}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}},wt=class{getSupportedBits(e){const t=e?.includeNonDeprecated??!0,i=e?.includeDeprecated??!1,r=[];for(const e of m.values()){if(e===m._error||e===m._comment)continue;const o=Y.getBitType(e),a=Y.getBitConfig(o),n=a.inheritedBitTypes.length>0?a.inheritedBitTypes:void 0;(t&&!a.deprecated||i&&a.deprecated)&&r.push({name:e,since:a.since,deprecated:a.deprecated,inheritedBitTypes:n})}return r}getSupportedBitConfigs(){const e=[];for(const t of m.values()){if(t===m._error||t===m._comment)continue;const i=Y.getBitType(t),r=Y.getBitConfig(i);e.push(r)}return e}},Ct=(0,d(u(),1).superenum)({peggy:"peggy"}),At=(0,d(u(),1).superenum)({text:"text",json:"json",pojo:"pojo"}),Bt=(0,d(u(),1).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"}),St=new mt,Pt=class{toAst(e){const t=this.preprocessJson(e),i=[];for(const e of t){const{bit:t,parser:r}=e,o=this.bitToAst(t,r?.internalComments);o&&i.push(o)}const r=i.length>0?{bits:i}:{};return St.buildBitmark(r)}preprocessJson(e){const t=[];if(O.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const i=e=>{if(this.isBitWrapper(e)){const i=e;t.push(i)}else if(this.isBit(e)){const i=e;t.push(this.bitToBitWrapper(i))}};if(Array.isArray(e))for(const t of e)i(t);else i(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 Y.getBitType(t.type)!==m._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){const{statement:i,reference:r,...o}=e,a=e.type===m._comment&&void 0!==e.originalType,n=Y.getBitType(a?e.originalType:e.type),s=Y.getBitConfig(n),l=Ne.fromValue(e.format);let c=T.fromValue(e.format)??s.textFormatDefault;l===Ne.bitmarkMinusMinus&&(c=T.bitmarkText);return St.buildBit({...o,bitType:n,bitLevel:Math.max(Math.min(e.bitLevel??1,Y.bitLevelMax),Y.bitLevelMin),textFormat:e.format,resourceType:this.getResourceType(e.resource),isCommented:a,internalComment:t,...this.processReference(r),...this.parseExample(e.example),person:e.partner??e.person,markConfig:e.marks,resources:this.processResources(n,e.resource,e.images,e.logos),body:this.processBody(e.body,e.placeholders),flashcards:e.cards,statements:this.processStatements(i,e.isCorrect,e.statements,e.example),responses:this.processResponses(n,e.responses),botResponses:this.processBotResponse(n,e.responses),cardBits:this.processListItems(e.listItems??e.sections??e.bookReferences,e.placeholders),footer:this.processFooter(e.footer)})}processStatements(e,t,i,r){const o=[];if(e){const i={statement:e??"",isCorrect:t??!1,...this.parseExample(r)};i&&o.push(i)}if(Array.isArray(i))for(const e of i)o.push(e);if(0!==o.length)return o}processResponses(e,t){if(!Y.isOfBitType(e,m.botActionResponse)&&Array.isArray(t))return t}processBotResponse(e,t){if(Y.isOfBitType(e,m.botActionResponse)&&Array.isArray(t))return t}processListItems(e,t){const i=[];if(Array.isArray(e))for(const r of e){const e={...r};e.body&&(e.body={body:e.body,placeholders:t}),e&&i.push(e)}if(0!==i.length)return i}getResourceType(e){if(e){return D.fromValue(e.type)}}processResources(e,t,i,r){const o=[];if(t&&o.push(t),Y.isOfBitType(e,[m.prototypeImages])&&Array.isArray(i))for(const e of i)e&&o.push(e);if(Y.isOfBitType(e,[m.imagesLogoGrave])&&Array.isArray(r))for(const e of r)e&&o.push(e);return o}processBody(e,t){return{body:e,placeholders:t}}processFooter(e){if(e)return{footer:e}}processReference(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}parseExample(e){if(null==e)return;if(!0===e)return{example:!0};if(!1===e)return{example:!1};const t=O.isString(e)||Array.isArray(e)?e:void 0;return t?{example:t}:{example:!!e}}},It=d(u(),1),Lt=class{constructor(e,t){p(this,"source"),p(this,"start"),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}},Et=(0,It.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:y.tag_title,Anchor:y.tag_anchor,Reference:y.tag_reference,ItemLead:y.tag_item,Instruction:y.tag_instruction,Hint:y.tag_hint,True:y.tag_true,False:y.tag_false,Gap:y.tag_gap,Mark:y.tag_mark,SampleSolution:y.tag_sampleSolution,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",BodyTextPlain:"BodyTextPlain",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain",PlainTextDivider:"PlainTextDivider",FooterDivider:"FooterDivider"}),Vt=(0,It.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"}),Nt=class{constructor(e){p(this,"cardIndex",0),p(this,"cardSideIndex",0),p(this,"cardVariantIndex",0),p(this,"parse"),p(this,"parserText"),p(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){const t=e.trim();if(this.debugPrint("RAW BIT",t),!t)return;const i=this.parserLocation()?.start??{line:1,column:1,offset:0},r=this.parse(e,{startRule:"bit",grammarSource:new Lt("bit",i)});return r.value&&(r.value.markup=t),r}handleTextFormat(e){return{type:Et.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:Et.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,key:y.fromValue(e),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:Et.Property,key:`@${Ve.unbreakscape(e,{format:T.plainText,location:he.tag})}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){const i=Ve.unbreakscape(e,{format:T.plainText,location:he.tag}),r=O.kebabToCamel(i);return{type:Et.Resource,key:`&${r}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let i=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),i=[e]}return i}handlePlainTextDivider(e){return e=this.reduceToString(e),{type:Et.PlainTextDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleFooterDivider(e){return e=this.reduceToString(e),{type:Et.FooterDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSet(e){const t=e,i={cards:[]},r={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:r,parser:o}=e;if(!t||t!==Et.Card)continue;const{cardIndex:a,cardSideIndex:n,cardVariantIndex:s,value:l}=r;let c=i.cards[a];c||(c={sides:[]},i.cards[a]=c);let d=c.sides[n];d||(d={variants:[]},c.sides[n]=d);d.variants[s]?d.variants[s].value+=l:d.variants[s]={value:l,parser:o}}i.cards=i.cards.filter(e=>e.sides.some(e=>e.variants.some(e=>0!==O.trimmedString(e.value).length)));for(const t of i.cards){const i={sides:[]};r.cards.push(i);for(const r of t.sides){const t={variants:[]};i.sides.push(t);for(const i of r.variants){let r={line:1,column:1,offset:0};if(i.parser.location){r=i.parser.location.start;const e=i.parser.text,t=e?e.length:0,o=1;r.offset+=t,r.line+=o}let o=this.parse(i.value,{startRule:"cardContent",grammarSource:new Lt("card-content",r)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:Et.CardSet,value:r,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 i=!1,r=!1,o=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===ft.v1?(i="==="===e,r="=="===e,o="--"===e):(i="===="===e,r="--"===e,o="++"===e)),i?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):r?(this.cardSideIndex++,this.cardVariantIndex=0):o&&this.cardVariantIndex++,this.isType(e,Et.Card)?e:{type:Et.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:Et.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){const t=[];let i,r;for(const o of e)switch(o.type){case Et.BodyChar:if(i){const e=`${i.value??""}${o.value??""}`;i.value=e}else i={type:Et.BodyText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case Et.CardChar:if(r){const e=`${r.value??""}${o.value??""}`;r.value=e}else r={type:Et.CardText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:i&&(t.push(i),i=void 0),r&&(t.push(r),r=void 0),t.push(o)}return i&&t.push(i),r&&t.push(r),t}isType(e,t){if(!e)return!1;const{type:i}=e;return t?Array.isArray(t)?t.indexOf(i)>=0:t===i:!!Et.fromValue(i)}reduceToArrayOfTypes(e,t,i){if(!Array.isArray(e))return[];return e.reduce((e,r,o)=>{if(null==r)return e;const{type:a,value:n}=r;if(Array.isArray(r)){const i=this.reduceToArrayOfTypes(r,t);e.push(...i)}else{if(!this.isType(r,t))return e;if(i&&Array.isArray(n)){const i=this.reduceToArrayOfTypes(n,t);e.push(...i)}else a&&e.push(r)}return e},[])}reduceToString(e){if(!Array.isArray(e))return"";return e.reduce((e,t,i)=>{if(null==t)return e;if(Array.isArray(t)){e+=this.reduceToString(t)}else e+=t;return e},[])}debugPrint(e,t){}},Rt=["----","\n==\n","\n---\n"],Ft=["==\n","--\n"],Ot=["\n==","\n--"],Dt=new class{validateBitTags(e,t){if(!t)return[];const{bitConfig:i,bitType:r,resourceType:o}=e,{tags:a,cardSet:n}=i,s={...a,...Y.getBitResourcesConfig(r,o).tags};return this.validateTagChainsRecursive(e,Vt.Bit,r,t,s,n).validated}checkBody(e,t,i,r,o){if(!o)return o;const{bitConfig:a}=e,{bodyAllowed:n}=a;return o.length>0&&!n&&e.addWarning(`Bit '${i}' should not have a body.`),o}checkBodyPart(e,t,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,i),i):i}checkFooter(e,t,i){if(!i)return i;const{bitConfig:r,bitType:o}=e,{footerAllowed:a}=r;return this.checkBodyForCommonPotentialMistakes(e,t,i),a||e.addWarning(`Bit '${o}' should not have a footer.`),i}checkCardBody(e,t,i,r,o,a,n){if(!r||!r.body)return r;const{bitConfig:s}=e;if(!s.cardSet)return r;const l=Y.getCardSetVariantConfig(i,a,n);if(!l)return r;const{bodyAllowed:c}=l;return r.bodyString.length>0&&!c&&e.addWarning(`Bit '${i}' should not have a card body at card:${o+1}, side:${a+1}, variant:${n+1}.`),r}validateTagChainsRecursive(e,t,i,r,o,a,n){if(!r)return{validated:[]};let s;const l=[...r],c=this.convertTagsToTypeKeyMap(e,t,i,o),d=(e,t,i)=>{c.set(e,{maxCount:t,minCount:i,_type:e,_tag:e,_seenCount:0})};t===Vt.Bit?(a&&d(Et.CardSet,1,0),d(Et.TextFormat,1,0),d(Et.BodyText,g.infinity,0),d(Et.BodyTextPlain,g.infinity,0),d(Et.PlainTextDivider,g.infinity,0),d(Et.FooterDivider,g.infinity,0)):t===Vt.Card&&d(Et.CardText,g.infinity,0);for(let r=0;r<l.length;r++){const o=l[r];if(!o)continue;const{type:d,key:p}=o;let u=Et.fromValue(d);if(!u)continue;let h=u;u!==Et.Property&&u!==Et.Resource||(h=p);let m=c.get(h);if(!m&&u===Et.Property){const t=p.replace(/^@/,"&");if((t===q.resource_backgroundWallpaper||t===q.resource_imagePlaceholder)&&(m=c.get(t),m)){u=Et.Resource,o.type=Et.Resource;const i=`Falling back to '[${t}]' from '[${p}]'. Replace '[${p}]' with '[&${p}]' to avoid this warning.`;e.addWarning(i)}}const{validated:g,warning:b}=this.validateSingleTag(e,t,i,o,u,m,a);u===Et.Resource&&(n=Et.Resource);let f=!0;if(!g)if(t===Vt.Chain&&n!==Et.Resource){s=o;const e=l.slice(r+1);e.length>0&&(s.chain=e),l.splice(r),f=!1}else l.splice(r,1,null);if(b&&f&&e.addWarning(b.warning??"",b.content,b.previousContent),t===Vt.Chain&&m&&m.chain&&g&&!g.chain){const e=l.slice(r+1);e.length>0&&(g.chain=e),l.splice(r+1)}if(g&&Array.isArray(g.chain)&&g.chain.length>0)if(m&&m.chain){const{validated:t,remaining:o}=this.validateTagChainsRecursive(e,Vt.Chain,i,g.chain,m.chain,void 0,g.type);t&&t.length>0?g.chain=t:g.chain=void 0,o&&l.splice(r+1,0,o)}else if(g.type!==Et.Resource){const e=g.chain[0];g.chain.length>1&&(e.chain=g.chain.slice(1)),l.splice(r+1,0,e),g.chain=void 0}}for(const t of c.values()){const{minCount:i,_seenCount:r}=t;if(null!=i&&r<i){const r=`${this.getTagSignature(t)} is required at least ${i} time(s)`;e.addWarning(r)}}return{validated:l.filter(e=>null!=e),remaining:s}}validateSingleTag(e,t,i,r,o,a,n){const{type:s,key:l}=r,c=a?this.getTagSignature(a):this.getUnknownTagSignature(s,l),d=" It will be ignored";let p,u,h="";if(a)switch(a._seenCount++,o){case Et.Property:{const{content:o,warning:n}=this.validatePropertyTag(e,t,i,a,r);p=o,u=n;break}case Et.Resource:{const{content:o,warning:n}=this.validateResourceTag(e,t,i,a,r);p=o,u=n;break}case Et.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,i,a,r,n);p=t,u=o;break}default:{const{content:o,warning:n}=this.validateStandardTag(e,t,i,a,r);p=o,u=n}}else switch(o){case Et.Property:u={extraProperty:!0},t!==Vt.Chain&&(p=r);break;case Et.Resource:u={excessResource:!0},p=r;break;default:u={invalid:!0}}if(u){const e=a?._previous;u.invalid||u.excessResource?h=`${c} is not valid here (incorrectly chained?).${d}`:null!=u.tooMany?(h=`${c} is included more than ${u.tooMany} time(s).`,u.tooMany>0&&(h+=" The earlier ones will be ignored")):u.extraProperty?h=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:u.unexpectedCardSet?h=`${c} is not expected here.${d}`:u.unexpectedCardSideVariant&&(h=`${c} has a card / side / variant that is not expected here.${d}`),u.warning=h,u.content=p,u.previousContent=e}return a&&(a._previous=r),{validated:p,warning:u}}validateStandardTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==g.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validatePropertyTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==g.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateResourceTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==g.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateCardSet(e,t,i,r,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:a}=r,n=a;let s,l=0,c=0;for(const i of n.cards){l=0;for(const r of i.sides){c=0;for(const i of r.variants){const o=i.content;let a;const n=Y.getCardSetVariantConfig(t,l,c);if(n){a=this.validateTagChainsRecursive(e,Vt.Card,t,o,n.tags).validated}else s={unexpectedCardSideVariant:!0};a&&a.length>0?r.variants[c]={parser:i.parser,content:a}:r.variants[c]={parser:i.parser,content:[]},c++}l++}}return{content:r,warning:s}}checkBodyForCommonPotentialMistakes(e,t,i){if(!i)return;const{bitType:r}=e;for(const t of Rt)i.includes(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of Ft)i.startsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of Ot)i.endsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`)}convertTagsToTypeKeyMap(e,t,i,r){const o=new Map;for(const e of Object.values(r)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===_.tag,isProperty:e.type===_.property,isResource:e.type===_.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)o.set(e.configKey,t);else if(t.isResource)o.set(e.configKey,t);else{const i=Et.fromValue(e.tag);i&&o.set(i,t)}}return o}getTagSignature(e){switch(e._type){case _.tag:case _.property:case _.resource:return`[${e._configKey}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case Et.Property:case Et.Resource:return`[${t}]`;default:return t?`'${e}' tag '${t}'`:`'${e}' tag`}}},zt=new class{concatenatePlainTextWithAstTexts(e,t,i){if(Array.isArray(e)){if(i=i&&i.trim()){const r=i.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:de.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&o.push({text:t,type:de.text}),e<r.length-1&&o.push({type:de.hardBreak})}const a=e[e.length-1];a&&a.type===de.paragraph?a.content=[...a.content??[],...o]:e.push({type:de.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}},qt=new at,Mt=new class{process(e,t,i,r,o,a,n,s){const l=[];let c,d;const p=n.length>0?this.trimBodyParts(n):void 0,u=s?p:Dt.checkBody(e,t,i,r,p);if(r===T.json&&u){c=u.reduce((e,t)=>{if(t.type===le.text&&t.data){return e+(t.data.bodyText??"")}return e},"");try{c=JSON.parse(c)}catch(t){c=null,e.addError("Body JSON is invalid.")}}else{let e="",t="",i="",o=0;const a=e=>`[!${e}]`;if(u)for(let r=0;r<u.length;r++){const n=u[r];if(n.type===le.text){const r=n,o=r.data.bodyText;r.data.isPlain?t=Ve.concatenate(t,o):e=Ve.concatenate(e,o),i=Ve.concatenate(i,o)}else{const t=a(o);e=Ve.concatenate(e,t),l.push(n),o++}}const n=r===T.bitmarkText?qt.toAst(e,{format:r,location:he.body}):Ve.unbreakscape(e,{format:T.plainText,location:he.body}),s=Ve.unbreakscape(t,{format:T.plainText,location:he.body}),p=O.countOccurrencesAtEnd(e,"\n")+O.countOccurrencesAtStart(t,"\n");c=zt.concatenatePlainTextWithAstTexts(n,p,s),d=Ve.unbreakscape(i,{format:r,location:he.body}).trim();const h=Array.isArray(c)?c:void 0;if(h&&u){o=0;for(let e=0;e<u.length;e++){const t=u[e];if(t.type===le.text)continue;const i=t;let r;switch(t.type){case le.gap:case le.mark:case le.select:case le.highlight:r=i}r&&this.replacePlaceholderWithBodyBit(h,r,o),o++}}}return{body:c,bodyBits:l.length>0?l:void 0,bodyString:d}}buildBodyText(e,t){return{type:le.text,data:{bodyText:e,isPlain:t}}}replacePlaceholderWithBodyBit(e,t,i){const r=(e,o,a)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const i=e[t];if(r(i,e,t))return!0}else{if("bit"===e.type&&e.index===i)return o[a]=t,!0;if(e.content){if(r(e.content,e,"content"))return!0}}return!1};r(e,null,null)}trimBodyParts(e){let t=!1,i=e.reduce((e,i)=>{const r=i;if(t||r.type!==le.text)t=!0,e.push(i);else{const i=r.data.bodyText.trimStart();i&&(t=!0,r.data.bodyText=i,e.push(r))}return e},[]);return t=!1,i=i.reduceRight((e,i)=>{const r=i;if(t||r.type!==le.text)t=!0,e.unshift(i);else{const i=r.data.bodyText.trimEnd();i&&(t=!0,r.data.bodyText=i,e.unshift(r))}return e},[]),i}};function $t(e,t,i,r,o,a,n,s){const{bitConfig:l}=e;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let c={};const d=function(e,t){const i={cards:[],internalComments:[]};if(!t)return i;const{bitType:r}=e;let o=0,a=0,n=0;for(const s of t.cards){const t={no:o++,sides:[]};i.cards.push(t);for(const o of s.sides){const s={no:a++,variants:[]};t.sides.push(s);for(const l of o.variants){const{parser:o,content:c}=l,d={parser:o,no:n++};s.variants.push(d);const p=Y.getTagsConfigForCardSet(r,a,n),u=e.bitContentProcessor(Vt.Card,p,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",u),u.cardBody=Dt.checkCardBody(e,Vt.Card,r,u.cardBody,t.no,s.no,d.no),u.cardBodyStr=u.cardBody?.bodyString,d.data=u,u.internalComments&&i.internalComments.push(...u.internalComments)}n=0}a=0}return i}(e,r),p=l.cardSet?.configKey;switch(p){case v.flashcard:case v.definitionList:c=function(e,t,i){const r=[],o=[];let a,n,s,l="",c=[],d=0,p={};const u=t===m.flashcard1,h=Jt(i);for(let g=0;g<i.cards.length;g++){const b=i.cards[g];if(!h||0!==g){a=void 0,n=void 0,c=[],d=0,p={};for(const e of b.sides)for(const t of e.variants){const{cardBody:e,resources:i,...r}=t.data;p={...p,...r};const o=i&&i.length>0?i[0]:void 0,u=e?.body;0===d?(s=t,l=e?.bodyString??"",a={text:u,icon:o}):1===d?n={text:u,icon:o}:c.push({text:u,icon:o}),d++}if(0!==g&&u){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${l}'`,s);break}if(Y.isOfBitType(t,[m.flashcard])){const e={question:a,answer:n,alternativeAnswers:c,...p};e&&r.push(e)}else{const e={term:a,definition:n,alternativeDefinitions:c,...p};e&&o.push(e)}}}return{heading:h?.heading,flashcards:r.length>0?r:void 0,definitions:o.length>0?o:void 0}}(e,t,d);break;case v.elements:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;r.push(t.cardBodyStr??"")}return{elements:r.length>0?r:void 0}}(0,0,d);break;case v.statements:c=function(e,t,i,r,o){const a=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{statements:t,statement:i,...r}=e.data;if(Array.isArray(t))for(const e of t){const t={statement:e.statement??"",isCorrect:e.isCorrect,item:e.item,lead:e.lead,hint:e.hint,instruction:e.instruction,example:e.example,...r};t&&a.push(t)}}r&&a.push(r);Array.isArray(o)&&o.length>0&&a.push(...o);return{statements:a.length>0?a:void 0}}(0,0,d,o,a);break;case v.feedback:c=function(e,t,i){let r;const o=[],a=Jt(i);for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(!a||0!==e){r=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const i=t.data,{cardBody:a,cardBodyStr:n,choices:s,...l}=i;if(0===e){const e=[];if(s&&s.length>0)for(const t of s){const{__isDefaultExample:i,example:r,...o}=t,a={choice:o.choice,requireReason:o.isCorrect,__isDefaultExample:i,example:r};e.push(a)}r={...i,choices:e},r&&o.push(r)}else if(1===e){const e={text:n??"",__textAst:a?.body,...l};r&&(r.reason=e)}}}}}return{heading:a?.heading,feedbacks:o.length>0?o:void 0}}(0,0,d);break;case v.quiz:c=function(e,t,i,r,o){const a=[],n=Y.isOfBitType(t,m.multipleChoice),s=Y.isOfBitType(t,m.multipleResponse);if(!n&&!s)return{};let l,c=!1;for(const e of i.cards){c=!1,l=void 0;for(const t of e.sides)for(const e of t.variants){const{__isDefaultExample:t,example:i,...r}=e.data;if(c=!0===t||c,l=i||l,r.trueFalse&&r.trueFalse.length>0){const e=[];for(const t of r.trueFalse){const{__isDefaultExample:i,example:r,...o}=t,a=i||c,n=r||l,d={isCorrect:o.isCorrect,__isDefaultExample:a,example:n};s?d.response=o.text:d.choice=o.text,d&&e.push(d)}s?r.responses=e:r.choices=e}const o={...r,choices:r.choices,responses:r.responses,__isDefaultExample:c,__defaultExample:l};o&&a.push(o)}}if(n&&Array.isArray(r)&&r.length>0){const e={choices:r};e&&a.push(e)}if(s&&Array.isArray(o)&&o.length>0){const e={responses:o};e&&a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,d,n,s);break;case v.questions:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,i={question:t.cardBodyStr??"",...t};i&&r.push(i)}return{questions:r.length>0?r:void 0}}(0,0,d);break;case v.matchPairs:c=function(e,t,i){const r=[];let o,a,n,s,l=[],c=[],d={},p=!1;const u=Y.isOfBitType(t,m.matchMatrix),h=Jt(i,u),g=h?.isDefaultExampleCardSet??!1;let b=h?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(h&&0===e)continue;o=void 0,l=[],c=[],a=void 0,n=void 0,d={},p=!1,s=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const{cardBody:i,cardBodyStr:r,resources:u,__isDefaultExample:h,example:m,...b}=t.data;if(p=!0===h||p,s=m||s,0===e)if(Array.isArray(u)&&u.length>0){const e=u[0];e.type===D.audio?a=e:e.type===D.image&&(n=e)}else o=r;else{const e=r??"",t=i?.body;l.push(e),c.push(t),!g&&!p||s||(s=t),delete b.item,delete b.lead}d={...d,...b}}}p&&(b=void 0);const u=p||g,m=s||b,f={key:o??"",keyAudio:a,keyImage:n,values:l,__valuesAst:c,...d,__isDefaultExample:u,example:m};f&&r.push(f)}return{heading:h?.heading,pairs:r.length>0?r:void 0}}(0,t,d);break;case v.matchMatrix:c=function(e,t,i){let r,o;const a=[];let n,s,l,c,d=[],p=[],u=[],h={},m=!1,g=!1;const b=Jt(i,!0),f=b?.isDefaultExampleCardSet??!1;let y=b?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(b&&0===e)continue;r=void 0,o=void 0,d=[],p=[],u=[],m=!1,n=void 0,l=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];p=[],u=[],h={},g=!1,s=void 0,c=void 0;for(const t of i.variants){const i=t.data,{cardBody:a,cardBodyStr:d,__isDefaultExample:b,example:y,isCaseSensitive:k,...T}=i;if(g=!0===b||g,s=y||s,Object.assign(h,T),0===e)r=d,o=T,m=!0===b||m,n=y||n,l=null!=k?k:l;else{const e=d??Ve.EMPTY_STRING,t=a?.body;p.push(e),u.push(t),!f&&!g||s||(s=t),c=null!=k?k:l}}if(e>0){g&&(n=y=void 0),m&&(y=void 0);const e=g||m||f,t=s||n||y,i={values:p,__valuesAst:u,...h,__isDefaultExample:e,example:t,isCaseSensitive:c};i&&d.push(i)}}const k={key:r??Ve.EMPTY_STRING,cells:d,...o};k&&a.push(k)}return{heading:b?.heading,matrix:a.length>0?a:void 0}}(0,0,d);break;case v.pronunciationTable:c=function(e,t,i){const r=[];let o=[];for(const e of i.cards){o=[];for(const t of e.sides)for(const e of t.variants){const t=e.data,{title:i,cardBody:r,resources:a}=t,n=i&&i[1].titleAst,s=a&&a.length>0?a.find(e=>e.type===D.audio):void 0,l={title:n??[],body:r?.body??[],audio:s};o.push(l)}r.push(o)}return{pronunciationTable:{data:r}}}(0,0,d);break;case v.table:c=function(e,t,i){let r=!1;const o=[],a=[];let n=[];for(let e=0;e<i.cards.length;e++){const t=i.cards[e];r=!1,n=[];for(const i of t.sides)for(const t of i.variants){const i=t.data,{title:a,cardBody:s}=i,l=a&&a[1].titleAst;if(0===e&&null!=l&&(r=!0),r)o.push(l??[]);else{const e=s?.body??[];n.push(e)}}r||a.push(n)}return{table:{columns:o,data:a}}}(0,0,d);break;case v.botActionResponses:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{__instructionString:t,reaction:i,cardBodyStr:o,...a}=e.data,n={response:t??Ve.EMPTY_STRING,reaction:i??Ve.EMPTY_STRING,feedback:o??Ve.EMPTY_STRING,...a};n&&r.push(n)}return{botResponses:r.length>0?r:void 0}}(0,0,d);break;case v.ingredients:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{title:t,__instructionString:i,unit:o,unitAbbr:a,decimalPlaces:n,disableCalculation:s,cardBodyStr:l,cardBody:c,...d}=e.data,p=Array.isArray(t)&&t.length>0?t[t.length-1].titleString:void 0;let u=!1,h=st.asNumber(i);if(c&&c.bodyBits){const e=c.bodyBits.find(e=>e.type===le.select);e&&(h=e.__instructionString?st.asNumber(e.__instructionString):h,e.options&&e.options.length>0&&(u=e.options[0].isCorrect))}const m={title:p,checked:u,ingredient:l,quantity:h,unit:o??Ve.EMPTY_STRING,unitAbbr:a??Ve.EMPTY_STRING,decimalPlaces:n??1,disableCalculation:s,...d};m&&r.push(m)}return{ingredients:r.length>0?r:void 0}}(0,0,d);break;case v.clozeList:case v.exampleBitList:case v.bookReferenceList:c=function(e,t,i,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{cardBody:t,...i}=e.data,r={body:t,...i};r&&o.push(r)}return{cardBits:o.length>0?o:void 0}}(0,0,0,d)}return c.internalComments=d.internalComments.length>0?d.internalComments:void 0,c}function Jt(e,t=!1){let i,r,o=!1;const a=[];let n,s=!1;if(0===e.cards.length)return;const l=e.cards[0];for(let e=0;e<l.sides.length;e++){const t=l.sides[e];if(0===t.variants.length)continue;const i=t.variants[0].data,{title:c,__isDefaultExample:d,example:p}=i,u=c&&c[1].titleString;null!=u&&(o=!0),0===e?o&&(r=u,s=!0===d||s,n=p||n):o&&(a.push(u??""),s=!0===d||s,n=p||n)}if(o){let e=a;e=t?a:a.length>=1?a[a.length-1]:"",i={forKeys:r??"",forValues:e}}return i?{heading:i,isDefaultExampleCardSet:s,exampleCardSet:n}:void 0}function jt(e,t,i,r,o){const{type:a,value:n}=r,{textFormat:s}=e,l=new at,c=O.trimmedString(n);switch(a){case Et.Instruction:o.instruction=l.toAst(c,{format:s,location:he.tag}),o.__instructionString=Ve.unbreakscape(c,{format:T.bitmarkText,location:he.tag});break;case Et.Hint:o.hint=l.toAst(c,{format:s,location:he.tag}),o.__hintString=Ve.unbreakscape(c,{format:T.bitmarkText,location:he.tag});break;case Et.Anchor:o.anchor=Ve.unbreakscape(c,{format:T.bitmarkText,location:he.tag});break;case Et.Reference:o.reference=Ve.unbreakscape(c,{format:T.bitmarkText,location:he.tag});break;case Et.SampleSolution:o.sampleSolution=Ve.unbreakscape(c,{format:T.bitmarkText,location:he.tag}),o.__sampleSolutionAst=l.toAst(c,{format:s,location:he.tag}),e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",r)}}var Wt=new at,Ht=new class{process(e,t,i,r,o,a){const{textFormat:n}=e;let s;o=o.trimStart(),a=a.trimEnd();const l=!!o.trim(),c=!!a.trim();let d=0;if(l&&c&&(d=O.countOccurrencesAtEnd(o,"\n")+O.countOccurrencesAtStart(a,"\n")),o||a){const i=n===T.bitmarkText;o&&(o=Dt.checkFooter(e,t,o));const r=i?Wt.toAst(o,{format:n,location:he.body}):Ve.unbreakscape(o,{format:T.plainText,location:he.body}),l=Ve.unbreakscape(a,{format:T.plainText,location:he.body});s=zt.concatenatePlainTextWithAstTexts(r,d,l)}return s?{footer:s}:void 0}},Ut=new at;function Gt(e,t,i,r,o,a){if(t===Vt.Chain)!function(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=o.solutions,l=o.__solutionsAst;if(s&&l&&O.isString(n)){const e=O.trimmedString(n);s.push(Ve.unbreakscape(e,{format:T.bitmarkText,location:he.tag}));const t=Ut.toAst(e,{format:a,location:he.tag});l.push(t)}}(e,0,0,r,o);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const o=Y.getTagConfigForTag(i,y.fromValue(r.type)),a=[r,...r.chain??[]],n=e.bitContentProcessor(Vt.Chain,o?.chain,a);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",n);const s={type:le.gap,...n};return s}(e,0,i,r);t&&a.push(t)}}function Kt(e,t,i,r,o){t===Vt.Chain?function(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=new at,l=O.trimmedString(n);o.itemLead||(o.itemLead=[]);const c=s.toAst(l,{format:a,location:he.tag});o.itemLead.push(c)}(e,0,0,r,o):function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("item lead content",r);const a=Y.getTagConfigForTag(i,y.fromValue(r.type)),n=[r,...r.chain??[]],s=e.bitContentProcessor(Vt.Chain,a?.chain,n);e.DEBUG_CHAIN_TAGS&&e.debugPrint("item lead TAGS",s);o.itemLead=s.itemLead}(e,0,i,r,o)}function Yt(e,t,i,r,o,a){if(t===Vt.Chain)!function(e,t,i,r){const{value:o}=i;O.isString(o)&&(r.solution=O.trimmedString(o))}(0,Vt.Chain,r,o);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const o=Y.getTagConfigForTag(i,y.fromValue(r.type)),a=e.bitContentProcessor(Vt.Chain,i,[r]),n=e.bitContentProcessor(Vt.Chain,o?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",n);const{solution:s}=a,{mark:l,...c}=n,d={type:le.mark,solution:s??"",mark:Re.asSingle(l)??"",...c};return d}(e,0,i,r);t&&a.push(t)}}function Qt(e,t,i,r,o){t===Vt.Chain||function(e,t,i,r,o){const{bitConfig:a}=e;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const n=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",n);const{reference:s,referenceEnd:l}=n,c=Ve.unbreakscape(O.trimmedString(r.value),{format:T.bitmarkText,location:he.tag}),d=a.tags[q.property_book];if(d&&(d.maxCount===g.infinity||d.maxCount>1))return Array.isArray(o.book)||(o.book=[]),void o.book.push({book:c,reference:s??"",referenceEnd:l??void 0});o.book=c,o.reference=s,o.referenceEnd=l}(e,0,i,r,o)}var Xt=new at;function Zt(e,t,i,r){const{bitType:o}=e,{value:a}=i,n=a;Y.isOfBitType(o,[m.cloze,m.clozeAndMultipleChoiceText,m.multipleChoiceText,m.highlightText,m.trueFalse,m.trueFalse1,m.multipleResponse,m.multipleResponse1,m.multipleChoice,m.multipleChoice1])?function(e,t,i,r){const{bitType:o,textFormat:a}=e;let n;Array.isArray(r.trueFalse)&&r.trueFalse.length>0&&(n=r.trueFalse[r.trueFalse.length-1]??void 0);n?!0===i?(n.__isDefaultExample=!0,n.example=!!n.isCorrect):nt.isBooleanString(i)?n.example=nt.toBoolean(i):(n.__isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t)):Array.isArray(r.__solutionsAst)&&r.__solutionsAst.length>0?r.example=!0===i?r.__solutionsAst[r.__solutionsAst.length-1]??void 0:i?Xt.toAst(i,{format:a,location:he.tag}):void 0:Y.isOfBitType(o,[m.multipleChoiceText,m.highlightText,m.trueFalse,m.trueFalse1,m.multipleResponse,m.multipleResponse1])?function(e,t,i,r){if(!0===i)r.__isDefaultExample=!0,r.example=void 0;else{const o=i?Ve.unbreakscape(i,{format:T.bitmarkText,location:he.tag}):void 0;nt.isBooleanString(o)?r.example=nt.toBoolean(o):(r.__isDefaultExample=!0,r.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t))}}(e,t,i,r):Y.isOfBitType(o,[m.clozeAndMultipleChoiceText,m.multipleChoice,m.multipleChoice1])?(r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("At this level, only default [@example] is allowed, using default",t)):ei(e,t,i,r)}(e,i,n,r):Y.isOfBitType(o,m.mark)?function(e,t,i,r){r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("Only default [@example] is allowed, using default",t)}(e,i,n,r):ei(e,i,n,r)}function ei(e,t,i,r){const{textFormat:o}=e;!0===i||"true"===i?(r.__isDefaultExample=!0,r.example=void 0):r.example=i?Xt.toAst(i,{format:o,location:he.tag}):void 0}function ti(e,t,i,r,o){t===Vt.Chain?function(e,t,i,r,o){const{value:a}=r,n=Ve.unbreakscape(O.trimmedString(a),{format:T.bitmarkText,location:he.tag});o.imageSourceUrl=n}(0,0,0,r,o):function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",r);const{key:a}=r,n=Y.getTagConfigForTag(i,q.fromValue(a)),s=e.bitContentProcessor(Vt.Chain,i,[r]),l=e.bitContentProcessor(Vt.Chain,n?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",l);const{imageSourceUrl:c}=s,{mockupId:d,...p}=l;c||e.addWarning("[@imageSource] is missing the image url",r);d||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",r);const u={url:c??"",mockupId:d??"",...p};o.imageSource=u}(e,0,i,r,o)}function ii(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("person content",r);const a=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("person TAGS",a);const{propertyTitle:n,resources:s}=a,l=Ve.unbreakscape(O.trimmedString(r.value),{format:T.bitmarkText,location:he.tag}),c=O.trimmedString(n),d=function(e,t){let i;const r=[];if(t)for(const e of t.reverse())i||D.image!==e.type?r.push(e):i=e;r.length>0&&(e.parser.excessResources=r,e.addWarning(`${r.length} excess resource(s) present in the [@person] chain.`));return i}(e,s),p={name:l,title:c,avatarImage:d};o.person=p}var ri=new at;var oi=new at;function ai(e,t,i,r,o){const{value:a}=r,{key:n}=r,s=t===Vt.Chain,l=Y.getTagConfigForTag(i,N.fromValue(n)),c=l?l.configKey:void 0;let d=$(n);if(c===q.property_internalComment)return void function(e,t,i,r){if(!r.internalComments)return;const{value:o}=i,a=O.isString(o)?O.trimmedString(o):void 0;a&&r.internalComments.push(a)}(0,0,r,o);if(l){if(c===q.property_example)return void Zt(e,0,r,o);if(c===q.property_groupTag)return void function(e,t,i,r,o){const{value:a}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("groupTag content",r);const n=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("groupTag TAGS",n);const{tag:s}=n,l={name:O.trimmedString(a)??"",tags:s??[]};Array.isArray(o.groupTag)||(o.groupTag=[]),o.groupTag.push(l)}(e,0,l.chain,r,o);if(c===q.property_ratingLevelStart||c===q.property_ratingLevelEnd)return void function(e,t,i,r,o){const{textFormat:a}=e,{key:n,value:s}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("ratingLevel content",r);const l=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("ratingLevel TAGS",l);const{label:c}=l,d={level:st.asNumber(s)??0,label:c?ri.toAst(c,{format:a,location:he.tag}):void 0};switch(n){case q.property_ratingLevelStart:o.ratingLevelStart=d;break;case q.property_ratingLevelEnd:o.ratingLevelEnd=d}}(e,0,l.chain,r,o);if(c===q.property_technicalTerm)return void function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("technicalTerm content",r);const a=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("technicalTerm TAGS",a);const{lang:n}=a,s={technicalTerm:Ve.unbreakscape(O.trimmedString(r.value),{format:T.bitmarkText,location:he.tag}),lang:n};o.technicalTerm=s}(e,0,l.chain,r,o);if(c===q.property_servings)return void function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("servings content",r);const a=e.bitContentProcessor(Vt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("servings TAGS",a);const{unit:n,unitAbbr:s,decimalPlaces:l,disableCalculation:c,__hintString:d}=a,p={servings:st.asNumber(r.value)??1,unit:n,unitAbbr:s,decimalPlaces:l??1,disableCalculation:c,hint:d};o.servings=p}(e,0,l.chain,r,o);if(c===q.property_person||c===q.property_partner)return void ii(e,0,l.chain,r,o);if(c===q.property_imageSource)return void ti(e,t,i,r,o);if(c===q.property_book)return void Qt(e,t,l.chain,r,o);if(c===q.property_mark&&!s)return void function(e,t,i,r,o){const{key:a}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const n=o.markConfig;if(!n)return;const s=Y.getTagConfigForTag(i,q.fromValue(a)),{mark:l,...c}=e.bitContentProcessor(Vt.Chain,s?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const d={mark:Ve.unbreakscape(O.trimmedString(r.value)??"unknown",{format:T.bitmarkText,location:he.tag}),emphasis:"underline",...c};d&&n.push(d)}(e,0,i,r,o);c===q.property_title&&s&&(d="propertyTitle")}const p=(e,t,i,r)=>{if(i=(e=>{if(null!=e){if(r)switch(r.format){case k.plainText:return Ve.unbreakscape(O.isString(e)?O.trimmedString(e):void 0,{format:T.plainText,location:he.tag});case k.number:return st.asNumber(Ve.unbreakscape(e,{format:T.plainText,location:he.tag}));case k.boolean:return nt.toBoolean(Ve.unbreakscape(e,{format:T.plainText,location:he.tag}),!0);case k.invertedBoolean:return!nt.toBoolean(Ve.unbreakscape(e,{format:T.plainText,location:he.tag}),!0);case k.bitmarkText:return e=O.isString(e)?e:"",oi.toAst(e,{format:T.bitmarkText,location:he.tag})}return Ve.unbreakscape(e,{format:T.plainText,location:he.tag})}})(i),null==r||r.array)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];e[t]=[...r,i]}else e[t]=[i];else e[t]=i};p(l?o:o.extraProperties,d,a,l),c===q.property_sampleSolution&&p(o,"__sampleSolutionAst",a,new A({configKey:q.property_sampleSolution,tag:"sampleSolution",maxCount:1,minCount:1,chain:void 0,jsonKey:void 0,format:k.bitmarkText,defaultValue:void 0,deprecated:void 0}))}function ni(e,t,i,r,o,a){const{value:n}=r,s=O.trimmedString(n);a?o.referenceEnd=Ve.unbreakscape(s,{format:T.bitmarkText,location:he.tag}):o.reference=Ve.unbreakscape(s,{format:T.bitmarkText,location:he.tag})}var si=new ht;function li(e,t,i,r,o){const{type:a,key:n,value:s,chain:l}=r,c=o.resources;if(!c)return;const d=q.fromValue(n);if(!d)return;const p=D.fromKey(d.replace(/^&/,""))??D.unknown,u=Y.getTagConfigForTag(i,d),{posterImage:h,...m}=e.bitContentProcessor(Vt.Chain,u?.chain,l);let g;if(h){const{subConfig:t,subChain:i}=function(e,t,i){let r;e&&(r=e[i]?.chain);const o=t?.reduce((e,t)=>{if(e)return e;const r=t;return r.key===i?r.chain:void 0},void 0);return{subConfig:r,subChain:o}}(u?.chain,l,q.property_posterImage),{posterImage:r,...o}=e.bitContentProcessor(Vt.Chain,t,i);g=si.resource(e,{type:D.image,value:h,...o}).image}const b=si.resource(e,{type:p,value:Ve.unbreakscape(s,{format:T.bitmarkText,location:he.tag}),posterImage:g,...m});b&&(d===q.resource_backgroundWallpaper||d===q.resource_imagePlaceholder?o.propertyStyleResources&&(o.propertyStyleResources[p]=b):c.push(b))}var ci=new at;function di(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=o.title;if(!s)return;const l=n,c=O.trimmedString(l.title);s[l.level.length]={titleAst:ci.toAst(c??"",{format:a,location:he.tag}),titleString:c??""}}function pi(e,t,i,r,o,a){t===Vt.Chain?function(e,t,i,r){const{type:o,value:a}=i,n=r.trueFalse;if(!n)return;const s=Ve.unbreakscape(O.trimmedString(a),{format:T.bitmarkText,location:he.tag});n.push({text:s,isCorrect:o===Et.True,__isDefaultExample:!1})}(0,Vt.Chain,r,o):function(e,t,i,r,o,a){const{bitType:n}=e,s=[r,...r.chain??[]],l=o.statements,c=o.choices,d=o.responses;if(!(l&&c&&d&&a))return;if(Y.isOfBitType(n,m.trueFalse1))o.statement=function(e,t,i){const{bitType:r}=e;if(!Y.isOfBitType(r,m.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const{trueFalse:o,...a}=e.bitContentProcessor(Vt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",a);let n,s;o&&o.length>0&&(s=o[0]);if(s){const{statement:e,...t}=a;n={...s,statement:s.text,...t}}return n}(e,i,s);else if(Y.isOfBitType(n,[m.trueFalse,m.multipleChoice,m.multipleChoice1,m.multipleResponse,m.multipleResponse1,m.feedback])){const t=function(e,t,i){const{bitType:r}=e,o=Y.isOfBitType(r,m.trueFalse),a=Y.isOfBitType(r,[m.multipleChoice,m.multipleChoice1,m.feedback]),n=Y.isOfBitType(r,[m.multipleResponse,m.multipleResponse1]);if(!o&&!a&&!n)return{};const s=[],l=[],c=[],d=e.splitBitContent(i,[Et.True,Et.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",d);for(const i of d){const{trueFalse:r,...d}=e.bitContentProcessor(Vt.Chain,t,i);let p;if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",d),r&&r.length>0&&(p=r[0]),p)if(o){const{statement:e,...t}=d,i={...p,statement:p.text,...t};i&&s.push(i)}else if(a){const e={...p,choice:p.text,...d};e&&l.push(e)}else if(n){const e={...p,response:p.text,...d};e&&c.push(e)}}const p={};o?p.statements=s:a?p.choices=l:n&&(p.responses=c);return p}(e,i,s);t.statements&&l.push(...t.statements),t.choices&&c.push(...t.choices),t.responses&&d.push(...t.responses)}else if(Y.isOfBitType(n,m.highlightText)){const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const{trueFalse:r,...o}=e.bitContentProcessor(Vt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",{trueFalse:r,...o});const a=[];if(r)for(const e of r){const t={...e,isHighlighted:!1};t&&a.push(t)}const n={type:le.highlight,texts:a,...o};return n}(e,i,s);t&&a.push(t)}else{const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const{trueFalse:r,...o}=e.bitContentProcessor(Vt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",{trueFalse:r,...o});const a=[];if(r)for(const e of r){const t=e;t&&a.push(t)}const n={type:le.select,options:a,...o};return n}(e,i,s);t&&a.push(t)}}(e,0,i,r,o,a)}var ui=!1,hi=!0,mi=!0,gi=!0,bi=!0,fi=new mt,yi=class{constructor(e){p(this,"context"),p(this,"nonFatalWarnings",[]),p(this,"nonFatalErrors",[]),p(this,"parser",{}),p(this,"parse"),p(this,"parserText"),p(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={bitConfig:Y.getBitConfig(m._error),bitType:m._error,textFormat:T.bitmarkText,DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:ui,DEBUG_BIT_CONTENT:hi,DEBUG_BIT_TAGS:mi,DEBUG_BODY:gi,DEBUG_FOOTER:bi,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){const t=[];let i=[];for(const r of e){if(!r)continue;const e=r.value;e?t.push(e):i=i.concat(r.errors??[])}return fi.buildBitmark({bits:t,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:i,textFormat:r,resourceType:o,bitLevel:a,isCommented:n}=e;if(!i||Y.isOfBitType(i,m._error))return this.invalidBit();const s=Y.getBitConfig(i);this.context.bitConfig=s,this.context.bitType=i,this.context.textFormat=r,this.context.resourceType=o;const l=Y.isOfBitType(i,m.trueFalse1),c=Y.isOfBitType(i,m.multipleChoice1),d=Y.isOfBitType(i,m.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=this.squashUnwantedInlineBodyBits(t),t=Dt.validateBitTags(this.context,t);const{body:p,footer:u,cardSet:h,title:b,statement:f,statements:y,choices:k,responses:T,propertyStyleResources:v,resources:x,posterImage:_,internalComments:w,...C}=this.bitContentProcessor(Vt.Bit,s.tags,t);this.debugPrint("BIT TAGS",C),this.debugPrint("BIT BODY",p),this.debugPrint("BIT FOOTER",u);const A=function(e,t,i){if(i=i??[],Y.isOfBitType(t,m.chapter)){let e;return i.length>0&&(e=i[i.length-1]),{title:e?.titleAst??[],titleString:e?.titleString??"",level:i.length>0?i.length-1:void 0}}return{title:i[1]?.titleAst??void 0,titleString:i[1]?.titleString??void 0,subtitle:i[2]?.titleAst??void 0,subtitleString:i[2]?.titleString??void 0}}(this.context,i,b),B=$t(this.context,i,0,h,f,y,k,T),S=function(e,t,i){const{bitType:r}=e,o=[],a=[],n=D.fromValue(t),s=Y.getBitResourcesConfig(r,n),l=s.resourceAttachmentAllowed,c=s.getCountsMin(),d=s.getCountsMax();if(i)for(const e of i.reverse()){const t=z(e.__typeAlias);let i=c.get(t)??0,r=d.get(t)??0;i=Math.max(0,i-1),r===g.infinity?o.unshift(e):r>0?(o.unshift(e),r--):a.unshift(e),c.set(t,i),d.set(t,r)}if(!l&&t){const i=`Resource type [&${t}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(i)}else 0===o.length&&t&&e.addWarning(`Resource type [&${t}] is specified in the bit header, but no such a resource is present`);return a.length>0&&(e.parser.excessResources=a),o}(this.context,o,x),P=[...w??[],...B.internalComments??[]],I=this.buildBitLevelWarnings(),L=this.buildBitLevelErrors();I&&(this.parser.warnings=I),L&&(this.parser.errors=L);return{value:fi.buildBit({bitType:i,bitLevel:a,isCommented:n,textFormat:r,resourceType:o,...A,posterImage:_,statement:l?f:void 0,choices:c?k:void 0,responses:d?T:void 0,...C,...v,resources:S,...B,body:p,footer:u,internalComment:P,parser:this.parser})}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:fi.buildBit({bitType:Y.getBitType(m._error),bitLevel:1,parser:this.parser})}}buildBitHeader(e,t,i){const r=Ve.unbreakscape(e,{format:T.plainText,location:he.tag}),o=Y.getBitType(r),a=Y.isBitTypeCommented(r);Y.isOfBitType(o,m._error)&&this.addError(`Invalid bit type: '${r}'`);const n=Y.getBitConfig(o);t>Y.bitLevelMax?(this.addWarning(`Bit level of ${t} too high, setting to max value of ${Y.bitLevelMax}`),t=Y.bitLevelMax):t<Y.bitLevelMin&&(this.addWarning(`Bit level of ${t} too low, setting to min value of ${Y.bitLevelMin}`),t=Y.bitLevelMin);let s=T.fromValue(i.textFormat);i.textFormat&&!s&&this.addWarning(`Invalid text format '${i.textFormat}', defaulting to '${me.bitmarkPlusPlus}'`);const l=Ne.fromValue(i.textFormat);l&&(s=T.bitmarkText,this.addWarning(`${l} text format is deprecated. Bit will be parsed as '${me.bitmarkPlusPlus}'`)),s=s??n.textFormatDefault;const c=D.fromValue(i.resourceType);return i.resourceType&&!c&&this.addWarning(`Invalid resource type '${i.resourceType}', it will be ignored`),{bitType:o,bitLevel:t,textFormat:s??n.textFormatDefault,resourceType:c,isCommented:a}}buildTextAndResourceType(e,t){const i={},r=e=>{if(e){const t=Ve.unbreakscape(O.string(e.value),{format:T.plainText,location:he.tag});e.type===Et.TextFormat?i.textFormat=t:i.resourceType=t}};return r(e),r(t),i}resetParserState(){this.context.state={}}squashUnwantedInlineBodyBits(e){const t=[];if(!e)return t;const{textFormat:i}=this.context,r=i===T.bitmarkText,o=(e,t="")=>{const{chain:i,parser:r}=e;if(t+=r.text,i)for(const e of i)t=o(e,t);return t};let a=!1;for(const i of e){const{type:e,value:n}=i,s=n??"";let l=!1;if(a||(e===Et.BodyText&&!r&&s&&s.trim()&&(a=!0),e===Et.PlainTextDivider&&(a=!0,l=!0)),l)t.push({type:Et.BodyText,value:"\n"});else if(a)if(e===Et.BodyText)t.push({type:Et.BodyTextPlain,value:n});else{const e=o(i);t.push({type:Et.BodyTextPlain,value:e})}else t.push(i)}return t}bitContentProcessor(e,t,i){const r={};if(!i)return r;const{bitType:o,textFormat:a}=this.context;r.title=[],r.solutions=[],r.__solutionsAst=[],r.statements=[],r.choices=[],r.responses=[],r.propertyStyleResources={},r.resources=[],r.trueFalse=[],r.markConfig=[],r.extraProperties={},r.internalComments=[];let n=!1,s=!1;const l=[];let c=Ve.EMPTY_STRING,d=Ve.EMPTY_STRING,p=Ve.EMPTY_STRING,u=Ve.EMPTY_STRING;const h=e===Vt.Bit,m=e===Vt.Card,g=e===Vt.Chain,b=()=>{if(c){c=Dt.checkBodyPart(this.context,e,c);const t=Mt.buildBodyText(c,!1);l.push(t)}c=Ve.EMPTY_STRING};for(const o of i){const{type:i,value:a}=o;switch(i){case Et.ItemLead:Kt(this.context,e,t,o,r);break;case Et.Instruction:case Et.Hint:case Et.Anchor:case Et.SampleSolution:jt(this.context,0,0,o,r);break;case Et.Reference:ni(this.context,0,0,o,r,n),n=!0;break;case Et.Title:di(this.context,0,0,o,r);break;case Et.Property:ai(this.context,e,t,o,r);break;case Et.Gap:g||b(),Gt(this.context,e,t,o,r,l);break;case Et.Mark:g||b(),Yt(this.context,e,t,o,r,l);break;case Et.True:case Et.False:g||b(),pi(this.context,e,t,o,r,l);break;case Et.Resource:li(this.context,0,t,o,r);break;case Et.CardSet:r.cardSet=a,s=!0;break;case Et.BodyText:case Et.CardText:s?d=Ve.concatenate(d,a):c=Ve.concatenate(c,a);break;case Et.BodyTextPlain:s?u=Ve.concatenate(u,a):p=Ve.concatenate(p,a);break;case Et.FooterDivider:s&&(d=Ve.concatenate(d,a)),s=!0}}b();const f=p?Mt.buildBodyText(p,!0):void 0;if(f&&l.push(f),r.itemLead){const e=r.itemLead.length;e>0&&(r.item=r.itemLead[0]),e>1&&(r.lead=r.itemLead[1]),e>2&&(r.pageNumber=r.itemLead[2]),e>3&&(r.marginNumber=r.itemLead[e-1])}return h?r.body=Mt.process(this.context,e,o,a,t,r,l,!1):m&&(r.cardBody=Mt.process(this.context,e,o,a,t,r,l,!0)),r.footer=Ht.process(this.context,e,t,r,d,u),0===Object.keys(r.extraProperties).length&&delete r.extraProperties,0===r.title.length&&delete r.title,0===r.solutions.length&&delete r.solutions,0===r.statements.length&&delete r.statements,0===r.choices.length&&delete r.choices,0===r.responses.length&&delete r.responses,0===r.trueFalse.length&&delete r.trueFalse,0===r.markConfig.length&&delete r.markConfig,0===Object.keys(r.propertyStyleResources).length&&delete r.propertyStyleResources,0===r.resources.length&&delete r.resources,0===r.internalComments.length&&delete r.internalComments,r}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 i=[];let r=[];for(const o of e)t.includes(o.type)&&(r.length>0&&i.push(r),r=[]),r.push(o);return r.length>0&&i.push(r),i}addWarning(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalWarnings.push(r)}addError(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalErrors.push(r)}debugPrint(e,t){}},ki=class extends SyntaxError{constructor(e,t,i,r){super(e),this.expected=t,this.found=i,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let i=null;const r=e.find(e=>e.source===this.location.source);r&&(i=r.text.split(/\r\n|\n|\r/g));const o=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+a.line+":"+a.column;if(i){const e=this.location.end,r="".padEnd(a.line.toString().length," "),s=i[o.line-1],l=(o.line===e.line?e.column:s.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+r+" |\n"+a.line+" | "+s+"\n"+r+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+n}return t}static buildMessage(e,t){function i(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return r?e.replace(r,e=>"\\u{"+i(e)+"}"):e}function a(e){return o(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,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}function n(e){return o(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,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}const s={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let i=1;i<t.length;i++)t[i-1]!==t[i]&&(t[e]=t[i],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+(((c=t)?'"'+a(c)+'"':"end of input")+" found.");var c}};var Ti=function e(t,i){const r={},o=(i=void 0!==i?i:{}).grammarSource,a={bitmark:tt,bit:function(){let e,t,i,o,a;e=qe,t=[],i=At();for(;i!==r;)t.push(i),i=At();if(i=ot(),i!==r){for(o=[],a=At();a!==r;)o.push(a),a=At();Me=e,e=i}else qe=e,e=r;return e},cardContent:function(){let e,t,i;e=qe,t=[],i=lt(),i===r&&(i=yt());for(;i!==r;)t.push(i),i=lt(),i===r&&(i=yt());return Me=e,t=ze(t),e=t,e}};let n=tt;const s="[.",l="]",c="[",d=":",p="&",u="$$$$",h="====",m="text",g="~~~~",b="footer",f="--",y="++",k="===",T="==",v="[@id",x="#",_="[▼",w="[►",C="[@",A="[%",B="[!",S="[?",P="[+",I="[-",L="[$",E="[_",V="[=",N="[&",R="^]",F="id:",O=".",D="\n",z="\r\n",q=/^[^\]]/,M=/^[^:\]]/,$=/^[^&:\]]/,J=/^[^\n\r\u2028\u2029]/,j=/^[ \t]/,W=/^[\r\u2028-\u2029]/,H=/^[ \t\n\r\u2028\u2029]/,U=Ge("[.",!1),G=Ke(["]"],!0,!1,!1),K=Ge("]",!1),Y=Ge("[",!1),Q=Ge(":",!1),X=Ge("&",!1),Z={type:"any"},ee=Ge("$$$$",!1),te=Ge("====",!1),ie=Ge("text",!1),re=Ge("~~~~",!1),oe=Ge("footer",!1),ae=Ge("--",!1),ne=Ge("++",!1),se=Ge("===",!1),le=Ge("==",!1),ce=Ge("[@id",!1),de=Ge("#",!1),pe=Ge("[▼",!1),ue=Ge("[►",!1),he=Ge("[@",!1),me=Ge("[%",!1),ge=Ge("[!",!1),be=Ge("[?",!1),fe=Ge("[+",!1),ye=Ge("[-",!1),ke=Ge("[$",!1),Te=Ge("[_",!1),ve=Ge("[=",!1),xe=Ge("[&",!1),_e=Ge("^]",!1),we=Ge("id:",!1),Ce=Ke([":","]"],!0,!1,!1),Ae=Ge(".",!1),Be=Ke(["&",":","]"],!0,!1,!1),Se=Ye("Character"),Pe=Ke(["\n","\r","\u2028","\u2029"],!0,!1,!1),Ie=Ye("Blank Line"),Le=Ke([" ","\t"],!1,!1,!1),Ee=Ye("Line Terminator"),Ve=Ge("\n",!1),Ne=Ge("\r\n",!1),Re=Ke(["\r",["\u2028","\u2029"]],!1,!1,!1),Fe=Ye("Whitespace, then Line Terminator"),Oe=Ye("whitespace"),De=Ke([" ","\t","\n","\r","\u2028","\u2029"],!1,!1,!1);function ze(e){return Vt.handleCardContent(e)}let qe=0|i.peg$currPos,Me=qe;const $e=[{line:1,column:1}];let Je,je=qe,We=i.peg$maxFailExpected||[],He=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in a))throw new Error("Can't start parsing from rule \""+i.startRule+'".');n=a[i.startRule]}function Ue(){return t.substring(Me,qe)}function Ge(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ke(e,t,i,r){return{type:"class",parts:e,inverted:t,ignoreCase:i,unicode:r}}function Ye(e){return{type:"other",description:e}}function Qe(e){let i,r=$e[e];if(r)return r;if(e>=$e.length)i=$e.length-1;else for(i=e;!$e[--i];);for(r=$e[i],r={line:r.line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return $e[e]=r,r}function Xe(e,t,i){const r=Qe(e),a=Qe(t),n={source:o,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return i&&o&&"function"==typeof o.offset&&(n.start=o.offset(n.start),n.end=o.offset(n.end)),n}function Ze(e){qe<je||(qe>je&&(je=qe,We=[]),We.push(e))}function et(e,t,i){return new ki(ki.buildMessage(e,t),e,t,i)}function tt(){let e;return e=function(){let e,i,o,a;e=qe,i=[],o=Pt();for(;o!==r;)i.push(o),o=Pt();return o=function(){let e,i,o,a;e=qe,i=qe,o=[],a=rt();for(;a!==r;)o.push(a),a=rt();return i=t.substring(i,qe),Me=e,i=function(e){return Vt.handleRawBit(e)}(i),e=i,e}(),a=function(){let e,t;e=[],t=it();for(;t!==r;)e.push(t),t=it();return e}(),Me=e,e=function(e,t){return Rt.buildBits([e,...t])}(o,a),e}(),e}function it(){let e,i,o,a;for(e=qe,i=[],o=At();o!==r;)i.push(o),o=At();return o=Bt(),o===r&&(o=null),a=function(){let e,i,o,a,n,c;if(e=qe,i=qe,o=qe,a=function(){let e,i,o,a;e=qe,t.substr(qe,2)===s?(i=s,qe+=2):(i=r,0===He&&Ze(U));if(i!==r){for(o=[],a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(G));a!==r;)o.push(a),a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(G));93===t.charCodeAt(qe)?(a=l,qe++):(a=r,0===He&&Ze(K)),a!==r?(Me=e,e=i):(qe=e,e=r)}else qe=e,e=r;return e}(),a!==r){for(n=[],c=rt();c!==r;)n.push(c),c=rt();a=[a,n],o=a}else qe=o,o=r;i=o!==r?t.substring(i,qe):o;i!==r&&(Me=e,d=i,i=Vt.handleRawBit(d));var d;return e=i,e}(),a!==r?(Me=e,e=a):(qe=e,e=r),e}function rt(){let e,t,i,o;if(e=qe,t=Bt(),t!==r?(i=qe,He++,o=at(),He--,o===r?i=void 0:(qe=i,i=r),i!==r?(t=[t,i],e=t):(qe=e,e=r)):(qe=e,e=r),e===r)if(e=[],t=wt(),t!==r)for(;t!==r;)e.push(t),t=wt();else e=r;return e}function ot(){let e,i,o;var a,n,s;return e=qe,i=at(),i!==r?(o=function(){let e,t,i;e=qe,t=[],i=ut(),i===r&&(i=mt(),i===r&&(i=bt(),i===r&&(i=lt(),i===r&&(i=pt()))));for(;i!==r;)t.push(i),i=ut(),i===r&&(i=mt(),i===r&&(i=bt(),i===r&&(i=lt(),i===r&&(i=pt()))));return Me=e,t=function(e){return Vt.handleBitContent(e)}(t),e=t,e}(),Me=e,a=i,n=o,e=Rt.buildBit(a,n)):(qe=e,e=r),e===r&&(e=qe,i=qe,o=function(){let e,i;He++,e=[],t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));for(;i!==r;)e.push(i),t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));return He--,e}(),i=t.substring(i,qe),Me=e,s=i,i=Rt.invalidBit(s),e=i),e}function at(){let e,i,o,a,n,s;var d,p,u;return e=qe,91===t.charCodeAt(qe)?(i=c,qe++):(i=r,0===He&&Ze(Y)),i!==r?(o=function(){let e,i,o;e=qe,i=[],46===t.charCodeAt(qe)?(o=O,qe++):(o=r,0===He&&Ze(Ae));if(o!==r)for(;o!==r;)i.push(o),46===t.charCodeAt(qe)?(o=O,qe++):(o=r,0===He&&Ze(Ae));else i=r;i!==r&&(Me=e,i=i.length);return e=i,e}(),o!==r?(a=xt(),n=function(){let e,t,i;e=qe,t=nt(),t===r&&(t=st());t===r&&(t=null);i=nt(),i===r&&(i=st());i===r&&(i=null);return Me=e,e=function(e,t){return Rt.buildTextAndResourceType(e,t)}(t,i),e}(),93===t.charCodeAt(qe)?(s=l,qe++):(s=r,0===He&&Ze(K)),s!==r?(Me=e,d=o,p=a,u=n,e=Rt.buildBitHeader(p,d,u)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r),e}function nt(){let e,i,o;var a;return e=qe,58===t.charCodeAt(qe)?(i=d,qe++):(i=r,0===He&&Ze(Q)),i!==r?(o=xt(),Me=e,a=o,e=Vt.handleTextFormat(a)):(qe=e,e=r),e}function st(){let e,i,o;var a;return e=qe,38===t.charCodeAt(qe)?(i=p,qe++):(i=r,0===He&&Ze(X)),i!==r?(o=xt(),Me=e,a=o,e=Vt.handleResourceType(a)):(qe=e,e=r),e}function lt(){let e,t,i,o,a;if(e=qe,t=qe,i=dt(),i!==r){for(o=[],a=ct();a!==r;)o.push(a),a=ct();i=[i,o],t=i}else qe=t,t=r;var n;return t!==r&&(Me=e,n=t,t=Vt.handleTagChain(n)),e=t,e}function ct(){let e,t;return e=qe,t=dt(),t!==r&&(Me=e),e=t,e}function dt(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,t.substr(qe,4)===v?(i=v,qe+=4):(i=r,0===He&&Ze(ce));i!==r?(o=_t(),o!==r?(a=function(){let e;93===t.charCodeAt(qe)?(e=l,qe++):(e=r,0===He&&Ze(K));return e}(),a!==r?(Me=e,n=o,e=Vt.handlePropertyTag("id",n)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,t.substr(qe,2)===C?(i=C,qe+=2):(i=r,0===He&&Ze(he));i!==r?(o=Tt(),o!==r?(a=_t(),a!==r?(n=vt(),n!==r?(Me=e,s=o,l=a,e=Vt.handlePropertyTag(s,l)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var s,l;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,91===t.charCodeAt(qe)?(i=c,qe++):(i=r,0===He&&Ze(Y));if(i!==r){if(o=[],35===t.charCodeAt(qe)?(a=x,qe++):(a=r,0===He&&Ze(de)),a!==r)for(;a!==r;)o.push(a),35===t.charCodeAt(qe)?(a=x,qe++):(a=r,0===He&&Ze(de));else o=r;o!==r?(a=kt(),n=vt(),n!==r?(Me=e,s=o,l=a,e=Vt.handleTag(Et.Title,{level:s,title:l})):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;var s,l;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===_?(i=_,qe+=2):(i=r,0===He&&Ze(pe));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Anchor,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===w?(i=w,qe+=2):(i=r,0===He&&Ze(ue));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Reference,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===A?(i=A,qe+=2):(i=r,0===He&&Ze(me));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.ItemLead,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===B?(i=B,qe+=2):(i=r,0===He&&Ze(ge));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Instruction,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===S?(i=S,qe+=2):(i=r,0===He&&Ze(be));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Hint,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===E?(i=E,qe+=2):(i=r,0===He&&Ze(Te));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Gap,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===V?(i=V,qe+=2):(i=r,0===He&&Ze(ve));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.Mark,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===L?(i=L,qe+=2):(i=r,0===He&&Ze(ke));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.SampleSolution,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===P?(i=P,qe+=2):(i=r,0===He&&Ze(fe));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.True,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===I?(i=I,qe+=2):(i=r,0===He&&Ze(ye));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Vt.handleTag(Et.False,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,t.substr(qe,2)===N?(i=N,qe+=2):(i=r,0===He&&Ze(xe));i!==r?(o=Tt(),o!==r?(a=_t(),a!==r?(n=vt(),n!==r?(Me=e,s=o,l=a,e=Vt.handleResourceTag(s,l)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var s,l;return e}()))))))))))))),i!==r&&(Me=e,o=i,i=Vt.handleBitTag(o)),e=i,e}function pt(){let e,i;var o;return e=qe,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),i!==r&&(Me=e,o=i,i={type:Et.BodyChar,value:o}),e=i,e}function ut(){let e;return e=function(){let e,t,i,o,a;e=qe,t=qe,i=Bt(),i!==r?(o=ht(),o!==r?(a=St(),a!==r?(i=[i,o,a],t=i):(qe=t,t=r)):(qe=t,t=r)):(qe=t,t=r);t!==r&&(Me=e,n=t,t=Vt.handleFooterDivider(n));var n;return e=t,e}(),e===r&&(e=function(){let e,i,o,a,n;e=qe,i=qe,o=Bt(),o!==r?(a=function(){let e,i,o,a,n,s;t.substr(qe,4)===u?(e=u,qe+=4):(e=r,0===He&&Ze(ee));if(e===r)if(e=qe,t.substr(qe,4)===h?(i=h,qe+=4):(i=r,0===He&&Ze(te)),i!==r){if(o=[],a=Pt(),a!==r)for(;a!==r;)o.push(a),a=Pt();else o=r;if(o!==r)if(t.substr(qe,4)===m?(a=m,qe+=4):(a=r,0===He&&Ze(ie)),a!==r){if(n=[],s=Pt(),s!==r)for(;s!==r;)n.push(s),s=Pt();else n=r;n!==r?(t.substr(qe,4)===h?(s=h,qe+=4):(s=r,0===He&&Ze(te)),s!==r?(i=[i,o,a,n,s],e=i):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;else qe=e,e=r}else qe=e,e=r;return e}(),a!==r?(n=St(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)):(qe=i,i=r)):(qe=i,i=r);i!==r&&(Me=e,s=i,i=Vt.handlePlainTextDivider(s));var s;return e=i,e}()),e}function ht(){let e,i,o,a,n,s;if(t.substr(qe,4)===g?(e=g,qe+=4):(e=r,0===He&&Ze(re)),e===r)if(e=qe,t.substr(qe,4)===h?(i=h,qe+=4):(i=r,0===He&&Ze(te)),i!==r){if(o=[],a=Pt(),a!==r)for(;a!==r;)o.push(a),a=Pt();else o=r;if(o!==r)if(t.substr(qe,6)===b?(a=b,qe+=6):(a=r,0===He&&Ze(oe)),a!==r){if(n=[],s=Pt(),s!==r)for(;s!==r;)n.push(s),s=Pt();else n=r;n!==r?(t.substr(qe,4)===h?(s=h,qe+=4):(s=r,0===He&&Ze(te)),s!==r?(i=[i,o,a,n,s],e=i):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;else qe=e,e=r}else qe=e,e=r;return e}function mt(){let e,i,o,a,n;if(e=qe,i=qe,o=function(){let e,i,o,a,n,s;e=qe,i=Bt(),i!==r?(o=qe,He++,a=qe,t.substr(qe,4)===h?(n=h,qe+=4):(n=r,0===He&&Ze(te)),n!==r?(s=St(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r),He--,a!==r?(qe=o,o=void 0):o=r,o!==r?(Me=e,e=void Vt.handleCardSetStart()):(qe=e,e=r)):(qe=e,e=r);return e}(),o!==r){for(a=[],n=gt();n!==r;)a.push(n),n=gt();n=function(){let e,t,i,o,a;e=qe,t=qe,i=ht(),i===r&&(i=null);o=qe,He++,a=Lt(),He--,a!==r?(qe=o,o=void 0):o=r;o!==r?(i=[i,o],t=i):(qe=t,t=r);t!==r&&(Me=e,t=void Vt.handleCardSetEnd());return e=t,e}(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)}else qe=i,i=r;var s;return i!==r&&(Me=e,s=i,i=Vt.handleCardSet(s[1].flat())),e=i,e}function gt(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,i=qe,t.substr(qe,4)===h?(o=h,qe+=4):(o=r,0===He&&Ze(te));o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r);i===r&&(i=qe,t.substr(qe,2)===f?(o=f,qe+=2):(o=r,0===He&&Ze(ae)),o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=qe,t.substr(qe,2)===y?(o=y,qe+=2):(o=r,0===He&&Ze(ne)),o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=function(){let e,i,o,a,n,s;e=qe,i=qe,He++,o=qe,a=ht(),a!==r?(n=Lt(),n!==r?(a=[a,n],o=a):(qe=o,o=r)):(qe=o,o=r);He--,o===r?i=void 0:(qe=i,i=r);if(i!==r){if(o=qe,a=qe,n=Ct(),s=Bt(),s!==r?(n=[n,s],a=n):(qe=a,a=r),a===r){if(a=qe,n=[],s=wt(),s!==r)for(;s!==r;)n.push(s),s=wt();else n=r;n!==r?(s=It(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r)}o=a!==r?t.substring(o,qe):a,o!==r?(Me=e,l=o,e=Vt.handleCardLine(l)):(qe=e,e=r)}else qe=e,e=r;var l;return e}())));i!==r&&(Me=e,n=i,i=Vt.handleCardLineOrDivider(n,2));var n;return e=i,e}(),i!==r&&(Me=e,o=i,i=Vt.handleCards(o)),e=i,e}function bt(){let e,i,o,a,n;if(e=qe,i=qe,o=function(){let e,i,o,a,n,s;e=qe,i=Bt(),i!==r?(o=qe,He++,a=qe,t.substr(qe,3)===k?(n=k,qe+=3):(n=r,0===He&&Ze(se)),n!==r?(s=St(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r),He--,a!==r?(qe=o,o=void 0):o=r,o!==r?(Me=e,e=void Vt.handleCardSetStart()):(qe=e,e=r)):(qe=e,e=r);return e}(),o!==r){for(a=[],n=ft();n!==r;)a.push(n),n=ft();n=function(){let e,t,i,o,a;e=qe,t=qe,i=ht(),i===r&&(i=null);o=qe,He++,a=Lt(),He--,a!==r?(qe=o,o=void 0):o=r;o!==r?(i=[i,o],t=i):(qe=t,t=r);t!==r&&(Me=e,t=void Vt.handleCardSetEnd());return e=t,e}(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)}else qe=i,i=r;var s;return i!==r&&(Me=e,s=i,i=Vt.handleCardSet(s[1].flat())),e=i,e}function ft(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,i=qe,t.substr(qe,3)===k?(o=k,qe+=3):(o=r,0===He&&Ze(se));o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r);i===r&&(i=qe,t.substr(qe,2)===T?(o=T,qe+=2):(o=r,0===He&&Ze(le)),o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=qe,t.substr(qe,2)===f?(o=f,qe+=2):(o=r,0===He&&Ze(ae)),o!==r?(a=St(),a===r&&(a=Lt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=function(){let e,i,o,a,n,s;e=qe,i=qe,He++,o=qe,a=ht(),a!==r?(n=Lt(),n!==r?(a=[a,n],o=a):(qe=o,o=r)):(qe=o,o=r);He--,o===r?i=void 0:(qe=i,i=r);if(i!==r){if(o=qe,a=qe,n=Ct(),s=Bt(),s!==r?(n=[n,s],a=n):(qe=a,a=r),a===r){if(a=qe,n=[],s=wt(),s!==r)for(;s!==r;)n.push(s),s=wt();else n=r;n!==r?(s=It(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r)}o=a!==r?t.substring(o,qe):a,o!==r?(Me=e,l=o,e=Vt.handleCardLine(l)):(qe=e,e=r)}else qe=e,e=r;var l;return e}())));i!==r&&(Me=e,n=i,i=Vt.handleCardLineOrDivider(n,1));var n;return e=i,e}(),i!==r&&(Me=e,o=i,i=Vt.handleCards(o)),e=i,e}function yt(){let e,i;var o;return e=qe,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),i!==r&&(Me=e,o=i,i={type:Et.CardChar,value:o}),e=i,e}function kt(){let e,i,o,a;for(e=qe,i=qe,o=[],t.substr(qe,2)===R?(a=R,qe+=2):(a=r,0===He&&Ze(_e)),a===r&&(a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(G)));a!==r;)o.push(a),t.substr(qe,2)===R?(a=R,qe+=2):(a=r,0===He&&Ze(_e)),a===r&&(a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(G)));return i=t.substring(i,qe),Me=e,e=i,e}function Tt(){let e,i,o,a,n;if(e=qe,i=qe,He++,t.substr(qe,3)===F?(o=F,qe+=3):(o=r,0===He&&Ze(we)),He--,o===r?i=void 0:(qe=i,i=r),i!==r){for(o=qe,a=[],n=t.charAt(qe),M.test(n)?qe++:(n=r,0===He&&Ze(Ce));n!==r;)a.push(n),n=t.charAt(qe),M.test(n)?qe++:(n=r,0===He&&Ze(Ce));o=t.substring(o,qe),Me=e,e=(s=o)?s.trim():""}else qe=e,e=r;var s;return e}function vt(){let e,i,o;if(93===t.charCodeAt(qe)?(e=l,qe++):(e=r,0===He&&Ze(K)),e===r){for(e=qe,i=[],o=Pt();o!==r;)i.push(o),o=Pt();o=function(){let e,i;e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));He--,i===r?e=void 0:(qe=e,e=r);return e}(),o!==r?(i=[i,o],e=i):(qe=e,e=r)}return e}function xt(){let e,i,o,a;for(e=qe,i=qe,o=[],a=t.charAt(qe),$.test(a)?qe++:(a=r,0===He&&Ze(Be));a!==r;)o.push(a),a=t.charAt(qe),$.test(a)?qe++:(a=r,0===He&&Ze(Be));var n;return i=t.substring(i,qe),Me=e,i=(n=i)?n.trim():null,e=i,e}function _t(){let e,i,o;var a;return e=qe,58===t.charCodeAt(qe)?(i=d,qe++):(i=r,0===He&&Ze(Q)),i!==r?(o=kt(),Me=e,e=(a=o)?a.trim():""):(qe=e,e=r),e===r&&(e=qe,i="",Me=e,i=!0,e=i),e}function wt(){let e,i;return He++,e=t.charAt(qe),J.test(e)?qe++:(e=r,0===He&&Ze(Pe)),He--,e===r&&(i=r,0===He&&Ze(Se)),e}function Ct(){let e,t;for(He++,e=[],t=wt();t!==r;)e.push(t),t=wt();return He--,e}function At(){let e,i,o;for(He++,e=qe,i=[],o=t.charAt(qe),j.test(o)?qe++:(o=r,0===He&&Ze(Le));o!==r;)i.push(o),o=t.charAt(qe),j.test(o)?qe++:(o=r,0===He&&Ze(Le));return o=Bt(),o!==r?(i=[i,o],e=i):(qe=e,e=r),He--,e===r&&(i=r,0===He&&Ze(Ie)),e}function Bt(){let e,i;return He++,10===t.charCodeAt(qe)?(e=D,qe++):(e=r,0===He&&Ze(Ve)),e===r&&(t.substr(qe,2)===z?(e=z,qe+=2):(e=r,0===He&&Ze(Ne)),e===r&&(e=t.charAt(qe),W.test(e)?qe++:(e=r,0===He&&Ze(Re)))),He--,e===r&&(i=r,0===He&&Ze(Ee)),e}function St(){let e,i,o;for(He++,e=qe,i=[],o=t.charAt(qe),j.test(o)?qe++:(o=r,0===He&&Ze(Le));o!==r;)i.push(o),o=t.charAt(qe),j.test(o)?qe++:(o=r,0===He&&Ze(Le));return o=Bt(),o!==r?(i=[i,o],e=i):(qe=e,e=r),He--,e===r&&(i=r,0===He&&Ze(Fe)),e}function Pt(){let e,i;return He++,e=t.charAt(qe),H.test(e)?qe++:(e=r,0===He&&Ze(De)),He--,e===r&&(i=r,0===He&&Ze(Oe)),e}function It(){let e,i;return e=Bt(),e===r&&(e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),He--,i===r?e=void 0:(qe=e,e=r)),e}function Lt(){let e,i;return e=St(),e===r&&(e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),He--,i===r?e=void 0:(qe=e,e=r)),e}const Vt=new Nt({parse:e,parserText:Ue,parserLocation:Ft}),Rt=new yi({parse:e,parserText:Ue,parserLocation:Ft});function Ft(){const e=Xe(Me,qe);return e?(delete e.source,e):e}function Xe(e,t,i){var r=Qe(e),a=Qe(t),n={source:o,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return o&&"function"==typeof o.offset&&(n.start=o.offset(n.start),n.end=o.offset(n.end)),n}Je=n();const Ot=Je!==r&&qe===t.length;function Dt(){throw Je!==r&&qe<t.length&&Ze({type:"end"}),et(We,je<t.length?function(e=qe){const i=t.codePointAt(e);return void 0===i?"":String.fromCodePoint(i)}(je):null,je<t.length?Xe(je,je+1):Xe(je,je))}return i.peg$library?{peg$result:Je,peg$currPos:qe,peg$FAILED:r,peg$maxFailExpected:We,peg$maxFailPos:je,peg$success:Ot,peg$throw:Ot?void 0:Dt}:Ot?Je:void Dt()},vi=class{constructor(){p(this,"jsonParser",new Pt)}toAst(e,t){return Ti(e)}},xi=(0,bt.superenum)({string:"string",file:"file"}),_i=(0,bt.superenum)({bitmark:"bitmark",json:"json",ast:"ast"}),wi=class{constructor(){p(this,"ast",new ue),p(this,"jsonParser",new Pt),p(this,"bitmarkParser",new vi),p(this,"textParser",new at),p(this,"textGenerator",new Qe),p(this,"jsonStringifyPrettify",(e,t,i)=>{const r=!0===t.prettify?2:t.prettify||void 0;return i||!0===t.stringify||void 0!==r?JSON.stringify(e,null,r):e})}version(){return oe.appVersion.full}info(e){const t=Object.assign({},e),i=new wt;let r;const o=!t.outputFormat||t.outputFormat===At.text,a=t.outputFormat===At.json,n=t.type===Bt.all,s=t.type===Bt.deprecated,l=n||!s,c=n||s;if(t.type===Bt.bit){const e=i.getSupportedBitConfigs().filter(e=>{if(!t.bit)return!0;return Y.getBitType(t.bit)===e.bitType});r=o?e.map(e=>e.toString({includeChains:!0,includeConfigs:!0})).join("\n\n--------------\n\n"):e}else{const e=i.getSupportedBits({includeNonDeprecated:l,includeDeprecated:c}).filter(e=>{if(!t.bit)return!0;const i=Y.getBitType(t.bit);return e.name===i||void 0});r=o?this.supportedBitsAsString(e):e}if(a){const e=!0===t.prettify?2:t.prettify||void 0;r=JSON.stringify(r,null,e)}return r}async generateConfig(e){const t=Object.assign({},e),i=new ConfigBuilder;await i.build(t)}async convert(e,t){let i;const r=Object.assign({},t),o=Object.assign({},r.jsonOptions),a=r.outputFormat,n=a===_i.bitmark,s=a===_i.json,l=a===_i.ast,c=Ct.peggy;let d=e;if(oe.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==xi.file||oe.isNode&&fs.existsSync(d)&&(d=fs.readFileSync(d,{encoding:"utf8"}));let p=this.ast.preprocessAst(d);const u=!!p;u||(p=this.jsonParser.toAst(d));const h=async e=>{i=this.bitmarkParser.toAst(e,{parserType:c})},m=async e=>{if(c===Ct.peggy)if(p=this.bitmarkParser.toAst(e,{parserType:c}),r.outputFile){const e=new JsonFileGenerator(r.outputFile,r);await e.generate(p)}else{const e=new _t(r),t=await e.generate(p);i=this.jsonStringifyPrettify(t,o)}},g=async e=>{if(r.outputFile){const t=new BitmarkFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new Tt(r);i=await t.generate(e)}},b=async e=>{i=this.jsonStringifyPrettify(e,o)},f=async e=>{if(r.outputFile){const t=new JsonFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new _t(r),a=await t.generate(e);i=this.jsonStringifyPrettify(a,o)}},y=async e=>{i=this.jsonStringifyPrettify(e,o)};return!!!p?.bits&&!u?n?await(async e=>{await h(e),await g(i)})(d):l?await h(d):await m(d):u?l?await b(p):s?await f(p):await g(p):s?await(async e=>{await f(e)})(p):l?await y(p):await(async e=>{if(r.outputFile){const t=new BitmarkFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new Tt(r);i=await t.generate(e)}})(p),i}async upgrade(e,t){let i;const r=Object.assign({},t),o=Object.assign({},r.jsonOptions),a=r.bitmarkParserType;let n=e;if(oe.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==xi.file||oe.isNode&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));let s=this.jsonParser.toAst(n);const l=async e=>{const t=this.bitmarkParser.toAst(e,{parserType:a});if(r.outputFile){const e=new BitmarkFileGenerator(r.outputFile,r);await e.generate(t)}else{const e=new Tt(r);i=await e.generate(t)}},c=async e=>{if(r.outputFile){const t=new JsonFileGenerator(r.outputFile,r);await t.generate(e)}else{const t=new _t(r),a=await t.generate(e);i=this.jsonStringifyPrettify(a,o)}};return!!!s?.bits?await l(n):await c(s),i}createAst(e,t){let i,r=e;const o=Object.assign({},t);o.inputFormat&&o.inputFormat!==xi.file||oe.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let a=this.ast.preprocessAst(r);const n=!!a;n||(a=this.jsonParser.toAst(r));return i=!!!a?.bits&&!n?this.bitmarkParser.toAst(r):a,i}async convertText(e,t){let i,r;const o=Object.assign({},t),a=Object.assign({},o.fileOptions),n=Object.assign({},o.jsonOptions),s=TextFormat.fromValue(o.textFormat)??TextFormat.bitmarkText,l=o.textLocation??TextLocation.body;let c=e;if(oe.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");o.inputFormat&&o.inputFormat!==xi.file||oe.isNode&&fs.existsSync(c)&&(c=fs.readFileSync(c,{encoding:"utf8"}));const d=this.textParser.preprocessAst(c),p=!!d;if(r=p?await this.textGenerator.generate(d,s,l):this.textParser.toAst(c,{format:s,location:TextLocation.body}),o.outputFile){const e=o.outputFile.toString();let t=r;p||(t=this.jsonStringifyPrettify(r,n,!0));const i=a.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,t,{flag:i})}else i=p?r:this.jsonStringifyPrettify(r,n);return i}breakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),o=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,a=i.textLocation??TextLocation.body;let n=e;if(oe.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==xi.file||oe.isNode&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));const s=Breakscape.breakscape(n,{format:o,location:a});if(!i.outputFile)return s;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,s,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),o=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,a=i.textLocation??TextLocation.body;let n=e;if(oe.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==xi.file||oe.isNode&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));const s=Breakscape.unbreakscape(n,{format:o,location:a});if(!i.outputFile)return s;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,s,{flag:t})}}supportedBitsAsString(e){let t="";for(const i of e)t+=`${i.name} (since: ${i.since}`,i.deprecated&&(t+=`, deprecated: ${i.deprecated}`),t+=")\n";return t}},Ci=class{constructor(e){p(this,"generator"),p(this,"writer"),this.writer=new gt,this.generator=new xt(this.writer,e)}async generate(e){return await this.generator.generate(e),this.writer.getString()}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}};se()}},t={};var i=function i(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,i),a.exports}(855);return i})());