@gmb/bitmark-parser-generator 5.0.1 → 5.2.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={722:e=>{var t,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(s,{Enum:()=>l}),e.exports=(t=s,((e,t,s,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===s||r(e,l,{get:()=>t[l],enumerable:!(n=i(t,l))||n.enumerable});return e})(r({},"__esModule",{value:!0}),t));var n=new WeakMap;function l(e){let t=n.get(e);const r=e;if(!t){const i=[];for(const t in e){const e=Number(t);!isNaN(e)&&r[r[e]]===e||i.push(t)}const o={_keys:i,_valueKeyMap:new Map};for(const e of o._keys){const t=r[e];o._valueKeyMap.set(t,e)}n.set(e,o),t=o}function i(){const e=new Map;for(const i of t._keys){const t=r[i];e.set(i,t)}return t._keyValueMap=e,e}function o(){const e=new Map;for(const i of t._keys){const t=r[i],o="string"==typeof t?t.toLowerCase():t;e.set(o,i)}return t._lcValueKeyMap=e,e}function a(){const e=new Map;return t._valueLabelMap=e,e}function s(e,r){if(r?.ignoreCase&&"string"==typeof e){const r=t._keyValueMap??i(),a=(t._lcValueKeyMap??o()).get(e.toLowerCase());if(!a)return;return r.get(a)}if(t._valueKeyMap.has(e))return e}function l(e,o){const a=t._keyValueMap??i();if(o?.ignoreCase&&"string"==typeof e){const i=t._lcKeyValueMap??function(){const e=new Map;for(const i of t._keys){const t=r[i];e.set(i.toLowerCase(),t)}return t._lcKeyValueMap=e,e}();return i.get(e.toLowerCase())}return a.get(`${e}`)}function c(){return t._values??function(){const e=t._keyValueMap??i();return t._values=t._keys.map(t=>e.get(t)),t._values}()}function p(){return t._entries??function(){const e=t._keyValueMap??i();return t._entries=t._keys.map(t=>[t,e.get(t)]),t._entries}()}return{fromValue:s,fromKey:l,keyFromValue:function(e,r){if(r?.ignoreCase&&"string"==typeof e){return(t._lcValueKeyMap??o()).get(e.toLowerCase())}return t._valueKeyMap.get(e)},hasKey:function(e,t){return null!=l(e,t)},hasValue:function(e,t){return null!=s(e,t)},keys:()=>t._keys,values:()=>c(),entries:()=>p(),[Symbol.iterator]:function*(){for(const e of c())yield e},setAllLabels:function(e){const r=t._valueLabelMap??a();for(const[t,i]of Object.entries(e)){const e=s(t);null!=e&&r.set(e,i)}},setLabels:function(e,r){(t._valueLabelMap??a()).set(e,r)},getLabels:function(e){return(t._valueLabelMap??a()).get(e)??{}},getLabel:function(e,r){const i=(t._valueLabelMap??a()).get(e)??{};if(!r)for(const t of Object.values(i))return t??`${e}`;return i[r]??`${e}`}}}l.fromArray=e=>{let t=e;Array.isArray(t)||(t=[]);return t.reduce((e,t)=>(e[t]=t,e),{})}},922:(e,t,r)=>{var i,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,l=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c={};((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})})(c,{Ast:()=>$e,BitType:()=>d,BitmarkGenerator:()=>tr,BitmarkParser:()=>yi,BitmarkParserGenerator:()=>Ti,BitmarkParserType:()=>cr,BitmarkStringGenerator:()=>rr,BitmarkVersion:()=>ft,BodyTextFormat:()=>He,Builder:()=>Kt,CardSetVersion:()=>Zt,InfoFormat:()=>pr,InfoType:()=>dr,Input:()=>ki,JsonGenerator:()=>ar,JsonParser:()=>hr,JsonStringGenerator:()=>xi,NodeType:()=>ze,Output:()=>vi,ResourceBuilder:()=>Gt,StringWriter:()=>Yt,TextMarkType:()=>Me,TextNodeType:()=>qe,bitmarkTextParse:()=>Dt}),e.exports=(i=c,((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))n.call(e,l)||l===r||o(e,l,{get:()=>t[l],enumerable:!(i=a(t,l))||i.enumerable});return e})(o({},"__esModule",{value:!0}),i));var p=r(722),d=(r(722),{_error:"_error",_comment:"_comment",_standard:"_standard",advertising:"advertising",advertisingAdvertorial:"advertising-advertorial",advertisingAdvertorialPage:"advertising-advertorial-page",advertisingCallToAction:"advertising-call-to-action",advertisingCallToActionMeeting:"advertising-call-to-action-meeting",advertisingBanner:"advertising-banner",advertisingSkyscraper:"advertising-skyscraper",advertisingRectangle:"advertising-rectangle",advertisingFullPage:"advertising-full-page",advertisingHalfPage:"advertising-half-page",advertisingQuarterPage:"advertising-quarter-page",advertisingClassifiedPage:"advertising-classified-page",advertisingLandscape:"advertising-landscape",advertisingPortrait:"advertising-portrait",aiChat:"ai-chat",aiEditor:"ai-editor",aiPrompt:"ai-prompt",aiTutor:"ai-tutor",aiWbt:"ai-wbt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appBitmarkFromJavascript:"app-bitmark-from-javascript",appCalculatorLatex:"app-calculator-latex",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",articleAuthor:"article-author",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",author:"author",authorContentBitGenerator:"author-content-bit-generator",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",bookAuthor:"book-author",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",brandColor:"brand-color",browserImage:"browser-image",bug:"bug",bugAlt:"bug-alt",bugCollapsible:"bug-collapsible",buttonCopyText:"button-copy-text",catalogItemBook:"catalog-item-book",catalogItemExternalBook:"catalog-item-external-book",catalogItemProduct:"catalog-item-product",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",extractorImage:"extractor-image",extractorImageCollapsible:"extractor-image-collapsible",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",nonProductionPrototypeIframe:"non-production-prototype-iframe",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",openBookChapter:"open-book-chapter",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",platform:"platform",platformBrandTarget:"platform-brand-target",platformHeader:"platform-header",platformMain:"platform-main",platformMainButton:"platform-main-button",platformMainInput:"platform-main-input",platformPath:"platform-path",platformSection:"platform-section",platformSectionButton:"platform-section-button",platformSectionChat:"platform-section-chat",platformSectionHeader:"platform-section-header",platformSectionInput:"platform-section-input",platformSystemIcon:"platform-system-icon",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",sandbox:"sandbox",sandboxOutputJson:"sandbox-output-json",sandboxOutputMarkup:"sandbox-output-markup",sandboxOutputRender:"sandbox-output-render",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",tableExtended:"table-extended",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",vendorLearndashEmbed:"vendor-learndash-embed",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"}),u=(r(722),"infinity"),m=(r(722),"string"),h="boolean",g=(r(722),{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:"&"}),f=g,b=(r(722),"plainText"),y="bitmarkText",k="number",v="boolean",T="invertedBoolean",x=(r(722),{plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkText:"bitmark++"}),_=(r(722),"flashcard"),C="definitionList",w="elements",A="statements",B="quiz",S="feedback",P="questions",I="matchPairs",L="matchAudioPairs",V="matchImagePairs",E="matchMatrix",N="table",R="tableExtended",F="pronunciationTable",O="botActionResponses",D="exampleBitList",M="clozeList",q="ingredients",z="bookReferenceList",$=(r(722),"standard"),J="resource",j="comboResource",W=(r(722),"unknown"),H="tag",U="property",G="resource",K="group",Y=class{constructor(e){l(this,"type"),l(this,"configKey"),l(this,"tag"),l(this,"maxCount"),l(this,"minCount"),l(this,"chain"),l(this,"jsonKey"),l(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}},Q=class extends Y{constructor(e){super({type:H,jsonKey:void 0,...e}),l(this,"type",H)}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},X=class extends Y{constructor(e){super({type:U,...e}),l(this,"type",U),l(this,"array"),l(this,"format"),l(this,"defaultValue"),this.array=e.maxCount===u||e.maxCount>1,this.format=e.format,this.defaultValue=e.defaultValue}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.array&&(r+=`, arr=${this.array}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},Z=class extends Y{constructor(e){super({type:G,...e}),l(this,"type",G)}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},ee=class{constructor(e,t,r,i){l(this,"tags"),l(this,"bodyAllowed"),l(this,"bodyRequired"),l(this,"repeatCount"),this.tags=e,this.bodyAllowed=t??!0,this.bodyRequired=r,this.repeatCount=i}toString(e){const t=Object.assign({},e);let r="";const i=[];this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),null!=this.repeatCount&&i.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}},te=class{constructor(e,t){l(this,"configKey"),l(this,"variants"),this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",i=0,o=0;for(const e of this.variants){for(const a of e)r+=`[Card - Side ${i}, Variant ${o}]`,r+=`\n${a.toString(t)}`,o++;i++}return r}},re=class{constructor(e){l(this,"since"),l(this,"bitType"),l(this,"inheritedBitTypes"),l(this,"inheritedBitTypesSet"),l(this,"textFormatDefault"),l(this,"tags",{}),l(this,"cardSet"),l(this,"quizBit"),l(this,"deprecated"),l(this,"bodyAllowed"),l(this,"bodyRequired"),l(this,"footerAllowed"),l(this,"footerRequired"),l(this,"resourceAttachmentAllowed"),l(this,"rootExampleType"),l(this,"comboResourceConfigKey");const{since:t,bitType:r,inheritedBitTypes:i,textFormatDefault:o,tags:a,cardSet:s,quizBit:n,deprecated:c,bodyAllowed:p,bodyRequired:d,footerAllowed:u,footerRequired:m,resourceAttachmentAllowed:h,rootExampleType:g,comboResourceConfigKey:f}=e;this.since=t,this.bitType=r,this.inheritedBitTypes=i,this.inheritedBitTypesSet=new Set(i),this.textFormatDefault=o,this.tags=a,this.cardSet=s,this.quizBit=n,this.deprecated=c,this.bodyAllowed=p??!0,this.bodyRequired=d,this.footerAllowed=u??!0,this.footerRequired=m,this.resourceAttachmentAllowed=h??!0,this.rootExampleType=g,this.comboResourceConfigKey=f}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(r+="\n\n[Inheritance]",r+=`\n${this.inheritedBitTypes.join(" => ")}`),r+=`\n\n[Default text format]\n${this.textFormatDefault}`;const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceConfigKey&&i.push(`comboResourceConfigKey=${this.comboResourceConfigKey}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===u||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}},ie=r(722),oe=(r(722),r(722),{property_action:"@action",property_activityType:"@activityType",property_additionalSolutions:"@additionalSolutions",property_advertisingClickUrl:"@advertisingClickUrl",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_authorFullName:"@authorFullName",property_authorJobTitle:"@authorJobTitle",property_authorPseudonym:"@authorPseudonym",property_authorTitle:"@authorTitle",property_autoplay:"@autoplay",property_availableClassifications:"@availableClassifications",property_brandColor:"@brandColor",property_brandColorName:"@brandColorName",property_blockId:"@blockId",property_book:"@book",property_bookAlias:"@bookAlias",property_bookDiff:"@bookDiff",property_bot:"@bot",property_bubbleTag:"@bubbleTag",property_extractorTag:"@extractorTag",property_buttonCaption:"@buttonCaption",property_callToActionUrl:"@callToActionUrl",property_caption:"@caption",property_categoryTag:"@categoryTag",property_chatWithBook:"@chatWithBook",property_chatWithBookBrainKey:"@chatWithBookBrainKey",property_currency:"@currency",property_bookIsbn:"@bookIsbn",property_bookAuthor:"@bookAuthor",property_bookType:"@bookType",property_bookBindingType:"@bookBindingType",property_bookNumberOfPages:"@bookNumberOfPages",property_bookRating:"@bookRating",property_bookSeriesTitle:"@bookSeriesTitle",property_bookSeriesId:"@bookSeriesId",property_bookSeriesNumber:"@bookSeriesNumber",property_bookLanguage:"@bookLanguage",property_bookPublishingDate:"@bookPublishingDate",property_bookPublisher:"@bookPublisher",property_bookTranslator:"@bookTranslator",property_bookOriginalTitle:"@bookOriginalTitle",property_gmbExternalShop:"@gmbExternalShop",property_gmbExternalShopItems:"@gmbExternalShopItems",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_listPrice:"@listPrice",property_customerProductId:"@customerProductId",property_customerProductShopLink:"@customerProductShopLink",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_isEditable:"@isEditable",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_formula:"@formula",property_fullName:"@fullName",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_iframeSrc:"@iframeSrc",property_iframeName:"@iframeName",property_imageFirst:"@imageFirst",property_imageSource:"@imageSource",property_index:"@index",property_internalComment:"@internalComment",property_internalPrintPdf:"@internalPrintPdf",property_hasPrintRestriction:"@hasPrintRestriction",property_isCaseSensitive:"@isCaseSensitive",property_isInfoOnly:"@isInfoOnly",property_isPublic:"@isPublic",property_isTemplate:"@isTemplate",property_isTemplateStripTheme:"@isTemplateStripTheme",property_isTracked:"@isTracked",property_jobTitle:"@jobTitle",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_spansPageBreak:"@spansPageBreak",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_platformBackgroundColor:"@platformBackgroundColor",property_platformBorderColor:"@platformBorderColor",property_platformBrandTarget:"@platformBrandTarget",property_platformButtonBackgroundColor:"@platformButtonBackgroundColor",property_platformButtonPrimaryColor:"@platformButtonPrimaryColor",property_platformMessageBackgroundColor:"@platformMessageBackgroundColor",property_platformName:"@platformName",property_platformPlaceholderColor:"@platformPlaceholderColor",property_platformPrimaryColor:"@platformPrimaryColor",property_platformScrollbarColor:"@platformScrollbarColor",property_platformSecondaryColor:"@platformSecondaryColor",property_platformSelectionColor:"@platformSelectionColor",property_platformSelectionTextColor:"@platformSelectionTextColor",property_platformBaseLayerColor:"@platformBaseLayerColor",property_platformMargin:"@platformMargin",property_platformBorderRadius:"@platformBorderRadius",property_platformSelectionBorderRadius:"@platformSelectionBorderRadius",property_platformNeedsShadow:"@platformNeedsShadow",property_platformSeparatorColor:"@platformSeparatorColor",property_platformTextSelectionColor:"@platformTextSelectionColor",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_pseudonym:"@pseudonym",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_relatedBook:"@relatedBook",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_selected:"@selected",property_servings:"@servings",property_showInIndex:"@showInIndex",property_showSubtitles:"@showSubtitles",property_siteName:"@siteName",property_size:"@size",property_slug:"@slug",property_sourceDocument:"@sourceDocument",property_sourceRL:"@sourceRL",property_spaceId:"@spaceId",property_src1x:"@src1x",property_src2x:"@src2x",property_src3x:"@src3x",property_src4x:"@src4x",property_srcAlt:"@srcAlt",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_tableCellType:"@tableCellType",property_tableRowSpan:"@tableRowSpan",property_tableColSpan:"@tableColSpan",property_tableScope:"@tableScope",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"}),ae=oe,se=(r(722),r(722),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 r=0;for(;e.startsWith(t);)r++,e=e.substring(t.length);return r}countOccurrencesAtEnd(e,t){let r=0;for(;e.endsWith(t);)r++,e=e.substring(0,e.length-t.length);return r}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const a=e[i],s=i===o-1;r.push(a),s||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let a,s=0;for(;s<o;){let i;const o=s+t,n=e.indexOf("\n",s);if(n>-1&&n>s&&n<o){i=n-s,a=e.substr(s,i),s=s+i+1,r.push(a);continue}const l=e.lastIndexOf(" ",o);let c=0;l>-1&&l!=s-1?(i=l-s,i>0&&(c=s+i+1)):(i=t,c=s+t),a=e.slice(s,s+i),s=c,r.push(a.trim())}return s<i&&(a=e.slice(s),r.push(a)),r}kebabToCamel(e){return e?e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):e}camelToKebab(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e}}),ne={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",platformIcon:"platformIcon",platformLogo:"platformLogo",platformBackgroundImage:"platformBackgroundImage",previewImage:"previewImage",previewVideo:"previewVideo",coverImage:"coverImage"};function le(e){return`&${se.kebabToCamel(e)}`}var ce={_unknown:"_unknown",...g,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_platformBackgroundImage:"&platformBackgroundImage",resource_platformIcon:"&platformIcon",resource_platformLogo:"&platformLogo",resource_backgroundWallpaper:"&backgroundWallpaper",resource_imagePlaceholder:"&imagePlaceholder",resource_previewImage:"&previewImage",resource_previewVideo:"&previewVideo",resource_coverImage:"&coverImage",...oe,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_advertisingCommon:"group_advertisingCommon",group_platformStylesCommon:"group_platformStylesCommon",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",group_previewImages:"group_previewImages",group_previewVideos:"group_previewVideos"};function pe(e){return e?e.startsWith("@")?U:e.startsWith("&")?G:e.startsWith("group_")?K:H:W}function de(e){return e.replace(/^@/,"")}function ue(e){return(0,ie.Enum)(ne).fromKey(e.replace(/^&/,""))}var me=class{constructor(e,t,r,i){l(this,"tags"),l(this,"resourceAttachmentAllowed"),l(this,"resourceAttachmentConfigKey"),l(this,"comboResourceConfigKeysMap"),this.tags=e,this.resourceAttachmentAllowed=t??!1,this.resourceAttachmentConfigKey=r,this.comboResourceConfigKeysMap=i}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}},he=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 r=e;for(const e of t){if(null==r)return;r=r[e]}return r}setViaPath(e,t,r,i){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 r=t[e];if(null==o[r]){if(!i)return!1;o[r]={}}o=o[r]}return o[t[t.length-1]]=r,!0}flatMapPath(e,t){if(!e)return[];if(!t)return[];Array.isArray(t)||(t=[t]);const r=e,i=t.shift();if(null==i)return r;const o=r[i];return o?Array.isArray(o)?o.flatMap(e=>this.flatMapPath(e,t.slice())):[this.flatMapPath(o,t)].flat():[]}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}deepMerge(...e){return function e(...t){function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(t,i){for(const[o,a]of Object.entries(i)){const i=r(a);void 0!==t[o]&&r(t[o])===i&&["array","object"].includes(i)?t[o]=e(t[o],a):t[o]=structuredClone(a)}}let o=structuredClone(t.shift());for(const e of t){const t=r(e);r(o)===t?"array"===t?o=[...o,...structuredClone(e)]:"object"===t?i(o,e):o=e:o=structuredClone(e)}return o}(...e)}},ge=r(722),fe={[C]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the definition.",format:b},{key:ce.tag_title,description:"Title of the definition."},{key:ce.group_resourceIcon,description:"Icon resource for the definition."}],repeatCount:u}]]},[_]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the flashcard.",format:b},{key:ce.tag_title,description:"Title of the flashcard."},{key:ce.group_resourceIcon,description:"Icon resource for the flashcard."}],repeatCount:u}]]},[w]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the element.",format:b}],repeatCount:u}]]},[A]:{variants:[[{tags:[{key:ce.tag_true,description:"Tag for true statements.",maxCount:1},{key:ce.tag_false,description:"Tag for false statements.",maxCount:1},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the statement.",format:b}],bodyAllowed:!1}]]},[B]:{variants:[[{tags:[{key:ce.group_trueFalse,description:"Group for true/false questions."},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the quiz question.",format:b}],bodyAllowed:!1}]]},[S]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.group_trueFalse,description:"Group for true/false feedback."},{key:ce.tag_title,description:"Title of the feedback."}],bodyAllowed:!1}],[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k},{key:ce.property_example,description:"Example text for the feedback.",format:b},{key:ce.tag_title,description:"Title of the feedback."}],bodyAllowed:!0}]]},[P]:{variants:[[{tags:[{key:ce.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k},{key:ce.tag_sampleSolution,description:"Sample solution for the question."},{key:ce.property_sampleSolution,description:"Property for sample solution text.",format:b},{key:ce.property_additionalSolutions,description:"Property for additional solutions.",format:b,maxCount:u},{key:ce.property_partialAnswer,description:"Property for partial answer text.",format:b},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the question.",format:b}],repeatCount:u}]]},[I]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the match pair.",format:b},{key:ce.tag_title,description:"Title of the match pair."},{key:ce.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:v}],repeatCount:u}]]},[L]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the audio match pair.",format:b},{key:ce.tag_title,description:"Title of the audio match pair."},{key:ce.resource_audio,description:"Audio resource for the match pair."}],repeatCount:u}]]},[V]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the image match pair.",format:b},{key:ce.tag_title,description:"Title of the image match pair."},{key:ce.resource_image,description:"Image resource for the match pair."}],repeatCount:u}]]},[E]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the match matrix.",format:b},{key:ce.tag_title,description:"Title of the match matrix."},{key:ce.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:v}],repeatCount:u}]]},[N]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the table."}],repeatCount:u}]]},[R]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the table."},{key:ce.property_tableCellType,description:"Table cell type (th/td).",format:b},{key:ce.property_tableRowSpan,description:"Number of rows the cell spans.",format:k},{key:ce.property_tableColSpan,description:"Number of columns the cell spans.",format:k},{key:ce.property_tableScope,description:"Scope attribute for header cells.",format:b}],repeatCount:u}]]},[F]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the pronunciation table."},{key:ce.resource_audio,description:"Audio resource for the pronunciation table."}],repeatCount:u}]]},[O]:{variants:[[{tags:[{key:ce.property_reaction,description:"Reaction to the bot action.",format:b},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the bot action response.",format:b}]}]]},[M]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for cloze items."},{key:ce.group_gap,description:"Group for gap tags in cloze items."}]}]]},[D]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for example bits."},{key:ce.tag_title,description:"Title of the example bit."}],repeatCount:u}]]},[q]:{variants:[[{tags:[{key:ce.tag_title,description:"Title of the ingredient."},{key:ce.group_trueFalse,description:"Group for true/false properties of the ingredient."},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_unit,description:"Unit of measurement for the ingredient.",format:b},{key:ce.property_unitAbbr,description:"Abbreviation for the unit of measurement.",format:b},{key:ce.property_decimalPlaces,description:"Number of decimal places for the ingredient quantity.",format:k,defaultValue:"1"},{key:ce.property_disableCalculation,description:"Disable calculation for the ingredient.",format:v}],repeatCount:u}]]},[z]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for book references."},{key:ce.property_refAuthor,description:"Author of the book.",format:b,maxCount:u},{key:ce.property_refBookTitle,description:"Title of the book.",format:b},{key:ce.property_refPublisher,description:"Publisher of the book.",format:b,maxCount:u},{key:ce.property_refPublicationYear,description:"Year of publication of the book.",format:b},{key:ce.property_citationStyle,description:"Citation style for the book reference.",format:b}],repeatCount:u}]]}},be={[ce.group_standardAllBits]:{name:"Standard",description:"Standard tags which apply to all bits",type:$,tags:[{key:ce.property_id,description:"The unique identifier(s) for the bit",format:b,maxCount:u},{key:ce.property_customerId,description:"The customer-specific identifier for the bit",format:b},{key:ce.property_externalId,description:"The external identifier for the bit",format:b,maxCount:u},{key:ce.property_sourceRL,description:"The original location of the information in the original source material",format:b},{key:ce.property_isTemplate,description:"If true, the bit is a template",format:v,defaultValue:"false"},{key:ce.property_isTemplateStripTheme,description:"If true, the bit is a template strip theme",format:v,defaultValue:"false"},{key:ce.property_aiGenerated,description:"If true, the bit is AI-generated",format:v},{key:ce.property_machineTranslated,description:"If true, the bit is machine-translated",format:b},{key:ce.property_spansPageBreak,description:"If true, the bit spans a page break",format:v},{key:ce.property_searchIndex,description:"The search index(es) for the bit",format:b,maxCount:u},{key:ce.property_analyticsTag,description:"The analytics tag(s) for the bit",format:b,maxCount:u},{key:ce.property_categoryTag,description:"The category tag(s) for the bit",format:b,maxCount:u},{key:ce.property_topicTag,description:"The topic tag(s) for the bit",format:b,maxCount:u},{key:ce.property_reportTag,description:"The report tag(s) for the bit",format:b,maxCount:u},{key:ce.property_altLangTag,description:"The alternative language tag for the bit",format:b},{key:ce.property_feedbackEngine,description:"The feedback engine for the bit",format:b},{key:ce.property_feedbackType,description:"The feedback type for the bit",format:b},{key:ce.property_disableFeedback,description:"If true, feedback is disabled for the bit",format:v},{key:ce.property_diffTo,description:"The diff to version for the bit",format:b},{key:ce.property_diffOp,description:"The diff operation for the bit",format:b},{key:ce.property_diffRef,description:"The diff reference for the bit",format:b},{key:ce.property_diffContext,description:"The diff context for the bit",format:b},{key:ce.property_diffTime,description:"The diff time for the bit",format:k},{key:ce.property_ageRange,description:"The age range for the bit",format:b,maxCount:u},{key:ce.property_lang,description:"The language for the bit",format:b},{key:ce.property_publisher,description:"The publisher(s) of the bit",format:b,maxCount:u},{key:ce.property_publisherName,description:"The name of the publisher of the bit",format:b},{key:ce.property_theme,description:"The theme(s) for the bit",format:b,maxCount:u},{key:ce.property_target,description:"The target(s) for the bit",format:b,maxCount:u},{key:ce.property_tag,description:"The tag(s) for the bit",format:b,maxCount:u},{key:ce.property_groupTag,description:"The group tag(s) for the bit",format:b,maxCount:u,chain:[{key:ce.property_tag,description:"The tag(s) for the group",format:b,maxCount:u}]},{key:ce.property_reductionTag,description:"The reduction tag(s) for the bit",format:b,maxCount:u},{key:ce.property_bubbleTag,description:"The bubble tag(s) for the bit",format:b,maxCount:u},{key:ce.property_extractorTag,description:"The extractor tag(s) for the bit",format:b,maxCount:u},{key:ce.property_levelCEFRp,description:"The CEFRp level for the bit",format:b},{key:ce.property_levelCEFR,description:"The CEFR level for the bit",format:b},{key:ce.property_levelILR,description:"The ILR level for the bit",format:b},{key:ce.property_levelACTFL,description:"The ACTFL level for the bit",format:b},{key:ce.property_icon,description:"The icon for the bit",format:b},{key:ce.property_iconTag,description:"The icon tag for the bit",format:b},{key:ce.property_colorTag,description:"The color tag(s) for the bit",format:b,maxCount:u},{key:ce.tag_anchor,name:"Anchor",description:"The anchor for the bit"},{key:ce.property_search,description:"The search text for the bit",format:b},{key:ce.property_showInIndex,description:"If true, the bit is shown in the index",format:v,defaultValue:"false"},{key:ce.property_layer,description:"The layer(s) for the bit",format:b,maxCount:u},{key:ce.property_layerRole,description:"The layer role(s) for the bit",format:b,maxCount:u}]},[ce.group_standardItemLeadInstructionHint]:{type:$,description:"Standard group for item, lead, page number, source page number, margin number, instruction and hint tags",tags:[{key:ce.tag_item,description:"The item for the bit",chain:[{key:ce.tag_item,description:"The lead, page number, source page number, and margin number for the bit",maxCount:4}]},{key:ce.tag_instruction,name:"Instruction",description:"The instruction for the bit"},{key:ce.tag_hint,name:"Hint",description:"The hint for the bit"}]},[ce.group_standardTags]:{type:$,description:"Standard tags which apply to MOST (but not all) bits",tags:[{key:ce.group_standardAllBits,description:"All standard tags which apply to all bits"},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"The example(s) for the bit",format:b}]},[ce.group_imageSource]:{type:$,description:"Image source chain",tags:[{key:ce.property_imageSource,description:"The source of an image",format:b,chain:[{key:ce.property_mockupId,description:"The mockup ID for the image",format:b},{key:ce.property_size,description:"The size of the image",format:k},{key:ce.property_format,description:"The format of the image",format:b},{key:ce.property_trim,description:"If true, the image is trimmed",format:v}]}]},[ce.group_technicalTerm]:{type:$,description:"Technical term chain",tags:[{key:ce.property_technicalTerm,description:"The technical term",format:b,chain:[{key:ce.property_lang,description:"The language of the technical term",format:b}]}]},[ce.group_person]:{type:$,description:"Person chain",tags:[{key:ce.property_person,description:"A person",format:b,chain:[{key:ce.property_title,description:"The person's title",format:b},{key:ce.group_resourceImage,description:"The image of the person"}]},{key:ce.property_partner,description:"A partner",format:b,chain:[{key:ce.property_title,description:"The partner's title",format:b},{key:ce.group_resourceImage,description:"The image of the partner"}]}]},[ce.group_gap]:{type:$,description:"Gap chain",tags:[{key:ce.tag_gap,description:"The value of a gap in the content",maxCount:u,chain:[{key:ce.tag_gap,description:"Alternative values for the gaps in the content",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the gap",format:b},{key:ce.property_isCaseSensitive,description:"If true, the gap text is case sensitive",format:v}]}]},[ce.group_trueFalse]:{type:$,description:"True/False chain",tags:[{key:ce.tag_true,description:"True value for a true/false statement/question",maxCount:u,chain:[{key:ce.tag_true,description:"True values for a true/false statement/question",maxCount:u},{key:ce.tag_false,description:"False values for a true/false statement/question",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the true/false statement/question",format:b}]},{key:ce.tag_false,description:"False value for a true/false statement/question",maxCount:u,chain:[{key:ce.tag_true,description:"True values for a true/false statement/question",maxCount:u},{key:ce.tag_false,description:"False values for a true/false statement/question",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the true/false statement/question",format:b}]}]},[ce.group_markConfig]:{type:$,description:"Mark configuration chain",tags:[{key:ce.property_mark,description:"The mark configuration",format:b,maxCount:u,chain:[{key:ce.property_color,description:"The color of the mark",format:b},{key:ce.property_emphasis,description:"The emphasis of the mark",format:b}]}]},[ce.group_mark]:{type:$,description:"Mark chain",tags:[{key:ce.tag_mark,description:"The marked content",maxCount:u,chain:[{key:ce.property_mark,description:"The mark configuration",format:b},{key:ce.property_example,description:"An example for the marked content",format:b}]}]},[ce.group_bookCommon]:{type:$,description:"Common book tags",tags:[{key:ce.property_language,description:"The language of the book",format:b,maxCount:u},{key:ce.property_customerExternalId,description:"The customer-specific external identifier for the book",format:b},{key:ce.property_spaceId,description:"The space ID for the book",format:b,maxCount:u},{key:ce.property_kind,description:"The kind of the book",format:b},{key:ce.property_hasMarkAsDone,description:'If true, the book has a "Mark as done" feature',format:v,defaultValue:"false"},{key:ce.property_processHandIn,description:"If true, the book will be processed when upon hand-in",format:v,defaultValue:"false"},{key:ce.property_processHandInLocation,description:"The location where the book was handed-in",format:b},{key:ce.property_isPublic,description:"If true, the book is public",format:v,defaultValue:"false"},{key:ce.property_isTemplate,description:"If true, the book is a template",format:v,defaultValue:"false"},{key:ce.property_isTemplateStripTheme,description:"If true, the book is a template strip theme",format:v,defaultValue:"false"},{key:ce.property_isEditable,description:"If true, the book is editable",format:v,defaultValue:"false"},{key:ce.property_chatWithBook,description:"If true, the user can chat about the book with an AI assistant",format:v,defaultValue:"false"},{key:ce.property_chatWithBookBrainKey,description:"The BookBrain key for the book chat",format:b},{key:ce.tag_title,name:"Title",description:"The title of the book",maxCount:2},{key:ce.property_subtype,description:"The subtype of the book",format:b},{key:ce.property_coverImage,description:"The cover image(s) of the book",format:b,maxCount:u},{key:ce.resource_coverImage,description:"The cover image of the book",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_coverColor,description:"The cover color of the book",format:b},{key:ce.property_subject,description:"The subject(s) of the book",format:b,maxCount:u},{key:ce.property_author,description:"The author(s) of the book",format:b,maxCount:u},{key:ce.property_publications,description:"The publication(s) of the book",format:b,maxCount:u},{key:ce.property_relatedBook,description:"Books related to this book",format:b,maxCount:u},{key:ce.property_duration,description:"The duration of the book",format:b},{key:ce.property_maxTocChapterLevel,description:"The maximum table of contents chapter level",format:k},{key:ce.property_sourceDocument,description:"Url of the source document for the book (for example, a PDF file)",format:b},{key:ce.property_internalPrintPdf,description:"Url of the internal print PDF for the book",format:b},{key:ce.property_hasPrintRestriction,description:"If true, the book has print restrictions",format:v,defaultValue:"true"}]},[ce.group_learningPathCommon]:{type:$,description:"Common learning path tags",tags:[{key:ce.property_action,description:"The action for the learning path",format:b},{key:ce.property_duration,description:"The duration of the learning path",format:b},{key:ce.property_date,description:"The date of the learning path",format:b},{key:ce.property_dateEnd,description:"The end date of the learning path",format:b},{key:ce.property_location,description:"The location of the learning path",format:b},{key:ce.property_list,description:"The list of items in the learning path",format:b,maxCount:u},{key:ce.property_textReference,description:"The text reference for the learning path",format:b},{key:ce.property_isTracked,description:"If true, the learning path is tracked",format:v},{key:ce.property_isInfoOnly,description:"If true, the learning path is info only",format:v},{key:ce.property_deeplink,description:"The deeplink(s) for the learning path",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"The caption for the button of the learning path",format:b},{key:ce.property_book,description:"The book(s) associated with the learning path",format:b,chain:[{key:ce.tag_reference,description:"The reference(s) for the book(s) in the learning path",maxCount:2}]}]},[ce.group_advertisingCommon]:{type:$,description:"Common advertising tags",tags:[{key:ce.property_advertisingClickUrl,description:"The URL to which the advertisement should link",format:b}]},[ce.group_platformStylesCommon]:{type:$,description:"Common platform styles",tags:[{key:ce.property_platformPrimaryColor,description:"The platform system primary color",format:b},{key:ce.property_platformSecondaryColor,description:"The platform section secondary color",format:b},{key:ce.property_platformBackgroundColor,description:"The platform system background color",format:b},{key:ce.property_platformButtonPrimaryColor,description:"The platform section header button primary color",format:b},{key:ce.property_platformButtonBackgroundColor,description:"The platform section header button background color",format:b},{key:ce.property_platformScrollbarColor,description:"The platform main scrollbar color",format:b},{key:ce.property_platformSelectionColor,description:"The platform main selection color",format:b},{key:ce.property_platformTextSelectionColor,description:"The platform main input text selection color",format:b},{key:ce.property_platformSeparatorColor,description:"The platform main separator color",format:b},{key:ce.property_platformPlaceholderColor,description:"The platform main input placeholder color",format:b},{key:ce.property_platformMessageBackgroundColor,description:"The platform section chat message background color",format:b},{key:ce.property_platformBorderColor,description:"The platform border color",format:b},{key:ce.property_platformSelectionTextColor,description:"The platform selection text color",format:b},{key:ce.property_platformBaseLayerColor,description:"The platform base layer color",format:b},{key:ce.property_platformMargin,description:"The platform margin",format:k},{key:ce.property_platformBorderRadius,description:"The platform border radius",format:k},{key:ce.property_platformSelectionBorderRadius,description:"The platform selection border radius",format:k},{key:ce.property_platformNeedsShadow,description:"If true, the platform needs shadow",format:v}]},[ce.group_quizCommon]:{type:$,description:"Common quiz tags",tags:[{key:ce.property_revealSolutions,description:"If true, the quiz solutions are revealed",format:v},{key:ce.property_additionalSolutions,description:"Additional solutions",format:b,maxCount:u}]},[ce.group_resourceBitTags]:{type:$,description:"Resource bit tags",tags:[{key:ce.resource_imagePlaceholder,description:"Placeholder image for the resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the placeholder image"}],maxCount:1}]},[ce.group_resourceCommon]:{type:$,description:"Common resource properties",tags:[{key:ce.property_license,description:"The license for the resource",format:b},{key:ce.property_copyright,description:"The copyright information for the resource",format:b},{key:ce.property_caption,description:"The caption for the resource",format:y},{key:ce.property_showInIndex,description:"If true, the resource is shown in the index",format:v,defaultValue:"false"},{key:ce.property_search,description:"The search text for the resource",format:b},{key:ce.property_selected,description:"If true, the resource is selected",format:v,defaultValue:"false"},{key:ce.property_srcAlt,description:"An alternative source for the resource",format:b,maxCount:u}]},[ce.group_resourceImageCommon]:{type:$,description:"Common properties for image resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_src1x,description:"The source URL for the image at 1x resolution",format:b},{key:ce.property_src2x,description:"The source URL for the image at 2x resolution",format:b},{key:ce.property_src3x,description:"The source URL for the image at 3x resolution",format:b},{key:ce.property_src4x,description:"The source URL for the image at 4x resolution",format:b},{key:ce.property_width,description:"The width of the image",format:k},{key:ce.property_height,description:"The height of the image",format:k},{key:ce.property_alt,description:"The alternative text for the image",format:b},{key:ce.property_zoomDisabled,description:"If true, zooming is disabled for the image",format:v}]},[ce.group_resourceAudioCommon]:{type:$,description:"Common properties for audio resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_duration,description:"The duration of the audio resource",format:b},{key:ce.property_mute,description:"If true, the audio is muted",format:v},{key:ce.property_autoplay,description:"If true, the audio plays automatically",format:v}]},[ce.group_resourceVideoCommon]:{type:$,description:"Common properties for video resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_width,description:"The width of the video",format:k},{key:ce.property_height,description:"The height of the video",format:k},{key:ce.property_duration,description:"The duration of the video",format:b},{key:ce.property_mute,description:"If true, the video is muted",format:v},{key:ce.property_autoplay,description:"If true, the video plays automatically",format:v},{key:ce.property_allowSubtitles,description:"If true, subtitles are allowed for the video",format:v},{key:ce.property_showSubtitles,description:"If true, subtitles are shown in the video",format:v},{key:ce.property_alt,description:"The alternative text for the video",format:b},{key:ce.property_posterImage,description:"The poster image for the video",format:b,chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the poster image"}]},{key:ce.property_src1x,description:"The source URL for the video at 1x resolution",format:b},{key:ce.property_src2x,description:"The source URL for the video at 2x resolution",format:b},{key:ce.property_src3x,description:"The source URL for the video at 3x resolution",format:b},{key:ce.property_src4x,description:"The source URL for the video at 4x resolution",format:b}]},[ce.group_resourceIcon]:{type:$,description:"Common properties for icon resources",tags:[{key:ce.resource_icon,description:"The icon resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the icon resource"}]}]},[ce.group_resourceImage]:{type:J,description:"Common properties for image resources",tags:[{key:ce.resource_image,description:"The image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[ce.group_resourceImagePortrait]:{type:J,description:"Portrait image resource",tags:[{key:ce.resource_imagePortrait,description:"The portrait image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the portrait image resource"}]}]},[ce.group_resourceImageLandscape]:{type:J,description:"Landscape image resource",tags:[{key:ce.resource_imageLandscape,description:"The landscape image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the landscape image resource"}]}]},[ce.group_resourceImageEmbed]:{type:J,description:"Embedded image resource",tags:[{key:ce.resource_imageEmbed,description:"The embedded image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the embedded image resource"}]}]},[ce.group_resourceImageLink]:{type:J,description:"Link to an image resource",tags:[{key:ce.resource_imageLink,description:"The link to the image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the linked image resource"}]}]},[ce.group_resourceAudio]:{type:J,description:"Audio resource",tags:[{key:ce.resource_audio,description:"The audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the audio resource"}]}]},[ce.group_resourceAudioEmbed]:{type:J,description:"Embedded audio resource",tags:[{key:ce.resource_audioEmbed,description:"The embedded audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the embedded audio resource"}]}]},[ce.group_resourceAudioLink]:{type:J,description:"Link to an audio resource",tags:[{key:ce.resource_audioLink,description:"The link to the audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the linked audio resource"}]}]},[ce.group_resourceVideo]:{type:J,description:"Video resource",tags:[{key:ce.resource_video,description:"The video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the video resource"}]}]},[ce.group_resourceVideoEmbed]:{type:J,description:"Embedded video resource",tags:[{key:ce.resource_videoEmbed,description:"The embedded video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the embedded video resource"}]}]},[ce.group_resourceVideoLink]:{type:J,description:"Link to a video resource",tags:[{key:ce.resource_videoLink,description:"The link to the video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the linked video resource"}]}]},[ce.group_resourceStillImageFilmEmbed]:{type:J,description:"Embedded still image film resource",tags:[{key:ce.resource_stillImageFilmEmbed,description:"The embedded still image film resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the embedded still image film resource"}]}]},[ce.group_resourceStillImageFilmLink]:{type:J,description:"Link to a still image film resource",tags:[{key:ce.resource_stillImageFilmLink,description:"The link to the still image film resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the linked still image film resource"}]}]},[ce.group_resourceArticle]:{type:J,description:"Article resource",tags:[{key:ce.resource_article,description:"The article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the article resource"}]}]},[ce.group_resourceArticleEmbed]:{type:J,description:"Embedded article resource",tags:[{key:ce.resource_articleEmbed,description:"The embedded article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the embedded article resource"}]}]},[ce.group_resourceArticleLink]:{type:J,description:"Link to an article resource",tags:[{key:ce.resource_articleLink,description:"The link to the article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked article resource"}]}]},[ce.group_resourceDocument]:{type:J,description:"Document resource",tags:[{key:ce.resource_document,description:"The document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the document resource"}]}]},[ce.group_resourceDocumentEmbed]:{type:J,description:"Embedded document resource",tags:[{key:ce.resource_documentEmbed,description:"The embedded document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the embedded document resource"}]}]},[ce.group_resourceDocumentLink]:{type:J,description:"Link to a document resource",tags:[{key:ce.resource_documentLink,description:"The link to the document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked document resource"}]}]},[ce.group_resourceDocumentDownload]:{type:J,description:"Downloadable document resource",tags:[{key:ce.resource_documentDownload,description:"The downloadable document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the downloadable document resource"}]}]},[ce.group_resourceAppLink]:{type:J,description:"Link to an app resource",tags:[{key:ce.resource_appLink,description:"The link to the app resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked app resource"}]}]},[ce.group_resourceWebsiteLink]:{type:J,description:"Link to a website resource",tags:[{key:ce.resource_websiteLink,description:"The link to the website resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked website resource"}]}]},[ce.group_resourceStillImageFilm]:{type:j,description:"Resource for still image film",comboResourceConfigKey:ce.resource_stillImageFilm,tags:[{key:ce.group_resourceImage,description:"The image resource for the still image film",maxCount:1,minCount:1},{key:ce.group_resourceAudio,description:"The audio resource for the still image film",maxCount:1,minCount:1}]},[ce.group_resourceImageResponsive]:{type:j,description:"Responsive image resource",comboResourceConfigKey:ce.resource_imageResponsive,tags:[{key:ce.group_resourceImagePortrait,description:"The portrait image resource",maxCount:1,minCount:1},{key:ce.group_resourceImageLandscape,description:"The landscape image resource",maxCount:1,minCount:1}]},[ce.group_previewImages]:{type:J,description:"Array of preview images for catalog items",tags:[{key:ce.resource_previewImage,description:"The preview image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[ce.group_previewVideos]:{type:J,description:"Array of preview videos for catalog items",tags:[{key:ce.resource_previewVideo,description:"The preview video resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]}},ye=new class{hydrateTagsConfig(e){const t={tags:{}};for(const r of e){let e;switch(pe(r.key)){case H:e=this.hydrateTagConfig(r);break;case U:e=this.hydratePropertyTagConfig(r);break;case G:e=this.hydrateResourceTagConfig(r);break;case K:e=this.hydrateTagGroupConfig(r);break;default:throw new Error(`Unknown tag type for config key '${r.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=fe[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new te(e,r)}hydrateTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a}=e,s=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!s)throw new Error(`No tag key found for config key '${s}'`);const n=(0,ge.Enum)(f).fromValue(s);if(!n)throw new Error(`No tag found for tag config key '${s}'`);let l;o&&(l=this.hydrateTagsConfig(o).tags);const c=new Q({configKey:s,tag:n,maxCount:r??1,minCount:i??0,chain:l,deprecated:a});return{tags:{[s]:c}}}hydratePropertyTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a,format:s,defaultValue:n,jsonKey:l}=e,c=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!c)throw new Error(`No property key found for config key '${c}'`);const p=t.substring(1);let d;o&&(d=this.hydrateTagsConfig(o).tags);const u=new X({configKey:c,tag:p,maxCount:r??1,minCount:i??0,chain:d,jsonKey:l,format:s,defaultValue:n,deprecated:a});return{tags:{[c]:u}}}hydrateResourceTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a,jsonKey:s}=e,n=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!n)throw new Error(`No resource key found for config key '${n}'`);const l=t.substring(1);let c;o&&(c=this.hydrateTagsConfig(o).tags);const p=new Z({configKey:n,tag:l,maxCount:r??1,minCount:i??0,chain:c,jsonKey:s,deprecated:a});return{tags:{[n]:p}}}hydrateTagGroupConfig(e){const{key:t}=e,r=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!r)throw new Error(`No group key found for config key '${r}'`);const i=be[r];if(!i)throw new Error(`No config found for group config key '${t}'`);const{tags:o}=i,a=this.hydrateTagsConfig(o).tags,s=Object.values(a);if(s.length>0){const t=s[0],r=t;r.maxCount=e.maxCount??t.maxCount,r.minCount=e.minCount??t.minCount}return{tags:a,info:{comboResourceConfigKey:i.comboResourceConfigKey}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:i,repeatCount:o}=e,a=this.hydrateTagsConfig(t);return new ee(a.tags,r,i,o)}},ke={[d._error]:{since:"1.3.0",description:"An error bit, rendered when the bit cannot be interpreted"},[d._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]"},[d._standard]:{since:"3.2.0",description:"The standard bit type, used as a base for other bits, should not be used directly",tags:[{key:ce.group_standardTags,description:"Standard tags for (almost) all bits"}]},[d.appFlashcards]:{since:"1.3.0",baseBitType:d._standard,description:"App flashcards bit, used for flashcard quizzes in the app",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.tag_title,description:"The title of the flashcard quiz"},{key:ce.property_flashcardSet,description:"The flashcard set to use for the app flashcards",format:b,maxCount:u}],rootExampleType:m},[d.appFlashcardsQuiz]:{since:"1.3.0",baseBitType:d.appFlashcards,description:"App flashcards quiz bit"},[d.appFlashcardsLearn]:{since:"1.3.0",baseBitType:d.appFlashcards,description:"App flashcards learn bit"},[d.appLink]:{since:"1.3.0",baseBitType:d._standard,description:"App link bit, used to link to other bits in the app",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAppLink,description:"Tags for the app link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.author]:{since:"4.2.0",baseBitType:d._standard,description:"Represents an author of something",tags:[{key:ce.property_fullName,description:"Full name of the author"},{key:ce.property_pseudonym,description:"A pseudonym of the author, if any"},{key:ce.property_title,description:'The title of the author, e.g. "Dr.", "Prof.", etc.',jsonKey:"title"},{key:ce.property_jobTitle,description:'The job title of the author, e.g. "Software Engineer", "Professor", etc.'}]},[d.bookAuthor]:{since:"4.2.0",baseBitType:d.author,description:"Represents an author of a book"},[d.articleAuthor]:{since:"4.2.0",baseBitType:d.author,description:"Represents an author of a book"},[d.article]:{since:"1.3.0",baseBitType:d._standard,description:"Article bit, used for articles / paragraphs",tags:[{key:ce.tag_title,description:"The title of the article"}]},[d.articleAlt]:{since:"1.15.0",baseBitType:d.article,description:"Alternative article bit"},[d.articleResponsive]:{since:"1.21.0",baseBitType:d.article,description:"Responsive article bit, used for articles that adapt to the screen size",tags:[{key:ce.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:v,defaultValue:"true"}]},[d.articleResponsiveAlt]:{since:"2.0.0",baseBitType:d.articleResponsive,description:"Alternative responsive article bit"},[d.standardArticleNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard normative article bit"},[d.standardArticleNonNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard non-normative article bit"},[d.smartStandardArticleNormative]:{since:"1.28.0",baseBitType:d.standardArticleNormative,description:"Smart standard normative article bit"},[d.smartStandardArticleNonNormative]:{since:"1.28.0",baseBitType:d.standardArticleNonNormative,description:"Smart standard non-normative article bit"},[d.smartStandardArticleNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardArticleNormative,description:"Smart standard normative article bit that is collapsible"},[d.smartStandardArticleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardArticleNonNormative,description:"Smart standard non-normative article bit that is collapsible"},[d.statement]:{since:"1.3.0",baseBitType:d.article,description:"Statement bit, used for statements in documents"},[d.pageArticle]:{since:"1.15.0",baseBitType:d.article,description:"Page article bit"},[d.pageArticleAlt]:{since:"1.15.0",baseBitType:d.article,description:"Alternative page article bit"},[d.pageArticleResponsive]:{since:"1.21.0",baseBitType:d.article,description:"Responsive page article bit, used for articles that adapt to the screen size",tags:[{key:ce.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:v,defaultValue:"true"}]},[d.buttonCopyText]:{since:"1.4.3",baseBitType:d.article,description:"Button copy text bit, used to create a button that copies text to the clipboard",tags:[{key:ce.property_buttonCaption,description:"The caption of the button",format:b}]},[d.catalogItemBook]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item book bit, used to represent a book product in a catalog with cover and description",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.resource_coverImage,description:"Cover image of the catalog item",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_content2Buy,description:"Content to buy identifier",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.catalogItemExternalBook]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item external book bit, used to represent an external book product in a catalog with link to external shop",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.resource_coverImage,description:"Cover image of the catalog item",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_customerProductShopLink,description:"Link to external shop for the product",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.catalogItemProduct]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item product bit, used to represent a general product in a catalog with cover and description",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.property_content2Buy,description:"Content to buy identifier",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.callToAction]:{since:"1.15.0",baseBitType:d._standard,description:"Call to action bit, used to create a call to action button",tags:[{key:ce.property_buttonCaption,description:"The caption of the call to action button",format:b},{key:ce.property_callToActionUrl,description:"The URL to navigate to when the call to action button is clicked",format:b,minCount:1}]},[d.callToActionSubscribe]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action subscribe bit"},[d.callToActionContact]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action contact bit"},[d.callToActionJoin]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action join bit"},[d.callToActionMail]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action mail bit"},[d.callToActionLearnMore]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action learn more bit"},[d.callToActionSeeMore]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action see more bit"},[d.callToActionWatch]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action watch bit"},[d.callToActionStartNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action start now bit"},[d.callToActionGetOffer]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action get offer bit"},[d.callToActionBookNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action book now bit"},[d.callToActionShopNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action shop now bit"},[d.callToActionGetNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action get now bit"},[d.callToActionDownload]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action download bit"},[d.callToActionCreateAccount]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action create account bit"},[d.appBitmarkFromJavascript]:{since:"1.4.5",baseBitType:d._standard,description:"App bitmark from JavaScript, used to create bits from JavaScript in the app",tags:[{key:ce.property_maxCreatedBits,description:"The maximum number of bits that can be created from this bit",format:k}],textFormatDefault:x.plainText},[d.appBitmarkFromEditor]:{since:"1.4.5",baseBitType:d.appBitmarkFromJavascript,description:"App bitmark from editor, used to create bits from the editor in the app"},[d.articleEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Article embed bit, used to embed articles from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceArticleEmbed,description:"Tags for the article embed resource",minCount:1}],resourceAttachmentAllowed:!1},[d.articleLink]:{since:"1.3.0",baseBitType:d._standard,description:"Article link bit, used to link to articles from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceArticleLink,description:"Tags for the article link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audio]:{since:"1.3.0",baseBitType:d._standard,description:"Audio bit, used for audio files",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudio,description:"Tags for the audio resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audioEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Audio embed bit, used to embed audio files from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudioEmbed,description:"Tags for the audio embed resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audioLink]:{since:"1.3.0",baseBitType:d._standard,description:"Audio link bit, used to link to audio files from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudioLink,description:"Tags for the audio link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.bitAlias]:{since:"1.3.0",baseBitType:d._standard,description:"Bit alias, used to create an alias for a bit",tags:[{key:ce.tag_reference,description:"The reference to the bit that this alias points to"},{key:ce.tag_anchor,description:"The anchor for the bit alias, used for linking"}]},[d.diff]:{since:"3.13.0",baseBitType:d._standard,description:"Diff bit, used to show differences between two bits",tags:[{key:ce.property_diffTo,description:"The reference to the bit that this diff compares to",format:b}]},[d.book]:{since:"1.3.0",baseBitType:d._standard,description:"Book bit, used to represent a book",tags:[{key:ce.group_bookCommon,description:"Common tags for book bits"}]},[d.bookEnd]:{since:"3.27.0",baseBitType:d.article,description:"End of book bit"},[d.bookAcknowledgements]:{since:"1.17.0",baseBitType:d.article,description:"Acknowledgements section of a book"},[d.bookAddendum]:{since:"1.3.0",baseBitType:d.article,description:"Addendum section of a book"},[d.bookAfterword]:{since:"1.3.0",baseBitType:d.article,description:"Afterword section of a book"},[d.bookAppendix]:{since:"1.3.0",baseBitType:d.article,description:"Appendix section of a book"},[d.bookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Article section of a book"},[d.bookAutherBio]:{since:"1.3.0",baseBitType:d.article,description:"Author biography section of a book"},[d.bookBibliography]:{since:"1.3.0",baseBitType:d.article,description:"Bibliography section of a book"},[d.bookComingSoon]:{since:"1.3.0",baseBitType:d.article,description:"Coming soon section of a book"},[d.bookConclusion]:{since:"1.3.0",baseBitType:d.article,description:"Conclusion section of a book"},[d.bookCopyright]:{since:"1.3.0",baseBitType:d.article,description:"Copyright section of a book"},[d.bookCopyrightPermissions]:{since:"1.3.0",baseBitType:d.article,description:"Copyright permissions section of a book"},[d.bookDedication]:{since:"1.3.0",baseBitType:d.article,description:"Dedication section of a book"},[d.bookEndnotes]:{since:"1.3.0",baseBitType:d.article,description:"Endnotes section of a book"},[d.bookEpigraph]:{since:"1.3.0",baseBitType:d.article,description:"Epigraph section of a book"},[d.bookEpilogue]:{since:"1.3.0",baseBitType:d.article,description:"Epilogue section of a book"},[d.bookForword]:{since:"1.3.0",baseBitType:d.article,description:"Foreword section of a book"},[d.bookFrontispiece]:{since:"1.3.0",baseBitType:d.article,description:"Frontispiece section of a book"},[d.bookImprint]:{since:"1.3.0",baseBitType:d.article,description:"Imprint section of a book"},[d.bookIncitingIncident]:{since:"1.3.0",baseBitType:d.article,description:"Inciting incident section of a book"},[d.bookIntroduction]:{since:"1.3.0",baseBitType:d.article,description:"Introduction section of a book"},[d.bookListOfContributors]:{since:"1.3.0",baseBitType:d.article,description:"List of contributors section of a book"},[d.bookNotes]:{since:"1.3.0",baseBitType:d.article,description:"Notes section of a book"},[d.bookPostscript]:{since:"1.3.0",baseBitType:d.article,description:"Postscript section of a book"},[d.bookPreface]:{since:"1.3.0",baseBitType:d.article,description:"Preface section of a book"},[d.bookPrologue]:{since:"1.3.0",baseBitType:d.article,description:"Prologue section of a book"},[d.bookReadMore]:{since:"1.3.0",baseBitType:d.article,description:"Read more section of a book"},[d.bookReferenceList]:{since:"3.2.0",baseBitType:d._standard,description:"Book reference list, used to list references in a book",cardSet:z},[d.bookRequestForABookReview]:{since:"1.3.0",baseBitType:d.article,description:"Request for a book review section of a book"},[d.bookSummary]:{since:"1.3.0",baseBitType:d.article,description:"Summary section of a book"},[d.bookTeaser]:{since:"1.3.0",baseBitType:d.article,description:"Teaser section of a book"},[d.bookTitle]:{since:"1.3.0",baseBitType:d.article,description:"Title section of a book"},[d.bookCover]:{since:"3.27.0",baseBitType:d.image,description:"Cover image of a book",tags:[{key:ce.tag_title,description:"The title of the book cover",maxCount:2},{key:ce.property_coverColor,description:"The color of the book cover",format:b}]},[d.bookAlias]:{since:"1.4.3",baseBitType:d.book,description:"Book alias, used to create an alias for a book",tags:[{key:ce.property_bookAlias,description:"The alias for the book",format:b,maxCount:u}]},[d.bookDiff]:{since:"3.10.0",baseBitType:d.book,description:"Book diff, used to show differences between two book versions",tags:[{key:ce.property_bookDiff,description:"The reference to the book that this diff compares to",format:b}]},[d.bookClose]:{since:"1.18.0",baseBitType:d.article,description:"Close section of a book, used to close the book",tags:[{key:ce.property_buttonCaption,description:"The caption of the close button",format:b}]},[d.bookReference]:{since:"2.2.0",baseBitType:d.article,description:"Book reference, used to reference a book in another book",tags:[{key:ce.property_refAuthor,description:"The author of the referenced book",format:b,maxCount:u},{key:ce.property_refBookTitle,description:"The title of the referenced book",format:b},{key:ce.property_refPublisher,description:"The publisher of the referenced book",format:b,maxCount:u},{key:ce.property_refPublicationYear,description:"The publication year of the referenced book",format:b},{key:ce.property_citationStyle,description:"The citation style to use for the book reference",format:b}]},[d.botActionResponse]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action response bit, used to define responses for bot actions",cardSet:O},[d.botActionSend]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action send bit, used to define actions for sending messages",tags:[{key:ce.property_date,description:"The date when the message should be sent",format:b}]},[d.browserImage]:{since:"1.3.0",baseBitType:d.image,description:"Browser image bit, used to display images in the browser",tags:[{key:ce.property_focusX,description:"The X coordinate for focusing the image in the browser",format:k},{key:ce.property_focusY,description:"The Y coordinate for focusing the image in the browser",format:k}]},[d.card1]:{since:"1.3.0",baseBitType:d._standard,description:"Card bit, used for cards in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"}]},[d.question1]:{since:"1.3.0",baseBitType:d.card1,description:"Question card bit"},[d.survey1]:{since:"1.3.0",baseBitType:d.card1,description:"Survey card bit"},[d.surveyAnonymous1]:{since:"1.3.0",baseBitType:d.card1,description:"Anonymous survey card bit"},[d.chapter]:{since:"1.3.0",baseBitType:d._standard,description:"Chapter bit, used to define chapters in books or articles",tags:[{key:ce.tag_anchor,description:"The anchor for the chapter, used for linking"},{key:ce.tag_title,description:"The title of the chapter"},{key:ce.property_toc,description:"If the chapter should be included in the table of contents",format:v,defaultValue:"true"},{key:ce.property_progress,description:"The progress of the chapter, used for tracking reading progress",format:v,defaultValue:"true"}]},[d.clozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:d._standard,description:"Cloze and multiple choice text bit, used for quizzes with cloze and multiple choice questions",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.group_gap,description:"Tags for gaps in cloze and multiple choice text bits"},{key:ce.group_trueFalse,description:"Tags for true/false questions in cloze and multiple choice text bits"}]},[d.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:d.clozeAndMultipleChoiceText,description:"Coach call to action cloze and multiple choice text bit"},[d.cloze]:{since:"1.3.0",baseBitType:d._standard,description:"Cloze bit, used for fill-in-the-blank questions in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.property_isCaseSensitive,description:"If the cloze answers are case sensitive",format:v},{key:ce.property_quizCountItems,description:"The number of items in the cloze quiz",format:v},{key:ce.property_quizStrikethroughSolutions,description:"If the cloze solutions should be strikethrough",format:v},{key:ce.group_gap,description:"Tags for gaps in cloze bits"}]},[d.clozeInstructionGrouped]:{since:"1.3.0",baseBitType:d.cloze,description:"Cloze instruction grouped bit, used for cloze questions with grouped instructions"},[d.clozeSolutionGrouped]:{since:"1.3.0",baseBitType:d.cloze,description:"Cloze solution grouped bit, used for cloze questions with grouped solutions"},[d.clozeSeveral]:{since:"3.5.0",baseBitType:d.cloze,description:"Cloze several bit, used for cloze questions with multiple answers"},[d.gapText]:{since:"1.5.15",baseBitType:d.cloze,description:"Gap text bit, used for fill-in-the-blank questions in quizzes with text gaps"},[d.gapTextInstructionGrouped]:{since:"1.5.15",baseBitType:d.clozeInstructionGrouped,description:"Gap text instruction grouped bit, used for fill-in-the-blank questions with grouped instructions"},[d.coachSelfReflectionCloze]:{since:"1.3.0",baseBitType:d.cloze,description:"Coach self-reflection cloze bit, used for self-reflection questions in coaching"},[d.coachCallToActionCloze]:{since:"1.3.0",baseBitType:d.cloze,description:"Coach call to action cloze bit, used for call to action questions in coaching"},[d.clozeList]:{since:"1.4.13",baseBitType:d._standard,description:"Cloze list bit, used for lists of cloze questions in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"}],cardSet:M},[d.code]:{since:"1.3.0",baseBitType:d._standard,description:"Code bit, used for code snippets in articles or documents",tags:[{key:ce.property_computerLanguage,description:"The programming language of the code snippet",format:b},{key:ce.property_codeLineNumbers,description:"If line numbers should be displayed for the code snippet",format:v},{key:ce.property_codeMinimap,description:"If a minimap should be displayed for the code snippet",format:v}],textFormatDefault:x.plainText},[d.formula]:{since:"1.35.0",baseBitType:d._standard,description:"Formula bit, used for mathematical formulas in articles or documents",textFormatDefault:x.latex},[d.smartStandardFormula]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard formula bit, used for mathematical formulas in smart standards"},[d.smartStandardFormulaNonNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard non-normative formula bit, used for mathematical formulas in smart standards that are non-normative"},[d.smartStandardFormulaNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard normative formula bit, used for mathematical formulas in smart standards that are normative"},[d.smartStandardRemarkFormula]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard remark formula bit, used for mathematical formulas in smart standards remarks"},[d.smartStandardRemarkFormulaNonNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard non-normative remark formula bit, used for mathematical formulas in smart standards remarks that are non-normative"},[d.smartStandardRemarkFormulaNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard normative remark formula bit, used for mathematical formulas in smart standards remarks that are normative"},[d.appCodeCell]:{since:"1.4.3",baseBitType:d.code,description:"App code cell, used to create code cells in the app editor"},[d.appCodeEditor]:{since:"1.4.3",baseBitType:d.code,description:"App code editor, used to create code editors in the app editor"},[d.appCodeIde]:{since:"1.4.3",baseBitType:d.code,description:"App code IDE, used to create code IDEs in the app editor"},[d.codeRuntime]:{since:"1.4.3",baseBitType:d.code,description:"Code runtime, used to define the runtime environment for code snippets"},[d.consoleLog]:{since:"1.4.3",baseBitType:d.code,description:"Console log, used to log messages to the console in code snippets"},[d.output]:{since:"1.4.3",baseBitType:d.code,description:"Output bit, used to display output from code snippets"},[d.stdout]:{since:"1.4.3",baseBitType:d.code,description:"Standard output bit, used to display standard output from code snippets"},[d.sandbox]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox bit, used to create a sandboxed environment for code execution"},[d.sandboxOutputJson]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output JSON bit, used to display JSON output from sandboxed code"},[d.sandboxOutputMarkup]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output markup bit, used to display markup output from sandboxed code"},[d.sandboxOutputRender]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output render bit, used to display rendered output from sandboxed code"},[d.step]:{since:"1.5.1",baseBitType:d.article,description:"Step bit, used to define steps in a process or guide"},[d.stepImageScreenshot]:{since:"1.5.1",baseBitType:d.image,description:"Step image screenshot bit, used to display screenshots in steps"},[d.stepImageScreenshotWithPointer]:{since:"1.5.1",baseBitType:d.image,description:"Step image screenshot with pointer bit, used to display screenshots with pointers in steps",tags:[{key:ce.property_pointerTop,description:"The top position of the pointer in the screenshot",format:b,minCount:1,maxCount:1},{key:ce.property_pointerLeft,description:"The left position of the pointer in the screenshot",format:b,minCount:1,maxCount:1}]},[d.milestone]:{since:"1.20.0",baseBitType:d.step,description:"Milestone bit, used to define milestones in a process or guide"},[d.conversationLeft1]:{since:"1.3.0",baseBitType:d._standard,description:"Conversation left bit, used to create a conversation on the left side of the screen",tags:[{key:ce.group_person,description:"Tags for the person in the conversation"}]},[d.conversationLeft1Scream]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation left scream bit, used to create a conversation with a scream on the left side of the screen"},[d.conversationLeft1Thought]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation left thought bit, used to create a conversation with a thought on the left side of the screen"},[d.conversationRight1]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right bit, used to create a conversation on the right side of the screen"},[d.conversationRight1Scream]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right scream bit, used to create a conversation with a scream on the right side of the screen"},[d.conversationRight1Thought]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right thought bit, used to create a conversation with a thought on the right side of the screen"},[d.clozeAndMultipleChoiceTextConversationLeft1]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationLeft1Scream]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationLeft1Thought]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1Scream]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1Thought]:{since:"1.3.0",baseBitType:d.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"},[d.advertising]:{since:"4.2.0",baseBitType:d.article,description:"General advertising content bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingAdvertorial]:{since:"4.2.0",baseBitType:d.article,description:"Advertorial content bit (sponsored article)",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingCallToAction]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for advertising",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingCallToActionMeeting]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for meeting or appointment",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingBanner]:{since:"4.2.0",baseBitType:d.image,description:"Banner advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingSkyscraper]:{since:"4.2.0",baseBitType:d.image,description:"Skyscraper (vertical) advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingRectangle]:{since:"4.2.0",baseBitType:d.image,description:"Rectangle advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingFullPage]:{since:"4.2.0",baseBitType:d.image,description:"Full-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingHalfPage]:{since:"4.2.0",baseBitType:d.image,description:"Half-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingQuarterPage]:{since:"4.2.0",baseBitType:d.image,description:"Quarter-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingClassifiedPage]:{since:"4.2.0",baseBitType:d.image,description:"Classifieds advertisement page bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingLandscape]:{since:"4.2.0",baseBitType:d.image,description:"Landscape format advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingPortrait]:{since:"4.2.0",baseBitType:d.image,description:"Portrait format advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.cookPreparation]:{since:"1.3.0",baseBitType:d.article,description:"Cook preparation bit"},[d.cookStep]:{since:"1.3.0",baseBitType:d.article,description:"Cook step bit"},[d.cookIngredients]:{since:"1.5.16",baseBitType:d._standard,description:"Cook ingredients bit, used to define ingredients for recipes",tags:[{key:ce.group_technicalTerm,description:"Tags for technical terms related to ingredients"},{key:ce.property_servings,description:"The number of servings for the ingredients",format:k,chain:[{key:ce.property_unit,description:"The unit of measurement for the ingredients",format:b},{key:ce.property_unitAbbr,description:"The abbreviation for the unit of measurement",format:b},{key:ce.property_decimalPlaces,description:"The number of decimal places for the ingredient quantity",format:k,defaultValue:"1"},{key:ce.property_disableCalculation,description:"If the ingredient quantity calculation should be disabled",format:v},{key:ce.tag_hint,description:"Hint for the ingredient, used to provide additional information"}]}],cardSet:q},[d.recipe]:{since:"1.5.24",baseBitType:d.cookIngredients,description:"Recipe bit, used to define a recipe"},[d.cookRemark]:{since:"1.3.0",baseBitType:d.article,description:"Cook remark bit, used to add remarks to recipes"},[d.cookVariation]:{since:"1.3.0",baseBitType:d.article,description:"Cook variation bit, used to define variations of recipes"},[d.cookInsert]:{since:"1.3.0",baseBitType:d.article,description:"Cook insert bit, used to insert additional content in recipes"},[d.cookNoteOnQuantity]:{since:"3.27.0",baseBitType:d.article,description:"Cook note on quantity bit, used to add notes on ingredient quantities in recipes"},[d.cookArrangement]:{since:"1.3.0",baseBitType:d.article,description:"Cook arrangement bit, used to arrange ingredients or steps in recipes"},[d.cookPracticeAdvise]:{since:"1.3.0",baseBitType:d.article,description:"Cook practice advice bit, used to provide practical advice in recipes"},[d.cookPlate]:{since:"1.3.0",baseBitType:d.article,description:"Cook plate bit, used to define the presentation of a dish"},[d.cookRecommendation]:{since:"1.3.0",baseBitType:d.article,description:"Cook recommendation bit, used to recommend dishes or ingredients"},[d.cookPersonalRecommendation]:{since:"1.3.0",baseBitType:d.article,description:"Cook personal recommendation bit, used to provide personal recommendations for dishes or ingredients"},[d.cookSideDrink]:{since:"1.3.0",baseBitType:d.article,description:"Cook side drink bit, used to define side drinks for dishes"},[d.cookSideDish]:{since:"1.3.0",baseBitType:d.article,description:"Cook side dish bit, used to define side dishes for main courses"},[d.cookTimer]:{since:"1.3.0",baseBitType:d.article,description:"Cook timer bit, used to set timers for cooking steps"},[d.document]:{since:"1.3.0",baseBitType:d._standard,description:"Document bit, used to define documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize documents"},{key:ce.group_resourceDocument,description:"Tags for document resources, used to define documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.documentDownload]:{since:"1.3.0",baseBitType:d._standard,description:"Document download bit, used to define downloadable documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize downloadable documents"},{key:ce.group_resourceDocumentDownload,description:"Tags for downloadable document resources, used to define downloadable documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.leDocumentDownload]:{since:"3.18.0",baseBitType:d.documentDownload,description:"LE Document download bit, used to define downloadable documents in learning experiences"},[d.documentEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Document embed bit, used to embed documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize embedded documents"},{key:ce.group_resourceDocumentEmbed,description:"Tags for embedded document resources, used to define embedded documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.documentLink]:{since:"1.3.0",baseBitType:d._standard,description:"Document link bit, used to link to documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize document links"},{key:ce.group_resourceDocumentLink,description:"Tags for document link resources, used to define links to documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.essay]:{since:"1.3.0",baseBitType:d._standard,description:"Essay bit, used to define essays in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.property_reasonableNumOfChars,description:"The reasonable number of characters for the essay",format:k},{key:ce.property_sampleSolution,description:"Sample solution for the essay, used as a reference answer",format:b},{key:ce.property_partialAnswer,description:"Partial answer for the essay, used to indicate incomplete answers",format:b},{key:ce.property_reference,description:"Reference for the essay, used to link to external resources",format:b,maxCount:u}],rootExampleType:m},[d.coachSelfReflectionEssay]:{since:"1.3.0",baseBitType:d.essay,description:"Coach self-reflection essay bit"},[d.coachCallToActionEssay]:{since:"1.3.0",baseBitType:d.essay,description:"Coach call to action essay bit"},[d.example]:{since:"1.3.0",baseBitType:d._standard,description:"Example bit, used to provide examples in articles or books",tags:[{key:ce.tag_title,description:"The title of the example"}],rootExampleType:m},[d.exampleAlt]:{since:"1.16.0",baseBitType:d.example,description:"Alternative example bit, used to provide alternative examples in articles or books"},[d.standardExampleNormative]:{since:"1.16.0",baseBitType:d.example,description:"Standard normative example bit, used to provide normative examples in articles or books"},[d.standardExampleNonNormative]:{since:"1.16.0",baseBitType:d.example,description:"Standard non-normative example bit, used to provide non-normative examples in articles or books"},[d.smartStandardExampleNormative]:{since:"1.28.0",baseBitType:d.standardExampleNormative,description:"Smart standard normative example bit, used to provide normative examples in smart standards"},[d.smartStandardExampleNonNormative]:{since:"1.28.0",baseBitType:d.standardExampleNonNormative,description:"Smart standard non-normative example bit, used to provide non-normative examples in smart standards"},[d.smartStandardExampleNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardExampleNormative,description:"Smart standard normative example collapsible bit, used to provide normative examples in smart standards that can be collapsed"},[d.smartStandardExampleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardExampleNonNormative,description:"Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"},[d.authorContentBitGenerator]:{since:"4.2.0",baseBitType:d.article,description:"Body contains the content of one or more bits to be created by the bit generator",tags:[{key:ce.property_classification,description:"Classification for the created bits",format:b,maxCount:u}]},[d.appAiPrompt]:{since:"1.3.0",baseBitType:d.article,description:"App AI prompt bit, used to create AI prompts in the app editor"},[d.aiPrompt]:{since:"1.3.0",baseBitType:d.article,description:"AI prompt bit, used to create AI prompts in articles or books"},[d.aiChat]:{since:"4.2.0",baseBitType:d.article,description:"AI chat bit, used to create an AI chat"},[d.aiEditor]:{since:"4.2.0",baseBitType:d.article,description:"AI editor bit, used to create an AI editor"},[d.aiTutor]:{since:"4.2.0",baseBitType:d.article,description:"AI tutor bit, used to create an AI tutor"},[d.aiWbt]:{since:"4.2.0",baseBitType:d.article,description:"AI WBT bit, used to create an AI WBT (Web-Based Training)"},[d.articleAi]:{since:"1.3.0",baseBitType:d.article,description:"Article AI bit, used to create AI-generated articles"},[d.articleAttachment]:{since:"1.3.0",baseBitType:d.article,description:"Article attachment bit, used to attach files to articles"},[d.assignment]:{since:"1.3.0",baseBitType:d.essay,description:"Assignment bit, used to define assignments in articles or books"},[d.audioTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Audio transcript bit, used to provide transcripts for audio files in articles or books"},[d.bitmarkExample]:{since:"1.3.0",baseBitType:d.example,description:"Bitmark example bit, used to provide examples for bitmarks in articles or books"},[d.blogArticle]:{since:"1.3.0",baseBitType:d.article,description:"Blog article bit, used to define blog articles in articles or books"},[d.bug]:{since:"1.3.0",baseBitType:d.article,description:"Bug bit, used to report bugs in articles or books"},[d.bugAlt]:{since:"1.16.0",baseBitType:d.bug,description:"Alternative bug bit, used to report bugs in articles or books with alternative styling"},[d.checklist]:{since:"1.3.0",baseBitType:d.article,description:"Checklist bit, used to create checklists in articles or books"},[d.coachAudioTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Coach audio transcript bit, used to provide transcripts for audio files in coaching articles or books"},[d.coachCallToActionChecklist]:{since:"1.3.0",baseBitType:d.article,description:"Coach call to action checklist bit, used to create checklists in coaching articles or books"},[d.coachHomeRules]:{since:"1.3.0",baseBitType:d.article,description:"Coach home rules bit, used to define home rules in coaching articles or books"},[d.coachVideoTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Coach video transcript bit, used to provide transcripts for video files in coaching articles or books"},[d.correction]:{since:"1.3.0",baseBitType:d.article,description:"Correction bit, used to provide corrections in articles or books"},[d.danger]:{since:"1.3.0",baseBitType:d.article,description:"Danger bit, used to highlight dangerous or critical information in articles or books"},[d.dangerAlt]:{since:"1.16.0",baseBitType:d.article,description:"Alternative danger bit, used to highlight dangerous or critical information in articles or books with alternative styling"},[d.definitionTerm]:{since:"1.34.0",baseBitType:d.article,description:"Definition term bit, used to define terms in articles or books"},[d.deleted]:{since:"3.9.0",baseBitType:d.article,description:"Deleted bit, used to indicate deleted content in articles or books"},[d.details1]:{since:"1.3.0",baseBitType:d.article,description:"Details bit, used to provide additional details in articles or books"},[d.details]:{since:"1.3.0",baseBitType:d.article,description:"Details bit, used to provide additional details in articles or books"},[d.qAndA]:{since:"3.5.0",baseBitType:d.article,description:"Q&A bit, used to create question and answer sections in articles or books"},[d.editorial]:{since:"1.3.0",baseBitType:d.article,description:"Editorial bit, used to provide editorial content in articles or books"},[d.editorNote]:{since:"1.3.0",baseBitType:d.article,description:"Editor note bit, used to provide notes from the editor in articles or books"},[d.featured]:{since:"1.3.0",baseBitType:d.article,description:"Featured bit, used to highlight featured content in articles or books"},[d.glossaryTerm]:{since:"1.33.0",baseBitType:d.article,description:"Glossary term bit, used to define glossary terms in articles or books"},[d.help]:{since:"1.3.0",baseBitType:d.article,description:"Help bit, used to provide help or support information in articles or books"},[d.helpAlt]:{since:"1.16.0",baseBitType:d.help,description:"Alternative help bit, used to provide help or support information in articles or books with alternative styling"},[d.hint]:{since:"1.3.0",baseBitType:d.article,description:"Hint bit, used to provide hints or tips in articles or books"},[d.hintAlt]:{since:"1.16.0",baseBitType:d.hint,description:"Alternative hint bit, used to provide hints or tips in articles or books with alternative styling"},[d.indexTerm]:{since:"1.33.0",baseBitType:d.article,description:"Index term bit, used to define index terms in articles or books"},[d.info]:{since:"1.3.0",baseBitType:d.article,description:"Info bit, used to provide informational content in articles or books"},[d.infoAlt]:{since:"1.16.0",baseBitType:d.info,description:"Alternative info bit, used to provide informational content in articles or books with alternative styling"},[d.langLearningOutcomes]:{since:"1.3.0",baseBitType:d.article,description:"Language learning outcomes bit, used to define learning outcomes in language articles or books"},[d.langEnablingLanguageSkills]:{since:"1.3.0",baseBitType:d.article,description:"Language enabling skills bit, used to define enabling language skills in language articles or books"},[d.langLifeSkills]:{since:"1.3.0",baseBitType:d.article,description:"Language life skills bit, used to define life skills in language articles or books"},[d.langEnglishAroundWorld]:{since:"1.3.0",baseBitType:d.article,description:"Language English around the world bit, used to provide information about English usage around the world in language articles or books"},[d.langGoodToKnow]:{since:"1.3.0",baseBitType:d.article,description:"Language good to know bit, used to provide useful information in language articles or books"},[d.langLearningGoal]:{since:"1.3.0",baseBitType:d.article,description:"Language learning goal bit, used to define learning goals in language articles or books"},[d.langLearningStrategy]:{since:"1.3.0",baseBitType:d.article,description:"Language learning strategy bit, used to define learning strategies in language articles or books"},[d.langLikeALocal]:{since:"1.3.0",baseBitType:d.article,description:"Language like a local bit, used to provide tips for speaking like a local in language articles or books"},[d.langMaterial]:{since:"1.3.0",baseBitType:d.article,description:"Language material bit, used to provide language learning materials in language articles or books"},[d.langUsefulPhrases]:{since:"1.3.0",baseBitType:d.article,description:"Language useful phrases bit, used to provide useful phrases in language articles or books"},[d.langLevelDown]:{since:"1.3.0",baseBitType:d.article,description:"Language level down bit, used to provide information about lower language levels in language articles or books"},[d.langLevelUp]:{since:"1.3.0",baseBitType:d.article,description:"Language level up bit, used to provide information about higher language levels in language articles or books"},[d.langExtraActivity]:{since:"1.3.0",baseBitType:d.article,description:"Language extra activity bit, used to provide additional activities in language articles or books"},[d.langVideoScript]:{since:"1.3.0",baseBitType:d.article,description:"Language video script bit, used to provide scripts for language learning videos in articles or books"},[d.langAudioScript]:{since:"1.3.0",baseBitType:d.article,description:"Language audio script bit, used to provide scripts for language learning audio files in articles or books"},[d.langVocabulary]:{since:"1.3.0",baseBitType:d.article,description:"Language vocabulary bit, used to provide vocabulary lists in language articles or books"},[d.langHomework]:{since:"1.3.0",baseBitType:d.article,description:"Language homework bit, used to define homework assignments in language articles or books"},[d.langTeacherNote]:{since:"1.3.0",baseBitType:d.article,description:"Language teacher note bit, used to provide notes for teachers in language articles or books"},[d.langTeacherPronunciation]:{since:"1.3.0",baseBitType:d.article,description:"Language teacher pronunciation bit, used to provide pronunciation guidance for teachers in language articles or books"},[d.list]:{since:"1.22.0",baseBitType:d.article,description:"List bit, used to create lists in articles or books"},[d.standardList]:{since:"1.22.0",baseBitType:d.article,description:"Standard list bit, used to create standard lists in articles or books"},[d.smartStandardList]:{since:"1.28.0",baseBitType:d.standardList,description:"Smart standard list bit, used to create smart standard lists in articles or books"},[d.smartStandardListCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardList,description:"Smart standard list collapsible bit, used to create collapsible smart standard lists in articles or books"},[d.message]:{since:"1.3.0",baseBitType:d.article,description:"Message bit, used to create messages in articles or books"},[d.newspaperArticle]:{since:"1.3.0",baseBitType:d.article,description:"Newspaper article bit, used to define newspaper articles in articles or books"},[d.note]:{since:"1.3.0",baseBitType:d.article,description:"Note bit, used to provide notes in articles or books"},[d.noteAlt]:{since:"1.16.0",baseBitType:d.note,description:"Alternative note bit, used to provide notes in articles or books with alternative styling"},[d.standardNoteNormative]:{since:"1.16.0",baseBitType:d.note,description:"Standard normative note bit, used to provide normative notes in articles or books"},[d.standardNoteNonNormative]:{since:"1.16.0",baseBitType:d.note,description:"Standard non-normative note bit, used to provide non-normative notes in articles or books"},[d.smartStandardNoteNormative]:{since:"1.28.0",baseBitType:d.standardNoteNormative,description:"Smart standard normative note bit, used to provide normative notes in smart standards"},[d.smartStandardNoteNonNormative]:{since:"1.28.0",baseBitType:d.standardNoteNonNormative,description:"Smart standard non-normative note bit, used to provide non-normative notes in smart standards"},[d.smartStandardNoteNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardNoteNormative,description:"Smart standard normative note collapsible bit, used to provide normative notes in smart standards that can be collapsed"},[d.smartStandardNoteNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardNoteNonNormative,description:"Smart standard non-normative note collapsible bit, used to provide non-normative notes in smart standards that can be collapsed"},[d.noteAi]:{since:"1.3.0",baseBitType:d.note,description:"Note AI bit, used to create AI-generated notes in articles or books"},[d.notebookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Notebook article bit, used to define notebook articles in articles or books"},[d.preparationNote]:{since:"1.3.0",baseBitType:d.article,description:"Preparation note bit, used to provide preparation notes in articles or books"},[d.releaseNotesSummary]:{since:"1.3.0",baseBitType:d.article,description:"Release notes summary bit, used to summarize release notes in articles or books"},[d.remark]:{since:"1.3.0",baseBitType:d.article,description:"Remark bit, used to provide remarks in articles or books"},[d.remarkAlt]:{since:"1.16.0",baseBitType:d.remark,description:"Alternative remark bit, used to provide remarks in articles or books with alternative styling"},[d.standardRemarkNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard normative remark bit, used to provide normative remarks in articles or books"},[d.standardRemarkNonNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard non-normative remark bit, used to provide non-normative remarks in articles or books"},[d.smartStandardRemarkNormative]:{since:"1.28.0",baseBitType:d.standardRemarkNormative,description:"Smart standard normative remark bit, used to provide normative remarks in smart standards"},[d.smartStandardRemarkNonNormative]:{since:"1.28.0",baseBitType:d.standardRemarkNonNormative,description:"Smart standard non-normative remark bit, used to provide non-normative remarks in smart standards"},[d.smartStandardRemarkNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkNormative,description:"Smart standard normative remark collapsible bit, used to provide normative remarks in smart standards that can be collapsed"},[d.smartStandardRemarkNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkNonNormative,description:"Smart standard non-normative remark collapsible bit, used to provide non-normative remarks in smart standards that can be collapsed"},[d.selfAssessment]:{since:"1.3.0",baseBitType:d.article,description:"Self-assessment bit, used to create self-assessment sections in articles or books"},[d.separator]:{since:"1.4.15",baseBitType:d.article,description:"Separator bit, used to create visual separators in articles or books"},[d.separatorAlt]:{since:"1.16.0",baseBitType:d.separator,description:"Alternative separator bit, used to create visual separators in articles or books with alternative styling"},[d.sticker]:{since:"1.5.28",baseBitType:d.article,description:"Sticker bit, used to create stickers in articles or books"},[d.sideNote]:{since:"1.3.0",baseBitType:d.article,description:"Side note bit, used to provide side notes in articles or books"},[d.summary]:{since:"1.3.0",baseBitType:d.article,description:"Summary bit, used to provide summaries in articles or books"},[d.summaryAi]:{since:"1.3.0",baseBitType:d.summary,description:"AI-generated summary bit"},[d.videoTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Video transcript bit, used to provide transcripts for video files in articles or books"},[d.warning]:{since:"1.3.0",baseBitType:d.article,description:"Warning bit, used to highlight warnings in articles or books"},[d.warningAlt]:{since:"1.16.0",baseBitType:d.warning,description:"Alternative warning bit, used to highlight warnings in articles or books with alternative styling"},[d.workbookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Workbook article bit, used to define workbook articles in articles or books"},[d.collapsible]:{since:"1.21.0",baseBitType:d.article,description:"Collapsible bit, used to create collapsible sections in articles or books"},[d.sideNoteCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Side note collapsible bit, used to create collapsible side notes in articles or books"},[d.infoCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Info collapsible bit, used to create collapsible informational sections in articles or books"},[d.remarkCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Remark collapsible bit, used to create collapsible remarks in articles or books"},[d.warningCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Warning collapsible bit, used to create collapsible warnings in articles or books"},[d.dangerCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Danger collapsible bit, used to create collapsible danger sections in articles or books"},[d.noteCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Note collapsible bit, used to create collapsible notes in articles or books"},[d.exampleCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Example collapsible bit, used to create collapsible examples in articles or books"},[d.hintCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Hint collapsible bit, used to create collapsible hints in articles or books"},[d.bugCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Bug collapsible bit, used to create collapsible bug reports in articles or books"},[d.platformPath]:{since:"3.14.1",baseBitType:d._standard,description:"Platform path bit, used to define paths in the platform",tags:[{key:ce.property_path,description:"The path for the platform, used to define navigation paths",format:b}]},[d.appCalculatorLatex]:{since:"4.10.0",baseBitType:d.article,description:"A LaTeX calculator bit, used to create a calculator that can interpret LaTeX expressions",tags:[{key:ce.property_formula,description:"The LaTeX formula for the calculator, used to define the calculation logic",format:b}]},[d.container]:{since:"1.9.0",baseBitType:d.article,description:"Container bit, used to group bits together in articles or books",tags:[{key:ce.property_allowedBit,description:"Allowed bits in the container, used to define which bits can be placed inside",format:b,maxCount:u}]},[d.containerWrap]:{since:"1.9.0",baseBitType:d.container,description:"Container wrap bit, used to wrap content in a container"},[d.containerNowrap]:{since:"1.9.0",baseBitType:d.container,description:"Container nowrap bit, used to prevent wrapping of content in a container"},[d.containerNowrapStretch]:{since:"1.9.0",baseBitType:d.container,description:"Container nowrap stretch bit, used to stretch content without wrapping in a container"},[d.containerGroup]:{since:"1.9.0",baseBitType:d.container,description:"Container group bit, used to group multiple containers together"},[d.containerFolder]:{since:"1.9.0",baseBitType:d.container,description:"Container folder bit, used to create folders for organizing bits"},[d.containerCarousel]:{since:"1.11.0",baseBitType:d.container,description:"Container carousel bit, used to create carousels for displaying bits"},[d.containerCards]:{since:"1.11.0",baseBitType:d.container,description:"Container cards bit, used to create card layouts for displaying bits"},[d.containerGrid]:{since:"1.11.0",baseBitType:d.container,description:"Container grid bit, used to create grid layouts for displaying bits"},[d.containerStack]:{since:"1.11.0",baseBitType:d.container,description:"Container stack bit, used to create stacked layouts for displaying bits"},[d.containerSlides]:{since:"1.11.0",baseBitType:d.container,description:"Container slides bit, used to create slide presentations for displaying bits"},[d.containerGallery]:{since:"1.11.0",baseBitType:d.container,description:"Container gallery bit, used to create galleries for displaying bits"},[d.containerScroller]:{since:"1.11.0",baseBitType:d.container,description:"Container scroller bit, used to create scrolling sections for displaying bits"},[d.containerTabs]:{since:"1.11.0",baseBitType:d.container,description:"Container tabs bit, used to create tabbed sections for displaying bits"},[d.containerAccordionTabs]:{since:"1.11.0",baseBitType:d.container,description:"Container accordion tabs bit, used to create accordion-style tabbed sections for displaying bits"},[d.containerFolderAll]:{since:"1.11.0",baseBitType:d.container,description:"Container folder all bit, used to create folders that can contain all types of bits"},[d.containerBits2]:{since:"1.11.0",baseBitType:d.container,description:"Container bits 2 bit, used to create a container for bits with additional features"},[d.containerCookRecipe]:{since:"1.11.0",baseBitType:d.container,description:"Container cook recipe bit, used to create recipe containers for displaying cooking recipes"},[d.containerNewsArticle]:{since:"1.11.0",baseBitType:d.container,description:"Container news article bit, used to create containers for news articles"},[d.containerPreview]:{since:"1.11.0",baseBitType:d.container,description:"Container preview bit, used to create preview sections for displaying bits"},[d.pageContainer]:{since:"1.9.0",baseBitType:d.container,description:"Page container bit, used to create containers for pages in articles or books"},[d.pageContainerWrap]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container wrap bit, used to wrap content in a page container"},[d.pageContainerNowrap]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container nowrap bit, used to prevent wrapping of content in a page container"},[d.pageContainerNowrapStretch]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container nowrap stretch bit, used to stretch content without wrapping in a page container"},[d.pageContainerFolder]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container folder bit, used to create folders for organizing bits in a page container"},[d.pageContainerGroup]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container group bit, used to group multiple page containers together"},[d.metalevelExplanation]:{since:"1.10.0",baseBitType:d.article,description:"Metalevel explanation bit, used to provide explanations for metalevels in articles or books"},[d.module]:{since:"1.5.26",baseBitType:d.article,description:"Module bit, used to define modules in articles or books",tags:[{key:ce.property_hasBookNavigation,description:"Indicates if the module has book navigation",format:v,defaultValue:"true"},{key:ce.property_productId,description:"Product ID for the module, used to link to a specific product",format:b,minCount:1,maxCount:u},{key:ce.property_duration,description:"Duration of the module, used to indicate how long it takes to complete",format:b}]},[d.moduleProduct]:{since:"1.9.0",baseBitType:d.module,description:"Module product bit, used to define products in modules",tags:[{key:ce.property_productId,description:"Product ID for the module product, used to link to a specific product",format:b,minCount:1,maxCount:u}]},[d.exampleList]:{since:"1.4.13",baseBitType:d.example,description:"Example list bit, used to create lists of examples in articles or books",cardSet:D,rootExampleType:m},[d.extractorPage]:{since:"1.5.17",baseBitType:d.image,description:"Extractor page bit, used to extract pages from images"},[d.extractorPageCollapsible]:{since:"1.30.0",baseBitType:d.extractorPage,description:"Collapsible extractor page bit, used to extract pages from images with collapsible functionality"},[d.extractorPageWithBlocks]:{since:"1.5.21",baseBitType:d.image,description:"Extractor page with blocks bit, used to extract pages with blocks from images"},[d.extractorPageWithBlocksCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageWithBlocks,description:"Collapsible extractor page with blocks bit, used to extract pages with blocks from images with collapsible functionality"},[d.extractorConfiguration]:{since:"1.7.1",baseBitType:d._standard,description:"Extractor configuration bit, used to configure extractors in articles or books",textFormatDefault:x.plainText},[d.extractorImage]:{since:"4.3.0",baseBitType:d._standard,description:"Extractor images bit, used for images extracted from PDFs",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:u}],resourceAttachmentAllowed:!1,textFormatDefault:x.plainText},[d.extractorImageCollapsible]:{since:"4.3.0",baseBitType:d.extractorImage,description:"Collapsible extractor images bit, used for images extracted from PDFs"},[d.extractorInformation]:{since:"3.8.0",baseBitType:d._standard,description:"Extractor information bit, used to provide information about extractors in articles or books",textFormatDefault:x.json},[d.extractorAiChat]:{since:"3.19.0",baseBitType:d._standard,description:"Extractor AI chat bit, used to create AI chat interfaces for extractors in articles or books"},[d.extractorBlock]:{since:"1.5.16",baseBitType:d._standard,description:"Extractor block bit, used to define blocks within extractor pages",tags:[{key:ce.property_blockId,description:"Unique identifier for the block, used to reference the block in extractor pages",format:b},{key:ce.property_pageNo,description:"Page number for the block, used to indicate the page on which the block appears",format:k},{key:ce.property_x,description:"X-coordinate for the block, used to position the block on the page",format:k},{key:ce.property_y,description:"Y-coordinate for the block, used to position the block on the page",format:k},{key:ce.property_width,description:"Width of the block, used to define the size of the block on the page",format:k},{key:ce.property_height,description:"Height of the block, used to define the size of the block on the page",format:k},{key:ce.property_index,description:"Index of the block, used to order blocks within the extractor page",format:k},{key:ce.property_classification,description:"Classification for the block, used to categorize the block within the extractor",format:b},{key:ce.property_availableClassifications,description:"Available classifications for the block, used to define possible classifications",format:b,maxCount:u},{key:ce.group_resourceImage,description:"Resource image for the block, used to attach images to the block",minCount:1}],resourceAttachmentAllowed:!1},[d.extractorRepeatedText]:{since:"1.5.21",baseBitType:d.article,description:"Extractor repeated text bit, used to define repeated text in extractor pages"},[d.extractorPageNumber]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page number bit, used to define page numbers in extractor pages"},[d.extractorPageNumberCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageNumber,description:"Collapsible extractor page number bit, used to define page numbers in extractor pages with collapsible functionality"},[d.extractorPageHeader]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page header bit, used to define headers in extractor pages"},[d.extractorPageHeaderCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageHeader,description:"Collapsible extractor page header bit, used to define headers in extractor pages with collapsible functionality"},[d.extractorPageFooter]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page footer bit, used to define footers in extractor pages"},[d.extractorPageFooterCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageFooter,description:"Collapsible extractor page footer bit, used to define footers in extractor pages with collapsible functionality"},[d.pageOpenBook]:{since:"1.5.10",baseBitType:d.article,description:"Page open book bit, used to create pages that open books in articles or books",tags:[{key:ce.property_slug,description:"Slug for the book, used to identify the book in the system",format:b},{key:ce.property_book,description:"Book reference for the page, used to link to a specific book",format:b,chain:[{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system"},{key:ce.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button"},{key:ce.property_authorFullName,description:"Full name of the author",format:b},{key:ce.property_authorPseudonym,description:"A pseudonym of the author, if any",format:b},{key:ce.property_authorTitle,description:'The title of the author, e.g. "Dr.", "Prof.", etc.',format:b},{key:ce.property_authorJobTitle,description:'The job title of the author, e.g. "Software Engineer", "Professor", etc.',format:b}]},[d.openBookChapter]:{since:"4.16.0",baseBitType:d.pageOpenBook,description:"Open book chapter bit, derived from page-open-book, used to create chapter pages that open books"},[d.pageOpenBookList]:{since:"2.1.0",baseBitType:d.article,description:"Page open book list bit, used to create pages that open lists of books in articles or books",tags:[{key:ce.property_book,description:"Book reference for the page, used to link to a specific book",maxCount:u,chain:[{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:ce.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button",format:b}]},[d.pageSubscribe]:{since:"1.5.10",baseBitType:d.article,description:"Page subscribe bit, used to create pages that allow users to subscribe to content",tags:[{key:ce.property_slug,description:"Slug for the subscription page, used to identify the page in the system",format:b},{key:ce.property_buttonCaption,description:"Caption for the subscription button, used to define the text displayed on the button",format:b},{key:ce.property_mailingList,description:"Mailing list for the subscription, used to link to a specific mailing list",format:b}]},[d.assignmentList]:{since:"1.4.13",baseBitType:d.exampleList,description:"Assignment list bit, used to create lists of assignments in articles or books"},[d.pageFooter]:{since:"1.4.13",baseBitType:d.article,description:"Page footer bit, used to create footers in articles or books",tags:[{key:ce.property_slug,description:"Slug for the footer, used to identify the footer in the system",format:b}],cardSet:D},[d.legend]:{since:"3.12.0",baseBitType:d._standard,description:"Legend bit, used to provide legends in articles or books",cardSet:C},[d.smartStandardLegend]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard legend bit, used to provide smart standard legends in articles or books"},[d.smartStandardLegendNonNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard non-normative legend bit, used to provide non-normative smart standard legends in articles or books"},[d.smartStandardLegendNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard normative legend bit, used to provide normative smart standard legends in articles or books"},[d.smartStandardRemarkLegend]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard remark legend bit, used to provide smart standard remarks in legends"},[d.smartStandardRemarkLegendNonNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard non-normative remark legend bit, used to provide non-normative smart standard remarks in legends"},[d.smartStandardRemarkLegendNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard normative remark legend bit, used to provide normative smart standard remarks in legends"},[d.definitionList]:{since:"1.34.0",baseBitType:d._standard,description:"Definition list bit, used to create lists of definitions in articles or books",cardSet:C},[d.metaSearchDefaultTerms]:{since:"3.12.0",baseBitType:d._standard,description:"Meta search default terms bit, used to define default search terms in articles",cardSet:C},[d.metaSearchDefaultTopics]:{since:"3.12.0",baseBitType:d.metaSearchDefaultTerms,description:"Meta search default topics bit, used to define default search topics in articles"},[d.flashcard]:{since:"1.3.0",baseBitType:d._standard,description:"Flashcard bit, used to create flashcards in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for flashcards"}],cardSet:_},[d.flashcard1]:{since:"1.3.0",baseBitType:d.flashcard,description:"Flashcard 1 bit"},[d.qAndACard]:{since:"3.25.0",baseBitType:d.flashcard1,description:"Q&A card bit, used to create question and answer cards in articles or books"},[d.focusImage]:{since:"1.3.0",baseBitType:d.image,description:"Focus image bit, used to create images with focus points in articles or books",tags:[{key:ce.property_focusX,description:"X-coordinate for the focus point, used to define the focus area in the image",format:k},{key:ce.property_focusY,description:"Y-coordinate for the focus point, used to define the focus area in the image",format:k}]},[d.highlightText]:{since:"1.3.0",baseBitType:d._standard,description:"Highlight text bit, used to create highlighted text in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for highlighted text"},{key:ce.group_trueFalse,description:"True/False quiz tags for highlighted text"}]},[d.image]:{since:"1.3.0",baseBitType:d._standard,description:"Image bit, used to create images in articles or books",tags:[{key:ce.resource_backgroundWallpaper,description:"Background wallpaper for the image, used to set a background for the image",chain:[{key:ce.group_resourceImageCommon,description:"Common resource image tags for images"}]},{key:ce.group_resourceBitTags,description:"Resource bit tags for images, used to define additional properties for images"},{key:ce.group_resourceImage,description:"Resource image tags for images, used to attach images to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.appCreateBitsFromImage]:{since:"1.3.0",baseBitType:d.image,description:"App create bits from image bit, used to create bits from images in the app"},[d.appGetScreenshot]:{since:"1.3.0",baseBitType:d.image,description:"App get screenshot bit, used to capture screenshots in the app"},[d.detailsImage]:{since:"1.3.0",baseBitType:d.image,description:"Details image bit, used to create detailed images in articles or books"},[d.figure]:{since:"1.3.0",baseBitType:d.image,description:"Figure bit, used to create figures in articles or books",cardSet:C},[d.imageBanner]:{since:"1.3.0",baseBitType:d.image,description:"Image banner bit, used to create banners in articles or books"},[d.imageFigure]:{since:"1.3.0",baseBitType:d.image,description:"Image figure bit, used to create figures with images in articles or books",cardSet:C},[d.imageFigureAlt]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Alternative image figure bit, used to create figures with alternative images in articles or books"},[d.standardImageFigureNormative]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Standard normative image figure bit, used to create normative image figures in articles or books"},[d.standardImageFigureNonNormative]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Standard non-normative image figure bit, used to create non-normative image figures in articles or books"},[d.smartStandardImageFigureNormative]:{since:"1.28.0",baseBitType:d.standardImageFigureNormative,description:"Smart standard normative image figure bit, used to create smart standard normative image figures in articles or books"},[d.smartStandardImageFigureNonNormative]:{since:"1.28.0",baseBitType:d.standardImageFigureNonNormative,description:"Smart standard non-normative image figure bit, used to create smart standard non-normative image figures in articles or books"},[d.smartStandardImageFigureNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardImageFigureNormative,description:"Collapsible smart standard normative image figure bit, used to create collapsible smart standard normative image figures in articles or books"},[d.smartStandardImageFigureNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardImageFigureNonNormative,description:"Collapsible smart standard non-normative image figure bit, used to create collapsible smart standard non-normative image figures in articles or books"},[d.imageLandscape]:{since:"1.3.0",baseBitType:d.image,description:"Image landscape bit, used to create landscape images in articles or books"},[d.imageMood]:{since:"1.3.0",baseBitType:d.image,description:"Image mood bit, used to create mood images in articles or books"},[d.imagePortrait]:{since:"1.3.0",baseBitType:d.image,description:"Image portrait bit, used to create portrait images in articles or books"},[d.imagePrototype]:{since:"1.3.0",baseBitType:d.image,description:"Image prototype bit, used to create prototype images in articles or books"},[d.imageSeparator]:{since:"1.4.15",baseBitType:d.image,description:"Image separator bit, used to create separators in articles or books"},[d.imageSeparatorAlt]:{since:"1.16.0",baseBitType:d.imageSeparator,description:"Alternative image separator bit, used to create alternative separators in articles or books"},[d.imageScreenshot]:{since:"1.3.0",baseBitType:d.image,description:"Image screenshot bit, used to create screenshots in articles or books"},[d.imageStyled]:{since:"1.3.0",baseBitType:d.image,description:"Image styled bit, used to create styled images in articles or books"},[d.imageSuperWide]:{since:"1.3.0",baseBitType:d.image,description:"Image super wide bit, used to create super wide images in articles or books"},[d.imageZoom]:{since:"1.3.0",baseBitType:d.image,description:"Image zoom bit, used to create zoomable images in articles or books"},[d.langLifeSkillIcon]:{since:"1.3.0",baseBitType:d.image,description:"Language life skill icon bit, used to create icons for life skills in articles or books"},[d.lifeSkillSticker]:{since:"1.3.0",baseBitType:d.image,description:"Life skill sticker bit, used to create stickers for life skills in articles or books"},[d.pageBanner]:{since:"1.4.3",baseBitType:d.image,description:"Page banner bit, used to create banners for pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the page banner, used to identify the banner in the system",format:b}]},[d.pageHero]:{since:"1.11.0",baseBitType:d.pageBanner,description:"Page hero bit, used to create hero sections in articles or books"},[d.screenshot]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:d.image,description:"Screenshot bit, used to create screenshots in articles or books"},[d.tableImage]:{since:"1.5.15",baseBitType:d.image,description:"Table image bit, used to create images in tables in articles or books",tags:[{key:ce.property_caption,description:"Caption for the table image, used to provide a description for the image",format:y}]},[d.tableImageAlt]:{since:"1.16.0",baseBitType:d.tableImage,description:"Alternative table image bit, used to create alternative images in tables in articles or books"},[d.standardTableImageNormative]:{since:"1.16.0",baseBitType:d.tableImage,description:"Standard normative table image bit, used to create normative images in tables in articles or books"},[d.standardTableImageNonNormative]:{since:"1.16.0",baseBitType:d.tableImage,description:"Standard non-normative table image bit, used to create non-normative images in tables in articles or books"},[d.standardRemarkTableImageNormative]:{since:"1.17.0",baseBitType:d.tableImage,description:"Standard normative remark table image bit, used to create normative remark images in tables in articles or books"},[d.standardRemarkTableImageNonNormative]:{since:"1.17.0",baseBitType:d.tableImage,description:"Standard non-normative remark table image bit, used to create non-normative remark images in tables in articles or books"},[d.smartStandardTableImageNormative]:{since:"1.28.0",baseBitType:d.standardTableImageNormative,description:"Smart standard normative table image bit, used to create smart standard normative images in tables in articles or books"},[d.smartStandardTableImageNonNormative]:{since:"1.28.0",baseBitType:d.standardTableImageNonNormative,description:"Smart standard non-normative table image bit, used to create smart standard non-normative images in tables in articles or books"},[d.smartStandardRemarkTableImageNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableImageNormative,description:"Smart standard normative remark table image bit, used to create smart standard normative remark images in tables in articles or books"},[d.smartStandardRemarkTableImageNonNormative]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableImageNormative,description:"Collapsible smart standard normative table image bit, used to create collapsible smart standard normative images in tables in articles or books"},[d.smartStandardTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardRemarkTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardRemarkTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.imageLink]:{since:"1.3.0",baseBitType:d._standard,description:"Image link bit, used to create links with images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for image links, used to define additional properties"},{key:ce.group_resourceImageLink,description:"Resource image link tags, used to attach images to the link",minCount:1}],resourceAttachmentAllowed:!1},[d.imageOnDevice]:{since:"1.3.0",baseBitType:d._standard,description:"Image on device bit, used to create images stored on the device in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for images on device, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for images on device, used to attach images"},{key:ce.group_imageSource,description:"Image source tags for images on device, used to define the source of the image"}],resourceAttachmentAllowed:!1},[d.imageResponsive]:{since:"1.3.0",baseBitType:d._standard,description:"Responsive image bit, used to create responsive images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for responsive images, used to define additional properties"},{key:ce.group_resourceImageResponsive,description:"Resource image responsive tags, used to attach responsive images"}],resourceAttachmentAllowed:!1},[d.imagesLogoGrave]:{since:"1.5.11",baseBitType:d._standard,description:"Logo grave images bit, used to create logo grave images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:u}],resourceAttachmentAllowed:!1},[d.prototypeImages]:{since:"1.6.1",baseBitType:d.imagesLogoGrave,description:"Prototype images bit, used to create prototype images in articles or books"},[d.internalLink]:{since:"1.3.0",baseBitType:d._standard,description:"Internal link bit, used to create links to other bits in articles or books",tags:[{key:ce.tag_reference,description:"Reference tag for the internal link, used to link to the target bit"}]},[d.interview]:{since:"1.3.0",baseBitType:d._standard,description:"Interview bit, used to create interviews in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for interviews"},{key:ce.property_reasonableNumOfChars,description:"Reasonable number of characters for the interview, used to limit input size",format:k}],cardSet:P},[d.interviewInstructionGrouped]:{since:"1.3.0",baseBitType:d.interview,description:"Grouped interview instruction bit"},[d.botInterview]:{since:"1.3.0",baseBitType:d.interview,description:"Bot interview bit, used to create bot interviews in articles or books"},[d.brandColor]:{since:"4.12.0",baseBitType:d._standard,description:"Brand color bit, used to define brand colors",tags:[{key:ce.property_brandColor,description:"The brand color",format:b},{key:ce.property_brandColorName,description:"The brand color name",format:b}]},[d.learningPathBook]:{since:"1.3.0",baseBitType:d._standard,description:"Learning path book bit, used to create learning paths in articles or books",tags:[{key:ce.group_learningPathCommon,description:"Common tags for learning path books, used to define properties of learning paths"}]},[d.bookLink]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Book link bit, used to create links to books in learning paths"},[d.bookLinkNext]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Next book link bit, used to create links to the next book in learning paths"},[d.bookLinkPrev]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Previous book link bit, used to create links to the previous book in learning paths"},[d.learningPathClassroomEvent]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path classroom event bit, used to create classroom events in learning paths"},[d.learningPathClassroomTraining]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path classroom training bit, used to create classroom training in learning paths"},[d.learningPathClosing]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path closing bit, used to close learning paths"},[d.learningPathFeedback]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path feedback bit, used to provide feedback in learning paths"},[d.learningPathLearningGoal]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path learning goal bit, used to define learning goals in learning paths"},[d.learningPathLti]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path LTI bit, used to integrate LTI tools in learning paths"},[d.learningPathSign]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path sign bit, used to create signs in learning paths"},[d.learningPathStep]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path step bit, used to create steps in learning paths"},[d.learningPathBotTraining]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path bot training bit, used to create bot training in learning paths",tags:[{key:ce.property_bot,description:"Bot reference for the training, used to link to a specific bot",format:b}]},[d.learningPathExternalLink]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path external link bit, used to create external links in learning paths",tags:[{key:ce.property_externalLink,description:"External link for the learning path, used to link to external resources",format:b},{key:ce.property_externalLinkText,description:"Text for the external link, used to define the link text displayed",format:b}]},[d.learningPathVideoCall]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path video call bit, used to create video calls in learning paths",tags:[{key:ce.property_videoCallLink,description:"Video call link for the learning path, used to link to video calls",format:b}]},[d.leLearningObjectives]:{since:"1.25.0",baseBitType:d.learningPathLearningGoal,description:"Learning objectives bit, used to define learning objectives in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the learning objectives, used to categorize the activity",format:b}]},[d.leVideoCall]:{since:"1.25.0",baseBitType:d.learningPathVideoCall,description:"Video call bit, used to create video calls in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the video call, used to categorize the activity",format:b}]},[d.leClassroomEvent]:{since:"1.25.0",baseBitType:d.learningPathClassroomEvent,description:"Classroom event bit, used to create classroom events in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the classroom event, used to categorize the activity",format:b}]},[d.leMultiDayEvent]:{since:"3.32.0",baseBitType:d.leClassroomEvent,description:"Multi-day event bit, used to create multi-day events in learning paths"},[d.leCompletion]:{since:"1.25.0",baseBitType:d.learningPathClosing,description:"Completion bit, used to mark the completion of learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the completion, used to categorize the activity",format:b}]},[d.leExternalLink]:{since:"1.25.0",baseBitType:d.learningPathExternalLink,description:"External link bit, used to create external links in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the external link, used to categorize the activity",format:b}]},[d.leReadBook]:{since:"1.25.0",baseBitType:d.learningPathBook,description:"Read book bit, used to create reading tasks in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the reading task, used to categorize the activity",format:b}]},[d.leLearningStep]:{since:"1.25.0",baseBitType:d.learningPathStep,description:"Learning step bit, used to create steps in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the learning step, used to categorize the activity",format:b}]},[d.lePreparationTask]:{since:"1.26.0",baseBitType:d.learningPathBook,description:"Preparation task bit, used to create preparation tasks in learning paths",tags:[{key:ce.property_activityType,format:b,description:"Activity type for the preparation task, used to categorize the activity"}]},[d.leRead]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Read task bit, used to create reading tasks in learning paths"},[d.leTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Task bit, used to create tasks in learning paths"},[d.leTodo]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Todo bit, used to create todo tasks in learning paths"},[d.leFollowUpTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Follow-up task bit, used to create follow-up tasks in learning paths"},[d.leFinishingTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Finishing task bit, used to create finishing tasks in learning paths"},[d.leAssignment]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Assignment bit, used to create assignments in learning paths"},[d.leWatchVideoEmbed]:{since:"1.27.0",baseBitType:d.learningPathBook,description:"Watch video embed bit, used to embed videos in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the video embed, used to categorize the activity",format:b},{key:ce.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:ce.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.leListenAudioEmbed]:{since:"1.27.0",baseBitType:d.learningPathBook,description:"Listen audio embed bit, used to embed audio in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the audio embed, used to categorize the activity",format:b},{key:ce.group_resourceBitTags,description:"Resource bit tags for audio embeds, used to define additional properties"},{key:ce.group_resourceAudioEmbed,description:"Resource audio embed tags, used to attach audio embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.listItem]:{since:"1.22.0",baseBitType:d.article,description:"List item bit, used to create list items in articles or books",tags:[{key:ce.property_listItemIndent,description:"Indentation level for the list item, used to define the hierarchy of the list",format:k,defaultValue:"0"}]},[d.standardListItem]:{since:"1.22.0",baseBitType:d.listItem,description:"Standard list item bit, used to create standard list items in articles or books"},[d.smartStandardListItem]:{since:"1.28.0",baseBitType:d.standardListItem,description:"Smart standard list item bit, used to create smart standard list items in articles or books"},[d.smartStandardListItemCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardListItem,description:"Collapsible smart standard list item bit, used to create collapsible smart standard list items in articles or books"},[d.mark]:{since:"1.3.0",baseBitType:d._standard,description:"Mark bit, used to create marks in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for marks"},{key:ce.group_markConfig,description:"Configuration tags for marks, used to define properties of marks"},{key:ce.group_mark,description:"Mark tags, used to define the content of marks"}]},[d.match]:{since:"1.3.0",baseBitType:d._standard,description:"Match bit, used to create matching pairs in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for matching pairs"},{key:ce.property_isCaseSensitive,description:"Case sensitivity for matching pairs, used to define if matches are case-sensitive",format:v}],cardSet:I},[d.matchAll]:{since:"1.3.0",baseBitType:d.match,description:"Match all bit, used to create matching pairs with all options in articles or books"},[d.matchReverse]:{since:"1.3.0",baseBitType:d.match,description:"Match reverse bit, used to create matching pairs with reversed options in articles or books"},[d.matchAllReverse]:{since:"1.3.0",baseBitType:d.match,description:"Match all reverse bit, used to create matching pairs with all options and reversed in articles or books"},[d.matchSolutionGrouped]:{since:"1.3.0",baseBitType:d.match,description:"Grouped match solution bit, used to create grouped matching solutions in articles or books"},[d.matchMatrix]:{since:"1.3.0",baseBitType:d.match,description:"Match matrix bit, used to create matching pairs in a matrix format in articles or books",cardSet:E},[d.matchAudio]:{since:"1.3.0",baseBitType:d.match,description:"Match audio bit, used to create matching pairs with audio in articles or books",cardSet:L},[d.matchPicture]:{since:"1.3.0",baseBitType:d.match,description:"Match picture bit, used to create matching pairs with pictures in articles or books",cardSet:V},[d.feedback]:{since:"3.13.0",baseBitType:d._standard,description:"Feedback bit, used to provide feedback in articles or books",tags:[{key:ce.property_reasonableNumOfChars,description:"Reasonable number of characters for feedback, used to limit input size",format:k}],cardSet:S},[d.learningDocumentationFeedback]:{since:"3.13.0",baseBitType:d.feedback,description:"Feedback for learning documentation"},[d.handInFeedbackExpert]:{since:"3.30.0",baseBitType:d.feedback,description:"Feedback for expert hand-in"},[d.handInFeedbackSelf]:{since:"3.30.0",baseBitType:d.feedback,description:"Self-feedback for hand-in"},[d.multipleChoice1]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice 1 bit, used to create single-choice questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice 1 questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice 1 questions"}]},[d.coachSelfReflectionMultipleChoice1]:{since:"1.3.0",baseBitType:d.multipleChoice1,description:"Coach self-reflection multiple choice 1 bit, used for self-reflection in coaching"},[d.multipleChoice]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice bit, used to create multiple-choice questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice questions"}],cardSet:B},[d.coachSelfReflectionMultipleChoice]:{since:"1.3.0",baseBitType:d.multipleChoice,description:"Coach self-reflection multiple choice bit, used for self-reflection in coaching"},[d.multipleChoiceText]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice text bit, used to create multiple-choice questions with text in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice text questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice text questions"}]},[d.coachCallToActionMultipleChoiceText]:{since:"1.3.0",baseBitType:d.multipleChoiceText,description:"Coach call to action multiple choice text bit, used for self-reflection in coaching"},[d.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0",baseBitType:d.multipleChoiceText,description:"Coach self-reflection multiple choice text bit, used for self-reflection in coaching"},[d.multipleResponse1]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple response 1 bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple response 1 questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple response 1 questions"}]},[d.coachSelfReflectionMultipleResponse1]:{since:"1.3.0",baseBitType:d.multipleResponse1,description:"Coach self-reflection multiple response 1 bit, used for self-reflection in coaching"},[d.multipleResponse]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple response bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple response questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple response questions"}],cardSet:B},[d.coachSelfReflectionMultipleResponse]:{since:"1.3.0",baseBitType:d.multipleResponse,description:"Coach self-reflection multiple response bit, used for self-reflection in coaching"},[d.page]:{since:"1.3.0",baseBitType:d._standard,description:"Page bit, used to create pages in articles or books",tags:[{key:ce.tag_title,description:"Title of the page, used to display the page title"},{key:ce.property_thumbImage,description:"Thumbnail image for the page, used to display a small image representation",format:b}]},[d.pageCollapsible]:{since:"1.30.0",baseBitType:d.page,description:"Collapsible page bit, used to create collapsible sections in pages"},[d.pageCoverImage]:{since:"1.22.0",baseBitType:d.page,description:"Page cover image bit, used to create cover images for pages"},[d.advertisingAdvertorialPage]:{since:"4.5.0",baseBitType:d.page,description:"Advertorial Page bit, used to create advertorial pages"},[d.pageBuyButton]:{since:"1.4.3",baseBitType:d._standard,description:"Page buy button bit, used to create buy buttons on pages",tags:[{key:ce.property_slug,description:"Slug for the page, used to identify the page in URLs",format:b},{key:ce.property_content2Buy,description:"Content to buy for the page, used to define what is being sold",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button, used to define the text displayed on the button",format:b}]},[d.pageBuyButtonAlt]:{since:"1.31.0",baseBitType:d.pageBuyButton,description:"Alternative page buy button bit, used to create alternative buy buttons on pages"},[d.pageBuyButtonPromotion]:{since:"1.5.11",baseBitType:d.pageBuyButton,description:"Page buy button for promotions, used to create buy buttons on promotional pages"},[d.pageSubpage]:{since:"1.6.6",baseBitType:d._standard,description:"Page subpage bit, used to create subpages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the subpage, used to identify the subpage in URLs",format:b},{key:ce.property_page,description:"Page reference for the subpage, used to link to the parent page",format:b}]},[d.pageShopInShop]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page shop-in-shop bit, used to create shop-in-shop pages in articles or books"},[d.pageCategory]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page category bit, used to create category pages in articles or books"},[d.pageAcademy]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page academy bit, used to create academy pages in articles or books"},[d.pagePromotion]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page promotion bit, used to create promotional pages in articles or books"},[d.pageSpecial]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page special bit, used to create special pages in articles or books"},[d.pagePerson]:{since:"1.5.16",baseBitType:d._standard,description:"Page person bit, used to create person pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the person page, used to identify the person in URLs",format:b},{key:ce.group_person,description:"Person tags, used to define properties of the person"},{key:ce.property_buttonCaption,description:"Caption for the button on the person page, used to define the text displayed",format:b}]},[d.pageProduct]:{since:"1.4.17",baseBitType:d._standard,description:"Page product bit, used to create product pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product page, used to identify the product in URLs",format:b},{key:ce.property_product,description:"Product reference for the product page, used to link to the product",format:b}]},[d.pageProductList]:{since:"1.4.17",baseBitType:d._standard,description:"Page product list bit, used to create product lists in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product list page, used to identify the product list in URLs",format:b},{key:ce.property_product,description:"Product reference for the product list, used to link to the product",format:b,maxCount:u}]},[d.pageProductVideo]:{since:"1.4.17",baseBitType:d._standard,description:"Page product video bit, used to create product video pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product video page, used to identify the product video in URLs",format:b},{key:ce.property_productVideo,description:"Product video reference for the product video page, used to link to the video",format:b}]},[d.pageProductVideoList]:{since:"1.4.17",baseBitType:d._standard,description:"Page product video list bit, used to create product video lists in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product video list page, used to identify the product video list in URLs",format:b},{key:ce.property_productVideo,description:"Product video reference for the product video list, used to link to the video",format:b,maxCount:u}]},[d.pageSectionFolder]:{since:"1.4.17",baseBitType:d._standard,description:"Page section folder bit, used to create section folders in articles or books",tags:[{key:ce.property_slug,description:"Slug for the section folder page, used to identify the section in URLs",format:b},{key:ce.property_productFolder,description:"Product folder reference for the section folder page, used to link to the folder",format:b}]},[d.photo]:{since:"1.3.0",baseBitType:d.image,description:"Photo bit, used to create photo bits in articles or books"},[d.platform]:{since:"4.12.0",baseBitType:d._standard,description:"Platform bit, used to define platform properties",tags:[{key:ce.property_platformName,description:"The platform name",format:b},{key:ce.resource_platformIcon,description:"The platform icon",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform icon resource"}],maxCount:1},{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformBrandTarget]:{since:"4.15.0",baseBitType:d._standard,description:"Platform brand target bit, used to define the brand target for publishing",tags:[{key:ce.property_platformBrandTarget,description:'The platform brand target (typically "light", "dark" or "none")',format:b}]},[d.platformHeader]:{since:"4.12.0",baseBitType:d._standard,description:"Platform header bit, used to define platform header properties",tags:[{key:ce.resource_platformLogo,description:"The platform logo",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform logo resource"}],maxCount:1},{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMain]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main bit, used to define platform main properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMainButton]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main button bit, used to define platform main button properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMainInput]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main input bit, used to define platform main input properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSection]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section bit, used to define platform section properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionButton]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section button bit, used to define platform section button properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionChat]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section chat bit, used to define platform section chat properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"},{key:ce.resource_platformBackgroundImage,description:"The platform section chat background image",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform background image resource"}]}]},[d.platformSectionHeader]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section header bit, used to define platform section header properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionInput]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section input bit, used to define platform section input properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSystemIcon]:{since:"4.12.0",baseBitType:d._standard,description:"Platform system icon bit, used to define platform system icon properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.quote]:{since:"1.3.0",baseBitType:d._standard,description:"Quote bit, used to create quotes in articles or books",tags:[{key:ce.property_quotedPerson,description:"Quoted person for the quote, used to define who is being quoted",format:b}]},[d.rating]:{since:"1.3.0",baseBitType:d._standard,description:"Rating bit, used to create rating bits in articles or books"},[d.coachSelfReflectionRating]:{since:"1.3.0",baseBitType:d.rating,description:"Coach self-reflection rating bit, used for self-reflection in coaching"},[d.releaseNote]:{since:"1.3.0",baseBitType:d._standard,description:"Release note bit, used to create release notes in articles or books",tags:[{key:ce.property_releaseVersion,description:"Release version for the release note, used to define the version of the release",format:b},{key:ce.property_releaseKind,description:"Release kind for the release note, used to define the type of release",format:b},{key:ce.property_releaseDate,description:"Release date for the release note, used to define when the release was made",format:b}]},[d.reviewNote]:{since:"1.3.0",baseBitType:d._standard,description:"Review note bit, used to create review notes in articles or books",tags:[{key:ce.tag_title,description:"Title of the review note, used to display the note title"},{key:ce.property_resolved,description:"Resolved status for the review note, used to indicate if the note is resolved",format:v},{key:ce.property_resolvedDate,description:"Resolved date for the review note, used to define when the note was resolved",format:b},{key:ce.property_resolvedBy,description:"Resolved by for the review note, used to define who resolved the note",format:b}],rootExampleType:m},[d.reviewAuthorNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Author review note bit, used to create author notes in reviews"},[d.reviewCustomerNote]:{since:"3.5.0",baseBitType:d.reviewNote,description:"Customer review note bit, used to create customer notes in reviews"},[d.reviewReviewerNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Reviewer review note bit, used to create reviewer notes in reviews"},[d.reviewRequestForReviewNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Request for review note bit, used to create notes requesting reviews"},[d.reviewApprovedNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Approved review note bit, used to create notes for approved reviews"},[d.sampleSolution]:{since:"1.3.0",baseBitType:d._standard,description:"Sample solution bit, used to create sample solutions in articles or books",tags:[{key:ce.tag_anchor,description:"Anchor for the sample solution, used to link to the solution"},{key:ce.tag_reference,description:"Reference for the sample solution, used to link to the source of the solution"}]},[d.sequence]:{since:"1.3.0",baseBitType:d._standard,description:"Sequence bit, used to create sequences in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for sequences"}],cardSet:w,rootExampleType:h},[d.stillImageFilm]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film bit, used to create still image films in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilm,description:"Resource still image film tags, used to attach still image films to the bit"}],resourceAttachmentAllowed:!1},[d.stillImageFilmEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film embed bit, used to embed still image films in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilmEmbed,description:"Resource still image film embed tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.stillImageFilmLink]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film link bit, used to create still image film links in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilmLink,description:"Resource still image film link tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.surveyAnonymous]:{since:"1.3.0",baseBitType:d._standard,description:"Anonymous survey bit, used to create anonymous surveys in articles or books"},[d.survey]:{since:"1.3.0",baseBitType:d._standard,description:"Survey bit, used to create surveys in articles or books"},[d.surveyMatrix]:{since:"1.6.2",baseBitType:d.image,description:"Survey matrix bit, used to create survey matrices in articles or books",tags:[{key:ce.property_pointerTop,description:"Pointer for the top of the survey matrix, used to define the top label",format:b,minCount:1,maxCount:1},{key:ce.property_pointerLeft,description:"Pointer for the left of the survey matrix, used to define the left label",format:b,minCount:1,maxCount:1},{key:ce.property_buttonCaption,description:"Caption for the button in the survey matrix, used to define the button text",format:b,minCount:1,maxCount:1}]},[d.surveyMatrixMe]:{since:"1.6.2",baseBitType:d.surveyMatrix,description:"Survey matrix me bit, used to create personal survey matrices in articles or books"},[d.surveyRating]:{since:"1.6.0",baseBitType:d._standard,description:"Survey rating bit, used to create rating surveys in articles or books",tags:[{key:ce.property_ratingLevelStart,description:"Start level for the rating survey, used to define the lowest rating",format:k,chain:[{key:ce.property_label,description:"Label for the start level of the rating survey, used to define the text displayed",format:y}]},{key:ce.property_ratingLevelEnd,description:"End level for the rating survey, used to define the highest rating",format:k,chain:[{key:ce.property_label,description:"Label for the end level of the rating survey, used to define the text displayed",format:y}]},{key:ce.property_ratingLevelSelected,description:"Selected level for the rating survey, used to define the default rating",format:k},{key:ce.property_buttonCaption,description:"Caption for the button in the rating survey, used to define the button text",format:b}]},[d.surveyRatingOnce]:{since:"1.6.0",baseBitType:d.surveyRating,description:"Survey rating once bit, used to create one-time rating surveys in articles or books"},[d.surveyRatingDisplay]:{since:"1.6.0",baseBitType:d.surveyRating,description:"Survey rating display bit, used to display rating surveys in articles or books"},[d.scorm]:{since:"1.5.11",baseBitType:d._standard,description:"SCORM bit, used to embed SCORM content in articles or books",tags:[{key:ce.property_scormSource,description:"Source for the SCORM content, used to define the SCORM package URL",format:b},{key:ce.property_posterImage,description:"Poster image for the SCORM content, used to display a preview image",format:b}]},[d.pronunciationTable]:{since:"3.1.0",baseBitType:d._standard,description:"Pronunciation table bit, used to create pronunciation tables in articles or books",cardSet:F},[d.table]:{since:"1.5.19",baseBitType:d._standard,description:"Table bit, used to create tables in articles or books",tags:[{key:ce.property_caption,description:"Caption for the table, used to define the title of the table",format:y},{key:ce.property_tableFixedHeader,description:"Fixed header for the table, used to keep the header visible while scrolling",format:v},{key:ce.property_tableHeaderWhitespaceNoWrap,description:"No wrap for table header whitespace, used to prevent header text wrapping",format:v},{key:ce.property_tableSearch,description:"Search functionality for the table, used to enable searching within the table",format:v},{key:ce.property_tableSort,description:"Sorting functionality for the table, used to enable sorting of table columns",format:v},{key:ce.property_tablePagination,description:"Pagination for the table, used to limit the number of rows displayed at once",format:v},{key:ce.property_tablePaginationLimit,description:"Pagination limit for the table, used to define the number of rows per page",format:k,defaultValue:"0"},{key:ce.property_tableHeight,description:"Height for the table, used to define the height of the table in pixels",format:k,defaultValue:"0"},{key:ce.property_tableWhitespaceNoWrap,description:"No wrap for table whitespace, used to prevent text wrapping in table cells",format:v},{key:ce.property_tableAutoWidth,description:"Auto width for table columns, used to automatically adjust column widths",format:v},{key:ce.property_tableResizableColumns,description:"Resizable columns for the table, used to allow users to resize table columns",format:v},{key:ce.property_tableColumnMinWidth,description:"Minimum width for table columns, used to define the minimum width of columns",format:k}],cardSet:N},[d.tableExtended]:{since:"4.14.0",baseBitType:d.table,description:"Extended table bit, used to create complex tables with all HTML table features",cardSet:R},[d.tableAlt]:{since:"1.16.0",baseBitType:d.table,description:"Alternative table bit, used to create alternative tables in articles or books"},[d.standardTableNormative]:{since:"1.16.0",baseBitType:d.table,description:"Standard normative table bit, used to create standard normative tables in articles or books"},[d.standardTableNonNormative]:{since:"1.16.0",baseBitType:d.table,description:"Standard non-normative table bit, used to create standard non-normative tables in articles or books"},[d.standardRemarkTableNormative]:{since:"1.17.0",baseBitType:d.table,description:"Standard normative remark table bit, used to create standard normative remark tables in articles or books"},[d.standardRemarkTableNonNormative]:{since:"1.17.0",baseBitType:d.table,description:"Standard non-normative remark table bit, used to create standard non-normative remark tables in articles or books"},[d.smartStandardTableNormative]:{since:"1.28.0",baseBitType:d.standardTableNormative,description:"Smart standard normative table bit, used to create smart standard normative tables in articles or books"},[d.smartStandardTableNonNormative]:{since:"1.28.0",baseBitType:d.standardTableNonNormative,description:"Smart standard non-normative table bit, used to create smart standard non-normative tables in articles or books"},[d.smartStandardRemarkTableNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableNormative,description:"Smart standard normative remark table bit, used to create smart standard normative remark tables in articles or books"},[d.smartStandardRemarkTableNonNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableNonNormative,description:"Smart standard non-normative remark table bit, used to create smart standard non-normative remark tables in articles or books"},[d.smartStandardTableNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableNormative,description:"Collapsible smart standard normative table bit, used to create collapsible smart standard normative tables in articles or books"},[d.smartStandardTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableNonNormative,description:"Collapsible smart standard non-normative table bit, used to create collapsible smart standard non-normative tables in articles or books"},[d.smartStandardRemarkTableNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkTableNormative,description:"Collapsible smart standard normative remark table bit, used to create collapsible smart standard normative remark tables in articles or books"},[d.smartStandardRemarkTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkTableNonNormative,description:"Collapsible smart standard non-normative remark table bit, used to create collapsible smart standard non-normative remark tables in articles or books"},[d.parameters]:{since:"1.18.0",baseBitType:d.table,description:"Parameters bit, used to create parameter tables in articles or books"},[d.toc]:{since:"1.3.0",baseBitType:d._standard,description:"Table of contents bit, used to create a table of contents in articles or books"},[d.tocChapter]:{since:"1.5.5",baseBitType:d.toc,description:"Table of contents chapter bit, used to create chapters in the table of contents",tags:[{key:ce.property_maxDisplayLevel,description:"Maximum display level for the chapter in the table of contents",format:k}]},[d.tocInline]:{since:"3.24.0",baseBitType:d.toc,description:"Inline table of contents bit, used to create inline tables of contents in articles or books",tags:[{key:ce.property_maxTocChapterLevel,description:"Maximum chapter level for the inline table of contents",format:k}]},[d.tocResource]:{since:"3.31.0",baseBitType:d.toc,description:"Table of contents resource bit, used to create resources in the table of contents",tags:[{key:ce.property_tocResource,description:"Resource content for the table of contents, used to define the resource",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"Caption for the button in the table of contents resource, used to define the text displayed on the button",format:b}]},[d.tocContent]:{since:"3.31.0",baseBitType:d.toc,description:"Table of contents content bit, used to create content sections in the table of contents",tags:[{key:ce.property_tocContent,description:"Content for the table of contents, used to define the content section",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"Caption for the button in the table of contents content, used to define the text displayed on the button",format:b}]},[d.anchor]:{since:"1.3.0",baseBitType:d._standard,description:"Anchor bit, used to create anchors in articles or books"},[d.bitBookEnding]:{since:"1.3.0",baseBitType:d._standard,description:"Bit book ending bit, used to create endings in articles or books"},[d.bitBookSummary]:{since:"1.3.0",baseBitType:d._standard,description:"Bit book summary bit, used to create summaries in articles or books"},[d.botActionAnnounce]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action announce bit, used to create announcements in articles or books"},[d.botActionRatingNumber]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action rating number bit, used to create rating number actions in articles or books"},[d.botActionRemind]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action remind bit, used to create reminders in articles or books"},[d.botActionSave]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action save bit, used to create save actions in articles or books"},[d.botActionTrueFalse]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action true/false bit, used to create true/false actions in articles or books"},[d.chapterSubjectMatter]:{since:"1.3.0",baseBitType:d._standard,description:"Chapter subject matter bit, used to create subject matter chapters in articles or books"},[d.chat]:{since:"1.3.0",baseBitType:d._standard,description:"Chat bit, used to create chat sections in articles or books"},[d.conclusion]:{since:"1.3.0",baseBitType:d._standard,description:"Conclusion bit, used to create conclusions in articles or books"},[d.conclusionAlt]:{since:"1.16.0",baseBitType:d.conclusion,description:"Alternative conclusion bit, used to create alternative conclusions in articles or books"},[d.documentUpload]:{since:"1.3.0",baseBitType:d._standard,description:"Document upload bit, used to create document upload sections in articles or books"},[d.footNote]:{since:"1.3.0",baseBitType:d._standard,description:"Footnote bit, used to create footnotes in articles or books"},[d.groupBorn]:{since:"1.3.0",baseBitType:d._standard,description:"Group born bit, used to create group born sections in articles or books"},[d.groupDied]:{since:"1.3.0",baseBitType:d._standard,description:"Group died bit, used to create group died sections in articles or books"},[d.recordAudio]:{since:"1.3.0",baseBitType:d._standard,description:"Record audio bit, used to create audio recording sections in articles or books"},[d.recordVideo]:{since:"1.5.24",baseBitType:d._standard,description:"Record video bit, used to create video recording sections in articles or books"},[d.stickyNote]:{since:"1.3.0",baseBitType:d._standard,description:"Sticky note bit, used to create sticky notes in articles or books"},[d.takePicture]:{since:"1.3.0",baseBitType:d._standard,description:"Take picture bit, used to create picture taking sections in articles or books"},[d.handInAudio]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in audio bit, used to create audio submission sections in articles or books"},[d.handInContact]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in contact bit, used to create contact submission sections in articles or books"},[d.handInDocument]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in document bit, used to create document submission sections in articles or books"},[d.handInFile]:{since:"3.2.0",baseBitType:d._standard,description:"Hand in file bit, used to create file submission sections in articles or books",tags:[{key:ce.property_handInAcceptFileType,description:"Accepted file types for the hand-in file, used to define allowed file formats",format:b,maxCount:u}]},[d.handInLocation]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in location bit, used to create location submission sections in articles or books"},[d.handInPhoto]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in photo bit, used to create photo submission sections in articles or books"},[d.handInScan]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in scan bit, used to create scan submission sections in articles or books"},[d.handInSubmit]:{since:"3.2.0",baseBitType:d._standard,description:"Hand in submit bit, used to create submission sections in articles or books",tags:[{key:ce.property_handInRequirement,description:"Requirement for the hand-in submission, used to define what is needed",format:b,maxCount:u},{key:ce.property_handInInstruction,description:"Instruction for the hand-in submission, used to guide the user",format:b},{key:ce.property_buttonCaption,description:"Caption for the button in the hand-in submission, used to define the button text",format:b}]},[d.handInVideo]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in video bit, used to create video submission sections in articles or books"},[d.handInVoice]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in voice bit, used to create voice submission sections in articles or books"},[d.trueFalse1]:{since:"1.3.0",baseBitType:d._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:ce.property_labelTrue,description:"Label for the true option in the true/false question",format:b},{key:ce.property_labelFalse,description:"Label for the false option in the true/false question",format:b},{key:ce.tag_true,description:"Tag for the true option in the true/false question"},{key:ce.tag_false,description:"Tag for the false option in the true/false question"}],rootExampleType:h},[d.trueFalse]:{since:"1.3.0",baseBitType:d._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:ce.property_labelTrue,description:"Label for the true option in the true/false question",format:b},{key:ce.property_labelFalse,description:"Label for the false option in the true/false question",format:b}],cardSet:A},[d.vendorAmcharts5Chart]:{since:"1.5.8",baseBitType:d.code,description:"AmCharts 5 chart bit, used to embed AmCharts 5 charts in articles or books",textFormatDefault:x.json},[d.vendorDatadogDashboardEmbed]:{since:"3.12.0",baseBitType:d.code,description:"Datadog dashboard embed bit, used to embed Datadog dashboards in articles or books",tags:[{key:ce.property_vendorDashboardId,description:"Dashboard ID for the Datadog dashboard, used to define which dashboard to embed",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksEmbed]:{since:"3.8.0",baseBitType:d.code,description:"Formbricks embed bit, used to embed Formbricks surveys in articles or books",tags:[{key:ce.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to embed",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksEmbedAnonymous]:{since:"3.9.0",baseBitType:d.vendorFormbricksEmbed,description:"Anonymous Formbricks embed bit, used to embed anonymous Formbricks surveys in articles or books"},[d.vendorFormbricksLink]:{since:"3.8.0",baseBitType:d.code,description:"Formbricks link bit, used to create links to Formbricks surveys in articles or books",tags:[{key:ce.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to link to",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksLinkAnonymous]:{since:"3.9.0",baseBitType:d.vendorFormbricksLink,description:"Anonymous Formbricks link bit, used to create links to anonymous Formbricks surveys in articles or books"},[d.vendorHighchartsChart]:{since:"1.5.28",baseBitType:d.vendorAmcharts5Chart,description:"Highcharts chart bit, used to embed Highcharts charts in articles or books"},[d.vendorIframelyEmbed]:{since:"1.5.10",baseBitType:d.code,description:"Iframely embed bit, used to embed content from various sources in articles or books",tags:[{key:ce.property_width,description:"Width for the embedded content, used to define the width in pixels",format:k},{key:ce.property_height,description:"Height for the embedded content, used to define the height in pixels",format:k},{key:ce.property_vendorUrl,description:"URL for the content to be embedded, used to define the source URL",format:b}],textFormatDefault:x.plainText},[d.vendorIframelyCard]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely card bit, used to create cards for embedded content in articles or books"},[d.vendorIframelyPreview]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely preview bit, used to create previews for embedded content in articles or books"},[d.vendorIframelyPreviewMini]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely preview mini bit, used to create mini previews for embedded content in articles or books"},[d.vendorJupyterOutput]:{since:"1.4.3",baseBitType:d.code,description:"Jupyter output bit, used to embed Jupyter notebook outputs in articles or books",tags:[{key:ce.property_jupyterId,description:"Jupyter ID for the notebook, used to define which notebook to embed",format:b},{key:ce.property_jupyterExecutionCount,description:"Execution count for the Jupyter output, used to define the execution order",format:k}],textFormatDefault:x.plainText},[d.vendorJupyterCellCode]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell code bit, used to embed Jupyter notebook cell code in articles or books"},[d.vendorJupyterCellMarkdown]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell markdown bit, used to embed Jupyter notebook cell markdown in articles or books"},[d.vendorJupyterCellRaw]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell raw bit, used to embed Jupyter notebook cell raw content in articles or books"},[d.vendorJupyterIpynb]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter IPYNB bit, used to embed Jupyter notebook files in articles or books"},[d.vendorPadletEmbed]:{since:"1.3.0",baseBitType:d.code,description:"Padlet embed bit, used to embed Padlet boards in articles or books",tags:[{key:ce.property_padletId,description:"Padlet ID for the board, used to define which Padlet to embed",format:b}],textFormatDefault:x.plainText},[d.vendorStripePricingTable]:{since:"1.20.0",baseBitType:d.article,description:"Stripe pricing table bit, used to embed Stripe pricing tables in articles or books",tags:[{key:ce.property_stripePricingTableId,description:"Stripe pricing table ID, used to define which pricing table to embed",format:b,minCount:1},{key:ce.property_stripePublishableKey,description:"Stripe publishable key, used to authenticate the Stripe pricing table",format:b,minCount:1}]},[d.vendorStripePricingTableExternal]:{since:"3.13.0",baseBitType:d.vendorStripePricingTable,description:"External Stripe pricing table bit, used to embed external Stripe pricing tables in articles or books"},[d.video]:{since:"1.3.0",baseBitType:d._standard,description:"Video bit, used to embed videos in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for videos, used to define additional properties"},{key:ce.group_resourceVideo,description:"Resource video tags, used to attach videos to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoLandscape]:{since:"1.3.0",baseBitType:d.video,description:"Landscape video bit, used to embed landscape videos in articles or books"},[d.videoPortrait]:{since:"1.3.0",baseBitType:d.video,description:"Portrait video bit, used to embed portrait videos in articles or books"},[d.videoEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Video embed bit, used to embed videos from external sources in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:ce.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoEmbedLandscape]:{since:"1.3.0",baseBitType:d.videoEmbed,description:"Landscape video embed bit, used to embed landscape videos from external sources in articles or books"},[d.videoEmbedPortrait]:{since:"1.3.0",baseBitType:d.videoEmbed,description:"Portrait video embed bit, used to embed portrait videos from external sources in articles or books"},[d.videoLink]:{since:"1.3.0",baseBitType:d._standard,description:"Video link bit, used to create links to videos in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for video links, used to define additional properties"},{key:ce.group_resourceVideoLink,description:"Resource video link tags, used to attach video links to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoLinkLandscape]:{since:"1.3.0",baseBitType:d.videoLink,description:"Landscape video link bit, used to create links to landscape videos in articles or books"},[d.videoLinkPortrait]:{since:"1.3.0",baseBitType:d.videoLink,description:"Portrait video link bit, used to create links to portrait videos in articles or books"},[d.websiteLink]:{since:"1.3.0",baseBitType:d._standard,description:"Website link bit, used to create links to websites in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for website links, used to define additional properties"},{key:ce.group_resourceWebsiteLink,description:"Resource website link tags, used to attach website links to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.nonProductionPrototypeIframe]:{since:"4.20.0",baseBitType:d._standard,description:"A non-production prototype iframe bit, used to embed prototype iframes",tags:[{key:ce.property_iframeSrc,description:"Iframe source URL, used to define the source of the iframe",minCount:1},{key:ce.property_iframeName,description:"Iframe name, used to define the name of the iframe"}]},[d.vendorLearndashEmbed]:{since:"5.0.0",baseBitType:d.nonProductionPrototypeIframe,description:"Learndash embed bit, used to embed Learndash content in an iframe"}},ve=new class{constructor(){l(this,"bitLevelMin",1),l(this,"bitLevelMax",7),l(this,"bitCache",new Map),l(this,"allResourcesCache"),l(this,"comboResourcesCache",new Map)}getBitType(e){return e?.startsWith("|")&&(e=e.substring(1)),(0,p.Enum)(d).fromValue(e)??d._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const r=this.getBitConfig(e);if(!r)return!1;if(Array.isArray(t)){for(const e of t)if(r.inheritedBitTypesSet.has(e))return!0;return!1}return r.inheritedBitTypesSet.has(t)}isBitTypeCommented(e){return!!e?.startsWith("|")}getBitConfig(e){let t=this.bitCache.get(e);if(!t){const r=()=>{throw new Error(`No config found for bit: ${e}`)},i=[],o=[];let a=e;for(;a;){const e=ke[a];e||r(),i.push(a),o.push(e),a=e.baseBitType}o.reverse();const s=o.reduce((e,t)=>e=he.deepMerge(e,t),{}),{since:n,textFormatDefault:l,quizBit:c,tags:p,cardSet:d,deprecated:m,bodyAllowed:h,bodyRequired:g,footerAllowed:f,footerRequired:y,resourceAttachmentAllowed:k,rootExampleType:v}=s;p?.push({key:ce.property_internalComment,description:"Internal comment for the bit.",format:b,maxCount:u,minCount:0});const T=this.getAllResourcesTagsWithZeroCounts(),_=ye.hydrateTagsConfig(p??[]),C=ye.hydrateCardSetConfig(d),w=_.info?.comboResourceConfigKey,A={..._.tags};for(const[e,t]of Object.entries(T))A[e]||(A[e]=t);t=new re({since:n,bitType:e,inheritedBitTypes:i,textFormatDefault:l??x.bitmarkText,tags:A,cardSet:C,quizBit:c,deprecated:m,bodyAllowed:h,bodyRequired:g,footerAllowed:f,footerRequired:y,resourceAttachmentAllowed:k,rootExampleType:v,comboResourceConfigKey:w}),this.bitCache.set(e,t)}return t}getTagConfigForTag(e,t){if(e)return e[t]}getTagsConfigForCardSet(e,t,r){const i=this.getCardSetVariantConfig(e,t,r);if(i)return i.tags}getCardSetVariantConfig(e,t,r){let i;const o=this.getBitConfig(e);if(!o)return;const a=o.cardSet?.variants;if(!a)return;const s=a[Math.min(t,a.length-1)],n=s.length-1;return i=r>n?s[n]:s[r],i}getBitResourcesConfig(e,t){let r={};const i=new Map,o=t?le(t):void 0,a=this.getBitConfig(e),s={};for(const[e,t]of Object.entries(a.tags))t.type===G&&(s[e]=t);const n=a.comboResourceConfigKey??(a.resourceAttachmentAllowed?o:void 0);if(n){const e=new Map,o=this.getComboResource(n);if(o){const t=Object.values(o).filter(e=>e.type===G);t.map(e=>e.configKey).forEach(r=>{const i=t.find(e=>e.configKey===r);i&&e.set(r,i)});const r=this.getComboResourceConfigKeys(n);r&&r.length>0&&i.set(n,r)}if(t)for(const[t,i]of Object.entries(s)){const o=n===i.configKey,a=!!e&&e.has(i.configKey);if(o){const e=new Z({configKey:i.configKey,tag:i.tag,minCount:1,maxCount:1,chain:i.chain,jsonKey:i.jsonKey,deprecated:i.deprecated});r[t]=e}else if(a){if(e){const o=e.get(i.configKey);o&&(r[t]=o)}}else r[t]=i}else r=s}else r=s;return new me(r,a.resourceAttachmentAllowed,o,i)}getComboResourceConfigKeys(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter(e=>e.type===G).map(e=>e.configKey)}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(be).filter(t=>t.type===j&&t.comboResourceConfigKey===e).forEach(e=>{t={...t,...ye.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(be).filter(e=>e.type===J).forEach(t=>{e={...e,...ye.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}},Te="@gmb/bitmark-parser-generator",xe="5.0.1",_e="ISC",Ce=(r(722),""),we="node",Ae="chrome",Be="safari",Se="firefox",Pe=(r(722),""),Ie="macos";function Le(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:Ce,os:Pe},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce((e,t)=>(t&&e.push(t),e),[]),r={keys:new Set,versions:{}};let i="";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?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),i=t.keys.has("chrome"),o=t.keys.has("chromium"),a=t.keys.has("safari"),s=i,n=r,l=t.keys.has("macintosh");return a&&!i&&!o?(e.browser=Be,e.browserVersion=t.versions.version):s?(e.browser=Ae,e.browserVersion=t.versions.chrome):n&&(e.browser=Se,e.browserVersion=t.versions.firefox),l&&(e.os=Ie,e.osVersion=t.versions.x),e}var Ve={full:"",major:"",minor:"",patch:"",build:""},Ee=new class{constructor(){l(this,"bootTimestamp"),l(this,"app"),l(this,"appVersion"),l(this,"environment"),l(this,"environmentVersion"),l(this,"os"),l(this,"osVersion"),l(this,"isBrowser"),l(this,"isNode"),l(this,"isCI"),l(this,"NODE_ENV"),l(this,"userAgentInfo"),Object.defineProperty(this,"userAgentInfo",{value:Le(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=Ve,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===we,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?we:Ce}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):Ve}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,Pe)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):Ve}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 Ve;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",a="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?a=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:a,build:o}}},Ne=Ee.init.bind(Ee),Re=!1;function Fe(){Re||(Ne(Te,xe),Re=!0)}var Oe=r(722),De=(r(722),{text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"}),Me=(r(722),{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"}),qe=(r(722),{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"}),ze=(r(722),{unknown:"unknown",__isDefaultExample:"__isDefaultExample",__typeAlias:"__typeAlias",action:"action",actionValue:"actionValue",activityType:"activityType",activityTypeValue:"activityTypeValue",additionalSolutions:"additionalSolutions",additionalSolutionsValue:"additionalSolutionsValue",advertisingClickUrl:"advertisingClickUrl",advertisingClickUrlValue:"advertisingClickUrlValue",ageRange:"ageRange",brandColor:"brandColor",brandColorValue:"brandColorValue",brandColorName:"brandColorName",brandColorNameValue:"brandColorNameValue",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",authorFullName:"authorFullName",authorFullNameValue:"authorFullNameValue",authorJobTitle:"authorJobTitle",authorJobTitleValue:"authorJobTitleValue",authorPseudonym:"authorPseudonym",authorPseudonymValue:"authorPseudonymValue",authorTitle:"authorTitle",authorTitleValue:"authorTitleValue",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",bookAuthor:"bookAuthor",bookBindingType:"bookBindingType",bookDiff:"bookDiff",bookDiffValue:"bookDiffValue",bookIsbn:"bookIsbn",bookLanguage:"bookLanguage",bookNumberOfPages:"bookNumberOfPages",bookOriginalTitle:"bookOriginalTitle",bookPublisher:"bookPublisher",bookPublishingDate:"bookPublishingDate",bookRating:"bookRating",bookSeriesId:"bookSeriesId",bookSeriesNumber:"bookSeriesNumber",bookSeriesTitle:"bookSeriesTitle",bookTranslator:"bookTranslator",bookType:"bookType",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",currency:"currency",customerExternalId:"customerExternalId",customerId:"customerId",customerIdValue:"customerIdValue",customerProductId:"customerProductId",customerProductShopLink:"customerProductShopLink",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",elementsValueValue:"elementsValueValue",emphasis:"emphasis",end:"end",errors:"errors",errorsValue:"errorsValue",example:"example",exampleValue:"exampleValue",externalId:"externalId",externalIdValue:"externalIdValue",externalLink:"externalLink",externalLinkText:"externalLinkText",extractorTag:"extractorTag",extractorTagValue:"extractorTagValue",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",footerValue:"footerValue",footerText:"footerText",forKeys:"forKeys",format:"format",formula:"formula",formulaValue:"formulaValue",forValues:"forValues",forValuesValue:"forValuesValue",fullName:"fullName",fullNameValue:"fullNameValue",gap:"gap",gmbExternalShop:"gmbExternalShop",gmbExternalShopItems:"gmbExternalShopItems",groupTag:"groupTag",groupTagValue:"groupTagValue",handInAcceptFileType:"handInAcceptFileType",handInAcceptFileTypeValue:"handInAcceptFileTypeValue",handInInstruction:"handInInstruction",handInInstructionValue:"handInInstructionValue",handInRequirement:"handInRequirement",handInRequirementValue:"handInRequirementValue",hasBookNavigation:"hasBookNavigation",hasBookNavigationValue:"hasBookNavigationValue",hasMarkAsDone:"hasMarkAsDone",hasMarkAsDoneValue:"hasMarkAsDoneValue",head:"head",heading:"heading",height:"height",heightValue:"heightValue",highlight:"highlight",hint:"hint",hintValue:"hintValue",href:"href",icon:"icon",iconTag:"iconTag",iconTagValue:"iconTagValue",iconValue:"iconValue",id:"id",idValue:"idValue",iframeSrc:"iframeSrc",iframeName:"iframeName",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",instructionValue:"instructionValue",internalComment:"internalComment",internalCommentValue:"internalCommentValue",internalPrintPdf:"internalPrintPdf",internalPrintPdfValue:"internalPrintPdfValue",hasPrintRestriction:"hasPrintRestriction",hasPrintRestrictionValue:"hasPrintRestrictionValue",isCaseSensitive:"isCaseSensitive",isCommented:"isCommented",isCorrect:"isCorrect",isEditable:"isEditable",isEditableValue:"isEditableValue",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",itemValue:"itemValue",itemLead:"itemLead",jobTitle:"jobTitle",jobTitleValue:"jobTitleValue",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",leadValue:"leadValue",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",listPrice:"listPrice",listValue:"listValue",location:"location",locationValue:"locationValue",machineTranslated:"machineTranslated",machineTranslatedValue:"machineTranslatedValue",spansPageBreak:"spansPageBreak",spansPageBreakValue:"spansPageBreakValue",mailingList:"mailingList",marginNumber:"marginNumber",marginNumberValue:"marginNumberValue",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",pageNumberValue:"pageNumberValue",pageValue:"pageValue",pairs:"pairs",pairsValue:"pairsValue",parent:"parent",parser:"parser",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",path:"path",pathValue:"pathValue",platformBrandTarget:"platformBrandTarget",platformBrandTargetValue:"platformBrandTargetValue",platformName:"platformName",platformNameValue:"platformNameValue",platformIcon:"platformIcon",platformIconValue:"platformIconValue",platformLogo:"platformLogo",platformLogoValue:"platformLogoValue",platformPrimaryColor:"platformPrimaryColor",platformPrimaryColorValue:"platformPrimaryColorValue",platformSecondaryColor:"platformSecondaryColor",platformSecondaryColorValue:"platformSecondaryColorValue",platformBackgroundColor:"platformBackgroundColor",platformBackgroundColorValue:"platformBackgroundColorValue",platformScrollbarColor:"platformScrollbarColor",platformScrollbarColorValue:"platformScrollbarColorValue",platformSelectionColor:"platformSelectionColor",platformSelectionColorValue:"platformSelectionColorValue",platformSeparatorColor:"platformSeparatorColor",platformSeparatorColorValue:"platformSeparatorColorValue",platformPlaceholderColor:"platformPlaceholderColor",platformPlaceholderColorValue:"platformPlaceholderColorValue",platformTextSelectionColor:"platformTextSelectionColor",platformTextSelectionColorValue:"platformTextSelectionColorValue",platformButtonPrimaryColor:"platformButtonPrimaryColor",platformButtonPrimaryColorValue:"platformButtonPrimaryColorValue",platformButtonBackgroundColor:"platformButtonBackgroundColor",platformButtonBackgroundColorValue:"platformButtonBackgroundColorValue",platformMessageBackgroundColor:"platformMessageBackgroundColor",platformMessageBackgroundColorValue:"platformMessageBackgroundColorValue",platformBackgroundImage:"platformBackgroundImage",platformBackgroundImageValue:"platformBackgroundImageValue",platformBorderColor:"platformBorderColor",platformBorderColorValue:"platformBorderColorValue",platformSelectionTextColor:"platformSelectionTextColor",platformSelectionTextColorValue:"platformSelectionTextColorValue",platformBaseLayerColor:"platformBaseLayerColor",platformBaseLayerColorValue:"platformBaseLayerColorValue",platformMargin:"platformMargin",platformMarginValue:"platformMarginValue",platformBorderRadius:"platformBorderRadius",platformBorderRadiusValue:"platformBorderRadiusValue",platformSelectionBorderRadius:"platformSelectionBorderRadius",platformSelectionBorderRadiusValue:"platformSelectionBorderRadiusValue",platformNeedsShadow:"platformNeedsShadow",platformNeedsShadowValue:"platformNeedsShadowValue",person:"person",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",posterImage:"posterImage",posterImageValue:"posterImageValue",postfix:"postfix",prefix:"prefix",previewImage:"previewImage",previewImageValue:"previewImageValue",previewVideo:"previewVideo",previewVideoValue:"previewVideoValue",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",pseudonym:"pseudonym",pseudonymValue:"pseudonymValue",publications:"publications",publicationsValue:"publicationsValue",publisher:"publisher",publisherName:"publisherName",publisherNameValue:"publisherNameValue",publisherValue:"publisherValue",quantity:"quantity",question:"question",questionValue:"questionValue",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",relatedBook:"relatedBook",relatedBookValue:"relatedBookValue",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",rows:"rows",rowsValue:"rowsValue",rubric:"rubric",rubricValue:"rubricValue",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",scormSource:"scormSource",scormSourceValue:"scormSourceValue",search:"search",searchIndex:"searchIndex",searchIndexValue:"searchIndexValue",searchValue:"searchValue",section:"section",select:"select",selected:"selected",servings:"servings",servingsValue:"servingsValue",showInIndex:"showInIndex",showInIndexValue:"showInIndexValue",size:"size",slug:"slug",slugValue:"slugValue",solution:"solution",solutions:"solutions",solutionsValue:"solutionsValue",sourceDocument:"sourceDocument",sourceDocumentValue:"sourceDocumentValue",sourceRL:"sourceRL",sourceRLValue:"sourceRLValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",srcAlt:"srcAlt",srcAltValue:"srcAltValue",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",subtitleValue:"subtitleValue",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",titleValue:"titleValue",titleString:"titleString",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"}),$e=class{constructor(){Fe()}walk(e,t,r,i){this.walkRecursive(e,[{index:0,key:t,value:e}],r,i)}getRouteKey(e){return e.reduce((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t),"")}printTree(e,t=ze.bitmarkAst){this.walkRecursive(e,[{index:0,key:t,value:e}],{enter:(e,t)=>(console.log("Enter: "+this.getRouteKey(t)),t[t.length-1].key!==ze.bodyJson),between:(e,t,r,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t)=>{console.log("Exit: "+this.getRouteKey(t))},leaf:(e,t)=>{console.log("Leaf: "+this.getRouteKey(t))}},void 0)}preprocessAst(e){if(se.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i){const{enter:o,between:a,exit:s,leaf:n}=r,l=t[t.length-1].key,c=!this.isValue(e),p=t[t.length-1];if(c){if(o){if(!1===o(p,t,i))return}}else n&&n(p,t,i);if(c){const o=this.isArray(e),s=Object.keys(e);for(let n=0,c=s.length;n<c;n++){const d=s[n],u=n===c-1,m=e,h=m[d];if(null!=h){const e={key:this.getAstKey(d,l,o),index:n,value:h},c=t.slice();if(c.push(e),this.walkRecursive(h,c,r,i),!u){const r=s[n+1],c=m[r],d={key:this.getAstKey(r,l,o),index:n+1,value:c};if(a){if(!1===a(p,e,d,t,i))break}}}}}c&&s&&s(p,t,i)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),(0,Oe.Enum)(ze).fromKey(i)||`unknown(${i})`}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)}},Je=r(722),je=(r(722),"tag"),We="body",He=(r(722),{plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"}),Ue=/([*`_!=])(?=\1)/,Ge=/(\^*])/,Ke=/(\^+)/,Ye=`${Ge.source}|${Ke.source}`,Qe=`${Ue.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}|${Ke.source}`,Xe=`${/^(\[)(\^*)(\.)/.source}`,Ze=new RegExp(`${Ue.source}|${Ge.source}|${Ke.source}`,"gm"),et=new RegExp(Ye,"gm"),tt=new RegExp(Qe,"gm"),rt=new RegExp(Xe,"gm"),it=new RegExp("^(?:(\\[)(\\^*)(\\.))|(\\^+)","gm"),ot=new RegExp("\\^([\\^]*)","gm"),at=new RegExp("^(\\[)\\^(\\^*)(\\.)","gm"),st=new RegExp("^(\\||•|#)","gm"),nt={format:He.bitmarkPlusPlus,location:We,v2:!1};function lt(e){return"string"==typeof e||e instanceof String}var ct={format:x.bitmarkText,location:We,inPlaceArray:!1,v2:!1},pt=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t={}){if(null==e)return;const r=Object.assign({},nt,t);if(Array.isArray(e))return e.map(e=>this.breakscape(e,r));if(!lt(e))return e;const{regex:i,replacer:o}=function(e,t,r=!1){return t===je?r||e!==He.bitmarkPlusPlus?{regex:et,replacer:"$2^$1"}:{regex:Ze,replacer:"$1$3^$2"}:e===He.bitmarkPlusPlus?r?{regex:it,replacer:"$1$4^$2$3"}:{regex:tt,replacer:"$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14"}:{regex:rt,replacer:"$1^$2$3"}}(r.format,r.location,r.v2);let a=e;return a=a.replace(i,o),a}unbreakscape(e,t={}){if(null==e)return;const r=Object.assign({},nt,t);if(Array.isArray(e))return e.map(e=>this.unbreakscape(e,r));if(!lt(e))return e;const{regex:i,replacer:o}=function(e,t){const r=e!==He.bitmarkPlusPlus;return t===We&&r?{regex:at,replacer:"$1$2$3"}:{regex:ot,replacer:"$1"}}(r.format,r.location);let a=e;return a=a.replace(i,o),a}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},nt,t),i=e=>e?e.replace(st,"$1^"):e;if(Array.isArray(e)){const t=r.inPlaceArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];lt(r)&&(e[t]=i(r))}e=t}else lt(e)&&(e=i(e));return e}version(){return xe}license(){return _e}},dt=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t){const r=Object.assign({},ct,t);return pt.breakscape(e,{format:r.format,location:r.location,inPlaceArray:r.inPlaceArray,v2:r.v2})}unbreakscape(e,t){const r=Object.assign({},ct,t);return pt.unbreakscape(e,r)}breakscapeCode(e,t){const r=Object.assign({},ct,t);return pt.breakscapeCode(e,r)}concatenate(e,t){return e+t}},ut=(r(722),{bitmarkMinusMinus:"bitmark--"});function mt(e,t){if(function(e){const t=e,r=!(!t.columns&&!t.data),i=!!(t.header||t.body||t.footer);return r&&i}(t)){const e=t;delete e.columns,delete e.data}const r=ve.isOfBitType(e,d.tableExtended);return r&&function(e){const t=e;return!(!t.columns&&!t.data||t.header||t.body||t.footer)}(t)?function(e){const t={};return e.columns&&e.columns.length>0&&(t.header={rows:[{cells:e.columns.map(e=>({content:e,title:!0}))}]}),e.data&&e.data.length>0&&(t.body={rows:e.data.map(e=>({cells:e.map(e=>({content:e}))}))}),t}(t):!r&&function(e){const t=e;return!!(t.header||t.body||t.footer)}(t)?function(e){const t={},r=e=>e&&Array.isArray(e.cells)?e.cells.map(e=>e?.content).filter(e=>void 0!==e):[],i=[],o=e.header?.rows??[];if(o.length>0){const e=r(o[0]);e.length>0&&(t.columns=e),o.slice(1).forEach(e=>{const t=r(e);t.length>0&&i.push(t)})}const a=e=>{e&&Array.isArray(e.rows)&&e.rows.forEach(e=>{const t=r(e);t.length>0&&i.push(t)})};return a(e.body),a(e.footer),i.length>0&&(t.data=i),t}(t):t}var ht=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 r=new Set;let i=0;for(let o=0;o<e.length;o++){const a=e[o],s=t?t(a):a;r.has(s)||(r.add(s),i!==o&&(e[i]=a),i++)}return i<e.length&&(e.length=i),e}},gt=r(722),ft=(r(722),{v2:2,v3:3}),bt=ft.v3,yt=class{constructor(){l(this,"ast",new $e),l(this,"debugGenerationInline",!1),l(this,"printed",!1)}enter(e,t,r){let i;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]&&(i=o[a](e,t,r)),i}between(e,t,r,i,o){let a;const s=this,n=`between_${e.key}`;return this.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[n]&&(a=s[n](e,t,r,i,o)),a}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}getParentNode(e,t=1){if(e.length>t)return e[e.length-t-1]}},kt={bodyBitCallback:void 0,debugGenerationInline:!1},vt="==",Tt=["*","`","_","!","="],xt={[Me.bold]:"**",[Me.light]:"``",[Me.italic]:"__",[Me.highlight]:"!!"},_t=[Me.bold,Me.light,Me.italic,Me.highlight],Ct=[Me.strike,Me.subscript,Me.superscript,Me.ins,Me.del,Me.underline,Me.doubleUnderline,Me.circle,Me.languageEmRed,Me.languageEmOrange,Me.languageEmYellow,Me.languageEmGreen,Me.languageEmBlue,Me.languageEmPurple,Me.languageEmPink,Me.languageEmBrown,Me.languageEmBlack,Me.languageEmWhite,Me.languageEmGray,Me.languageEm,Me.userUnderline,Me.userDoubleUnderline,Me.userStrike,Me.userCircle,Me.userHighlight,Me.notranslate,Me.link,Me.ref,Me.xref,Me.extref,Me.footnote,Me.footnoteStar,Me.symbol,Me.var,Me.code,Me.timer,Me.duration,Me.color,Me.comment],wt=new RegExp(/(\n|\r\n)/,"g"),At=new RegExp(/https?:\/\/|mailto:(.*)/,"g"),Bt=new RegExp(/\]/,"g"),St="enter",Pt="between",It="exit",Lt=class extends yt{constructor(e,t){super(),l(this,"ast",new $e),l(this,"bitmarkVersion"),l(this,"options"),l(this,"generateOptions",{}),l(this,"textFormat",x.bitmarkText),l(this,"textLocation",We),l(this,"writerText",""),l(this,"nodeIndex",0),l(this,"currentIndent",0),l(this,"prevIndent",0),l(this,"indentationStringCache",""),l(this,"inParagraph",!1),l(this,"inHeading",!1),l(this,"inCodeBlock",!1),l(this,"exitedCodeBlock",!1),l(this,"inBulletList",!1),l(this,"inInline",!1),l(this,"textDepth",0),l(this,"placeholderIndex",0),l(this,"placeholders",{}),l(this,"rootParagraphNodeContentIndex",0),l(this,"previousRootParagraphContextType",qe.text),l(this,"inPreText",!1),l(this,"thisNodeIsPreText",!1),l(this,"preTextIndexTemp",-1),l(this,"havePreText",!1),l(this,"preTextIndex",-1),this.bitmarkVersion=(0,gt.Enum)(ft).fromValue(e)??bt,this.options={...kt,...t},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion,ft.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,r,i){return this.generateSync(e,t,r,i)}generateSync(e,t,r,i){if(this.generateOptions=Object.assign({},i),this.validateGenerateOptions(e),this.generateOptions.plainTextDividerAllowed){const i=this.options.writeCallback,o=this.options.bodyBitCallback;this.options.writeCallback=void 0,this.options.bodyBitCallback=void 0,this.resetState(t,r),this.walkAndWrite(e),this.options.writeCallback=i,this.options.bodyBitCallback=o;const a=this.havePreText,s=this.preTextIndex;this.resetState(t,r),this.havePreText=a,this.preTextIndex=s,this.walkAndWrite(e)}else this.resetState(t,r),this.walkAndWrite(e);return this.writerText}getPlaceholders(){return this.placeholders}resetState(e,t){this.printed=!1,this.textFormat=e??x.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=qe.hardBreak,this.inPreText=!1,this.thisNodeIsPreText=!1,this.preTextIndexTemp=-1,this.havePreText=!1,this.preTextIndex=-1}walkAndWrite(e){this.ast.walk(e,ze.textAst,this,void 0)}enter_textAstValue(e,t){return this.handleEnterNode(e.value,t)}between_textAstValue(e,t,r,i){return this.handleBetweenNode(e.value,t,r,i)}exit_textAstValue(e,t){return this.handleExitNode(e.value,t)}enter_contentValue(e,t){return this.handleEnterContentValueNode(e,t)}between_contentValue(e,t,r,i){this.handleBetweenContentValueNode(e,t,r,i)}exit_contentValue(e,t){this.handleExitContentValueNode(e,t)}enter_contentValueValue(e,t){return this.handleEnterNode(e.value,t)}between_contentValueValue(e,t,r,i){this.handleBetweenNode(e.value,t,r,i)}exit_contentValueValue(e,t){return this.handleExitNode(e.value,t)}handleEnterNode(e,t){switch(this.handleEnterNodePreTextCheck(e,t),this.handleIndent(e),e.type){case qe.paragraph:this.inParagraph=!0,this.writeParagraph(e);break;case qe.hardBreak:this.writeHardBreak(e);break;case qe.text:this.writeMarks(e,St),this.writeText(e),this.writeMarks(e,Pt),0===this.textDepth&&(this.inInline=!0),this.textDepth++;break;case qe.heading:this.writeHeading(e),this.inHeading=!0;break;case qe.section:this.writeSection(e);break;case qe.listItem:case qe.taskItem:this.writeBullet(e,t);break;case qe.image:case qe.imageInline:this.writeImage(e);break;case qe.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case qe.latex:this.writeLatex(e);break;case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.inBulletList=!0;break;case qe.gap:case qe.select:case qe.highlight:case qe.mark:return this.writeBodyBit(e,t),!1}this.exitedCodeBlock=!1}handleBetweenNode(e,t,r,i){e.type}handleExitNode(e,t){switch(e.type){case qe.text:this.textDepth--,0===this.textDepth&&(this.inInline=!1),this.writeMarks(e,It);break;case qe.paragraph:this.writeNL(),this.inParagraph=!1;break;case qe.heading:this.inHeading=!1;case qe.section:case qe.image:this.inParagraph||(this.writeNL(),this.writeNL());break;case qe.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent<=1&&(this.writeNL(),this.inBulletList=!1)}this.handleDedent(e),this.nodeIndex++}handleIndent(e){switch(e.type){case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent--}}handleEnterContentValueNode(e,t){3===t.length&&(this.thisNodeIsPreText=!0,this.inPreText=!1,this.previousRootParagraphContextType=qe.hardBreak)}handleBetweenContentValueNode(e,t,r,i){if(3===i.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===qe.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===qe.hardBreak)return;if(e.type===qe.text)return}this.thisNodeIsPreText=!1}getLinkHref(e){if(e.type===qe.text&&e.marks){const t=e.marks.reduce((e,t)=>{if(t.type===Me.link){const e=t,r=e.attrs?.href;if(r)return r}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 r=`[!${this.placeholderIndex}]`;if(this.placeholders[r]=e,this.options.bodyBitCallback){const r=this.options.bodyBitCallback(e,this.placeholderIndex,t);this.write(r)}else this.write(r);this.placeholderIndex++}writeText(e){if(null==e.text)return;const t=this.inCodeBlock;let r=e.text;const i=this.getLinkText(e);if(i&&(r=i),r=i||this.breakscape(r,{format:this.textFormat,location:this.textLocation}),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(wt,`$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:x.plainText,location:this.textLocation});this.write(t)}else this.write(r);(this.currentIndent>1||t)&&(this.thisNodeIsPreText=!1),this.inPreText||e.text!==r||(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(At,"$1")===e.text}return!1}getLinkText(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r;return r=t.replace(At,"$1")===e.text?t:e.text,r=(r??"").replace(Bt,"^]"),r}return!1}getInterTextBreakscape(e){if(this.bitmarkVersion===ft.v2)return"";if(this.textFormat===x.plainText)return"";const t=this.writerText.slice(-1),r=e.slice(0,1);return t===r&&-1!==Tt.indexOf(t)||this.textLocation===We&&"["===t&&-1!=="@#▼►%!?+-$_=&".indexOf(r)?"^":""}validateGenerateOptions(e){this.generateOptions.plainTextDividerAllowed&&(1!==e.length||1===e.length&&e[0].type!==qe.paragraph)&&(this.generateOptions.plainTextDividerAllowed=!1)}writeMarks(e,t){if(e.marks){const r=!(!this.inInline&&!this.inHeading);this.thisNodeIsPreText=!1;if(0===e.marks.length)return void this.writeMarkTextWrapper(vt);const i=1===e.marks.length&&r,o=e.marks.reduce((e,t)=>e||(-1!==_t.indexOf(t.type)?i?xt[t.type]:vt:-1!==Ct.indexOf(t.type)?vt:e),void 0),a=this.isSimpleLink(e);if(null!=o&&!a){if(t!=St&&t!=Pt||this.writeMarkTextWrapper(o),t==Pt)for(const t of e.marks)-1!==_t.indexOf(t.type)?i||(this.writeInlineMarkStartEnd(),this.writeInlineMark(t)):Me.comment===t.type?(this.writeInlineMarkStartEnd(),this.writeCommentMark(t)):Me.link===t.type?(this.writeInlineMarkStartEnd(),this.writeLinkMark(t)):Me.ref===t.type?(this.writeInlineMarkStartEnd(),this.writeRefMark(t)):Me.xref===t.type?(this.writeInlineMarkStartEnd(),this.writeXRefMark(t)):Me.extref===t.type?(this.writeInlineMarkStartEnd(),this.writeExtRefMark(t)):Me.footnote===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteMark(t)):Me.footnoteStar===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteStarMark(t)):Me.symbol===t.type?(this.writeInlineMarkStartEnd(),this.writeSymbolMark(t)):-1!==Ct.indexOf(t.type)&&(this.writeInlineMarkStartEnd(),this.writeInlineMark(t));if(t==It){let t=!1;for(const r of e.marks)-1!==_t.indexOf(r.type)?i||(t=!0):Me.comment!==r.type&&Me.link!==r.type&&Me.ref!==r.type&&Me.xref!==r.type&&Me.footnote!==r.type&&Me.footnoteStar!==r.type&&-1===Ct.indexOf(r.type)||(t=!0);t&&this.writeInlineMarkStartEnd()}}}}writeParagraph(e){if(this.textFormat===x.bitmarkText){if(this.inBulletList)return;const t=e.content?.length??0;if(0===this.nodeIndex){if(1===t){const t=e.content?.[0].type===qe.text,r=e.content?.[0].text??"";if(!t||""!==r)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 r=e.attrs?.level??1;for(let e=0;e<+r;e++)t+="#";t+=" ",this.write(t)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e,t){let r=this.getIndentationString();const i=this.getParentNode(t,2),o=i?.value,a=o?.type,s=o?.attrs?.start??1;if(a===qe.bulletList)r+="• ";else if(a===qe.noBulletList)r+="•_ ";else if(a===qe.orderedList)r+=`•${s} `;else if(a===qe.orderedListRoman)r+=`•${s}I `;else if(a===qe.orderedListRomanLower)r+=`•${s}i `;else if(a===qe.letteredList)r+="•A ";else if(a===qe.letteredListLower)r+="•a ";else if(a===qe.taskList){const t=e;r+=t.attrs?.checked??!1?"•+ ":"•- "}r&&this.write(r)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs,r=e.type===qe.imageInline,i=this.getMediaAttrs(r?"imageInline":"image",t,{ignoreAttributes:r?new Set(["alt","zoomDisabled","title"]):void 0});let o="";r&&(o=`==${t.alt??""}==`),o+=i?`|${i}|`:"",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,r=`==${this.breakscape(t.formula,{format:this.textFormat,location:this.textLocation})}==|latex|`;this.write(r)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,i]of Object.entries(e.attrs))("language"===r&&"plain text"!==i||"color"===r||"name"===r||"duration"===r)&&(t=`${t}:${i}`);this.write(t)}writeCommentMark(e){const t=`#${e.comment||""}`;this.write(t)}writeLinkMark(e){const t=`link:${((e.attrs?.href||"")??"").replace(Bt,"^]")}`;this.write(t)}writeRefMark(e){const t=`►${e.attrs?.reference??""}`;this.write(t)}writeXRefMark(e){const t=e.attrs?.xref??"",r=e.attrs?.reference??"";let i=`xref:${t}`;r&&(i+=`|►${r}`),this.write(i)}writeExtRefMark(e){const t=e.attrs?.extref??"",r=e.attrs?.references??[],i=e.attrs?.provider??"";let o=`extref:${t}`;for(const e of r)o+=`|►${e??""}`;o+=`|provider:${i}`,this.write(o)}writeFootnoteMark(e){this.write("footnote:")}writeFootnoteStarMark(e){this.write("footnote*:")}writeSymbolMark(e){if(null==e.attrs)return;const t=e.attrs,r=this.getMediaAttrs("symbol",t)??"";this.write(r)}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 r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getMediaAttrs(e,t,r){if(!e)return;const i=Object.assign({},r).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,r]=a[e];if(!i.has(t))switch(t){case"textAlign":"left"!==r&&(o+=`|captionAlign:${r}`);break;case"alignment":"center"!==r&&r&&(o+=`|alignment:${r}`);break;case"title":r&&(o+=`|caption:${r}`);break;case"class":"center"!==r&&r&&(o+=`|align:${r}`);break;case"comment":r&&(o+=`|#${r}`);break;case"":se.isString(r)?o+=`|:${r}`:o+="|";break;case"zoomDisabled":r||(o+="|zoomDisabled:false");break;default:t&&r&&(o+=`|${t}:${r}`)}}return o}breakscape(e,t){return this.generateOptions.noBreakscaping?e:dt.breakscape(e,t)}getBitType(e){for(const t of e)if(t.key===ze.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 r of e)this.write(`${r}${t??""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}};function Vt(e){return"string"!=typeof e?null:dt.unbreakscape(e)}function Et(e){e&&"object"==typeof e&&(delete e._tempParsingParent,delete e._tempListStart,Object.keys(e).forEach(t=>{Et(e[t])}))}function Nt(e){const t=e=>e&&"text"===e.type&&!e.text;function r(e){for(let i=e.length-1;i>=0;i--){const o=e[i];t(o)?e.splice(i,1):o&&Array.isArray(o.content)&&r(o.content)}}return Array.isArray(e)?r(e):e&&Array.isArray(e.content)&&r(e.content),e}function Rt(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):Ot(e,{startRule:"bitmarkPlusString"})}var Ft=class extends SyntaxError{constructor(e,t,r,i){super(e),this.expected=t,this.found=r,this.location=i,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null;const i=e.find(e=>e.source===this.location.source);i&&(r=i.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,s=this.location.source+":"+a.line+":"+a.column;if(r){const e=this.location.end,i="".padEnd(a.line.toString().length," "),n=r[o.line-1],l=(o.line===e.line?e.column:n.length+1)-o.column||1;t+="\n --\x3e "+s+"\n"+i+" |\n"+a.line+" | "+n+"\n"+i+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}const i=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return i?e.replace(i,e=>"\\u{"+r(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function s(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}const n={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return n[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],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 Ot(e,t){const r={},i=(t=void 0!==t?t:{}).grammarSource,o={version:Do,bitmarkPlusPlus:function(){let e,t;if(Io++,e=[],t=Mo(),t!==r)for(;t!==r;)e.push(t),t=Mo();else e=r;e===r&&(e=function(){let e,t;return e=Co,t="",wo=e,t=[],e=t,e}());Io--,e===r&&(t=r,0===Io&&Fo($t));return e},bitmarkPlus:function(){let e,t;return Io++,e=Co,t=ma(),wo=e,t=xo(t),e=t,Io--,e},bitmarkMinusMinus:function(){let e,t;return Io++,e=Co,t=xa(),wo=e,t=_o(t),e=t,Io--,e},bitmarkPlusString:function(){let e;return Io++,e=ma(),Io--,e},bitmarkMinusMinusString:xa};let a=Do;const s="|",n="### ",l="## ",c="# ",p="code",d=":",u="bitmark++",m="bitmark--",h="JavaScript",g="• ",f="•_ ",b="•",y=" ",k="I ",v="i ",T="•A ",x="•a ",_="•+ ",C="•- ",w="\t",A="image",B="#",S="@",P="width",I="height",L="alignment",V="captionAlign",E="left",N="center",R="right",F="alt",O="caption",D="zoomDisabled",M="true",q="false",z="=",$="|latex|",J="|imageInline:",j="srcAlt",W="alignmentVertical",H="size",U="top",G="middle",K="bottom",Y="baseline",Q="sub",X="super",Z="text-bottom",ee="text-top",te="line-height",re="font-height",ie="explicit",oe="link:",ae="extref:",se="provider:",ne="xref:",le="►",ce="symbol:",pe="footnote:",de="footnote*:",ue="var:",me="code:",he="timer",ge="timer:",fe="duration:",be="P",ye="color:",ke="|►",ve="bold",Te="italic",xe="light",_e="highlight",Ce="strike",we="subscript",Ae="superscript",Be="ins",Se="del",Pe="underline",Ie="doubleUnderline",Le="circle",Ve="languageEmRed",Ee="languageEmOrange",Ne="languageEmYellow",Re="languageEmGreen",Fe="languageEmBlue",Oe="languageEmPurple",De="languageEmPink",Me="languageEmBrown",qe="languageEmBlack",ze="languageEmWhite",$e="languageEmGray",Je="languageEm",je="userUnderline",We="userDoubleUnderline",He="userStrike",Ue="userCircle",Ge="userHighlight",Ke="notranslate",Ye="aqua",Qe="black",Xe="blue",Ze="brown",et="fuchsia",tt="lightgrey",rt="gray",it="darkgray",ot="green",at="lime",st="magenta",nt="maroon",lt="navy",ct="olive",pt="orange",dt="pink",ut="purple",mt="red",ht="silver",gt="teal",ft="violet",bt="white",yt="yellow",kt="*",vt="_",Tt="`",xt="!",_t="[!",Ct="]",wt="\n",At="\r\n",Bt="http",St="s",Pt="://",It="mailto:",Lt=/^[ \t]/,Ot=/^[0-9]/,Dt=/^[\r\u2028-\u2029]/,Mt=/^[^\n\r\u2028\u2029]/,qt=/^[!#-;=?-[\]-_a-{}-~]/,zt={type:"any"},$t=Eo("StyledText"),Jt=Lo("|",!1),jt=Lo("### ",!1),Wt=Lo("## ",!1),Ht=Lo("# ",!1),Ut=Lo("code",!1),Gt=Vo([" ","\t"],!1,!1,!1),Kt=Lo(":",!1),Yt=Lo("bitmark++",!1),Qt=Lo("bitmark--",!1),Xt=Lo("JavaScript",!1),Zt=Lo("• ",!1),er=Lo("•_ ",!1),tr=Lo("•",!1),rr=Vo([["0","9"]],!1,!1,!1),ir=Lo(" ",!1),or=Lo("I ",!1),ar=Lo("i ",!1),sr=Lo("•A ",!1),nr=Lo("•a ",!1),lr=Lo("•+ ",!1),cr=Lo("•- ",!1),pr=Lo("\t",!1),dr=Lo("image",!1),ur=Lo("#",!1),mr=Lo("@",!1),hr=Lo("width",!1),gr=Lo("height",!1),fr=Lo("alignment",!1),br=Lo("captionAlign",!1),yr=Lo("left",!1),kr=Lo("center",!1),vr=Lo("right",!1),Tr=Lo("alt",!1),xr=Lo("caption",!1),_r=Lo("zoomDisabled",!1),Cr=Lo("true",!1),wr=Lo("false",!1),Ar=Lo("=",!1),Br=Lo("|latex|",!1),Sr=Lo("|imageInline:",!1),Pr=Lo("srcAlt",!1),Ir=Lo("alignmentVertical",!1),Lr=Lo("size",!1),Vr=Lo("top",!1),Er=Lo("middle",!1),Nr=Lo("bottom",!1),Rr=Lo("baseline",!1),Fr=Lo("sub",!1),Or=Lo("super",!1),Dr=Lo("text-bottom",!1),Mr=Lo("text-top",!1),qr=Lo("line-height",!1),zr=Lo("font-height",!1),$r=Lo("explicit",!1),Jr=Lo("link:",!1),jr=Lo("extref:",!1),Wr=Lo("provider:",!1),Hr=Lo("xref:",!1),Ur=Lo("►",!1),Gr=Lo("symbol:",!1),Kr=Lo("footnote:",!1),Yr=Lo("footnote*:",!1),Qr=Lo("var:",!1),Xr=Lo("code:",!1),Zr=Lo("timer",!1),ei=Lo("timer:",!1),ti=Lo("duration:",!1),ri=Lo("P",!1),ii=Lo("color:",!1),oi=Lo("|►",!1),ai=Lo("bold",!1),si=Lo("italic",!1),ni=Lo("light",!1),li=Lo("highlight",!1),ci=Lo("strike",!1),pi=Lo("subscript",!1),di=Lo("superscript",!1),ui=Lo("ins",!1),mi=Lo("del",!1),hi=Lo("underline",!1),gi=Lo("doubleUnderline",!1),fi=Lo("circle",!1),bi=Lo("languageEmRed",!1),yi=Lo("languageEmOrange",!1),ki=Lo("languageEmYellow",!1),vi=Lo("languageEmGreen",!1),Ti=Lo("languageEmBlue",!1),xi=Lo("languageEmPurple",!1),_i=Lo("languageEmPink",!1),Ci=Lo("languageEmBrown",!1),wi=Lo("languageEmBlack",!1),Ai=Lo("languageEmWhite",!1),Bi=Lo("languageEmGray",!1),Si=Lo("languageEm",!1),Pi=Lo("userUnderline",!1),Ii=Lo("userDoubleUnderline",!1),Li=Lo("userStrike",!1),Vi=Lo("userCircle",!1),Ei=Lo("userHighlight",!1),Ni=Lo("notranslate",!1),Ri=Lo("aqua",!1),Fi=Lo("black",!1),Oi=Lo("blue",!1),Di=Lo("brown",!1),Mi=Lo("fuchsia",!1),qi=Lo("lightgrey",!1),zi=Lo("gray",!1),$i=Lo("darkgray",!1),Ji=Lo("green",!1),ji=Lo("lime",!1),Wi=Lo("magenta",!1),Hi=Lo("maroon",!1),Ui=Lo("navy",!1),Gi=Lo("olive",!1),Ki=Lo("orange",!1),Yi=Lo("pink",!1),Qi=Lo("purple",!1),Xi=Lo("red",!1),Zi=Lo("silver",!1),eo=Lo("teal",!1),to=Lo("violet",!1),ro=Lo("white",!1),io=Lo("yellow",!1),oo=Lo("*",!1),ao=Lo("_",!1),so=Lo("`",!1),no=Lo("!",!1),lo=Lo("[!",!1),co=Lo("]",!1),po=Eo("Line Terminator"),uo=Lo("\n",!1),mo=Lo("\r\n",!1),ho=Vo(["\r",["\u2028","\u2029"]],!1,!1,!1),go=Vo(["\n","\r","\u2028","\u2029"],!0,!1,!1),fo=Lo("http",!1),bo=Lo("s",!1),yo=Lo("://",!1),ko=Lo("mailto:",!1),vo=Vo(["!",["#",";"],"=",["?","["],["]","_"],["a","{"],["}","~"]],!1,!1,!1);function To(e){let t={...e};Et(t);return Nt(t)}function xo(e){return[{type:"paragraph",content:e,attrs:{}}]}function _o(e){return[{type:"paragraph",content:e,attrs:{}}]}let Co=0|t.peg$currPos,wo=Co;const Ao=[{line:1,column:1}];let Bo,So=Co,Po=t.peg$maxFailExpected||[],Io=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 Lo(e,t){return{type:"literal",text:e,ignoreCase:t}}function Vo(e,t,r,i){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:i}}function Eo(e){return{type:"other",description:e}}function No(t){let r,i=Ao[t];if(i)return i;if(t>=Ao.length)r=Ao.length-1;else for(r=t;!Ao[--r];);for(i=Ao[r],i={line:i.line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Ao[t]=i,i}function Ro(e,t,r){const o=No(e),a=No(t),s={source:i,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:a.line,column:a.column}};return r&&i&&"function"==typeof i.offset&&(s.start=i.offset(s.start),s.end=i.offset(s.end)),s}function Fo(e){Co<So||(Co>So&&(So=Co,Po=[]),Po.push(e))}function Oo(e,t,r){return new Ft(Ft.buildMessage(e,t),e,t,r)}function Do(){let t,i,o;for(t=Co,i=[],e.length>Co?(o=e.charAt(Co),Co++):(o=r,0===Io&&Fo(zt));o!==r;)i.push(o),e.length>Co?(o=e.charAt(Co),Co++):(o=r,0===Io&&Fo(zt));return wo=t,i="8.35.0",t=i,t}function Mo(){let t,i;var o;return t=Co,i=function(){let t,i,o,a,s;if(t=Co,i=$o(),i!==r){for(o=Co,a=[],s=Oa();s!==r;)a.push(s),s=Oa();o=e.substring(o,Co),a=Da(),a!==r?(s=Fa(),s===r&&(s=null),wo=t,n=i,t={type:"heading",content:Rt(o),attrs:{level:n.length-1}}):(Co=t,t=r)}else Co=t,t=r;var n;return t}(),i!==r&&(wo=t,o=i,i=Nt({...o})),t=i,t===r&&(t=Co,i=function(){let e,t,i,o;if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Ho(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"bulletList"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,a=t,s=i,e={...a,content:s,attrs:{}}):(Co=e,e=r)}else Co=e,e=r;var a,s;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Uo(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"noBulletList"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Go(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"orderedList"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Ko(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"orderedListRoman"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Yo(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"orderedListRomanLower"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Qo(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"letteredList"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r){if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Xo(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"letteredListLower"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Co=e,e=r)}else Co=e,e=r;if(e===r)if(e=Co,t=function(){let e,t,i;e=Co,t=Co,Io++,i=Zo(),Io--,i!==r?(Co=t,t=void 0):t=r;t!==r&&(wo=e,t={type:"taskList"});return e=t,e}(),t!==r){if(i=[],o=ta(),o!==r)for(;o!==r;)i.push(o),o=ta();else i=r;i!==r?(o=Fa(),o===r&&(o=null),wo=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Co=e,e=r)}else Co=e,e=r}}}}}}return e}(),i!==r&&(wo=t,i=To(i)),t=i,t===r&&(t=Co,i=la(),i!==r&&(wo=t,i=function(e){return{...e}}(i)),t=i,t===r&&(t=Co,i=function(){let t,i,o;t=Co,i=jo(),i!==r?(o=function(){let t,i,o,a;t=Co,i=Co,o=[],a=Wo();for(;a!==r;)o.push(a),a=Wo();return i=e.substring(i,Co),wo=t,i=function(e){return[{type:"text",text:Vt(e.trim())}]}(i),t=i,t}(),wo=t,t=function(e,t){return{...e,content:t}}(i,o)):(Co=t,t=r);return t}(),i!==r&&(wo=t,i=function(e){return{...e}}(i)),t=i,t===r&&(t=Co,i=function(){let e,t,i;e=Co,t=Co,Io++,i=qo(),Io--,i===r?t=void 0:(Co=t,t=r);t!==r?(i=oa(),i!==r?(wo=e,e={type:"paragraph",content:Rt(i.trim()),attrs:{}}):(Co=e,e=r)):(Co=e,e=r);e===r&&(e=Co,t=sa(),t!==r?(i=oa(),i!==r?(wo=e,e=function(e){return{type:"paragraph",content:Rt(e.trim()),attrs:{}}}(i)):(Co=e,e=r)):(Co=e,e=r),e===r&&(e=Co,t=sa(),t!==r?(i="",wo=e,e=function(e){return{type:"paragraph",content:Rt(e.trim()),attrs:{}}}(i)):(Co=e,e=r)));return e}(),i!==r&&(wo=t,i=function(e){return Nt({...e})}(i)),t=i)))),t}function qo(){let e;return e=$o(),e===r&&(e=ea(),e===r&&(e=la(),e===r&&(e=jo(),e===r&&(e=sa())))),e}function zo(){let t;return 124===e.charCodeAt(Co)?(t=s,Co++):(t=r,0===Io&&Fo(Jt)),t}function $o(){let t;return e.substr(Co,4)===n?(t=n,Co+=4):(t=r,0===Io&&Fo(jt)),t===r&&(e.substr(Co,3)===l?(t=l,Co+=3):(t=r,0===Io&&Fo(Wt)),t===r&&(e.substr(Co,2)===c?(t=c,Co+=2):(t=r,0===Io&&Fo(Ht)))),t}function Jo(){let t,i,o;return t=Co,i=zo(),i!==r?(o=function(){let t;return e.substr(Co,4)===p?(t=p,Co+=4):(t=r,0===Io&&Fo(Ut)),t}(),o!==r?(wo=t,t=o):(Co=t,t=r)):(Co=t,t=r),t}function jo(){let t,i,o,a,s,n,l,c;if(t=Co,i=Jo(),i!==r){for(o=Co,a=Co,s=[],n=e.charAt(Co),Lt.test(n)?Co++:(n=r,0===Io&&Fo(Gt));n!==r;)s.push(n),n=e.charAt(Co),Lt.test(n)?Co++:(n=r,0===Io&&Fo(Gt));n=Da(),n!==r?(s=[s,n],a=s):(Co=a,a=r),o=a!==r?e.substring(o,Co):a,o!==r?(wo=t,t={type:"codeBlock",language:""}):(Co=t,t=r)}else Co=t,t=r;if(t===r)if(t=Co,i=Jo(),i!==r)if(58===e.charCodeAt(Co)?(o=d,Co++):(o=r,0===Io&&Fo(Kt)),o!==r)if(a=function(){let t,i,o;e.substr(Co,9)===u?(t=u,Co+=9):(t=r,0===Io&&Fo(Yt));if(t===r&&(e.substr(Co,9)===m?(t=m,Co+=9):(t=r,0===Io&&Fo(Qt)),t===r&&(e.substr(Co,10)===h?(t=h,Co+=10):(t=r,0===Io&&Fo(Xt)),t===r))){if(t=Co,i=[],o=Oa(),o!==r)for(;o!==r;)i.push(o),o=Oa();else i=r;t=i!==r?e.substring(t,Co):i,t===r&&(t="")}return t}(),a!==r){for(s=Co,n=Co,l=[],c=e.charAt(Co),Lt.test(c)?Co++:(c=r,0===Io&&Fo(Gt));c!==r;)l.push(c),c=e.charAt(Co),Lt.test(c)?Co++:(c=r,0===Io&&Fo(Gt));c=Da(),c!==r?(l=[l,c],n=l):(Co=n,n=r),s=n!==r?e.substring(s,Co):n,s!==r?(wo=t,t={type:"codeBlock",attrs:{language:a.trim().toLowerCase()}}):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;else Co=t,t=r;return t}function Wo(){let t,i,o,a,s,n;if(t=Co,i=Co,Io++,o=qo(),Io--,o===r?i=void 0:(Co=i,i=r),i!==r){if(o=Co,a=Co,s=[],n=Oa(),n!==r)for(;n!==r;)s.push(n),n=Oa();else s=r;s!==r?(n=Da(),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r),o=a!==r?e.substring(o,Co):a,o!==r?(wo=t,t=o):(Co=t,t=r)}else Co=t,t=r;return t===r&&(t=Fa()),t}function Ho(){let t;return e.substr(Co,2)===g?(t=g,Co+=2):(t=r,0===Io&&Fo(Zt)),t}function Uo(){let t;return e.substr(Co,3)===f?(t=f,Co+=3):(t=r,0===Io&&Fo(er)),t}function Go(){let t,i,o,a,s;if(t=Co,i=Co,8226===e.charCodeAt(Co)?(o=b,Co++):(o=r,0===Io&&Fo(tr)),o!==r){if(a=[],s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr));else a=r;a!==r?(32===e.charCodeAt(Co)?(s=y,Co++):(s=r,0===Io&&Fo(ir)),s!==r?(o=[o,a,s],i=o):(Co=i,i=r)):(Co=i,i=r)}else Co=i,i=r;return t=i!==r?e.substring(t,Co):i,t}function Ko(){let t,i,o,a,s;if(t=Co,i=Co,8226===e.charCodeAt(Co)?(o=b,Co++):(o=r,0===Io&&Fo(tr)),o!==r){if(a=[],s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr));else a=r;a!==r?(e.substr(Co,2)===k?(s=k,Co+=2):(s=r,0===Io&&Fo(or)),s!==r?(o=[o,a,s],i=o):(Co=i,i=r)):(Co=i,i=r)}else Co=i,i=r;return t=i!==r?e.substring(t,Co):i,t}function Yo(){let t,i,o,a,s;if(t=Co,i=Co,8226===e.charCodeAt(Co)?(o=b,Co++):(o=r,0===Io&&Fo(tr)),o!==r){if(a=[],s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr));else a=r;a!==r?(e.substr(Co,2)===v?(s=v,Co+=2):(s=r,0===Io&&Fo(ar)),s!==r?(o=[o,a,s],i=o):(Co=i,i=r)):(Co=i,i=r)}else Co=i,i=r;return t=i!==r?e.substring(t,Co):i,t}function Qo(){let t;return e.substr(Co,3)===T?(t=T,Co+=3):(t=r,0===Io&&Fo(sr)),t}function Xo(){let t;return e.substr(Co,3)===x?(t=x,Co+=3):(t=r,0===Io&&Fo(nr)),t}function Zo(){let t;return e.substr(Co,3)===_?(t=_,Co+=3):(t=r,0===Io&&Fo(lr)),t===r&&(e.substr(Co,3)===C?(t=C,Co+=3):(t=r,0===Io&&Fo(cr))),t}function ea(){let e;return e=Ho(),e===r&&(e=Uo(),e===r&&(e=Go(),e===r&&(e=Ko(),e===r&&(e=Yo(),e===r&&(e=Qo(),e===r&&(e=Xo(),e===r&&(e=Zo()))))))),e}function ta(){let t,i,o,a,s,n,l,c,p;if(t=Co,i=ia(),i!==r)if(o=ea(),o!==r){for(a=Co,s=Co,n=[],l=Co,c=Co,Io++,p=Fa(),Io--,p===r?c=void 0:(Co=c,c=r),c!==r?(e.length>Co?(p=e.charAt(Co),Co++):(p=r,0===Io&&Fo(zt)),p!==r?(c=[c,p],l=c):(Co=l,l=r)):(Co=l,l=r);l!==r;)n.push(l),l=Co,c=Co,Io++,p=Fa(),Io--,p===r?c=void 0:(Co=c,c=r),c!==r?(e.length>Co?(p=e.charAt(Co),Co++):(p=r,0===Io&&Fo(zt)),p!==r?(c=[c,p],l=c):(Co=l,l=r)):(Co=l,l=r);for(l=Fa(),l===r&&(l=null),n=[n,l],s=n,a=e.substring(a,Co),s=[],n=ra();n!==r;)s.push(n),n=ra();if(n=Co,l=function(){let t,i,o,a;t=Co,Io++,i=Co,o=[],9===e.charCodeAt(Co)?(a=w,Co++):(a=r,0===Io&&Fo(pr));if(a!==r)for(;a!==r;)o.push(a),9===e.charCodeAt(Co)?(a=w,Co++):(a=r,0===Io&&Fo(pr));else o=r;o!==r?(wo=Co,a=o.length>$a.length,a=a?void 0:r,a!==r?(wo=i,i=function(e){za.push($a),$a=e.join("")}(o)):(Co=i,i=r)):(Co=i,i=r);Io--,i!==r?(Co=t,t=void 0):t=r;return t}(),l!==r){for(c=[],p=ta();p!==r;)c.push(p),p=ta();p=function(){let e;wo=Co,e=function(){return $a=za.pop(),!0}(),e=e?void 0:r;return e}(),p!==r?(wo=n,n=c):(Co=n,n=r)}else Co=n,n=r;n===r&&(n=null),wo=t,t=function(e,t,r,i){let o="bulletList";const a=e.match(/•([0-9]+)([Ii]?) /);let s=1;if(a&&(o="orderedList",a.length>1&&(s=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 n=[{type:"paragraph",attrs:{},content:Rt((t+r.join("")).trim())}];if(i&&i[0]&&i[0]._tempParsingParent){let e={type:i[0]._tempParsingParent,attrs:{start:s},content:i};if((e.type.startsWith("orderedList")||e.type.startsWith("letteredList"))&&i[0]._tempListStart){const t=i[0]._tempListStart;t>1&&(e.attrs.start=t)}n.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:n,_tempParsingParent:o,_tempListStart:s}:{type:l,content:n,_tempParsingParent:o,_tempListStart:s}}(o,a,s,n)}else Co=t,t=r;else Co=t,t=r;return t}function ra(){let t,i,o,a,s,n,l,c,p,d;if(t=Co,i=Co,Io++,o=function(){let t,i,o;t=Co,i=[],o=e.charAt(Co),Lt.test(o)?Co++:(o=r,0===Io&&Fo(Gt));for(;o!==r;)i.push(o),o=e.charAt(Co),Lt.test(o)?Co++:(o=r,0===Io&&Fo(Gt));o=Fa(),o!==r?(i=[i,o],t=i):(Co=t,t=r);return t}(),Io--,o===r?i=void 0:(Co=i,i=r),i!==r)if(o=ia(),o!==r)if(a=Co,Io++,s=ea(),Io--,s===r?a=void 0:(Co=a,a=r),a!==r){if(s=Co,n=Co,l=[],c=Co,p=Co,Io++,d=Fa(),Io--,d===r?p=void 0:(Co=p,p=r),p!==r?(e.length>Co?(d=e.charAt(Co),Co++):(d=r,0===Io&&Fo(zt)),d!==r?(p=[p,d],c=p):(Co=c,c=r)):(Co=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Co,p=Co,Io++,d=Fa(),Io--,d===r?p=void 0:(Co=p,p=r),p!==r?(e.length>Co?(d=e.charAt(Co),Co++):(d=r,0===Io&&Fo(zt)),d!==r?(p=[p,d],c=p):(Co=c,c=r)):(Co=c,c=r);else l=r;l!==r?(c=Da(),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r),s=n!==r?e.substring(s,Co):n,s!==r?(wo=t,t=s):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;else Co=t,t=r;return t}function ia(){let t,i,o;for(t=Co,i=[],9===e.charCodeAt(Co)?(o=w,Co++):(o=r,0===Io&&Fo(pr));o!==r;)i.push(o),9===e.charCodeAt(Co)?(o=w,Co++):(o=r,0===Io&&Fo(pr));return wo=Co,o=i.join("")===$a,o=o?void 0:r,o!==r?(i=[i,o],t=i):(Co=t,t=r),t}function oa(){let t,i,o;if(t=Co,i=[],o=aa(),o!==r)for(;o!==r;)i.push(o),o=aa();else i=r;return t=i!==r?e.substring(t,Co):i,t}function aa(){let t,i,o,a,s,n;if(t=Co,i=Co,Io++,o=qo(),Io--,o===r?i=void 0:(Co=i,i=r),i!==r){if(o=Co,a=Co,s=[],n=Oa(),n!==r)for(;n!==r;)s.push(n),n=Oa();else s=r;s!==r?(n=Da(),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r),o=a!==r?e.substring(o,Co):a,o!==r?(i=[i,o],t=i):(Co=t,t=r)}else Co=t,t=r;return t===r&&(t=Fa()),t}function sa(){let t,i,o,a,s,n;if(t=Co,i=zo(),i!==r){for(o=Co,a=Co,s=[],n=e.charAt(Co),Lt.test(n)?Co++:(n=r,0===Io&&Fo(Gt));n!==r;)s.push(n),n=e.charAt(Co),Lt.test(n)?Co++:(n=r,0===Io&&Fo(Gt));n=Da(),n!==r?(s=[s,n],a=s):(Co=a,a=r),o=a!==r?e.substring(o,Co):a,o!==r?(a=Fa(),a===r&&(a=null),i=[i,o,a],t=i):(Co=t,t=r)}else Co=t,t=r;return t}function na(){let t,i,o;return t=Co,i=zo(),i!==r?(o=function(){let t;return e.substr(Co,5)===A?(t=A,Co+=5):(t=r,0===Io&&Fo(dr)),t}(),o!==r?(wo=t,t=o):(Co=t,t=r)):(Co=t,t=r),t}function la(){let t,i,o,a,s,n,l,c,p,u,m,h;if(t=Co,i=na(),i!==r)if(58===e.charCodeAt(Co)?(o=d,Co++):(o=r,0===Io&&Fo(Kt)),o!==r)if(32===e.charCodeAt(Co)?(a=y,Co++):(a=r,0===Io&&Fo(ir)),a===r&&(a=null),s=function(){let t,i,o,a,s,n,l,c,p;t=Co,i=Co,e.substr(Co,4)===Bt?(o=Bt,Co+=4):(o=r,0===Io&&Fo(fo));if(o!==r)if(115===e.charCodeAt(Co)?(a=St,Co++):(a=r,0===Io&&Fo(bo)),a===r&&(a=null),e.substr(Co,3)===Pt?(s=Pt,Co+=3):(s=r,0===Io&&Fo(yo)),s!==r){for(n=[],l=Co,c=Co,Io++,p=zo(),Io--,p===r?c=void 0:(Co=c,c=r),c!==r?(p=qa(),p!==r?(c=[c,p],l=c):(Co=l,l=r)):(Co=l,l=r);l!==r;)n.push(l),l=Co,c=Co,Io++,p=zo(),Io--,p===r?c=void 0:(Co=c,c=r),c!==r?(p=qa(),p!==r?(c=[c,p],l=c):(Co=l,l=r)):(Co=l,l=r);o=[o,a,s,n],i=o}else Co=i,i=r;else Co=i,i=r;t=i!==r?e.substring(t,Co):i;return t}(),s!==r){for(n=[],32===e.charCodeAt(Co)?(l=y,Co++):(l=r,0===Io&&Fo(ir));l!==r;)n.push(l),32===e.charCodeAt(Co)?(l=y,Co++):(l=r,0===Io&&Fo(ir));if(l=zo(),l!==r){for(c=ca(),p=Co,u=Co,m=[],h=e.charAt(Co),Lt.test(h)?Co++:(h=r,0===Io&&Fo(Gt));h!==r;)m.push(h),h=e.charAt(Co),Lt.test(h)?Co++:(h=r,0===Io&&Fo(Gt));h=Da(),h!==r?(m=[m,h],u=m):(Co=u,u=r),p=u!==r?e.substring(p,Co):u,p!==r?(u=Fa(),u===r&&(u=null),wo=t,t=function(e,t,r){const i=Object.assign({},...r);let o=i.alignment||"center";delete i.alignment;let a=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let l=i.align||"center";delete i.align;let c=void 0===i.zoomDisabled||("boolean"==typeof i.zoomDisabled?i.zoomDisabled:"true"===String(i.zoomDisabled).toLowerCase());return delete i.zoomDisabled,{type:e,attrs:{alignment:o,textAlign:a,src:t,alt:Vt(s),title:Vt(n),class:l,zoomDisabled:c,...i}}}(i,s,c)):(Co=t,t=r)}else Co=t,t=r}else Co=t,t=r;else Co=t,t=r;else Co=t,t=r;return t}function ca(){let e,t,i;for(e=Co,t=[],i=pa();i!==r;)t.push(i),i=pa();return wo=e,e=t,e}function pa(){let t,i,o,a,s,n,l,c,p,u;if(t=Co,35===e.charCodeAt(Co)?(i=B,Co++):(i=r,0===Io&&Fo(ur)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t={comment:o.trim()}):(Co=t,t=r)}else Co=t,t=r;var m,h;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=da(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));if(n=Co,l=[],c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=e.charAt(Co),Ot.test(u)?Co++:(u=r,0===Io&&Fo(rr)),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=e.charAt(Co),Ot.test(u)?Co++:(u=r,0===Io&&Fo(rr)),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);else l=r;if(n=l!==r?e.substring(n,Co):l,n!==r){for(l=[],32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c!==r;)l.push(c),32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c=zo(),c!==r?(wo=t,m=o,h=n,t={[m]:parseInt(h)}):(Co=t,t=r)}else Co=t,t=r}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=function(){let t;e.substr(Co,3)===F?(t=F,Co+=3):(t=r,0===Io&&Fo(Tr));t===r&&(e.substr(Co,7)===O?(t=O,Co+=7):(t=r,0===Io&&Fo(xr)));return t}(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));for(n=Co,l=[],c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);c!==r;)l.push(c),c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);n=e.substring(n,Co),l=zo(),l!==r?(wo=t,t=function(e,t){return{[e]:t.trim()}}(o,n)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=function(){let t;e.substr(Co,9)===L?(t=L,Co+=9):(t=r,0===Io&&Fo(fr));t===r&&(e.substr(Co,12)===V?(t=V,Co+=12):(t=r,0===Io&&Fo(br)));return t}(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));if(n=function(){let t;e.substr(Co,4)===E?(t=E,Co+=4):(t=r,0===Io&&Fo(yr));t===r&&(e.substr(Co,6)===N?(t=N,Co+=6):(t=r,0===Io&&Fo(kr)),t===r&&(e.substr(Co,5)===R?(t=R,Co+=5):(t=r,0===Io&&Fo(vr))));return t}(),n!==r){for(l=[],32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c!==r;)l.push(c),32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c=zo(),c!==r?(wo=t,t=function(e,t){return{[e]:t}}(o,n)):(Co=t,t=r)}else Co=t,t=r}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=ua(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));if(n=function(){let t;e.substr(Co,4)===M?(t=M,Co+=4):(t=r,0===Io&&Fo(Cr));t===r&&(e.substr(Co,5)===q?(t=q,Co+=5):(t=r,0===Io&&Fo(wr)));return t}(),n!==r){for(l=[],32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c!==r;)l.push(c),32===e.charCodeAt(Co)?(c=y,Co++):(c=r,0===Io&&Fo(ir));c=zo(),c!==r?(wo=t,t=function(e,t){return{[e]:t}}(o,n)):(Co=t,t=r)}else Co=t,t=r}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=ua(),o!==r){for(a=[],32===e.charCodeAt(Co)?(s=y,Co++):(s=r,0===Io&&Fo(ir));s!==r;)a.push(s),32===e.charCodeAt(Co)?(s=y,Co++):(s=r,0===Io&&Fo(ir));s=zo(),s!==r?(wo=t,t=function(e){return{[e]:!0}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r&&(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=zo(),o!==r?(wo=t,t=void 0):(Co=t,t=r),t===r)){for(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{error:"Found unknown property or invalid value: "+e}}(o)):(Co=t,t=r)}}}}}}return t}function da(){let t;return e.substr(Co,5)===P?(t=P,Co+=5):(t=r,0===Io&&Fo(hr)),t===r&&(e.substr(Co,6)===I?(t=I,Co+=6):(t=r,0===Io&&Fo(gr))),t}function ua(){let t;return e.substr(Co,12)===D?(t=D,Co+=12):(t=r,0===Io&&Fo(_r)),t}function ma(){let e,t,i,o;for(e=Co,t=ha(),t===r&&(t=null),i=[],o=ba(),o===r&&(o=ha());o!==r;)i.push(o),o=ba(),o===r&&(o=ha());var a,s;return wo=e,s=i,e=Nt((a=t)?[a,...s.flat()]:s.flat()),e}function ha(){let t,i,o,a,s,n,l;if(t=Co,i=Fa(),i!==r&&(wo=t,i={type:"hardBreak"}),t=i,t===r){if(t=Co,i=Co,o=[],a=Co,s=ya(),s===r&&(s=null),n=Co,Io++,l=ba(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(s=[s,n,l],a=s):(Co=a,a=r)):(Co=a,a=r),a===r&&(a=Co,s=ya(),s!==r?(n=Co,Io++,l=ba(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r)),a!==r)for(;a!==r;)o.push(a),a=Co,s=ya(),s===r&&(s=null),n=Co,Io++,l=ba(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(s=[s,n,l],a=s):(Co=a,a=r)):(Co=a,a=r),a===r&&(a=Co,s=ya(),s!==r?(n=Co,Io++,l=ba(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r));else o=r;i=o!==r?e.substring(i,Co):o,i!==r&&(wo=t,i={text:Vt(i),type:"text"}),t=i}return t}function ga(){let t;return 61===e.charCodeAt(Co)?(t=z,Co++):(t=r,0===Io&&Fo(Ar)),t}function fa(){let e,t,i;return e=Co,t=ga(),t!==r?(i=ga(),i!==r?(t=[t,i],e=t):(Co=e,e=r)):(Co=e,e=r),e}function ba(){let t,i,o,a,n,l,c,p;if(t=Co,i=Va(),i!==r){if(o=Co,a=[],n=e.charAt(Co),Ot.test(n)?Co++:(n=r,0===Io&&Fo(rr)),n!==r)for(;n!==r;)a.push(n),n=e.charAt(Co),Ot.test(n)?Co++:(n=r,0===Io&&Fo(rr));else a=r;o=a!==r?e.substring(o,Co):a,o!==r?(a=Ea(),a!==r?(wo=t,t={index:+o,type:"bit"}):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;var d,u;if(t===r){if(t=Co,i=fa(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=fa(),a!==r?(e.substr(Co,7)===$?(n=$,Co+=7):(n=r,0===Io&&Fo(Br)),n!==r?(wo=t,t=function(e){return{attrs:{formula:Vt(e)},type:"latex"}}(o)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=fa(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=fa(),a!==r?(e.substr(Co,13)===J?(n=J,Co+=13):(n=r,0===Io&&Fo(Sr)),n!==r?(l=Ma(),l!==r?(124===e.charCodeAt(Co)?(c=s,Co++):(c=r,0===Io&&Fo(Jt)),c!==r?(p=function(){let e,t,i;e=Co,t=[],i=ka();for(;i!==r;)t.push(i),i=ka();return wo=e,e=t,e}(),wo=t,u=p,t={attrs:{alt:o,src:((d=l).pr+d.t).trim(),...Object.assign({},...u),zoomDisabled:!0},type:"imageInline"}):(Co=t,t=r)):(Co=t,t=r)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=fa(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=fa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=fa(),a!==r?(n=function(){let t,i,o,a;t=Co,124===e.charCodeAt(Co)?(i=s,Co++):(i=r,0===Io&&Fo(Jt));if(i!==r){if(o=[],a=va(),a!==r)for(;a!==r;)o.push(a),a=va();else o=r;o!==r?(wo=t,t=o):(Co=t,t=r)}else Co=t,t=r;return t}(),n!==r?(wo=t,t=function(e,t){return t||(t=[]),{marks:t,text:Vt(e),type:"text"}}(o,n)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Sa(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=Sa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=Sa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=Sa(),a!==r?(wo=t,t=function(e){return{marks:[{type:"bold"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Pa(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=Pa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=Pa(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=Pa(),a!==r?(wo=t,t=function(e){return{marks:[{type:"italic"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Ia(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=Ia(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=Ia(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=Ia(),a!==r?(wo=t,t=function(e){return{marks:[{type:"light"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=La(),i!==r){for(o=Co,a=[],n=Co,l=Co,Io++,c=La(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);n!==r;)a.push(n),n=Co,l=Co,Io++,c=La(),Io--,c===r?l=void 0:(Co=l,l=r),l!==r?(e.length>Co?(c=e.charAt(Co),Co++):(c=r,0===Io&&Fo(zt)),c!==r?(l=[l,c],n=l):(Co=n,n=r)):(Co=n,n=r);o=e.substring(o,Co),a=La(),a!==r?(wo=t,t=function(e){return{marks:[{type:"highlight"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;t===r&&(t=Co,i=Ma(),i!==r&&(wo=t,i=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}}(i)),t=i)}}}}}}}return t}function ya(){let t,i,o,a,s;if(t=Co,i=Co,o=fa(),o!==r){if(a=[],s=ga(),s!==r)for(;s!==r;)a.push(s),s=ga();else a=r;a!==r?(o=[o,a],i=o):(Co=i,i=r)}else Co=i,i=r;if(t=i!==r?e.substring(t,Co):i,t===r){if(t=Co,i=Co,o=Ia(),o!==r){if(a=[],s=Aa(),s!==r)for(;s!==r;)a.push(s),s=Aa();else a=r;a!==r?(o=[o,a],i=o):(Co=i,i=r)}else Co=i,i=r;if(t=i!==r?e.substring(t,Co):i,t===r){if(t=Co,i=Co,o=La(),o!==r){if(a=[],s=Ba(),s!==r)for(;s!==r;)a.push(s),s=Ba();else a=r;a!==r?(o=[o,a],i=o):(Co=i,i=r)}else Co=i,i=r;t=i!==r?e.substring(t,Co):i}}return t}function ka(){let t,i,o,a,s,n,l,c,p,u;if(t=Co,35===e.charCodeAt(Co)?(i=B,Co++):(i=r,0===Io&&Fo(ur)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t={comment:o}):(Co=t,t=r)}else Co=t,t=r;var m,h;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),e.substr(Co,6)===j?(o=j,Co+=6):(o=r,0===Io&&Fo(Pr)),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));for(n=Co,l=[],c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);c!==r;)l.push(c),c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);n=e.substring(n,Co),l=zo(),l!==r?(wo=t,m=o,h=n,t={[m]:h}):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=da(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));if(n=Co,l=[],c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=e.charAt(Co),Ot.test(u)?Co++:(u=r,0===Io&&Fo(rr)),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=e.charAt(Co),Ot.test(u)?Co++:(u=r,0===Io&&Fo(rr)),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);else l=r;n=l!==r?e.substring(n,Co):l,n!==r?(l=zo(),l!==r?(wo=t,t=function(e,t){return{[e]:parseInt(t)}}(o,n)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),o=da(),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));for(n=Co,l=[],c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);c!==r;)l.push(c),c=Co,p=Co,Io++,u=zo(),Io--,u===r?p=void 0:(Co=p,p=r),p!==r?(u=Oa(),u!==r?(p=[p,u],c=p):(Co=c,c=r)):(Co=c,c=r);n=e.substring(n,Co),l=zo(),l!==r?(wo=t,t=function(e,t){return{type:"error",msg:e+" must be a positive integer.",found:t}}(o,n)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;if(t===r){if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),e.substr(Co,17)===W?(o=W,Co+=17):(o=r,0===Io&&Fo(Ir)),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n=function(){let t;e.substr(Co,3)===U?(t=U,Co+=3):(t=r,0===Io&&Fo(Vr));t===r&&(e.substr(Co,6)===G?(t=G,Co+=6):(t=r,0===Io&&Fo(Er)),t===r&&(e.substr(Co,6)===K?(t=K,Co+=6):(t=r,0===Io&&Fo(Nr)),t===r&&(e.substr(Co,8)===Y?(t=Y,Co+=8):(t=r,0===Io&&Fo(Rr)),t===r&&(e.substr(Co,3)===Q?(t=Q,Co+=3):(t=r,0===Io&&Fo(Fr)),t===r&&(e.substr(Co,5)===X?(t=X,Co+=5):(t=r,0===Io&&Fo(Or)),t===r&&(e.substr(Co,11)===Z?(t=Z,Co+=11):(t=r,0===Io&&Fo(Dr)),t===r&&(e.substr(Co,8)===ee?(t=ee,Co+=8):(t=r,0===Io&&Fo(Mr)))))))));return t}(),n!==r?(l=zo(),l!==r?(wo=t,t=function(e,t){return{[e]:t}}(o,n)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r;if(t===r)if(t=Co,64===e.charCodeAt(Co)?(i=S,Co++):(i=r,0===Io&&Fo(mr)),i===r&&(i=null),e.substr(Co,4)===H?(o=H,Co+=4):(o=r,0===Io&&Fo(Lr)),o!==r)if(58===e.charCodeAt(Co)?(a=d,Co++):(a=r,0===Io&&Fo(Kt)),a!==r){for(s=[],32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n!==r;)s.push(n),32===e.charCodeAt(Co)?(n=y,Co++):(n=r,0===Io&&Fo(ir));n=function(){let t;e.substr(Co,11)===te?(t=te,Co+=11):(t=r,0===Io&&Fo(qr));t===r&&(e.substr(Co,11)===re?(t=re,Co+=11):(t=r,0===Io&&Fo(zr)),t===r&&(e.substr(Co,5)===X?(t=X,Co+=5):(t=r,0===Io&&Fo(Or)),t===r&&(e.substr(Co,3)===Q?(t=Q,Co+=3):(t=r,0===Io&&Fo(Fr)),t===r&&(e.substr(Co,8)===ie?(t=ie,Co+=8):(t=r,0===Io&&Fo($r))))));return t}(),n!==r?(l=zo(),l!==r?(wo=t,t=function(e,t){return{[e]:t}}(o,n)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r}}}}return t}function va(){let t,i,o,a,s,n,l,c,d,u,m;if(t=Co,e.substr(Co,5)===oe?(i=oe,Co+=5):(i=r,0===Io&&Fo(Jr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t={type:"link",attrs:{href:o.trim(),target:"_blank"}}):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,7)===ae?(i=ae,Co+=7):(i=r,0===Io&&Fo(jr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);if(o=e.substring(o,Co),a=function(){let e,t;e=[],t=Ta();for(;t!==r;)e.push(t),t=Ta();return e}(),s=zo(),s!==r)if(e.substr(Co,9)===se?(n=se,Co+=9):(n=r,0===Io&&Fo(Wr)),n!==r){for(l=Co,c=[],d=Co,u=Co,Io++,m=zo(),Io--,m===r?u=void 0:(Co=u,u=r),u!==r?(m=Oa(),m!==r?(u=[u,m],d=u):(Co=d,d=r)):(Co=d,d=r);d!==r;)c.push(d),d=Co,u=Co,Io++,m=zo(),Io--,m===r?u=void 0:(Co=u,u=r),u!==r?(m=Oa(),m!==r?(u=[u,m],d=u):(Co=d,d=r)):(Co=d,d=r);l=e.substring(l,Co),c=zo(),c!==r?(wo=t,t=function(e,t,r){return{type:"extref",attrs:{extref:e.trim(),references:t,provider:r.trim()}}}(o,a,l)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,5)===ne?(i=ne,Co+=5):(i=r,0===Io&&Fo(Hr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);if(o=e.substring(o,Co),a=zo(),a!==r)if(9658===e.charCodeAt(Co)?(s=le,Co++):(s=r,0===Io&&Fo(Ur)),s!==r){for(n=Co,l=[],c=Co,d=Co,Io++,u=zo(),Io--,u===r?d=void 0:(Co=d,d=r),d!==r?(u=Oa(),u!==r?(d=[d,u],c=d):(Co=c,c=r)):(Co=c,c=r);c!==r;)l.push(c),c=Co,d=Co,Io++,u=zo(),Io--,u===r?d=void 0:(Co=d,d=r),d!==r?(u=Oa(),u!==r?(d=[d,u],c=d):(Co=c,c=r)):(Co=c,c=r);n=e.substring(n,Co),l=zo(),l!==r?(wo=t,t=function(e,t){return{type:"xref",attrs:{xref:e.trim(),reference:t.trim()}}}(o,n)):(Co=t,t=r)}else Co=t,t=r;else Co=t,t=r}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,5)===ne?(i=ne,Co+=5):(i=r,0===Io&&Fo(Hr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"xref",attrs:{xref:e.trim(),reference:""}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,9658===e.charCodeAt(Co)?(i=le,Co++):(i=r,0===Io&&Fo(Ur)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"ref",attrs:{reference:e.trim()}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,7)===ce?(i=ce,Co+=7):(i=r,0===Io&&Fo(Gr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(s=ca(),wo=t,t=function(e,t){const r=Object.assign({},...t);return{type:"symbol",attrs:{src:e.trim(),...r}}}(o,s)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,9)===pe?(i=pe,Co+=9):(i=r,0===Io&&Fo(Kr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"footnote",attrs:{content:Rt(e.trim())}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,10)===de?(i=de,Co+=10):(i=r,0===Io&&Fo(Yr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"footnote*",attrs:{content:Rt(e.trim())}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,4)===ue?(i=ue,Co+=4):(i=r,0===Io&&Fo(Qr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"var",attrs:{name:e.trim()}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r&&(t=Co,e.substr(Co,4)===p?(i=p,Co+=4):(i=r,0===Io&&Fo(Ut)),i!==r?(o=zo(),o!==r?(wo=t,t={type:"code",attrs:{language:"plain text"}}):(Co=t,t=r)):(Co=t,t=r),t===r)){if(t=Co,e.substr(Co,5)===me?(i=me,Co+=5):(i=r,0===Io&&Fo(Xr)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t={type:"code",attrs:{language:o.trim().toLowerCase()}}):(Co=t,t=r)}else Co=t,t=r;if(t===r&&(t=Co,e.substr(Co,5)===he?(i=he,Co+=5):(i=r,0===Io&&Fo(Zr)),i!==r?(o=zo(),o!==r?(wo=t,t={type:"timer",attrs:{name:""}}):(Co=t,t=r)):(Co=t,t=r),t===r)){if(t=Co,e.substr(Co,6)===ge?(i=ge,Co+=6):(i=r,0===Io&&Fo(ei)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"timer",attrs:{name:e.trim()}}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,e.substr(Co,9)===fe?(i=fe,Co+=9):(i=r,0===Io&&Fo(ti)),i!==r){if(o=Co,a=Co,80===e.charCodeAt(Co)?(s=be,Co++):(s=r,0===Io&&Fo(ri)),s!==r){for(n=Co,l=[],c=Co,d=Co,Io++,u=zo(),Io--,u===r?d=void 0:(Co=d,d=r),d!==r?(u=Oa(),u!==r?(d=[d,u],c=d):(Co=c,c=r)):(Co=c,c=r);c!==r;)l.push(c),c=Co,d=Co,Io++,u=zo(),Io--,u===r?d=void 0:(Co=d,d=r),d!==r?(u=Oa(),u!==r?(d=[d,u],c=d):(Co=c,c=r)):(Co=c,c=r);n=e.substring(n,Co),s=[s,n],a=s}else Co=a,a=r;o=a!==r?e.substring(o,Co):a,o!==r?(a=zo(),a!==r?(wo=t,t=function(e){return{type:"duration",attrs:{duration:e}}}(o)):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;if(t===r&&(t=Co,e.substr(Co,6)===ye?(i=ye,Co+=6):(i=r,0===Io&&Fo(ii)),i!==r?(o=function(){let t;e.substr(Co,4)===Ye?(t=Ye,Co+=4):(t=r,0===Io&&Fo(Ri));t===r&&(e.substr(Co,5)===Qe?(t=Qe,Co+=5):(t=r,0===Io&&Fo(Fi)),t===r&&(e.substr(Co,4)===Xe?(t=Xe,Co+=4):(t=r,0===Io&&Fo(Oi)),t===r&&(e.substr(Co,5)===Ze?(t=Ze,Co+=5):(t=r,0===Io&&Fo(Di)),t===r&&(e.substr(Co,7)===et?(t=et,Co+=7):(t=r,0===Io&&Fo(Mi)),t===r&&(e.substr(Co,9)===tt?(t=tt,Co+=9):(t=r,0===Io&&Fo(qi)),t===r&&(e.substr(Co,4)===rt?(t=rt,Co+=4):(t=r,0===Io&&Fo(zi)),t===r&&(e.substr(Co,8)===it?(t=it,Co+=8):(t=r,0===Io&&Fo($i)),t===r&&(e.substr(Co,5)===ot?(t=ot,Co+=5):(t=r,0===Io&&Fo(Ji)),t===r&&(e.substr(Co,4)===at?(t=at,Co+=4):(t=r,0===Io&&Fo(ji)),t===r&&(e.substr(Co,7)===st?(t=st,Co+=7):(t=r,0===Io&&Fo(Wi)),t===r&&(e.substr(Co,6)===nt?(t=nt,Co+=6):(t=r,0===Io&&Fo(Hi)),t===r&&(e.substr(Co,4)===lt?(t=lt,Co+=4):(t=r,0===Io&&Fo(Ui)),t===r&&(e.substr(Co,5)===ct?(t=ct,Co+=5):(t=r,0===Io&&Fo(Gi)),t===r&&(e.substr(Co,6)===pt?(t=pt,Co+=6):(t=r,0===Io&&Fo(Ki)),t===r&&(e.substr(Co,4)===dt?(t=dt,Co+=4):(t=r,0===Io&&Fo(Yi)),t===r&&(e.substr(Co,6)===ut?(t=ut,Co+=6):(t=r,0===Io&&Fo(Qi)),t===r&&(e.substr(Co,3)===mt?(t=mt,Co+=3):(t=r,0===Io&&Fo(Xi)),t===r&&(e.substr(Co,6)===ht?(t=ht,Co+=6):(t=r,0===Io&&Fo(Zi)),t===r&&(e.substr(Co,4)===gt?(t=gt,Co+=4):(t=r,0===Io&&Fo(eo)),t===r&&(e.substr(Co,6)===ft?(t=ft,Co+=6):(t=r,0===Io&&Fo(to)),t===r&&(e.substr(Co,5)===bt?(t=bt,Co+=5):(t=r,0===Io&&Fo(ro)),t===r&&(e.substr(Co,6)===yt?(t=yt,Co+=6):(t=r,0===Io&&Fo(io))))))))))))))))))))))));return t}(),o!==r?(a=zo(),a!==r?(wo=t,t={type:"color",attrs:{color:o}}):(Co=t,t=r)):(Co=t,t=r)):(Co=t,t=r),t===r&&(t=Co,i=function(){let t;e.substr(Co,4)===ve?(t=ve,Co+=4):(t=r,0===Io&&Fo(ai));t===r&&(e.substr(Co,6)===Te?(t=Te,Co+=6):(t=r,0===Io&&Fo(si)),t===r&&(e.substr(Co,5)===xe?(t=xe,Co+=5):(t=r,0===Io&&Fo(ni)),t===r&&(e.substr(Co,9)===_e?(t=_e,Co+=9):(t=r,0===Io&&Fo(li)),t===r&&(e.substr(Co,6)===Ce?(t=Ce,Co+=6):(t=r,0===Io&&Fo(ci)),t===r&&(e.substr(Co,9)===we?(t=we,Co+=9):(t=r,0===Io&&Fo(pi)),t===r&&(e.substr(Co,11)===Ae?(t=Ae,Co+=11):(t=r,0===Io&&Fo(di)),t===r&&(e.substr(Co,3)===Be?(t=Be,Co+=3):(t=r,0===Io&&Fo(ui)),t===r&&(e.substr(Co,3)===Se?(t=Se,Co+=3):(t=r,0===Io&&Fo(mi)),t===r&&(e.substr(Co,9)===Pe?(t=Pe,Co+=9):(t=r,0===Io&&Fo(hi)),t===r&&(e.substr(Co,15)===Ie?(t=Ie,Co+=15):(t=r,0===Io&&Fo(gi)),t===r&&(e.substr(Co,6)===Le?(t=Le,Co+=6):(t=r,0===Io&&Fo(fi)),t===r&&(e.substr(Co,13)===Ve?(t=Ve,Co+=13):(t=r,0===Io&&Fo(bi)),t===r&&(e.substr(Co,16)===Ee?(t=Ee,Co+=16):(t=r,0===Io&&Fo(yi)),t===r&&(e.substr(Co,16)===Ne?(t=Ne,Co+=16):(t=r,0===Io&&Fo(ki)),t===r&&(e.substr(Co,15)===Re?(t=Re,Co+=15):(t=r,0===Io&&Fo(vi)),t===r&&(e.substr(Co,14)===Fe?(t=Fe,Co+=14):(t=r,0===Io&&Fo(Ti)),t===r&&(e.substr(Co,16)===Oe?(t=Oe,Co+=16):(t=r,0===Io&&Fo(xi)),t===r&&(e.substr(Co,14)===De?(t=De,Co+=14):(t=r,0===Io&&Fo(_i)),t===r&&(e.substr(Co,15)===Me?(t=Me,Co+=15):(t=r,0===Io&&Fo(Ci)),t===r&&(e.substr(Co,15)===qe?(t=qe,Co+=15):(t=r,0===Io&&Fo(wi)),t===r&&(e.substr(Co,15)===ze?(t=ze,Co+=15):(t=r,0===Io&&Fo(Ai)),t===r&&(e.substr(Co,14)===$e?(t=$e,Co+=14):(t=r,0===Io&&Fo(Bi)),t===r&&(e.substr(Co,10)===Je?(t=Je,Co+=10):(t=r,0===Io&&Fo(Si)),t===r&&(e.substr(Co,13)===je?(t=je,Co+=13):(t=r,0===Io&&Fo(Pi)),t===r&&(e.substr(Co,19)===We?(t=We,Co+=19):(t=r,0===Io&&Fo(Ii)),t===r&&(e.substr(Co,10)===He?(t=He,Co+=10):(t=r,0===Io&&Fo(Li)),t===r&&(e.substr(Co,10)===Ue?(t=Ue,Co+=10):(t=r,0===Io&&Fo(Vi)),t===r&&(e.substr(Co,13)===Ge?(t=Ge,Co+=13):(t=r,0===Io&&Fo(Ei)),t===r&&(e.substr(Co,11)===Ke?(t=Ke,Co+=11):(t=r,0===Io&&Fo(Ni)))))))))))))))))))))))))))))));return t}(),i!==r?(o=zo(),o!==r?(wo=t,t={type:i}):(Co=t,t=r)):(Co=t,t=r),t===r)))if(t=Co,35===e.charCodeAt(Co)?(i=B,Co++):(i=r,0===Io&&Fo(ur)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=zo(),a!==r?(wo=t,t=function(e){return{type:"comment",comment:e}}(o)):(Co=t,t=r)}else Co=t,t=r}}}}}}}}}}}return t}function Ta(){let t,i,o,a,s,n,l;if(t=Co,e.substr(Co,2)===ke?(i=ke,Co+=2):(i=r,0===Io&&Fo(oi)),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),wo=t,t=o.trim()}else Co=t,t=r;return t}function xa(){let e,t,i,o;for(Io++,e=Co,t=_a(),t===r&&(t=null),i=[],o=Na(),o===r&&(o=_a());o!==r;)i.push(o),o=Na(),o===r&&(o=_a());var a,s;return wo=e,s=i,e=Nt((a=t)?[a,...s.flat()]:s.flat()),Io--,e}function _a(){let t,i,o,a,s,n,l;if(t=Co,i=Fa(),i!==r&&(wo=t,i={type:"hardBreak"}),t=i,t===r){if(t=Co,i=Co,o=[],a=Co,s=Ra(),s===r&&(s=null),n=Co,Io++,l=Na(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(s=[s,n,l],a=s):(Co=a,a=r)):(Co=a,a=r),a===r&&(a=Co,s=Ra(),s!==r?(n=Co,Io++,l=Na(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r)),a!==r)for(;a!==r;)o.push(a),a=Co,s=Ra(),s===r&&(s=null),n=Co,Io++,l=Na(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=Oa(),l!==r?(s=[s,n,l],a=s):(Co=a,a=r)):(Co=a,a=r),a===r&&(a=Co,s=Ra(),s!==r?(n=Co,Io++,l=Na(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(s=[s,n],a=s):(Co=a,a=r)):(Co=a,a=r));else o=r;i=o!==r?e.substring(i,Co):o,i!==r&&(wo=t,i={text:Vt(i),type:"text"}),t=i}return t}function Ca(){let t;return 42===e.charCodeAt(Co)?(t=kt,Co++):(t=r,0===Io&&Fo(oo)),t}function wa(){let t;return 95===e.charCodeAt(Co)?(t=vt,Co++):(t=r,0===Io&&Fo(ao)),t}function Aa(){let t;return 96===e.charCodeAt(Co)?(t=Tt,Co++):(t=r,0===Io&&Fo(so)),t}function Ba(){let t;return 33===e.charCodeAt(Co)?(t=xt,Co++):(t=r,0===Io&&Fo(no)),t}function Sa(){let e,t,i;return e=Co,t=Ca(),t!==r?(i=Ca(),i!==r?(t=[t,i],e=t):(Co=e,e=r)):(Co=e,e=r),e}function Pa(){let e,t,i;return e=Co,t=wa(),t!==r?(i=wa(),i!==r?(t=[t,i],e=t):(Co=e,e=r)):(Co=e,e=r),e}function Ia(){let e,t,i;return e=Co,t=Aa(),t!==r?(i=Aa(),i!==r?(t=[t,i],e=t):(Co=e,e=r)):(Co=e,e=r),e}function La(){let e,t,i;return e=Co,t=Ba(),t!==r?(i=Ba(),i!==r?(t=[t,i],e=t):(Co=e,e=r)):(Co=e,e=r),e}function Va(){let t;return e.substr(Co,2)===_t?(t=_t,Co+=2):(t=r,0===Io&&Fo(lo)),t}function Ea(){let t;return 93===e.charCodeAt(Co)?(t=Ct,Co++):(t=r,0===Io&&Fo(co)),t}function Na(){let t,i,o,a,s,n,l;if(t=Co,i=Va(),i!==r){if(o=Co,a=[],s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Co),Ot.test(s)?Co++:(s=r,0===Io&&Fo(rr));else a=r;o=a!==r?e.substring(o,Co):a,o!==r?(a=Ea(),a!==r?(wo=t,t={index:+o,type:"bit"}):(Co=t,t=r)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Sa(),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=Sa(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=Sa(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=Sa(),a!==r?(wo=t,t=function(e){return{marks:[{type:"bold"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Pa(),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=Pa(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=Pa(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=Pa(),a!==r?(wo=t,t=function(e){return{marks:[{type:"italic"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r){if(t=Co,i=Ia(),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=Ia(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=Ia(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=Ia(),a!==r?(wo=t,t=function(e){return{marks:[{type:"light"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r;if(t===r)if(t=Co,i=La(),i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=La(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=La(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(e.length>Co?(l=e.charAt(Co),Co++):(l=r,0===Io&&Fo(zt)),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),a=La(),a!==r?(wo=t,t=function(e){return{marks:[{type:"highlight"}],text:Vt(e),type:"text"}}(o)):(Co=t,t=r)}else Co=t,t=r}}}return t}function Ra(){let t,i,o,a,s;if(t=Co,i=Co,o=Ia(),o!==r){if(a=[],s=Aa(),s!==r)for(;s!==r;)a.push(s),s=Aa();else a=r;a!==r?(o=[o,a],i=o):(Co=i,i=r)}else Co=i,i=r;if(t=i!==r?e.substring(t,Co):i,t===r){if(t=Co,i=Co,o=La(),o!==r){if(a=[],s=Ba(),s!==r)for(;s!==r;)a.push(s),s=Ba();else a=r;a!==r?(o=[o,a],i=o):(Co=i,i=r)}else Co=i,i=r;t=i!==r?e.substring(t,Co):i}return t}function Fa(){let t,i;return Io++,10===e.charCodeAt(Co)?(t=wt,Co++):(t=r,0===Io&&Fo(uo)),t===r&&(e.substr(Co,2)===At?(t=At,Co+=2):(t=r,0===Io&&Fo(mo)),t===r&&(t=e.charAt(Co),Dt.test(t)?Co++:(t=r,0===Io&&Fo(ho)))),Io--,t===r&&(i=r,0===Io&&Fo(po)),t}function Oa(){let t;return t=e.charAt(Co),Mt.test(t)?Co++:(t=r,0===Io&&Fo(go)),t}function Da(){let t,i;return t=Fa(),t===r&&(t=Co,Io++,e.length>Co?(i=e.charAt(Co),Co++):(i=r,0===Io&&Fo(zt)),Io--,i===r?t=void 0:(Co=t,t=r)),t}function Ma(){let t,i,o,a,s,n,l;if(t=Co,i=Co,o=Co,e.substr(Co,4)===Bt?(a=Bt,Co+=4):(a=r,0===Io&&Fo(fo)),a!==r?(115===e.charCodeAt(Co)?(s=St,Co++):(s=r,0===Io&&Fo(bo)),s===r&&(s=null),e.substr(Co,3)===Pt?(n=Pt,Co+=3):(n=r,0===Io&&Fo(yo)),n!==r?(a=[a,s,n],o=a):(Co=o,o=r)):(Co=o,o=r),o===r&&(e.substr(Co,7)===It?(o=It,Co+=7):(o=r,0===Io&&Fo(ko))),i=o!==r?e.substring(i,Co):o,i!==r){for(o=Co,a=[],s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=qa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);s!==r;)a.push(s),s=Co,n=Co,Io++,l=zo(),Io--,l===r?n=void 0:(Co=n,n=r),n!==r?(l=qa(),l!==r?(n=[n,l],s=n):(Co=s,s=r)):(Co=s,s=r);o=e.substring(o,Co),wo=t,t={pr:i,t:o}}else Co=t,t=r;return t}function qa(){let t;return t=e.charAt(Co),qt.test(t)?Co++:(t=r,0===Io&&Fo(vo)),t}var za=[],$a="";e=e.trimStart(),Bo=a();const Ja=Bo!==r&&Co===e.length;function ja(){throw Bo!==r&&Co<e.length&&Fo({type:"end"}),Oo(Po,So<e.length?function(t=Co){const r=e.codePointAt(t);return void 0===r?"":String.fromCodePoint(r)}(So):null,So<e.length?Ro(So,So+1):Ro(So,So))}return t.peg$library?{peg$result:Bo,peg$currPos:Co,peg$FAILED:r,peg$maxFailExpected:Po,peg$maxFailPos:So,peg$success:Ja,peg$throw:Ja?void 0:ja}:Ja?Bo:void ja()}var Dt=Ot,Mt=class{version(){return Dt("",{startRule:"version"})}preprocessAst(e){if(se.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 r=e??"";if(!r)return[];let i="bitmarkPlusPlus";return Object.assign({},t).location===je&&(i="bitmarkPlus"),r=r.trim(),Dt(r,{startRule:i})}extractBodyBits(e){if(!Array.isArray(e))return[];const t=[],r=e;for(const e of r)switch(e.type){case qe.gap:case qe.select:case qe.highlight:case qe.mark:t.push(e);break;default:{const r=this.extractBodyBits(e.content);for(const e of r)t.push(e)}}return t}walkBodyBits(e,t){if(!Array.isArray(e))return;const r=e;for(let e=0;e<r.length;e++){const i=r[e];switch(i.type){case qe.gap:case qe.select:case qe.highlight:case qe.mark:t(r,e,i);break;default:this.walkBodyBits(i.content,t)}}}},qt=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}},zt=new class{asNumber(e,t){if(null==e)return t??void 0;const r=+e;return Number.isNaN(r)||!isFinite(r)?t??void 0:r}isNumeric(e){if(null==e)return!1;const t=+e;return!Number.isNaN(t)&&isFinite(t)}},$t=class{constructor(){l(this,"textParser"),l(this,"textGenerator"),this.textParser=new Mt,this.textGenerator=new Lt}toExample(e,t,r){if(null!=t){let e;return e=qt.isBoolean(r)?qt.toBoolean(t):t,{isExample:!0,example:e,__defaultExample:r??null}}return e?{isExample:!0,example:r??null,__defaultExample:r??null}:{isExample:!1,example:null,__defaultExample:r??null}}toAstProperty(e,t,r,i){if(null==r)return;let o=ve.getBitConfig(e).tags;if(i?.cardSet){const{sideNo:t,variantNo:r}=i.cardSet;o=ve.getTagsConfigForCardSet(e,t,r)??o}const a=ve.getTagConfigForTag(o,t);a?.array&&!Array.isArray(r)?r=[r]:!a?.array&&Array.isArray(r)&&(r=r[r.length-1]);const s=e=>{if(null==e)return;switch(a?.format??b){case b:return null!=zt.asNumber(e)&&(e=`${e}`),se.isString(e)?se.trimmedString(e):void 0;case k:return zt.asNumber(e);case v:return qt.toBoolean(e,!0);case T:return!qt.toBoolean(e,!0)}return e};if(Array.isArray(r)){const e=r;for(let t=0,r=e.length;t<r;t++)e[t]=s(e[t])}else r=s(r);return r}getEmptyTextAst(e){return this.handleJsonText(e,je," ")}handleJsonText(e,t,r){let i;const{textFormat:o}=e;if(null==r)i=[];else if(this.textParser.isAst(r))i=r;else{if(Array.isArray(r)){const e=[];for(let i=0,a=r.length;i<a;i++){const a=r[i];this.textParser.isAst(a)?e[i]=a:se.isString(a)?(e[i]=this.textParser.toAst(dt.breakscape(a,{format:o,location:t}),{format:o,location:t}),e[i].__tag="text"):e[i]=[]}return e}i=se.isString(r)?this.textParser.toAst(dt.breakscape(r,{format:o,location:t,v2:!0}),{format:o,location:t}):[]}return i.__tag="text",i}},Jt=new Mt,jt=new class{fillStringExample(e,t,r,i,o){if(t){Array.isArray(t)||(t=[t]);for(const a of t)if(!a.isExample&&(r?(a.example=a.__defaultExample,a.isExample=!0):a.example=i?Jt.toAst(i,{format:e,location:je}):void 0,o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!i||o.isCorrect)&&(t?(o.example=o.__defaultExample,o.isExample=!0):o.example=qt.toBoolean(r),i))break}}},Wt=r(722),Ht=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}},Ut=new class{validateBit(e){if(!e)return e;return e}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;const t=e;let r=!0;switch(e.type){case ne.image:{const t=e.image;se.isString(t.src)||(t.src="");break}case ne.imageLink:{const t=e.imageLink;se.isString(t.url)||(t.url="");break}case ne.audio:{const t=e.audio;se.isString(t.src)||(t.src="");break}case ne.audioEmbed:{const t=e.audioEmbed;se.isString(t.src)||(t.src="");break}case ne.audioLink:{const t=e.audioLink;se.isString(t.url)||(t.url="");break}case ne.video:{const t=e.video;se.isString(t.src)||(t.src="");break}case ne.videoEmbed:{const t=e.videoEmbed;se.isString(t.url)||(t.url="");break}case ne.videoLink:{const t=e.videoLink;se.isString(t.url)||(t.url="");break}case ne.stillImageFilm:{const t=e;se.isString(t.image.src)||(t.image.src=""),se.isString(t.audio.src)||(t.audio.src="");break}case ne.stillImageFilmEmbed:{const t=e.stillImageFilmEmbed;se.isString(t.url)||(t.url="");break}case ne.stillImageFilmLink:{const t=e.stillImageFilmLink;se.isString(t.url)||(t.url="");break}case ne.article:{const t=e.article;se.isString(t.body)||(t.body="");break}case ne.document:{const t=e.document;se.isString(t.url)||(t.url="");break}case ne.documentEmbed:{const t=e.documentEmbed;se.isString(t.url)||(t.url="");break}case ne.documentLink:{const t=e.documentLink;se.isString(t.url)||(t.url="");break}case ne.documentDownload:{const t=e.documentDownload;se.isString(t.url)||(t.url="");break}case ne.appLink:{const t=e.appLink;se.isString(t.url)||(t.url="");break}case ne.websiteLink:{const t=e.websiteLink;se.isString(t.url)||(t.url="");break}default:r=!1}return r||e.type&&(e.__invalid=!0),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(!se.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!se.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!se.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!se.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(!se.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`)}},Gt=class extends $t{resourceFromResourceJson(e,t){if(!t)return;const r=[];Array.isArray(t)||(t=[t]);for(const i of t){let t=(0,Wt.Enum)(ne).fromValue(i.type);if(!t)return;const o=(0,Wt.Enum)(ne).keyFromValue(t);if(!o)return;let a;if(t=(0,Wt.Enum)(ne).fromValue(i.__typeAlias)??t,t===ne.imageResponsive){const t=i,o=this.resourceFromResourceDataJson(e,ne.imagePortrait,t.imagePortrait),a=this.resourceFromResourceDataJson(e,ne.imageLandscape,t.imageLandscape);o&&r.push(o),a&&r.push(a)}else if(t===ne.stillImageFilm){const t=i,o=this.resourceFromResourceDataJson(e,ne.image,t.image),a=this.resourceFromResourceDataJson(e,ne.audio,t.audio);o&&r.push(o),a&&r.push(a)}else{if(a=i[o],!a)return;const s=this.resourceFromResourceDataJson(e,t,a);s&&r.push(s)}}return 0!==r.length?1===r.length?r[0]:r:void 0}resourceFromResourceDataJson(e,t,r){if(!r)return;if(!(t=(0,Wt.Enum)(ne).fromValue(t)))return;const i=se.isString(r)?r:void 0,o=r.url||r.src||r.body||i,a=r.posterImage?this.resourceFromResourceDataJson(e,ne.image,r.posterImage)?.image:void 0,s=r.thumbnails?r.thumbnails.map(t=>this.resourceFromResourceDataJson(e,ne.image,t)?.image):void 0;return this.resource(e,{type:t,value:o,srcAlt:r.srcAlt,format:r.format,src1x:r.src1x,src2x:r.src2x,src3x:r.src3x,src4x:r.src4x,caption:this.handleJsonText(e,je,r.caption),width:r.width??void 0,height:r.height??void 0,alt:r.alt,zoomDisabled:r.zoomDisabled,duration:r.duration,mute:r.mute,autoplay:r.autoplay,allowSubtitles:r.allowSubtitles,showSubtitles:r.showSubtitles,posterImage:a,thumbnails:s,siteName:void 0,license:r.license,copyright:r.copyright,showInIndex:r.showInIndex,search:r.search,selected:r.selected})}resource(e,t){let r;const{type:i,value:o,format:a,...s}=t,n={type:i,value:o??dt.EMPTY_STRING,format:a??dt.EMPTY_STRING,...s};switch(i){case ne.video:case ne.videoEmbed:case ne.videoLink:case ne.stillImageFilmEmbed:case ne.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const o of r){const r=t[o];if(r){const t=this.resource(e,{type:ne.image,value:r});t&&i.push(t.image)}}n.thumbnails=[...n.thumbnails||[],...i]}}switch(i){case ne.image:case ne.imagePortrait:case ne.imageLandscape:case ne.backgroundWallpaper:case ne.imagePlaceholder:case ne.icon:case ne.platformIcon:case ne.platformLogo:case ne.platformBackgroundImage:case ne.previewImage:case ne.coverImage:r=this.imageResource(e,n,i);break;case ne.imageLink:r=this.imageLinkResource(e,n);break;case ne.audio:r=this.audioResource(e,n);break;case ne.audioEmbed:r=this.audioEmbedResource(e,n);break;case ne.audioLink:r=this.audioLinkResource(e,n);break;case ne.video:case ne.previewVideo:r=this.videoResource(e,n);break;case ne.videoEmbed:r=this.videoEmbedResource(e,n);break;case ne.videoLink:r=this.videoLinkResource(e,n);break;case ne.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(e,n);break;case ne.stillImageFilmLink:r=this.stillImageFilmLinkResource(e,n);break;case ne.article:r=this.articleResource(e,n);break;case ne.document:r=this.documentResource(e,n);break;case ne.documentEmbed:r=this.documentEmbedResource(e,n);break;case ne.documentLink:r=this.documentLinkResource(e,n);break;case ne.documentDownload:r=this.documentDownloadResource(e,n);break;case ne.appLink:r=this.appLinkResource(e,n);break;case ne.websiteLink:r=this.websiteLinkResource(e,n)}return r}imageResource(e,t,r){const{value:i,srcAlt:o,src1x:a,src2x:s,src3x:n,src4x:l,width:c,height:p,alt:u,zoomDisabled:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,{bitType:v}=e;let T=!1;ve.isOfBitType(v,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages,d.extractorImage])&&(T=!0);const x={type:ne.image,__typeAlias:r??ne.image,__configKey:le(r??ne.image),image:{format:Ht.fileExtensionFromUrl(i)??void 0,provider:Ht.domainFromUrl(i)??void 0,src:i??"",srcAlt:o??void 0,src1x:a??void 0,src2x:s??void 0,src3x:n??void 0,src4x:l??void 0,width:c??null,height:p??null,alt:u??"",zoomDisabled:m??T,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(x.image,{ignoreFalse:["zoomDisabled","showInIndex","selected"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","alt","license","copyright"]}),Ut.validateResource(x)}imageLinkResource(e,t){const{value:r,srcAlt:i,src1x:o,src2x:a,src3x:s,src4x:n,width:l,height:c,alt:p,zoomDisabled:d,license:u,copyright:m,showInIndex:h,caption:g,search:f,selected:b}=t,y={type:ne.imageLink,__typeAlias:ne.imageLink,__configKey:le(ne.imageLink),imageLink:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,src1x:o??void 0,src2x:a??void 0,src3x:s??void 0,src4x:n??void 0,width:l??null,height:c??null,alt:p??"",zoomDisabled:d??!1,license:u??"",copyright:m??"",showInIndex:h??!1,caption:this.handleJsonText(e,je,g),search:f??void 0,selected:b??!1}};return he.removeUnwantedProperties(y.imageLink,{ignoreFalse:["zoomDisabled","showInIndex","selected"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","alt","license","copyright"]}),Ut.validateResource(y)}audioResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audio,__typeAlias:ne.audio,__configKey:le(ne.audio),audio:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,je,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audio,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(m)}audioEmbedResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audioEmbed,__typeAlias:ne.audioEmbed,__configKey:le(ne.audioEmbed),audioEmbed:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,je,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audioEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(m)}audioLinkResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audioLink,__typeAlias:ne.audioLink,__configKey:le(ne.audioLink),audioLink:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,je,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audioLink,{ignoreEmptyString:["url"],ignoreFalse:["selected"]}),Ut.validateResource(m)}videoResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.video,__typeAlias:ne.video,__configKey:le(ne.video),video:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1,posterImage:u??void 0,thumbnails:m??void 0}};return he.removeUnwantedProperties(v.video,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(v)}videoEmbedResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.videoEmbed,__typeAlias:ne.videoEmbed,__configKey:le(ne.videoEmbed),videoEmbed:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.videoEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(v)}videoLinkResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.videoLink,__typeAlias:ne.videoLink,__configKey:le(ne.videoLink),videoLink:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.videoLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(v)}stillImageFilmEmbedResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.stillImageFilmEmbed,__typeAlias:ne.stillImageFilmEmbed,__configKey:le(ne.stillImageFilmEmbed),stillImageFilmEmbed:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.stillImageFilmEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(v)}stillImageFilmLinkResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.stillImageFilmLink,__typeAlias:ne.stillImageFilmLink,__configKey:le(ne.stillImageFilmLink),stillImageFilmLink:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,je,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.stillImageFilmLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(v)}articleResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.article,__typeAlias:ne.article,__configKey:le(ne.article),article:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,body:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.article,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["body","alt","license","copyright"],ignoreFalse:["selected"]}),Ut.validateResource(p)}documentResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.document,__typeAlias:ne.document,__configKey:le(ne.document),document:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.document,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}documentEmbedResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentEmbed,__typeAlias:ne.documentEmbed,__configKey:le(ne.documentEmbed),documentEmbed:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}documentLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentLink,__typeAlias:ne.documentLink,__configKey:le(ne.documentLink),documentLink:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}documentDownloadResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentDownload,__typeAlias:ne.documentDownload,__configKey:le(ne.documentDownload),documentDownload:{format:Ht.fileExtensionFromUrl(r)??void 0,provider:Ht.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentDownload,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}appLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.appLink,__typeAlias:ne.appLink,__configKey:le(ne.appLink),appLink:{provider:void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.appLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}websiteLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.websiteLink,__typeAlias:ne.websiteLink,__configKey:le(ne.websiteLink),websiteLink:{provider:void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,je,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.websiteLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ut.validateResource(p)}},Kt=class extends $t{constructor(){super(...arguments),l(this,"resourceBuilder",new Gt)}buildBitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return he.removeUnwantedProperties(i),i}buildBit(e,t){const r=(e=structuredClone(e)).bitType,i=ve.getBitConfig(r),o=(0,Je.Enum)(ut).fromValue(e.textFormat);let a=(0,Je.Enum)(x).fromValue(e.textFormat)??i.textFormatDefault;o===ut.bitmarkMinusMinus&&(a=x.bitmarkText);const s={bitConfig:i,bitType:r,textFormat:a},n=this.buildCardNode(s,e),l=ve.isOfBitType(e.bitType,d.essay)?this.toAstProperty(r,ce.property_reasonableNumOfChars,e.reasonableNumOfChars,t):void 0,c={...this.toExample(e.__isDefaultExample,e.example)},p={bitType:r,bitLevel:e.bitLevel,textFormat:a,resourceType:(0,Je.Enum)(ne).fromValue(e.resourceType),isCommented:e.isCommented,id:this.toAstProperty(r,ce.property_id,e.id,t),internalComment:this.toAstProperty(r,ce.property_internalComment,e.internalComment,t),customerId:this.toAstProperty(r,ce.property_customerId,e.customerId,t),customerExternalId:this.toAstProperty(r,ce.property_customerExternalId,e.customerExternalId,t),externalId:this.toAstProperty(r,ce.property_externalId,e.externalId,t),spaceId:this.toAstProperty(r,ce.property_spaceId,e.spaceId,t),padletId:this.toAstProperty(r,ce.property_padletId,e.padletId,t),jupyterId:this.toAstProperty(r,ce.property_jupyterId,e.jupyterId,t),jupyterExecutionCount:this.toAstProperty(r,ce.property_jupyterExecutionCount,e.jupyterExecutionCount,t),sourceRL:this.toAstProperty(r,ce.property_sourceRL,e.sourceRL,t),isPublic:this.toAstProperty(r,ce.property_isPublic,e.isPublic,t),isTemplate:this.toAstProperty(r,ce.property_isTemplate,e.isTemplate,t),isTemplateStripTheme:this.toAstProperty(r,ce.property_isTemplateStripTheme,e.isTemplateStripTheme,t),isEditable:this.toAstProperty(r,ce.property_isEditable,e.isEditable,t),aiGenerated:this.toAstProperty(r,ce.property_aiGenerated,e.aiGenerated,t),machineTranslated:this.toAstProperty(r,ce.property_machineTranslated,e.machineTranslated,t),spansPageBreak:this.toAstProperty(r,ce.property_spansPageBreak,e.spansPageBreak,t),searchIndex:this.toAstProperty(r,ce.property_searchIndex,e.searchIndex,t),analyticsTag:this.toAstProperty(r,ce.property_analyticsTag,e.analyticsTag,t),categoryTag:this.toAstProperty(r,ce.property_categoryTag,e.categoryTag,t),topicTag:this.toAstProperty(r,ce.property_topicTag,e.topicTag,t),reportTag:this.toAstProperty(r,ce.property_reportTag,e.reportTag,t),altLangTag:this.toAstProperty(r,ce.property_altLangTag,e.altLangTag,t),feedbackEngine:this.toAstProperty(r,ce.property_feedbackEngine,e.feedbackEngine,t),feedbackType:this.toAstProperty(r,ce.property_feedbackType,e.feedbackType,t),disableFeedback:this.toAstProperty(r,ce.property_disableFeedback,e.disableFeedback,t),diffTo:this.toAstProperty(r,ce.property_diffTo,e.diffTo,t),diffOp:this.toAstProperty(r,ce.property_diffOp,e.diffOp,t),diffRef:this.toAstProperty(r,ce.property_diffRef,e.diffRef,t),diffContext:this.toAstProperty(r,ce.property_diffContext,e.diffContext,t),diffTime:this.toAstProperty(r,ce.property_diffTime,e.diffTime,t),path:this.toAstProperty(r,ce.property_path,e.path,t),releaseVersion:this.toAstProperty(r,ce.property_releaseVersion,e.releaseVersion,t),releaseKind:this.toAstProperty(r,ce.property_releaseKind,e.releaseKind,t),releaseDate:this.toAstProperty(r,ce.property_releaseDate,e.releaseDate,t),iframeSrc:this.toAstProperty(r,ce.property_iframeSrc,e.iframeSrc,t),iframeName:this.toAstProperty(r,ce.property_iframeName,e.iframeName,t),book:this.buildBooks(s,e.book),ageRange:this.toAstProperty(r,ce.property_ageRange,e.ageRange,t),lang:this.toAstProperty(r,ce.property_lang,e.lang,t),language:this.toAstProperty(r,ce.property_language,e.language,t),publisher:this.toAstProperty(r,ce.property_publisher,e.publisher,t),publisherName:this.toAstProperty(r,ce.property_publisherName,e.publisherName,t),theme:this.toAstProperty(r,ce.property_theme,e.theme,t),computerLanguage:this.toAstProperty(r,ce.property_computerLanguage,e.computerLanguage,t),target:this.toAstProperty(r,ce.property_target,e.target,t),slug:this.toAstProperty(r,ce.property_slug,e.slug,t),tag:this.toAstProperty(r,ce.property_tag,e.tag,t),groupTag:this.buildGroupTags(s,e.groupTag),reductionTag:this.toAstProperty(r,ce.property_reductionTag,e.reductionTag,t),bubbleTag:this.toAstProperty(r,ce.property_bubbleTag,e.bubbleTag,t),extractorTag:this.toAstProperty(r,ce.property_extractorTag,e.extractorTag,t),levelCEFRp:this.toAstProperty(r,ce.property_levelCEFRp,e.levelCEFRp,t),levelCEFR:this.toAstProperty(r,ce.property_levelCEFR,e.levelCEFR,t),levelILR:this.toAstProperty(r,ce.property_levelILR,e.levelILR,t),levelACTFL:this.toAstProperty(r,ce.property_levelACTFL,e.levelACTFL,t),icon:this.toAstProperty(r,ce.property_icon,e.icon,t),iconTag:this.toAstProperty(r,ce.property_iconTag,e.iconTag,t),colorTag:this.toAstProperty(r,ce.property_colorTag,e.colorTag,t),flashcardSet:this.toAstProperty(r,ce.property_flashcardSet,e.flashcardSet,t),subtype:this.toAstProperty(r,ce.property_subtype,e.subtype,t),bookAlias:this.toAstProperty(r,ce.property_bookAlias,e.bookAlias,t),bookDiff:this.toAstProperty(r,ce.property_bookDiff,e.bookDiff,t),coverImage:"string"==typeof e.coverImage||Array.isArray(e.coverImage)?this.toAstProperty(r,ce.property_coverImage,ht.asArray(e.coverImage),t):this.toImageResource(s,e.coverImage),coverColor:this.toAstProperty(r,ce.property_coverColor,e.coverColor,t),publications:this.toAstProperty(r,ce.property_publications,e.publications,t),relatedBook:this.toAstProperty(r,ce.property_relatedBook,e.relatedBook,t),author:this.toAstProperty(r,ce.property_author,e.author,t),subject:this.toAstProperty(r,ce.property_subject,e.subject,t),date:this.toAstProperty(r,ce.property_date,e.date,t),dateEnd:this.toAstProperty(r,ce.property_dateEnd,e.dateEnd,t),location:this.toAstProperty(r,ce.property_location,e.location,t),kind:this.toAstProperty(r,ce.property_kind,e.kind,t),hasMarkAsDone:this.toAstProperty(r,ce.property_hasMarkAsDone,e.hasMarkAsDone,t),processHandIn:this.toAstProperty(r,ce.property_processHandIn,e.processHandIn,t),processHandInLocation:this.toAstProperty(r,ce.property_processHandInLocation,e.processHandInLocation,t),chatWithBook:this.toAstProperty(r,ce.property_chatWithBook,e.chatWithBook,t),chatWithBookBrainKey:this.toAstProperty(r,ce.property_chatWithBookBrainKey,e.chatWithBookBrainKey,t),currency:this.toAstProperty(r,ce.property_currency,e.currency,t),bookIsbn:this.toAstProperty(r,ce.property_bookIsbn,e.bookIsbn,t),bookAuthor:this.toAstProperty(r,ce.property_bookAuthor,e.bookAuthor,t),bookType:this.toAstProperty(r,ce.property_bookType,e.bookType,t),bookBindingType:this.toAstProperty(r,ce.property_bookBindingType,e.bookBindingType,t),bookNumberOfPages:this.toAstProperty(r,ce.property_bookNumberOfPages,e.bookNumberOfPages,t),bookRating:this.toAstProperty(r,ce.property_bookRating,e.bookRating,t),bookSeriesTitle:this.toAstProperty(r,ce.property_bookSeriesTitle,e.bookSeriesTitle,t),bookSeriesId:this.toAstProperty(r,ce.property_bookSeriesId,e.bookSeriesId,t),bookSeriesNumber:this.toAstProperty(r,ce.property_bookSeriesNumber,e.bookSeriesNumber,t),bookLanguage:this.toAstProperty(r,ce.property_bookLanguage,e.bookLanguage,t),bookPublishingDate:this.toAstProperty(r,ce.property_bookPublishingDate,e.bookPublishingDate,t),bookPublisher:this.toAstProperty(r,ce.property_bookPublisher,e.bookPublisher,t),bookTranslator:this.toAstProperty(r,ce.property_bookTranslator,e.bookTranslator,t),bookOriginalTitle:this.toAstProperty(r,ce.property_bookOriginalTitle,e.bookOriginalTitle,t),gmbExternalShop:this.toAstProperty(r,ce.property_gmbExternalShop,e.gmbExternalShop,t),gmbExternalShopItems:this.toAstProperty(r,ce.property_gmbExternalShopItems,e.gmbExternalShopItems,t),action:this.toAstProperty(r,ce.property_action,e.action,t),showInIndex:this.toAstProperty(r,ce.property_showInIndex,e.showInIndex,t),refAuthor:this.toAstProperty(r,ce.property_refAuthor,e.refAuthor,t),refBookTitle:this.toAstProperty(r,ce.property_refBookTitle,e.refBookTitle,t),refPublisher:this.toAstProperty(r,ce.property_refPublisher,e.refPublisher,t),refPublicationYear:this.toAstProperty(r,ce.property_refPublicationYear,e.refPublicationYear,t),citationStyle:this.toAstProperty(r,ce.property_citationStyle,e.citationStyle,t),blockId:this.toAstProperty(r,ce.property_blockId,e.blockId,t),pageNo:this.toAstProperty(r,ce.property_pageNo,e.pageNo,t),x:this.toAstProperty(r,ce.property_x,e.x,t),y:this.toAstProperty(r,ce.property_y,e.y,t),width:this.toAstProperty(r,ce.property_width,e.width,t),height:this.toAstProperty(r,ce.property_height,e.height,t),index:this.toAstProperty(r,ce.property_index,e.index,t),classification:this.toAstProperty(r,ce.property_classification,e.classification,t),availableClassifications:this.toAstProperty(r,ce.property_availableClassifications,e.availableClassifications,t),allowedBit:this.toAstProperty(r,ce.property_allowedBit,e.allowedBit,t),authorFullName:this.toAstProperty(r,ce.property_authorFullName,e.authorFullName,t),authorPseudonym:this.toAstProperty(r,ce.property_authorPseudonym,e.authorPseudonym,t),authorTitle:this.toAstProperty(r,ce.property_authorTitle,e.authorTitle,t),authorJobTitle:this.toAstProperty(r,ce.property_authorJobTitle,e.authorJobTitle,t),tableFixedHeader:this.toAstProperty(r,ce.property_tableFixedHeader,e.tableFixedHeader,t),tableHeaderWhitespaceNoWrap:this.toAstProperty(r,ce.property_tableHeaderWhitespaceNoWrap,e.tableHeaderWhitespaceNoWrap,t),tableSearch:this.toAstProperty(r,ce.property_tableSearch,e.tableSearch,t),tableSort:this.toAstProperty(r,ce.property_tableSort,e.tableSort,t),tablePagination:this.toAstProperty(r,ce.property_tablePagination,e.tablePagination,t),tablePaginationLimit:this.toAstProperty(r,ce.property_tablePaginationLimit,e.tablePaginationLimit,t),tableHeight:this.toAstProperty(r,ce.property_tableHeight,e.tableHeight,t),tableWhitespaceNoWrap:this.toAstProperty(r,ce.property_tableWhitespaceNoWrap,e.tableWhitespaceNoWrap,t),tableAutoWidth:this.toAstProperty(r,ce.property_tableAutoWidth,e.tableAutoWidth,t),tableResizableColumns:this.toAstProperty(r,ce.property_tableResizableColumns,e.tableResizableColumns,t),tableColumnMinWidth:this.toAstProperty(r,ce.property_tableColumnMinWidth,e.tableColumnMinWidth,t),quizCountItems:this.toAstProperty(r,ce.property_quizCountItems,e.quizCountItems,t),quizStrikethroughSolutions:this.toAstProperty(r,ce.property_quizStrikethroughSolutions,e.quizStrikethroughSolutions,t),codeLineNumbers:this.toAstProperty(r,ce.property_codeLineNumbers,e.codeLineNumbers,t),codeMinimap:this.toAstProperty(r,ce.property_codeMinimap,e.codeMinimap,t),stripePricingTableId:this.toAstProperty(r,ce.property_stripePricingTableId,e.stripePricingTableId,t),stripePublishableKey:this.toAstProperty(r,ce.property_stripePublishableKey,e.stripePublishableKey,t),thumbImage:this.toAstProperty(r,ce.property_thumbImage,e.thumbImage,t),scormSource:this.toAstProperty(r,ce.property_scormSource,e.scormSource,t),posterImage:this.toAstProperty(r,ce.property_posterImage,e.posterImage,t),focusX:this.toAstProperty(r,ce.property_focusX,e.focusX,t),focusY:this.toAstProperty(r,ce.property_focusY,e.focusY,t),pointerLeft:this.toAstProperty(r,ce.property_pointerLeft,e.pointerLeft,t),pointerTop:this.toAstProperty(r,ce.property_pointerTop,e.pointerTop,t),listItemIndent:this.toAstProperty(r,ce.property_listItemIndent,e.listItemIndent,t),backgroundWallpaper:this.toImageResource(s,e.backgroundWallpaper),hasBookNavigation:this.toAstProperty(r,ce.property_hasBookNavigation,e.hasBookNavigation,t),duration:this.toAstProperty(r,ce.property_duration,e.duration,t),deeplink:this.toAstProperty(r,ce.property_deeplink,e.deeplink,t),externalLink:this.toAstProperty(r,ce.property_externalLink,e.externalLink,t),externalLinkText:this.toAstProperty(r,ce.property_externalLinkText,e.externalLinkText,t),videoCallLink:this.toAstProperty(r,ce.property_videoCallLink,e.videoCallLink,t),vendorDashboardId:this.toAstProperty(r,ce.property_vendorDashboardId,e.vendorDashboardId,t),vendorSurveyId:this.toAstProperty(r,ce.property_vendorSurveyId,e.vendorSurveyId,t),vendorUrl:this.toAstProperty(r,ce.property_vendorUrl,e.vendorUrl,t),search:this.toAstProperty(r,ce.property_search,e.search,t),list:this.toAstProperty(r,ce.property_list,e.list,t),layer:this.toAstProperty(r,ce.property_layer,e.layer,t),layerRole:this.toAstProperty(r,ce.property_layerRole,e.layerRole,t),textReference:this.toAstProperty(r,ce.property_textReference,e.textReference,t),isTracked:this.toAstProperty(r,ce.property_isTracked,e.isTracked,t),isInfoOnly:this.toAstProperty(r,ce.property_isInfoOnly,e.isInfoOnly,t),imageFirst:this.toAstProperty(r,ce.property_imageFirst,e.imageFirst,t),activityType:this.toAstProperty(r,ce.property_activityType,e.activityType,t),labelTrue:this.toAstProperty(r,ce.property_labelTrue,e.labelTrue,t),labelFalse:this.toAstProperty(r,ce.property_labelFalse,e.labelFalse,t),content2Buy:this.toAstProperty(r,ce.property_content2Buy,e.content2Buy,t),listPrice:this.toAstProperty(r,ce.property_listPrice,e.listPrice,t),customerProductId:this.toAstProperty(r,ce.property_customerProductId,e.customerProductId,t),customerProductShopLink:this.toAstProperty(r,ce.property_customerProductShopLink,e.customerProductShopLink,t),mailingList:this.toAstProperty(r,ce.property_mailingList,e.mailingList,t),buttonCaption:this.toAstProperty(r,ce.property_buttonCaption,e.buttonCaption,t),callToActionUrl:this.toAstProperty(r,ce.property_callToActionUrl,e.callToActionUrl,t),advertisingClickUrl:this.toAstProperty(r,ce.property_advertisingClickUrl,e.advertisingClickUrl,t),brandColor:this.toAstProperty(r,ce.property_brandColor,e.brandColor,t),brandColorName:this.toAstProperty(r,ce.property_brandColorName,e.brandColorName,t),caption:this.handleJsonText(s,je,e.caption),quotedPerson:this.toAstProperty(r,ce.property_quotedPerson,e.quotedPerson,t),reasonableNumOfChars:l,resolved:this.toAstProperty(r,ce.property_resolved,e.resolved,t),resolvedDate:this.toAstProperty(r,ce.property_resolvedDate,e.resolvedDate,t),resolvedBy:this.toAstProperty(r,ce.property_resolvedBy,e.resolvedBy,t),handInAcceptFileType:this.toAstProperty(r,ce.property_handInAcceptFileType,e.handInAcceptFileType,t),handInRequirement:this.toAstProperty(r,ce.property_handInRequirement,e.handInRequirement,t),handInInstruction:this.toAstProperty(r,ce.property_handInInstruction,e.handInInstruction,t),maxCreatedBits:this.toAstProperty(r,ce.property_maxCreatedBits,e.maxCreatedBits,t),maxDisplayLevel:this.toAstProperty(r,ce.property_maxDisplayLevel,e.maxDisplayLevel,t),maxTocChapterLevel:this.toAstProperty(r,ce.property_maxTocChapterLevel,e.maxTocChapterLevel,t),sourceDocument:this.toAstProperty(r,ce.property_sourceDocument,e.sourceDocument,t),internalPrintPdf:this.toAstProperty(r,ce.property_internalPrintPdf,e.internalPrintPdf,t),hasPrintRestriction:this.toAstProperty(r,ce.property_hasPrintRestriction,e.hasPrintRestriction,t),tocResource:this.toAstProperty(r,ce.property_tocResource,e.tocResource,t),tocContent:this.toAstProperty(r,ce.property_tocContent,e.tocContent,t),page:this.toAstProperty(r,ce.property_page,e.page,t),platformBrandTarget:this.toAstProperty(r,ce.property_platformBrandTarget,e.platformBrandTarget,t),platformName:this.toAstProperty(r,ce.property_platformName,e.platformName,t),platformIcon:this.toImageResource(s,e.platformIcon),platformLogo:this.toImageResource(s,e.platformLogo),platformPrimaryColor:this.toAstProperty(r,ce.property_platformPrimaryColor,e.platformPrimaryColor,t),platformSecondaryColor:this.toAstProperty(r,ce.property_platformSecondaryColor,e.platformSecondaryColor,t),platformBackgroundColor:this.toAstProperty(r,ce.property_platformBackgroundColor,e.platformBackgroundColor,t),platformScrollbarColor:this.toAstProperty(r,ce.property_platformScrollbarColor,e.platformScrollbarColor,t),platformSelectionColor:this.toAstProperty(r,ce.property_platformSelectionColor,e.platformSelectionColor,t),platformSeparatorColor:this.toAstProperty(r,ce.property_platformSeparatorColor,e.platformSeparatorColor,t),platformPlaceholderColor:this.toAstProperty(r,ce.property_platformPlaceholderColor,e.platformPlaceholderColor,t),platformTextSelectionColor:this.toAstProperty(r,ce.property_platformTextSelectionColor,e.platformTextSelectionColor,t),platformButtonPrimaryColor:this.toAstProperty(r,ce.property_platformButtonPrimaryColor,e.platformButtonPrimaryColor,t),platformButtonBackgroundColor:this.toAstProperty(r,ce.property_platformButtonBackgroundColor,e.platformButtonBackgroundColor,t),platformMessageBackgroundColor:this.toAstProperty(r,ce.property_platformMessageBackgroundColor,e.platformMessageBackgroundColor,t),platformBackgroundImage:this.toImageResource(s,e.platformBackgroundImage),platformBorderColor:this.toAstProperty(r,ce.property_platformBorderColor,e.platformBorderColor,t),platformSelectionTextColor:this.toAstProperty(r,ce.property_platformSelectionTextColor,e.platformSelectionTextColor,t),platformBaseLayerColor:this.toAstProperty(r,ce.property_platformBaseLayerColor,e.platformBaseLayerColor,t),platformMargin:this.toAstProperty(r,ce.property_platformMargin,e.platformMargin,t),platformBorderRadius:this.toAstProperty(r,ce.property_platformBorderRadius,e.platformBorderRadius,t),platformSelectionBorderRadius:this.toAstProperty(r,ce.property_platformSelectionBorderRadius,e.platformSelectionBorderRadius,t),platformNeedsShadow:this.toAstProperty(r,ce.property_platformNeedsShadow,e.platformNeedsShadow,t),productId:this.toAstProperty(r,ce.property_productId,e.productId,t),product:this.toAstProperty(r,ce.property_product,e.product,t),productVideo:this.toAstProperty(r,ce.property_productVideo,e.productVideo,t),productFolder:this.toAstProperty(r,ce.property_productFolder,e.productFolder,t),technicalTerm:this.buildTechnicalTerm(s,e.technicalTerm),servings:this.buildServings(s,e.servings),ratingLevelStart:this.buildRatingLevelStartEnd(s,e.ratingLevelStart),ratingLevelEnd:this.buildRatingLevelStartEnd(s,e.ratingLevelEnd),ratingLevelSelected:this.toAstProperty(r,ce.property_ratingLevelSelected,e.ratingLevelSelected,t),formula:this.toAstProperty(r,ce.property_formula,e.formula,t),markConfig:this.buildMarkConfigs(s,e.markConfig),imageSource:this.buildImageSource(s,e.imageSource),person:this.buildPerson(s,e.person),bot:this.toAstProperty(r,ce.property_bot,e.bot,t),referenceProperty:this.toAstProperty(r,ce.property_reference,e.referenceProperty,t),fullName:this.toAstProperty(r,ce.property_fullName,e.fullName,t),pseudonym:this.toAstProperty(r,ce.property_pseudonym,e.pseudonym,t),titleString:this.toAstProperty(r,ce.property_title,e.titleString,t),jobTitle:this.toAstProperty(r,ce.property_jobTitle,e.jobTitle,t),title:this.handleJsonText(s,je,e.title),subtitle:this.handleJsonText(s,je,e.subtitle),level:zt.asNumber(e.level),toc:this.toAstProperty(r,ce.property_toc,e.toc,t),progress:this.toAstProperty(r,ce.property_progress,e.progress,t),anchor:e.anchor,reference:e.reference,referenceEnd:e.referenceEnd,revealSolutions:this.toAstProperty(r,ce.property_revealSolutions,e.revealSolutions,t),item:this.handleJsonText(s,je,e.item),lead:this.handleJsonText(s,je,e.lead),pageNumber:this.handleJsonText(s,je,e.pageNumber),marginNumber:this.handleJsonText(s,je,e.marginNumber),hint:this.handleJsonText(s,je,e.hint),instruction:this.handleJsonText(s,je,e.instruction),partialAnswer:this.toAstProperty(r,ce.property_partialAnswer,e.partialAnswer,t),sampleSolution:this.toAstProperty(r,ce.property_sampleSolution,e.sampleSolution,t),additionalSolutions:this.toAstProperty(r,ce.property_additionalSolutions,e.additionalSolutions,t),...this.toExample(e.__isDefaultExample,e.example),previewImage:this.toImageResources(s,e.previewImage),previewVideo:this.toVideoResources(s,e.previewVideo),imagePlaceholder:this.toImageResource(s,e.imagePlaceholder),resources:ht.asArray(this.resourceBuilder.resourceFromResourceJson(s,e.resources)),body:this.buildBody(s,e.body),cardNode:n,footer:this.buildFooter(s,e.footer),extraProperties:this.parseExtraProperties(e.extraProperties),markup:e.markup,parser:e.parser,__isDefaultExample:e.__isDefaultExample??!1};return ve.isOfBitType(p.bitType,d.interview)&&this.pushDownTree(s,void 0,void 0,n,"questions","reasonableNumOfChars",e.reasonableNumOfChars),ve.isOfBitType(p.bitType,d.feedback)&&this.pushDownTree(s,void 0,void 0,n,["feedbacks","reason"],"reasonableNumOfChars",e.reasonableNumOfChars),this.pushDownTree(s,[p.body,...n?.cardBits?.map(e=>e.body)||[]],[De.gap],void 0,void 0,"isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(s,void 0,void 0,n,"pairs","isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(s,void 0,void 0,n,["matrix","cells"],"isCaseSensitive",e.isCaseSensitive??!0),this.pushExampleDownTree(s,p.body,n,p.__isDefaultExample,c.example),this.setDefaultBitValues(p),this.setIsExampleFlags(p),this.addVersionToParserInfo(p),he.removeUnwantedProperties(p,{ignoreAllFalse:!0,ignoreUndefined:["example"],ignoreEmptyArrays:["item","lead","pageNumber","marginNumber","hint","instruction"]}),Ut.validateBit(p)}buildBooks(e,t){if(se.isString(t))return t;if(!Array.isArray(t))return;const r=t.map(t=>this.buildBook(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildBook(e,t){if(!t)return;const r={book:t.book??"",reference:t.reference??"",referenceEnd:t.referenceEnd??void 0};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["book","reference"]}),r}buildGroupTags(e,t){if(!t)return;Array.isArray(t)||(t=[t]);let r=t.map(t=>this.buildGroupTag(e,t)).filter(e=>null!=e);const i={};for(const e of r)e&&(i[e.name]?i[e.name].tags=ht.removeDuplicates([...i[e.name].tags,...e.tags]):i[e.name]=e);return r=Object.values(i),r.length>0?r:void 0}buildGroupTag(e,t){if(!t)return;const r=Array.isArray(t.tags)?t.tags:[];return{name:t.name??"",tags:r.map(e=>e?.trim()??"")??[]}}buildFeedbackChoices(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFeedbackChoice(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFeedbackChoice(e,t){if(!t)return;const r={choice:t.choice??"",requireReason:!!t.requireReason,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildFeedbackReason(e,t){if(!t)return;const r=this.handleJsonText(e,je,"true"),i={text:t.text??"",reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,r),__textAst:t.__textAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example","reasonableNumOfChars"]}),i}buildChoices(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildChoice(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildChoice(e,t){if(!t)return;const r={choice:t.choice??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildResponses(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildResponse(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildResponse(e,t){if(!t)return;const r={response:t.response??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildBotResponses(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.botResponse(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}botResponse(e,t){if(!t)return;const r={response:t.response??"",reaction:t.reaction??"",feedback:t.feedback??"",item:t.item??"",lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint)};return he.removeUnwantedProperties(r,{ignoreEmptyString:["response","reaction","feedback","item"],ignoreAllFalse:!0,ignoreEmptyArrays:[],ignoreUndefined:["example"]}),r}buildFeedbacks(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFeedback(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFeedback(e,t){if(!t)return;let r,i;if(!t.choices)return;r=this.buildFeedbackChoices(e,t.choices),t.reason&&(i=this.buildFeedbackReason(e,t.reason));const o={item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),choices:r,reason:i};return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),o}buildQuizzes(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildQuiz(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildQuiz(e,t){if(!t)return;const r={...this.toExample(t.__isDefaultExample,t.__defaultExample)};let i,o;if(t.choices)i=this.buildChoices(e,t.choices),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,r.example,!0,i);else{if(!t.responses)return;o=this.buildResponses(e,t.responses),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,r.example,!1,o)}const a={item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),isExample:!!t.__defaultExample,choices:i,responses:o};return he.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),a}buildHeading(e,t){if(!t)return;if(null==t.forKeys)return;const r={forKeys:t.forKeys??"",forValues:t.forValues??t.__forValuesDefault??""};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["forKeys","forValues"],ignoreEmptyArrays:["forValues"]}),r}buildPairs(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildPair(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildPair(e,t){if(!t)return;const r=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,i=this.resourceBuilder.resourceFromResourceJson(e,t.keyAudio),o=this.resourceBuilder.resourceFromResourceJson(e,t.keyImage),a={key:t.key??"",keyAudio:i,keyImage:o,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),values:t.values||[],__valuesAst:t.__valuesAst};return he.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction","values"],ignoreUndefined:["example","isCaseSensitive"]}),a}buildMatricies(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildMatrix(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildMatrix(e,t){if(!t)return;let r=!1;for(const e of t.cells||[])t.__isDefaultExample&&!e.isExample&&(e.isExample=!0),r=!!e.isExample||r;const i={key:t.key??"",item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),isExample:r,cells:(t.cells||[]).map(t=>this.buildMatrixCell(e,t)).filter(e=>null!=e)};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["hint","item","cells"],ignoreUndefined:["isCaseSensitive"]}),i}buildMatrixCell(e,t){if(!t)return;const r=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,i={values:t.values||[],item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),__valuesAst:t.__valuesAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["instruction","item","values"],ignoreUndefined:["example","isCaseSensitive"]}),i}buildPronunciationTable(e,t){if(!t)return;return{data:(t.data||[]).map(t=>(t||[]).map(t=>{const r=this.resourceBuilder.resourceFromResourceJson(e,t.audio);return{title:this.handleJsonText(e,je,t.title),body:this.handleJsonText(e,je,t.body),audio:r}}))}}buildTable(e,t){if(!t)return;const r=mt(e.bitType,t),i=r,o=r;Array.isArray(i.columns)&&i.columns.length>0&&(i.columns=i.columns.map(t=>this.handleJsonText(e,je,t))),Array.isArray(i.data)&&i.data.length>0&&(i.data=i.data.map(t=>(t||[]).map(t=>this.handleJsonText(e,je,t))));const a=t=>{if(!t||!Array.isArray(t.rows))return;return{rows:t.rows.map(t=>({cells:(t.cells||[]).map(t=>{const r={content:this.handleJsonText(e,je,t.content)};return null!=t.title&&(r.title=t.title),null!=t.rowspan&&(r.rowspan=t.rowspan),null!=t.colspan&&(r.colspan=t.colspan),t.scope&&(r.scope=t.scope),r})}))}},s=a(o.header);s&&s.rows?.length>0&&(o.header=s);const n=a(o.body);n&&n.rows?.length>0&&(o.body=n);const l=a(o.footer);return l&&l.rows?.length>0&&(o.footer=l),r}buildQuestions(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildQuestion(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildQuestion(e,t){if(!t)return;const r=t.__sampleSolutionAst,i={question:this.handleJsonText(e,We,t.question),partialAnswer:t.partialAnswer??"",sampleSolution:t.sampleSolution??"",additionalSolutions:t.additionalSolutions??void 0,reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,r),__sampleSolutionAst:t.__sampleSolutionAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","item","hint","instruction"],ignoreUndefined:["example"],ignoreEmptyString:["partialAnswer","sampleSolution"]}),i}buildIngredients(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildIngredient(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildIngredient(e,t){if(!t)return;const r={title:this.handleJsonText(e,je,t.title),checked:t.checked??!1,ingredient:this.handleJsonText(e,je,t.ingredient),quantity:t.quantity??0,unit:t.unit??"",unitAbbr:t.unitAbbr??"",decimalPlaces:t.decimalPlaces??1,disableCalculation:t.disableCalculation??!1,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["item","unit"]}),r}buildBody(e,t){if(!t)return;let r;const i=[],o=t.placeholders,a=t.bodyString,{textFormat:s}=e,n=()=>{let a,n=t.body;const l={};if(se.isString(t.body)?(a=(t.body??"").trim(),n=[]):Array.isArray(t.body)||(n=[]),o)for(const[e,t]of Object.entries(o))l[e]=t;if(a){a=dt.breakscape(a,{format:s,location:We,v2:!0});let e=0;const t=[];for(const[r,i]of Object.entries(l))if(a){const o=`[!${e}]`;a=a.replace(`${r}`,o),t.push(i),e++}n=this.textParser.toAst(a,{format:s,location:We});const r=e=>{for(let i=0,o=e.length;i<o;i++){const o=e[i];if("bit"===o.type){const r=o.index;null!=t[r]&&(e[i]=t[r])}else o.content&&r(o.content)}};r(n)}n=structuredClone(n),this.textParser.walkBodyBits(n,(t,r,o)=>{let a;switch(o.type){case De.gap:a=this.buildGap(e,o);break;case De.mark:a=this.buildMark(e,o);break;case De.select:a=this.buildSelect(e,o);break;case De.highlight:a=this.buildHighlight(e,o)}null!=a&&(t[r]=a,i.push(a))}),r=n,r.__tag="text"},l=s===x.bitmarkText;s===x.json?(()=>{if("string"==typeof t.body)try{r=JSON.parse(t.body)}catch(e){r=null}else r=t.body})():l?n():r=t.body;return{body:r,bodyBits:i,bodyString:a}}buildFooter(e,t){if(!t)return;return{footer:this.handleJsonText(e,We,t.footer)}}buildGap(e,t){if(!t)return;const r=Array.isArray(t.__solutionsAst)&&t.__solutionsAst.length>0?t.__solutionsAst[0]:null;t=this.bodyBitCopyFromAttrs(t);const i={type:De.gap,solutions:t.solutions||[],item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),__solutionsAst:t.__solutionsAst,attrs:{}};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example","isCaseSensitive"]}),i}buildMarkConfigs(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildMarkConfig(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildMarkConfig(e,t){if(!t)return;const r={mark:t.mark??"unknown",color:t.color??"",emphasis:t.emphasis??""};return he.removeUnwantedProperties(r,{ignoreAllEmptyString:!0}),r}buildMark(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.mark,solution:t.solution??"",mark:t.mark??"",item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0),attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"],ignoreEmptyString:["solution","mark"]}),r}buildSelect(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.select,options:this.buildSelectOptions(e,t.options)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(!1,void 0,void 0),__hintString:t.__hintString,__instructionString:t.__instructionString,attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),r}buildSelectOptions(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildSelectOption(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildSelectOption(e,t){if(!t)return;const r={text:t.text??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),r}buildHighlight(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.highlight,texts:this.buildHighlightTexts(e,t.texts)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(!1,void 0,void 0),attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),r}buildHighlightTexts(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildHighlightText(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildHighlightText(e,t){if(!t)return;const r={text:t.text??"",isCorrect:!!t.isCorrect,isHighlighted:!!t.isHighlighted,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),r}buildFlashcards(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFlashcard(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFlashcard(e,t){if(!t)return;const r={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,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeAnswers","item","hint","instruction"],ignoreUndefined:["example"]}),r}buildDefinitionList(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildDefinitionListItem(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildDefinitionListItem(e,t){if(!t)return;const{bitType:r}=e,i=ve.isOfBitType(r,[d.metaSearchDefaultTerms]),o={term:this.buildTextAndIcon(e,t.term,i),definition:this.buildTextAndIcon(e,t.definition,i),alternativeDefinitions:(t.alternativeDefinitions||[]).map(t=>this.buildTextAndIcon(e,t,i)).filter(e=>null!=e),item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeDefinitions","item","hint","instruction"],ignoreUndefined:["example"]}),o}buildTextAndIcon(e,t,r=!1){const i=this.resourceBuilder.resourceFromResourceJson(e,t?.icon);let o=this.handleJsonText(e,je,t?.text||t);r&&(o=this.textGenerator.generateSync(o,x.plainText,We,{noBreakscaping:!0}).trim());const a={text:o,icon:i};return he.removeUnwantedProperties(a,{ignoreEmptyArrays:["text"],ignoreUndefined:["icon"]}),a}buildStatements(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildStatement(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildStatement(e,t){if(!t)return;const r={statement:this.handleJsonText(e,je,t.statement),isCorrect:!!t.isCorrect,item:this.handleJsonText(e,je,t.item),lead:this.handleJsonText(e,je,t.lead),hint:this.handleJsonText(e,je,t.hint),instruction:this.handleJsonText(e,je,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["statement"],ignoreUndefined:["example"]}),r}buildImageSource(e,t){if(!t)return;const{url:r,mockupId:i,size:o,format:a,trim:s}=t,n={url:r??"",mockupId:i??"",size:o??null,format:a??null,trim:qt.isBoolean(s)?s:null};return he.removeUnwantedProperties(n,{ignoreFalse:["trim"],ignoreEmptyString:["url","mockupId"],ignoreAllUndefined:!0}),n}buildPerson(e,t){if(!t)return;const{name:r,title:i,avatarImage:o}=t,a={name:r??"",title:i??void 0,avatarImage:this.resourceBuilder.resourceFromResourceJson(e,o)};return he.removeUnwantedProperties(a,{ignoreEmptyString:["name"],ignoreAllUndefined:!0}),a}buildTechnicalTerm(e,t){if(!t)return;const{technicalTerm:r,lang:i}=t,o={technicalTerm:r??"",lang:i??""};return he.removeUnwantedProperties(o,{ignoreEmptyString:["technicalTerm"]}),o}buildServings(e,t){if(!t)return;const{servings:r,unit:i,unitAbbr:o,decimalPlaces:a,disableCalculation:s,hint:n}=t,l={servings:r??0,unit:i??"",unitAbbr:o??"",decimalPlaces:a??1,disableCalculation:s??!1,hint:n??""};return he.removeUnwantedProperties(l,{ignoreEmptyString:["servings","unit"]}),l}buildRatingLevelStartEnd(e,t){if(!t)return;const{level:r,label:i}=t,o={level:r??0,label:this.handleJsonText(e,je,i)};return he.removeUnwantedProperties(o,{}),o}buildCardBits(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildCardBit(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildCardBit(e,t){if(!t)return;const{bitType:r,textFormat:i}=e,o=this.buildBit({...t,bitType:r,textFormat:i},{cardSet:{sideNo:0,variantNo:0}});return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),Ut.validateCardBit(o)}toImageResource(e,t){return ht.asSingle(this.resourceBuilder.resourceFromResourceDataJson(e,ne.image,t?.image))}toImageResources(e,t){const r=ht.asArray(t),i=[];if(r&&r.length>0)for(const t of r){const r=this.resourceBuilder.resourceFromResourceDataJson(e,ne.image,t.image);i.push(r)}return i}toVideoResources(e,t){const r=ht.asArray(t),i=[];if(r&&r.length>0)for(const t of r){const r=this.resourceBuilder.resourceFromResourceDataJson(e,ne.video,t.video);i.push(r)}return i}buildCardNode(e,t){const r={heading:this.buildHeading(e,t.heading),questions:this.buildQuestions(e,t.questions),elements:this.handleJsonText(e,We,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 he.removeUnwantedProperties(r,{ignoreEmptyObjects:["table"]}),Object.keys(r).length>0?r:void 0}bodyBitCopyFromAttrs(e){const t={...e};if(e.attrs)for(const[r,i]of Object.entries(e.attrs))t[r]=i;return t}pushExampleDownTree(e,t,r,i,o){if(i||null!=o){if(r){if(this.pushExampleDownTreeString(e,i,o,r.pairs),this.pushExampleDownTreeBoolean(e,i,o,!1,r.flashcards),this.pushExampleDownTreeBoolean(e,i,o,!1,r.definitions),this.pushExampleDownTreeBoolean(e,i,o,!0,r.choices),this.pushExampleDownTreeBoolean(e,i,o,!1,r.responses,r.statements,r.statement),r.quizzes)for(const t of r.quizzes)this.pushExampleDownTreeBoolean(e,i,o,!0,t.choices),this.pushExampleDownTreeBoolean(e,i,o,!1,t.responses);if(r.matrix)for(const t of r.matrix)this.pushExampleDownTreeString(e,i,o,t.cells)}t&&this.pushExampleDownTreeBodyBits(e,i,o,t)}}pushExampleDownTreeBoolean(e,t,r,i,...o){if((t||null!=r)&&Array.isArray(o))for(const e of o)if(e){const o=Array.isArray(e)?e:[e];jt.fillBooleanExample(o,t,r,i)}}pushExampleDownTreeString(e,t,r,...i){if((t||r)&&Array.isArray(i))for(const o of i)if(o){const i=Array.isArray(o)?o:[o];jt.fillStringExample(e.textFormat,i,t,r,!1)}}pushExampleDownTreeBodyBits(e,t,r,i){if(!t&&!r)return;const o=this.textParser.extractBodyBits(i?.body);for(const i of o)if(i)switch(i.type){case De.gap:{const o=i;jt.fillStringExample(e.textFormat,[o],t,r,!1);break}case De.mark:{const e=i;jt.fillBooleanExample([e],t,r,!1);break}case De.select:{const e=i;jt.fillBooleanExample(e.options,t,r,!0);break}case De.highlight:{const e=i;jt.fillBooleanExample(e.texts,t,r,!0);break}}}pushDownTree(e,t,r,i,o,a,s){if(void 0!==s){if(i&&o){Array.isArray(o)||(o=[o]);const e=he.flatMapPath(i,o);for(const t of e)null==t[a]&&(t[a]=s)}if(t){const e=Array.isArray(t)?t:[t];for(const t of e)if(t&&t.body&&r){const e=this.textParser.extractBodyBits(t.body);if(r&&e&&e.length>0)for(const t of e)if(t&&-1!==r.indexOf(t.type)){const e=t;null==e[a]&&(e[a]=s)}}}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=ht.asArray(i)||[i];return r}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:r,cardNode:i}=e,o=this.textParser.extractBodyBits(r?.body);for(const e of o)switch(e.type){case De.gap:case De.mark:t(e);break;case De.select:{const r=e;let i=!1;for(const e of r.options)i=!!t(e)||i;r.isExample=i;break}case De.highlight:{const r=e;let i=!1;for(const e of r.texts)i=!!t(e)||i;r.isExample=i;break}}if(i){for(const e of i.flashcards||[])t(e);for(const e of i.definitions||[])t(e);for(const e of i.pairs||[])t(e);for(const e of i.matrix||[]){let r=!1;for(const i of e.cells||[])r=!!t(i)||r;e.isExample=r}for(const e of i.quizzes||[]){let r=!1;for(const i of e.responses||[])r=!!t(i)||r;for(const i of e.choices||[])r=!!t(i)||r;e.isExample=r}for(const e of i.responses||[])t(e);for(const e of i.choices||[])t(e);for(const e of i.statements||[])t(e);t(i.statement);for(const e of i.questions||[])t(e)}t(e.statement);for(const r of e.responses||[])t(r);for(const r of e.choices||[])t(r);t(e)}setDefaultBitValues(e){const{bitType:t}=e;switch(t){case d.articleAi:case d.noteAi:case d.summaryAi:e.aiGenerated=this.toAstProperty(t,ce.property_aiGenerated,!0,void 0)}}addVersionToParserInfo(e){const t=e.parser??{};t.version=Ee.appVersion.full,e.parser=t}},Yt=class{constructor(){l(this,"_buffer"),l(this,"_string",""),l(this,"endOfLineString","\n"),l(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){if(!this._buffer)return this;let t;return t=null!=e?e+this.endOfLineString:this.endOfLineString,this._buffer.push(t),this.lastWrite=t,this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;let r="";for(let i=0,o=e.length;i<o;i++){const a=e[i];this._buffer.push(a),r+=a,t&&i<o-1&&(this._buffer.push(t),r+=t),this._buffer.push(this.endOfLineString),r+=this.endOfLineString}return this.lastWrite=r,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}},Qt=r(722),Xt=r(722),Zt=(r(722),{v1:1,v2:2}),er={debugGenerationInline:!1},tr=class extends yt{constructor(e,t){super(),l(this,"ast",new $e),l(this,"textGenerator"),l(this,"bitmarkVersion"),l(this,"options"),l(this,"mainWriter"),l(this,"partWriter"),l(this,"writer"),l(this,"prettifySpace"),l(this,"spacesAroundValues"),l(this,"spacesAroundValuesStr"),l(this,"bitType",d._error),l(this,"textFormat",x.bitmarkText),l(this,"isBodyBitmarkText",!1),l(this,"isCardAllowed",!1),l(this,"firstBit",!0),l(this,"hasCardSet",!1),l(this,"hasFooter",!1),l(this,"inTag",!0),l(this,"skipTableTraversal",!1),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=(0,Xt.Enum)(ft).fromValue(t?.bitmarkVersion)??bt,this.options={...er,...t?.bitmarkOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion===ft.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=Zt.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=Zt.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 Lt(this.bitmarkVersion,{writeCallback:this.write,bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.mainWriter=e,this.partWriter=new Yt,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=d._error,this.textFormat=x.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,ze.bitmarkAst,this,void 0),this.writeLine()}enter_bitsValue(e,t){const r=e.value,i=ve.getBitConfig(r.bitType),o=ve.getBitResourcesConfig(r.bitType,r.resourceType);if(this.bitType=r.bitType,this.textFormat=r.textFormat??i.textFormatDefault,this.isBodyBitmarkText=this.textFormat===x.bitmarkText,this.isCardAllowed=this.calculateIsCardAllowed(),this.hasCardSet=this.haveValidCardSet(r),this.hasFooter=this.haveValidFooter(r),this.firstBit||(this.writeNL(),this.writeNL(),this.writeNL()),this.writeOPD(r.bitLevel),r.isCommented&&this.writeString("|"),this.writeTagKey(r.bitType),r.textFormat){this.isWriteTextFormat(r.textFormat,i.textFormatDefault)&&(this.writeColon(),this.writeTagKey(r.textFormat))}let a;if(i.resourceAttachmentAllowed&&r.resources&&r.resources.length>0){const e=o.comboResourceConfigKeysMap;if(o.comboResourceConfigKeysMap.size>0)for(const t of e.keys())a=ue(t);else a=r.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 r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;for(let e=0;e<r.length;e++){const i=r[e];this.writeNL(),this.writeProperty("internalComment",i,t,{format:b,array:!0})}return!1}enter_groupTag(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;for(const e of r){const{name:r,tags:i}=e;if(this.writeNL(),this.writeProperty("groupTag",r,t,{format:b,writeEmpty:!0}),i&&i.length>0)for(const e of i)this.writeProperty("tag",e,t,{format:b,writeEmpty:!0})}return!1}enter_labelTrue(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const o=i?.value;if(o){const e=""!=r,i=o.labelFalse&&""!=o.labelFalse;(e||i)&&this.writeNL(),e&&this.writeProperty("labelTrue",r,t,{format:b}),i&&this.writeProperty("labelFalse",o.labelFalse,t,{format:b})}return!1}enter_labelFalse(e,t){return!0}enter_imageSource(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{url:o,mockupId:a,size:s,format:n,trim:l}=r;return this.writeNL(),this.writeProperty("imageSource",o,t,{format:b}),o&&(a&&this.writeProperty("mockupId",a,t,{format:b}),s&&this.writeProperty("size",s,t,{format:b}),n&&this.writeProperty("format",n,t,{format:b}),qt.isBoolean(l)&&this.writeProperty("trim",l,t,{format:b})),!1}enter_technicalTerm(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{technicalTerm:o,lang:a}=r;return this.writeNL(),this.writeProperty("technicalTerm",o,t,{format:b}),null!=a&&this.writeProperty("lang",a,t,{format:b}),!1}enter_servings(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{servings:o,unit:a,unitAbbr:s,decimalPlaces:n,disableCalculation:l,hint:c}=r;return this.writeNL(),this.writeProperty("servings",o,t,{format:b}),null!=a&&this.writeProperty("unit",a,t,{format:b}),null!=s&&this.writeProperty("unitAbbr",s,t,{format:b}),null!=n&&this.writeProperty("decimalPlaces",n,t,{format:b}),null!=l&&this.writeProperty("disableCalculation",l,t,{format:b}),null!=c&&(this.writeOPQ(),this.writeTextOrValue(c,x.plainText,je),this.writeCL()),!1}enter_person(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{name:o,title:a,avatarImage:s}=r;return this.writeNL(),this.writeProperty("person",o,t,{format:b}),a&&this.writeProperty("title",a,t,{format:b}),s&&this.writeResource(ne.image,s.image.src),!1}enter_text(e,t){const r=this.getParentNode(t);return!r||r.key!==ze.term&&r.key!==ze.definition&&r.key!==ze.alternativeDefinitionsValue&&r.key!==ze.question&&r.key!==ze.answer&&r.key!==ze.alternativeAnswersValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1)}leaf_text(e,t){const r=this.getParentNode(t);return!r||r.key!==ze.term&&r.key!==ze.definition&&r.key!==ze.alternativeDefinitionsValue&&r.key!==ze.question&&r.key!==ze.answer&&r.key!==ze.alternativeAnswersValue&&r.key!==ze.reason||(se.isString(e.value)&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1)}enter_icon(e,t){const r=e.value,i=this.getParentNode(t);return!i||(i.key!==ze.term&&i.key!==ze.definition&&i.key!==ze.alternativeDefinitionsValue&&i.key!==ze.question&&i.key!==ze.answer&&i.key!==ze.alternativeAnswersValue||(this.writeNL(),this.writeResource(ne.icon,r.image.src)),!0)}leaf_iconValue(e,t){return this.writeNL(),this.writeProperty("icon",e.value,t,{format:b}),!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 r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{level:o,label:a}=r,s=e.key===ze.ratingLevelStart?"ratingLevelStart":"ratingLevelEnd";return this.writeNL(),this.writeProperty(s,o,t,{format:b}),a&&this.writeProperty("label",a,t,{format:y}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.markConfig)return!0;const{mark:o,color:a,emphasis:s}=r;return o&&(this.writeNL(),this.writeProperty("mark",o,t,{format:b}),a&&this.writeProperty("color",a,t,{format:b}),s&&this.writeProperty("emphasis",s,t,{format:b})),!1}enter_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:b})),!1}leaf_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:b})),!1}enter_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:b})),!1}leaf_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:b})),!1}leaf_reasonableNumOfChars(e,t){this.writeNL(),this.writeProperty("reasonableNumOfChars",e.value,t,{format:b})}leaf_additionalSolutionsValue(e,t){const r=this.getParentNode(t,2);r?.key===ze.questionsValue&&(this.writeNL(),this.writeProperty("additionalSolutions",e.value,t,{format:b,array:!0,writeEmpty:!0}))}enter_item(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.lead)||(!this.isEmptyText(i?.value?.pageNumber)||(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,je),this.writeCL(),!0))))}enter_lead(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.pageNumber)||(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,je),this.writeCL(),!0)))}enter_pageNumber(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.lead??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r??"",x.bitmarkText,je),this.writeCL(),!0))}enter_marginNumber(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.lead??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.pageNumber??"",x.bitmarkText,je),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,je),this.writeCL(),!0)}enter_body(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue&&r?.key!==ze.cardBitsValue)return!0;this.inTag=!1;const i=e.value;if(this.textFormat===x.json){const e=i.body??null;if(Array.isArray(e)||he.isObject(e)){const t=JSON.stringify(e,null,this.prettifySpace);t&&(this.writePlainTextDivider(),this.writeNL(),this.writeTextOrValue(t,x.plainText,We))}}else if(this.isBodyBitmarkText){const e=!(this.hasCardSet||this.hasFooter);this.writeNL();const t=Array.isArray(i.body)?i.body:[];this.writeTextOrValue(t,this.textFormat,We,{plainTextDividerAllowed:e})}else{this.writePlainTextDivider(),this.writeNL();const e=se.isString(i.body)?i.body:"";this.writeTextOrValue(`${e}`,x.plainText,We)}return!1}exit_body(e,t){this.inTag=!0}bodyBitCallback(e,t,r){const i=(0,Xt.Enum)(ze).fromValue(e.type)??ze.bodyBit;return this.ast.walk(e,i,this,void 0),""}enter_gap(e,t){const r=e.value;if(r.solutions&&0===r.solutions.length)this.writeOPU(),this.writeCL();else for(const e of r.solutions)this.writeOPU(),this.writeTextOrValue(e,x.plainText,je),this.writeCL();return!0}enter_mark(e,t){const r=e.value;return this.writeOPE(),this.writeTextOrValue(r.solution,x.plainText,je),this.writeCL(),!0}enter_select(e,t){return!0}enter_highlight(e,t){return!0}enter_footer(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;return this.textFormat===x.json||i.footer&&i.footer.length>0&&this.isBodyBitmarkText&&(this.writeNL(),this.writeTextOrValue("==== footer ====",x.plainText,We),this.writeNL(),this.writeTextOrValue(i.footer,this.textFormat,We,{plainTextDividerAllowed:!0})),!1}enter_solutions(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;return i&&0===i.length&&(this.writeOPU(),this.writeCL()),!0}leaf_solution(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return;const i=e.value,o=this.getParentNode(t,2)?.value;o?.type===De.mark&&i&&(this.writeOPE(),this.writeTextOrValue(i,x.plainText,je),this.writeCL())}leaf_mark(e,t){const r=t[0];if(r?.key!==ze.mark)return;const i=e.value;i&&this.writeProperty("mark",i,t,{format:b})}enter_optionsValue(e,t){const r=e.value;return r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.text,x.plainText,je),this.writeCL(),!0}enter_textsValue(e,t){const r=e.value;return r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.text,x.plainText,je),this.writeCL(),!0}enter_cardNode(e,t){return!this.isCardAllowed||(this.writeCardSetStart(),!0)}between_cardNode(e,t,r,i){this.isCardAllowed&&this.writeCardSetCardDivider()}exit_cardNode(e,t){this.isCardAllowed&&(this.writeCardSetEnd(),this.options.cardSetVersion,Zt.v1)}enter_elements(e,t){}between_elements(e,t,r,i){this.writeCardSetSideDivider()}between_flashcards(e,t,r,i){this.writeCardSetCardDivider()}between_flashcardsValue(e,t,r,i){this.isCardAllowed&&(r.key===ze.answer?this.writeCardSetSideDivider():r.key===ze.alternativeAnswers&&0!==r.value?.length&&this.writeCardSetVariantDivider())}between_alternativeAnswers(e,t){this.writeCardSetVariantDivider()}between_alternativeDefinitions(e,t){this.writeCardSetVariantDivider()}enter_statements(e,t){}between_statements(e,t,r,i){this.isOfBitType(d.trueFalse1)||this.writeCardSetCardDivider()}enter_statementsValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.statement,x.plainText,je),this.writeCL(),!0}enter_choicesValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect||r.requireReason?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.choice,x.plainText,je),this.writeCL(),!0}enter_responsesValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.response,x.plainText,je),this.writeCL(),!0}between_feedbacks(e,t,r,i){this.writeCardSetCardDivider()}enter_reason(e,t){return this.writeCardSetSideDivider(),!0}enter_quizzes(e,t){}between_quizzes(e,t,r,i){this.writeCardSetCardDivider()}enter_heading(e,t){}between_heading(e,t,r,i){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_forValues(e,t){}between_forValues(e,t,r,i){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_pairs(e,t){}between_pairs(e,t,r,i){this.writeCardSetCardDivider()}enter_keyAudio(e,t){const r=e.value;return this.writeNL(),this.writeResource(ne.audio,r.audio.src),!1}enter_keyImage(e,t){const r=e.value;return this.writeNL(),this.writeResource(ne.image,r.image.src),!1}enter_matrix(e,t){}between_matrix(e,t,r,i){this.isCardAllowed&&this.writeCardSetCardDivider()}enter_values(e,t){this.isCardAllowed&&this.writeCardSetSideDivider()}between_values(e,t,r,i){this.isCardAllowed&&this.writeCardSetVariantDivider()}between_pronunciationTable(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}enter_table(e,t){const r=this.getParentNode(t);if(r?.key!==ze.cardNode)return!0;const i=e.value;return!i||!this.writeAdvancedTable(i)}between_table(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}writeAdvancedTable(e){const t=mt(d.tableExtended,e),r=[{key:"header",qualifier:"table-header",section:t.header},{key:"body",qualifier:void 0,section:t.body},{key:"footer",qualifier:"table-footer",section:t.footer}];let i=0;for(const{key:e,qualifier:t,section:o}of r){const r=o?.rows??[];if(0!==r.length)for(const o of r)this.writeCardSetCardDivider(t),this.writeTableRow(o,e),i++}return i>0}writeTableRow(e,t){const r=e?.cells??[];if(0!==r.length)for(let e=0;e<r.length;e++)e>0&&this.writeCardSetSideDivider(),this.writeNL(),this.writeTableCell(r[e],t)}writeTableCell(e,t){const r="body"===t?"td":"th",i=e.title?"th":"td";i!==r&&(this.writeTableCellProperty("tableCellType",i),this.writeNL()),e.rowspan&&e.rowspan>1&&(this.writeTableCellProperty("tableRowSpan",e.rowspan),this.writeNL()),e.colspan&&e.colspan>1&&(this.writeTableCellProperty("tableColSpan",e.colspan),this.writeNL()),e.scope&&(this.writeTableCellProperty("tableScope",e.scope),this.writeNL());const o=e.content??dt.EMPTY_STRING;this.writeTextOrValue(o,this.textFormat,We)}writeTableCellProperty(e,t){this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${t}`,x.plainText,je),this.writeCL()}between_data(e,t,r,i){const o=this.getParentNode(i);o?.key!==ze.table&&o?.key!==ze.pronunciationTable||this.writeCardSetCardDivider()}between_columns(e,t,r,i){const o=this.getParentNode(i),a=o?.key;a!==ze.table&&a!==ze.captionDefinitionList||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL()}enter_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.bitmarkText,je),this.writeCL()}between_dataValue(e,t,r,i){const o=this.getParentNode(i,2);o?.key!==ze.table&&o?.key!==ze.pronunciationTable||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_dataValueValue(e,t){const r=this.getParentNode(t,3);r?.key===ze.table&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We))}enter_dataValueValue(e,t){const r=this.getParentNode(t,3);if((r?.key===ze.table||r?.key===ze.pronunciationTable)&&e.value){if(r?.key===ze.pronunciationTable){const t=e.value;return t.title&&(this.writeNL(),this.writeOP(),this.writeHash(),this.writeTextOrValue(t.title,x.bitmarkText,je),this.writeCL()),t.audio&&(this.writeNL(),this.writeResource(ne.audio,t.audio.audio.src)),t.body&&(this.writeNL(),this.writeTextOrValue(t.body,this.textFormat,We)),!1}this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)}}between_captionDefinitionList(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.writeCardSetCardDivider()}leaf_term(e,t){const r=this.getParentNode(t);return r?.key!==ze.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1)}leaf_definition(e,t){const r=this.getParentNode(t);return r?.key!==ze.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1)}between_definitions(e,t,r,i){const o=this.getParentNode(i);o?.key!==ze.cardNode&&o?.key!==ze.captionDefinitionList||this.writeCardSetCardDivider()}between_definitionsValue(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.definitions&&this.isCardAllowed&&(r.key===ze.definition?this.writeCardSetSideDivider():r.key===ze.alternativeDefinitions&&r.value?.length>0&&this.writeCardSetVariantDivider())}enter_questions(e,t){}between_questions(e,t,r,i){this.writeCardSetCardDivider()}enter_ingredients(e,t){}between_ingredients(e,t,r,i){this.writeCardSetCardDivider()}enter_ingredientsValue(e,t){const r=e.value;return null!=r.title&&(this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(r.title,x.bitmarkText,je),this.writeCL()),null!=r.ingredient&&(this.writeNL(),r.checked?this.writeOPP():this.writeOPM(),this.writeCL(),null!=r.quantity&&(this.writeOPB(),this.writeTextOrValue(`${r.quantity}`,x.plainText,je),this.writeCL()),null!=r.unit&&this.writeProperty("unit",r.unit,t,{format:b}),null!=r.unitAbbr&&this.writeProperty("unitAbbr",r.unitAbbr,t,{format:b}),null!=r.decimalPlaces&&this.writeProperty("decimalPlaces",r.decimalPlaces,t,{format:b}),r.disableCalculation&&this.writeProperty("disableCalculation",!0,t,{format:b}),this.writeNL(),this.writeTextOrValue(r.ingredient,this.textFormat,We)),!0}enter_botResponses(e,t){}between_botResponses(e,t,r,i){this.writeCardSetCardDivider()}enter_cardBits(e,t){}between_cardBits(e,t,r,i){this.writeCardSetCardDivider()}leaf_item(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeOPC(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_response(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeOPB(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_reaction(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeProperty("reaction",e.value,t,{format:b}))}leaf_feedback(e,t){const r=this.getParentNode(t);if(r?.key!==ze.botResponsesValue)return;const i=e.value;i&&(this.writeNL(),this.writeTextOrValue(i,this.textFormat,We))}enter_backgroundWallpaper(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_imagePlaceholder(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_previewImageValue(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource("previewImage",r),!0}enter_previewVideoValue(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource("previewVideo",r),!0}enter_platformIcon(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_platformLogo(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_platformBackgroundImage(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_coverImage(e,t){const r=e.value;if(r&&"object"==typeof r&&!Array.isArray(r)&&"type"in r){const t=r;return this.writeNL(),this.writePropertyStyleResource(e.key,t),!0}if(Array.isArray(r)){if(null==r)return!0;const e=this.getParentNode(t);if(e?.key!==ze.bitsValue)return!0;const i=this.getBitType(t);if(!i)return!0;const o=ve.getBitConfig(i),a=ve.getTagConfigForTag(o.tags,ce.property_coverImage);if(!a)return!0;this.writeNL_IfNotChain(t),this.writeProperty(a.tag,r,t,{format:a.format??b,array:a.array??!1,writeEmpty:!0,ignoreFalse:"false"===a.defaultValue,ignoreTrue:"true"===a.defaultValue})}return!0}leaf_coverImage(e,t){if(null==e.value)return;const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return;const i=this.getBitType(t);if(!i)return;const o=ve.getBitConfig(i),a=ve.getTagConfigForTag(o.tags,ce.property_coverImage);a&&(this.writeNL_IfNotChain(t),this.writeProperty(a.tag,e.value,t,{format:a.format??b,array:a.array??!1,writeEmpty:!0,ignoreFalse:"false"===a.defaultValue,ignoreTrue:"true"===a.defaultValue}))}exit_imagePlaceholder(e,t){}enter_posterImage(e,t){const r=this.getParentNode(t);if(r?.key===ze.bitsValue){const r=e.value;r&&this.writeProperty("posterImage",r,t,{format:b})}else{const r=e.value;r&&r.src&&this.writeProperty("posterImage",r.src,t,{format:b})}return!0}enter_thumbnails(e,t){const r=e.value;if(Array.isArray(r)){const e=["src1x","src2x","src3x","src4x"];for(let i=0;i<r.length&&i!==e.length;i++){const o=r[i],a=e[i];this.writeProperty(a,o.src,t,{format:b})}}return!1}leaf_level(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;if(!ve.isOfBitType(this.bitType,[d.chapter]))return!0;const i=e.value,o=r?.value;if(i>0&&null==o.title){this.writeNL(),this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeCL()}return!1}leaf_titleString(e,t){const r=this.getParentNode(t);return r?.key!==ze.bitsValue||(e.value&&(this.writeNL(),this.writeProperty("title",e.value,t,{format:b})),!1)}enter_title(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value,o=r?.value,a=o.level||1;if(a&&i){this.writeNL(),this.writeOP();for(let e=0;e<+a;e++)this.writeHash();this.writeTextOrValue(i,x.bitmarkText,je),this.writeCL()}return!1}enter_subtitle(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;if(i){this.writeNL(),this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeTextOrValue(i,x.bitmarkText,je),this.writeCL()}return!1}enter_book(e,t){}enter_bookValue(e,t){const r=e.value;return r&&(this.writeNL(),this.writeProperty("book",r.book,t,{format:b,writeEmpty:!0}),r.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(r.reference,x.plainText,je),this.writeCL(),r.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(r.referenceEnd,x.plainText,je),this.writeCL()))),!1}leaf_book(e,t){const r=this.getParentNode(t),i=r?.value;i&&e.value&&(this.writeNL(),this.writeProperty("book",e.value,t,{format:b,writeEmpty:!0}),i.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(i.reference,x.plainText,je),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(i.referenceEnd,x.plainText,je),this.writeCL())))}leaf_anchor(e,t){e.value&&(this.writeNL(),this.writeOPDANGLE(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_reference(e,t){const r=this.getParentNode(t),i=r?.value;i&&e.value&&(i.book||(this.writeNL(),this.writeOPRANGLE(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL()))}enter_hint(e,t){const r=e.value;return this.isEmptyText(r)||(this.writeNL_IfNotChain(t),this.writeOPQ(),this.writeTextOrValue(r,x.bitmarkText,je),this.writeCL()),!1}enter_instruction(e,t){const r=e.value;return this.isEmptyText(r)||(this.writeNL_IfNotChain(t),this.writeOPB(),this.writeTextOrValue(r,x.bitmarkText,je),this.writeCL()),!1}leaf_lang(e,t){e.value&&(this.writeNL(),this.writeProperty("lang",e.value,t,{format:v}))}enter_refAuthor(e,t){e.value&&(this.writeNL(),this.writeProperty("refAuthor",e.value,t,{format:b,array:!0}))}leaf_refBookTitle(e,t){e.value&&(this.writeNL(),this.writeProperty("refBookTitle",e.value,t,{format:b,array:!0}))}enter_refPublisher(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublisher",e.value,t,{format:b,array:!0}))}leaf_refPublicationYear(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublicationYear",e.value,t,{format:b}))}leaf_citationStyle(e,t){e.value&&(this.writeNL(),this.writeProperty("citationStyle",e.value,t,{format:b}))}leaf_isExample(e,t){if(!e.value)return;const r=this.getParentNode(t),i=r?.value.example??null;null!=i&&""!==i&&(this.writeNL_IfNotChain(t),this.writeOPA(),this.writeString("example"),this.writeColon(),!0===i?this.writeString(" true "):!1===i?this.writeString(" false "):Array.isArray(i)?this.writeTextOrValue(i,x.bitmarkText,je):this.writeTextOrValue(i,x.plainText,je),this.writeCL())}enter_elementsValue(e,t){return e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1}leaf_solutionsValue(e,t){const r=this.getParentNode(t,2);r?.key===ze.bitsValue&&null!=e.value&&(this.writeOPU(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_prefix(e,t){e.value&&(this.writeOPPRE(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_postfix(e,t){e.value&&(this.writeOPPOST(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL())}leaf_isCaseSensitive(e,t){this.writeProperty("isCaseSensitive",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0})}leaf_forKeys(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL()}leaf_forValues(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL()}leaf_forValuesValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,je),this.writeCL()}leaf_key(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We))}leaf_valuesValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We))}enter_question(e,t){const r=this.getParentNode(t);return r?.key!==ze.questionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We)),!1)}leaf_question(e,t){const r=this.getParentNode(t);r?.key===ze.flashcardsValue&&e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,We))}leaf_srcAltValue(e,t){this.writeProperty("srcAlt",e.value,t,{format:b})}leaf_src1x(e,t){this.writeProperty("src1x",e.value,t,{format:b})}leaf_src2x(e,t){this.writeProperty("src2x",e.value,t,{format:b})}leaf_src3x(e,t){this.writeProperty("src3x",e.value,t,{format:b})}leaf_src4x(e,t){this.writeProperty("src4x",e.value,t,{format:b})}leaf_width(e,t){this.writeProperty("width",e.value,t,{format:b})}leaf_height(e,t){this.writeProperty("height",e.value,t,{format:b})}leaf_alt(e,t){this.writeProperty("alt",e.value,t,{format:b})}leaf_zoomDisabled(e,t){ve.isOfBitType(this.bitType,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages,d.extractorImage])?this.writeProperty("zoomDisabled",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0}):this.writeProperty("zoomDisabled",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!0,ignoreTrue:!1})}leaf_license(e,t){this.writeProperty("license",e.value,t,{format:b})}leaf_copyright(e,t){this.writeProperty("copyright",e.value,t,{format:b})}leaf_provider(e,t){}leaf_showInIndex(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("showInIndex",e.value,t,{format:v,ignoreFalse:!0}))}enter_caption(e,t){const r=e.value;return this.writeNL_IfNotChain(t),this.writeProperty("caption",r,t,{format:y}),!1}leaf_search(e,t){const r=e.value;r&&(this.writeNL_IfNotChain(t),this.writeProperty("search",r,t,{format:b}))}leaf_selected(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("selected",e.value,t,{format:v,ignoreFalse:!0}))}leaf_duration(e,t){const r=this.getParentNode(t);r?.key===ze.bitsValue&&this.writeNL(),this.writeProperty("duration",e.value,t,{format:b})}leaf_mute(e,t){this.writeProperty("mute",e.value,t,{format:v})}leaf_autoplay(e,t){this.writeProperty("autoplay",e.value,t,{format:v})}leaf_allowSubtitles(e,t){this.writeProperty("allowSubtitles",e.value,t,{format:v})}leaf_showSubtitles(e,t){this.writeProperty("showSubtitles",e.value,t,{format:v})}generateResourceHandlers(){for(const e of(0,Xt.Enum)(ne).keys()){if(e===(0,Xt.Enum)(ne).keyFromValue(ne.unknown))continue;const t=`enter_${e}`;"function"!=typeof this[t]&&(this[t]=(e,t)=>{const r=e.value;if(null==r)return!1;const i=this.getParentNode(t);if(i?.key!==ze.resourcesValue)return!0;const o=(0,Xt.Enum)(ne).fromValue(i?.value.__typeAlias)??(0,Xt.Enum)(ne).fromValue(i?.value.type);if(!o)return!1;const a=r.url||r.src||r.body||"";return this.writeNL(),this.writeResource(o,a),!0},this[t]=this[t].bind(this))}}generatePropertyHandlers(){for(const e of(0,Xt.Enum)(ae).values()){const t=de(e),r=[`enter_${t}`,`leaf_${t}`];for(const i of r)"function"!=typeof this[i]&&"example"!==t&&(this[i]=(t,r)=>{if(null==t.value)return;const i=this.getParentNode(r);if(i?.key!==ze.bitsValue)return;const o=this.getBitType(r);if(!o)return;const a=ve.getBitConfig(o),s=ve.getTagConfigForTag(a.tags,e);s&&(this.writeNL_IfNotChain(r),this.writeProperty(s.tag,t.value,r,{format:s.format??b,array:s.array??!1,writeEmpty:!0,ignoreFalse:"false"===s.defaultValue,ignoreTrue:"true"===s.defaultValue}))},this[i]=this[i].bind(this))}}getBitType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.bitType}}isChain(e){const t=this.getParentNode(e);return t?.key!==ze.bitsValue&&(t?.key!==ze.cardBitsValue&&(t?.key!==ze.feedbacksValue&&(t?.key!==ze.quizzesValue&&(t?.key!==ze.pairsValue&&(t?.key!==ze.matrixValue&&(t?.key!==ze.definitionsValue&&(t?.key!==ze.questionsValue&&t?.key!==ze.reason)))))))}haveValidCardSet(e){const t=ve.getBitConfig(e.bitType);return!!t&&!!t.cardSet}haveValidFooter(e){const t=e.footer;if(!t)return!1;return e.textFormat!==x.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(dt.breakscape(`${e}`,{format:x.plainText,location:je}))}writeTextOrValue(e,t,r,i){const o=r===je,a="string"==typeof e?e:void 0,s=Array.isArray(e)?e:void 0,n=o?this.spacesAroundValuesStr:"",l=t===x.bitmarkText?t:x.plainText,c=e=>o?`${n}${e}${n}`:e,p=e=>{const t=this.writer;this.writer=this.partWriter,this.partWriter.openSync(),e(),this.partWriter.closeSync();const r=this.partWriter.getString().trim();return this.writer=t,r};if(null!=a){const e=()=>this.write(dt.breakscape(a,{format:l,location:r}));if(o){const t=p(e);t&&this.write(c(t))}else e();return}if(null!=s){const e=()=>this.textGenerator.generateSync(s,t,r,i);if(o){const t=p(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===Zt.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.writeNL(),this.options.cardSetVersion===Zt.v1&&this.write("===")}writeCardSetCardDivider(e){this.writeNL();const t=this.getCardDividerMarker();this.write(t),e&&this.appendCardDividerQualifier(e)}writeCardSetSideDivider(){this.writeNL(),this.options.cardSetVersion===Zt.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.writeNL(),this.options.cardSetVersion===Zt.v1?this.write("--"):this.write("++")}getCardDividerMarker(){return this.options.cardSetVersion===Zt.v1?"===":"===="}appendCardDividerQualifier(e){const t=this.getCardDividerMarker(),r=dt.breakscape(e,{format:x.plainText,location:je});this.write(" "),this.write(r),this.write(" "),this.write(t)}writeNL_IfNotChain(e){this.isChain(e)||this.writeNL()}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writePropertyStyleResource(e,t,r=!1){if(e&&t){const i=t[(0,Xt.Enum)(ne).keyFromValue(t.type)??""],o=i&&(i.src||i.url||i.body)||"";r?this.writeOPA():this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(o,x.plainText,je),t.type,this.writeCL()}}writeResource(e,t){e&&(this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,x.plainText,je),this.writeCL())}writeProperty(e,t,r,i){let o;if(void 0!==t){const a=i.format===y;if(a){if(!i.writeEmpty&&a&&this.isEmptyText(t))return;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,x.bitmarkText,je),this.writeCL()}else if(o=Array.isArray(t)?t:[t],o.length>0){i.array||(o=o.slice(o.length-1));let t=0;for(const a of o)if(void 0!==a){if(i.ignoreFalse&&!1===a)continue;if(i.ignoreTrue&&!0===a)continue;if(!i.writeEmpty&&""===a)continue;t>0&&this.writeNL_IfNotChain(r),this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${a}`,x.plainText,je),this.writeCL(),t++}}}}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isEmptyText(e){return!e||(!Array.isArray(e)||0===e.length)}isWriteTextFormat(e,t){return!!(!((0,Xt.Enum)(x).fromValue(e)===t)||this.options.explicitTextFormat)}calculateIsCardAllowed(){return this.isBodyBitmarkText&&!this.isOfBitType1()&&!this.isTableBitType()}isTableBitType(){return this.isOfBitType([d.table])}isOfBitType1(){return this.isOfBitType([d.trueFalse1,d.multipleChoice1,d.multipleResponse1])}isOfBitType(e){return ve.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}},rr=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new tr(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()}},ir=r(722),or={},ar=class extends yt{constructor(e,t){super(),l(this,"ast",new $e),l(this,"textGenerator"),l(this,"bitmarkVersion"),l(this,"textParserVersion"),l(this,"textParser",new Mt),l(this,"options"),l(this,"jsonPrettifySpace"),l(this,"writer"),l(this,"json",[]),l(this,"bitWrapperJson",{}),l(this,"bitJson",{}),l(this,"textDefault",dt.EMPTY_STRING),l(this,"bodyDefault",dt.EMPTY_STRING),l(this,"bodyJson",this.bodyDefault),l(this,"listItem"),l(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=(0,ir.Enum)(ft).fromValue(t?.bitmarkVersion)??bt,this.textParserVersion=this.textParser.version(),this.options={...or,...t?.jsonOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===ft.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.textGenerator=new Lt(ft.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.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?dt.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?dt.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.listItem=void 0,this.placeholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,ze.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 r=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(r),this.bitWrapperJson.bit=this.bitJson;const i=ve.getBitConfig(r.bitType),o=this.getTextFormat(t),a=!!i.rootExampleType,s=i.rootExampleType===h;if(a){let e;s?(e=!0,ve.isOfBitType(r.bitType,d.trueFalse1)&&void 0!==r.cardNode?.statement?.isCorrect&&(e=r.cardNode.statement.isCorrect)):e="true";const t=this.toExample(r,{defaultExample:e,isBoolean:s,textFormat:o});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else r.isExample&&(this.bitJson.isExample=!0);this.placeholderIndex=0}exit_bitsValue(e,t){const r=this.bitJson.isExample,i=this.bitJson.example;delete this.bitJson.isExample,delete this.bitJson.example,this.bitJson.isExample=r,this.bitJson.example=i,this.cleanBitJson(this.bitJson)}enter_imageSource(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_person(e,t){const r=this.getBitType(t);let i="person";return ve.isOfBitType(r,d.conversationLeft1)&&(i="partner"),this.standardHandler(e,t,ze.bitsValue,{array:!1,keyOverride:i})}enter_ratingLevelStart(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_ratingLevelEnd(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_productId(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;return this.getBitType(t)===d.module?this.addProperty(this.bitJson,"productId",r,{array:!0}):r.length>0&&this.addProperty(this.bitJson,"productId",r[r.length-1],{array:!1}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const r=e.value,i=this.getParentNode(t);return i?.key!==ze.markConfig||(this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(r),!1)}enter_item(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_lead(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_pageNumber(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_marginNumber(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_hint(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_instruction(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}leaf_titleString(e,t){const r=this.getParentNode(t);return r?.key!==ze.bitsValue||this.standardHandler(e,t,[ze.bitsValue],{array:!1,keyOverride:"title"})}enter_title(e,t){return this.standardHandler(e,t,[ze.bitsValue,ze.cardNode],{array:!0})}enter_subtitle(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_caption(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_width(e,t){let r=e.value;const i=this.getBitType(t),o=this.getParentNode(t);return o?.key===ze.bitsValue&&ve.isOfBitType(i,d.extractorBlock)&&(r=zt.asNumber(r,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:r})}enter_height(e,t){let r=e.value;const i=this.getBitType(t),o=this.getParentNode(t);return o?.key===ze.bitsValue&&ve.isOfBitType(i,d.extractorBlock)&&(r=zt.asNumber(r,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:r})}enter_extraProperties(e,t){const r=e.value;if(!this.options.excludeUnknownProperties&&r)for(const[e,t]of Object.entries(r)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t,{array:!0})}}enter_cardBitsValue(e,t){const r=e.value,i=this.getBitType(t);if(!i)return;let o;if(i===d.bookReferenceList){this.bitJson.bookReferences||(this.bitJson.bookReferences=[]);const e={};this.addProperty(e,"lang",r.lang,{array:!1}),this.addProperty(e,"refAuthor",r.refAuthor??[],{array:!0}),this.addProperty(e,"refBookTitle",r.refBookTitle??[],{array:!1}),this.addProperty(e,"refPublisher",r.refPublisher??[],{array:!0}),this.addProperty(e,"refPublicationYear",r.refPublicationYear??[],{array:!1}),this.addProperty(e,"citationStyle",r.citationStyle??[],{array:!1}),this.bitJson.bookReferences.push(e)}else i===d.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),o=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),o=this.bitJson.listItems),this.listItem={item:r.item??[],lead:r.lead??[],hint:r.hint??[],instruction:r.instruction??[],body:this.bodyDefault},o.push(this.listItem)}exit_cardBitsValue(e,t){this.listItem=void 0}enter_body(e,t){const r=e.value,i=this.getParentNode(t);if(!i)return!1;const o=this.getTextFormat(t),a=o===x.bitmarkText;if(this.bodyJson=r.body,i.key===ze.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,We,{noBreakscaping:!0});this.bitJson.body=(e??"").trim()}else e&&(this.bitJson.body=this.moveBodyBitPropertiesToAttrs(this.bodyJson))}else i.key===ze.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson);return!1}bodyBitCallback(e,t,r){const i=`{${this.placeholderIndex}}`;return this.placeholderIndex++,this.bitJson.placeholders=this.bitJson.placeholders??{},this.bitJson.placeholders[i]=e,i}moveBodyBitPropertiesToAttrs(e,t=0){if(0===t)e=structuredClone(e);else if(t>5e3)throw new Error("Recursion limit exceeded");for(const r of e)if(r.type!==De.text&&(0,ir.Enum)(De).values().includes(r.type)){const e=r;e.attrs={};for(const[t,r]of Object.entries(e))"type"!==t&&"attrs"!==t&&(e.attrs[t]=r,delete e[t])}else Array.isArray(r.content)&&(t++,this.moveBodyBitPropertiesToAttrs(r.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,ze.cardNode,{array:!0,keyOverride:"cards"})}enter_definitions(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_statement(e,t){const r=e.value,i=this.getParentNode(t);i?.key===ze.cardNode&&r&&(this.bitJson.statement=r.statement??[],this.bitJson.isCorrect=r.isCorrect??!1,this.bitJson.example=r.example,this.bitJson.isExample=r.isExample)}enter_statements(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_choices(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_responses(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_feedbacks(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_quizzes(e,t){return this.standardHandler(e,t,ze.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,ze.cardNode,{array:!0})}enter_matrix(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_pronunciationTable(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_table(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_questions(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_botResponses(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0,keyOverride:"responses"})}enter_ingredients(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_captionDefinitionList(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_backgroundWallpaper(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_imagePlaceholder(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_previewImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_previewVideo(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_platformIcon(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_platformLogo(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_platformBackgroundImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_coverImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:Array.isArray(e.value)})}enter_resources(e,t){const r=e.value,i=this.getBitType(t),o=this.getResourceType(t);if(!r||!i)return!0;let a;const s=ve.getBitConfig(i),n=ve.getBitResourcesConfig(i,o).comboResourceConfigKeysMap;if(n.size>0)for(const[e,t]of n.entries()){const i=ue(e),o={type:i,__typeAlias:i,__configKey:e};for(const e of t){const t=r.find(t=>t.__configKey===e);if(t){const e=ve.getTagConfigForTag(s.tags,t.__configKey);if(e){const r=e.jsonKey??e.tag,i=e.configKey??t.__configKey,a=t.__configKey===i?t:void 0;if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(o[r]=t)}}}a=o}else if(ve.isOfBitType(i,[d.imagesLogoGrave,d.prototypeImages,d.extractorImage])){const e=[];for(const t of r)t.type===ne.image&&e.push(t);i===d.imagesLogoGrave?this.bitJson.logos=e:this.bitJson.images=e}else r.length>=1&&(a=r[0]);return this.bitJson.resource=a,!1}leaf_level(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_book(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}leaf_book(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_anchor(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_reference(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_referenceEnd(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_markup(e,t){const r=e.value;return r&&(this.bitWrapperJson.bitmark=r),!1}enter_internalComment(e,t){return!1}enter_parser(e,t){const r=e.value,i=this.getBitType(t),o=this.getParentNode(t);if(r&&i){const{version:e,warnings:i,errors:a,...s}=r,n=`${this.bitmarkVersion}`,l=this.textParserVersion,c=this.getInternalComments(t);o?.key===ze.bitsValue&&(this.bitWrapperJson.parser={version:e,bitmarkVersion:n,textParserVersion:l,internalComments:c,...s,warnings:i,errors:a},this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){for(const e of(0,ir.Enum)(ae).values()){const t=de(e),r=[`enter_${t}`,`leaf_${t}`];for(const e of r)"function"!=typeof this[e]&&"example"!==t&&(this[e]=(e,r)=>{const i=e.value;if(null==i)return;const o=this.getParentNode(r);o?.key===ze.bitsValue&&(this.bitJson[t]=i)},this[e]=this[e].bind(this))}}standardHandler(e,t,r,i){if(r){const e=Array.isArray(r)?r:[r],i=this.getParentNode(t);if(!i?.key||!e.includes(i?.key))return!0}return this.addProperty(this.bitJson,i.keyOverride??e.key,i.valueOverride??e.value,i),!1}addProperty(e,t,r,i){if(void 0!==r){let o;Array.isArray(r)||(r=[r]);const a=r;o=!i.array&&a.length>=1?a[a.length-1]:a,(i.allowNull||null!=o)&&(e[t]=o)}}toExample(e,t){const{isExample:r,example:i,__isDefaultExample:o}=e,{defaultExample:a,isBoolean:s}=t;if(!r)return{isExample:!1,example:null};let n;return n=o?s?qt.toBoolean(a):this.convertBreakscapedStringToJsonText(a,t.textFormat,je):s?qt.toBoolean(i):this.convertBreakscapedStringToJsonText(i,t.textFormat,je),{isExample:!0,example:n}}getBitType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.bitType}}getTextFormat(e){const t=this.getBitType(e);if(t){const r=ve.getBitConfig(t);for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return(0,ir.Enum)(x).fromValue(e?.textFormat)??r.textFormatDefault}}return x.bitmarkText}getResourceType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===ze.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t,r){if(!e)return"";if(!(t===x.bitmarkText))return e||"";if(this.options.textAsPlainText)return e||"";return this.textParser.toAst(e,{format:t,location:r})}concatenatePlainTextWithJsonTexts(e,t,r){if(Array.isArray(e)){if(r=r.trim()){const i=r.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:qe.hardBreak});for(let e=0;e<i.length;e++){const t=i[e];t&&o.push({text:t,type:qe.text}),e<i.length-1&&o.push({type:qe.hardBreak})}const a=e[e.length-1];a&&a.type===qe.paragraph?a.content=[...a.content??[],...o]:e.push({type:qe.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${r??""}`}isBitmarkText(e){return null!=e&&(!!Array.isArray(e)&&"text"===e.__tag)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){const t=e.textFormat;return{type:e.isCommented?d._comment:e.bitType,originalType:e.isCommented?e.bitType:void 0,format:t,bitLevel:e.bitLevel}}cleanBitJson(e){const t=ve.getBitType(e.type);if(null==e.originalType&&(e.originalType=void 0),e.item||(e.item=void 0),ve.isOfBitType(t,[d._error,d._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,i=!1;ve.isOfBitType(t,[d.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),ve.isOfBitType(t,[d.article]),ve.isOfBitType(t,[d.example])&&(r=!0,i=!0),ve.isOfBitType(t,[d.multipleChoice1,d.multipleResponse1,d.multipleChoiceText,d.highlightText,d.gapText,d.gapTextInstructionGrouped,d.clozeAndMultipleChoiceText,d.sequence,d.mark,d.flashcard,d.definitionList])&&(r=!0,null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,[d.sequence])&&(r=!0,i=!0,null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.cloze)&&(r=!0,ve.isOfBitType(t,d.clozeSolutionGrouped)?(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!0)):ve.isOfBitType(t,d.clozeInstructionGrouped)&&(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!1))),ve.isOfBitType(t,[d.multipleChoice,d.multipleResponse])&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault)),ve.isOfBitType(t,d.essay)&&(r=!0,i=!0,null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="")),ve.isOfBitType(t,d.trueFalse1)&&(r=!0,i=!0,null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.trueFalse)&&(r=!0,null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.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)),ve.isOfBitType(t,d.interview)&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[])),ve.isOfBitType(t,d.sequence)&&null==e.elements&&(e.elements=[]),t===d.matchMatrix&&(r=!0),ve.isOfBitType(t,d.match)&&(r=!0,null==e.heading&&(e.heading={})),ve.isOfBitType(t,d.learningPathBook)&&(null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1)),ve.isOfBitType(t,d.table)&&(null==e.tableFixedHeader&&(e.tableFixedHeader=!1),null==e.tableHeaderWhitespaceNoWrap&&(e.tableHeaderWhitespaceNoWrap=!1),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)),ve.isOfBitType(t,d.bookReference)&&(null==e.refAuthor&&(e.refAuthor=[]),null==e.refBookTitle&&(e.refBookTitle=""),null==e.refPublisher&&(e.refPublisher=[]),null==e.refPublicationYear&&(e.refPublicationYear="")),ve.isOfBitType(t,[d.pageBanner,d.pageBuyButton,d.pageBuyButtonAlt,d.pageBuyButtonPromotion,d.pageFooter,d.pageOpenBook,d.pagePerson,d.pageProduct,d.pageProductList,d.pageProductVideo,d.pageProductVideoList,d.pageSectionFolder,d.pageSubscribe,d.pageSubpage])&&(null==e.slug&&(e.slug=""),null==e.body&&(e.body=this.bodyDefault),ve.isOfBitType(t,d.pageBuyButton)&&null==e.content2Buy&&(e.content2Buy="")),ve.isOfBitType(t,d.tocResource)&&null==e.tocResource&&(e.tocResource=[]),ve.isOfBitType(t,d.tocContent)&&null==e.tocContent&&(e.tocContent=[]),ve.isOfBitType(t,d.book)&&(null==e.maxTocChapterLevel&&(e.maxTocChapterLevel=-1),null==e.hasPrintRestriction&&(e.hasPrintRestriction=!0),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!==d.articleAi&&t!==d.noteAi&&t!==d.summaryAi||null==e.aiGenerated&&(e.aiGenerated=!0),ve.isOfBitType(t,[d.articleResponsive,d.pageArticleResponsive])&&null==e.imageFirst&&(e.imageFirst=!0),ve.isOfBitType(t,d.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy="")),ve.isOfBitType(t,[d.imagesLogoGrave,d.prototypeImages,d.extractorImage])&&(t===d.imagesLogoGrave?null==e.logos&&(e.logos=[]):null==e.images&&(e.images=[])),ve.isOfBitType(t,[d.stepImageScreenshotWithPointer,d.surveyMatrix])&&(null==e.pointerTop&&(e.pointerTop=""),null==e.pointerLeft&&(e.pointerLeft=""),ve.isOfBitType(t,[d.surveyMatrix])&&null==e.buttonCaption&&(e.buttonCaption="")),ve.isOfBitType(t,[d.listItem])&&null==e.listItemIndent&&(e.listItemIndent=0),ve.isOfBitType(t,d.surveyRating)&&(null==e.ratingLevelStart&&(e.ratingLevelStart={level:0}),null==e.ratingLevelEnd&&(e.ratingLevelEnd={level:0})),ve.isOfBitType(t,d.vendorStripePricingTable)&&(null==e.stripePricingTableId&&(e.stripePricingTableId=""),null==e.stripePublishableKey&&(e.stripePublishableKey="")),ve.isOfBitType(t,d.callToAction)&&(null==e.buttonCaption&&(e.buttonCaption=""),null==e.callToActionUrl&&(e.callToActionUrl="")),ve.isOfBitType(t,d.handInFile)&&null==e.handInAcceptFileType&&(e.handInAcceptFileType=[]),ve.isOfBitType(t,d.handInSubmit)&&(null==e.handInRequirement&&(e.handInRequirement=[]),null==e.handInInstruction&&(e.handInInstruction=""),null==e.buttonCaption&&(e.buttonCaption="")),ve.isOfBitType(t,d.module)&&null==e.hasBookNavigation&&(e.hasBookNavigation=!0),ve.isOfBitType(t,d.container)&&null==e.allowedBit&&(e.allowedBit=[]),ve.isOfBitType(t,d.platformPath)&&null==e.path&&(e.path=""),ve.isOfBitType(t,d.platformBrandTarget)&&null==e.platformBrandTarget&&(e.platformBrandTarget="none"),r?null==e.isExample&&(e.isExample=!1):(delete e.isExample,delete e.example),i?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 r=t[e];if(this.isBitmarkText(r)){const i=this.textGenerator.generateSync(r,x.bitmarkText,je,{noBreakscaping:!0});t[e]=(i??"").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}},sr=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new ar(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())}},nr=r(722),lr=class{getSupportedBits(e){const t=e?.includeNonDeprecated??!0,r=e?.includeDeprecated??!1,i=[];for(const e of(0,nr.Enum)(d).values()){if(e===d._error||e===d._comment)continue;const o=ve.getBitType(e),a=ve.getBitConfig(o),s=a.inheritedBitTypes.length>0?a.inheritedBitTypes:void 0;(t&&!a.deprecated||r&&a.deprecated)&&i.push({name:e,since:a.since,deprecated:a.deprecated,inheritedBitTypes:s})}return i}getSupportedBitConfigs(){const e=[];for(const t of(0,nr.Enum)(d).values()){if(t===d._error||t===d._comment)continue;const r=ve.getBitType(t),i=ve.getBitConfig(r);e.push(i)}return e}},cr=(r(722),{peggy:"peggy"}),pr=(r(722),{text:"text",json:"json",pojo:"pojo"}),dr=(r(722),{list:"list",deprecated:"deprecated",all:"all",bit:"bit"}),ur=r(722),mr=new Kt,hr=class{toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t,parser:i}=e,o=this.bitToAst(t,i?.internalComments);o&&r.push(o)}const i=r.length>0?{bits:r}:{};return mr.buildBitmark(i)}preprocessJson(e){const t=[];if(se.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return ve.getBitType(t.type)!==d._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){const{statement:r,reference:i,...o}=e,a=e.type===d._comment&&void 0!==e.originalType,s=ve.getBitType(a?e.originalType:e.type),n=ve.getBitConfig(s),l=(0,ur.Enum)(ut).fromValue(e.format);let c=(0,ur.Enum)(x).fromValue(e.format)??n.textFormatDefault;l===ut.bitmarkMinusMinus&&(c=x.bitmarkText);return mr.buildBit({...o,bitType:s,bitLevel:Math.max(Math.min(e.bitLevel??1,ve.bitLevelMax),ve.bitLevelMin),textFormat:e.format,resourceType:this.getResourceType(e.resource),isCommented:a,internalComment:t,...this.processTitle(s,e.title),...this.processReference(i),...this.parseExample(e.example),person:e.partner??e.person,markConfig:e.marks,resources:this.processResources(s,e.resource,e.images,e.logos),body:this.processBody(e.body,e.placeholders),flashcards:e.cards,statements:this.processStatements(r,e.isCorrect,e.statements,e.example),responses:this.processResponses(s,e.responses),botResponses:this.processBotResponse(s,e.responses),cardBits:this.processListItems(e.listItems??e.sections??e.bookReferences,e.placeholders),footer:this.processFooter(e.footer)})}processStatements(e,t,r,i){const o=[];if(e){const r={statement:e??"",isCorrect:t??!1,...this.parseExample(i)};r&&o.push(r)}if(Array.isArray(r))for(const e of r)o.push(e);if(0!==o.length)return o}processResponses(e,t){if(!ve.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processBotResponse(e,t){if(ve.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processListItems(e,t){const r=[];if(Array.isArray(e))for(const i of e){const e={...i};e.body&&(e.body={body:e.body,placeholders:t}),e&&r.push(e)}if(0!==r.length)return r}getResourceType(e){if(e){return(0,ur.Enum)(ne).fromValue(e.type)}}processResources(e,t,r,i){const o=[];if(t&&o.push(t),ve.isOfBitType(e,[d.prototypeImages,d.extractorImage])&&Array.isArray(r))for(const e of r)e&&o.push(e);if(ve.isOfBitType(e,[d.imagesLogoGrave])&&Array.isArray(i))for(const e of i)e&&o.push(e);return o}processBody(e,t){return{body:e,placeholders:t}}processFooter(e){if(e)return{footer:e}}processTitle(e,t){return ve.isOfBitType(e,d.author)?{titleString:t,title:void 0}:{titleString:void 0,title:t}}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=se.isString(e)||Array.isArray(e)?e:void 0;return t?{example:t}:{example:!!e}}},gr=(r(722),class{constructor(e,t){l(this,"source"),l(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}}),fr={TextFormat:"TextFormat",ResourceType:"ResourceType",Title:f.tag_title,Anchor:f.tag_anchor,Reference:f.tag_reference,ItemLead:f.tag_item,Instruction:f.tag_instruction,Hint:f.tag_hint,True:f.tag_true,False:f.tag_false,Gap:f.tag_gap,Mark:f.tag_mark,SampleSolution:f.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"},br="Bit",yr="Card",kr="Chain",vr=r(722),Tr=class{constructor(e){l(this,"cardIndex",0),l(this,"cardSideIndex",0),l(this,"cardVariantIndex",0),l(this,"currentCardQualifier"),l(this,"currentSideQualifier"),l(this,"currentVariantQualifier"),l(this,"parse"),l(this,"parserText"),l(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 r=this.parserLocation()?.start??{line:1,column:1,offset:0},i=this.parse(e,{startRule:"bit",grammarSource:new gr("bit",r)});return i.value&&(i.value.markup=t),i}handleTextFormat(e){return{type:fr.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:fr.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:(0,vr.Enum)(f).fromValue(e),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:fr.Property,key:`@${dt.unbreakscape(e,{format:x.plainText,location:je})}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){const r=dt.unbreakscape(e,{format:x.plainText,location:je}),i=se.kebabToCamel(r);return{type:fr.Resource,key:`&${i}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handlePlainTextDivider(e){return e=this.reduceToString(e),{type:fr.PlainTextDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleFooterDivider(e){return e=this.reduceToString(e),{type:fr.FooterDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSet(e){const t=e,r={cards:[]},i={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:i,parser:o}=e;if(!t||t!==fr.Card)continue;const{cardIndex:a,cardSideIndex:s,cardVariantIndex:n,value:l,cardQualifier:c,cardSideQualifier:p,cardVariantQualifier:d}=i;let u=r.cards[a];u?c&&!u.qualifier&&(u.qualifier=c):(u={sides:[],qualifier:c},r.cards[a]=u);let m=u.sides[s];m?p&&!m.qualifier&&(m.qualifier=p):(m={variants:[],qualifier:p},u.sides[s]=m);const h=m.variants[n];h?(m.variants[n].value+=l,d&&!h.qualifier&&(h.qualifier=d)):m.variants[n]={value:l,parser:o,qualifier:d}}r.cards=r.cards.filter(e=>e.sides.some(e=>e.variants.some(e=>0!==se.trimmedString(e.value).length)));for(const t of r.cards){const r={sides:[],qualifier:t.qualifier};i.cards.push(r);for(const i of t.sides){const t={variants:[],qualifier:i.qualifier};r.sides.push(t);for(const r of i.variants){let i={line:1,column:1,offset:0};if(r.parser.location){i=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,o=1;i.offset+=t,i.line+=o}let o=this.parse(r.value,{startRule:"cardContent",grammarSource:new gr("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o,qualifier:r.qualifier})}}}}return{type:fr.CardSet,value:i,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=void 0,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=void 0,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r,i=!1,o=!1,a=!1;if(Array.isArray(e)&&2===e.length){const[t,i]=e;"string"==typeof t?(e=t,"string"==typeof i&&i.trim()===i&&i.length>0&&(r=i)):e=t}else if(Array.isArray(e)&&1===e.length){const[t]=e;e=t}return t===Zt.v1?(i="==="===e,o="=="===e,a="--"===e):(i="===="===e,o="--"===e,a="++"===e),i?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=r,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0):o?(this.cardSideIndex++,this.cardVariantIndex=0,this.currentSideQualifier=r,this.currentVariantQualifier=void 0):a&&(this.cardVariantIndex++,this.currentVariantQualifier=r),this.isType(e,fr.Card)?e:{type:fr.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:"",cardQualifier:this.currentCardQualifier,cardSideQualifier:this.currentSideQualifier,cardVariantQualifier:this.currentVariantQualifier},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:fr.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e,cardQualifier:this.currentCardQualifier,cardSideQualifier:this.currentSideQualifier,cardVariantQualifier:this.currentVariantQualifier},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){const t=[];let r,i;for(const o of e)switch(o.type){case fr.BodyChar:if(r){const e=`${r.value??""}${o.value??""}`;r.value=e}else r={type:fr.BodyText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case fr.CardChar:if(i){const e=`${i.value??""}${o.value??""}`;i.value=e}else i={type:fr.CardText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:r&&(t.push(r),r=void 0),i&&(t.push(i),i=void 0),t.push(o)}return r&&t.push(r),i&&t.push(i),t}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!(0,vr.Enum)(fr).fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce((e,i,o)=>{if(null==i)return e;const{type:a,value:s}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(s)){const r=this.reduceToArrayOfTypes(s,t);e.push(...r)}else a&&e.push(i)}return e},[])}reduceToString(e){if(!Array.isArray(e))return"";return e.reduce((e,t,r)=>{if(null==t)return e;if(Array.isArray(t)){e+=this.reduceToString(t)}else e+=t;return e},[])}debugPrint(e,t){}},xr=r(722),_r=r(722),Cr=["----","\n==\n","\n---\n"],wr=["==\n","--\n"],Ar=["\n==","\n--"],Br=new class{validateBitTags(e,t){if(!t)return[];const{bitConfig:r,bitType:i,resourceType:o}=e,{tags:a,cardSet:s}=r,n={...a,...ve.getBitResourcesConfig(i,o).tags};return this.validateTagChainsRecursive(e,br,i,t,n,s).validated}checkBody(e,t,r,i,o){if(!o)return o;const{bitConfig:a}=e,{bodyAllowed:s}=a;return o.length>0&&!s&&e.addWarning(`Bit '${r}' should not have a body.`),o}checkBodyPart(e,t,r){return r?(this.checkBodyForCommonPotentialMistakes(e,t,r),r):r}checkFooter(e,t,r){if(!r)return r;const{bitConfig:i,bitType:o}=e,{footerAllowed:a}=i;return this.checkBodyForCommonPotentialMistakes(e,t,r),a||e.addWarning(`Bit '${o}' should not have a footer.`),r}checkCardBody(e,t,r,i,o,a,s){if(!i||!i.body)return i;const{bitConfig:n}=e;if(!n.cardSet)return i;const l=ve.getCardSetVariantConfig(r,a,s);if(!l)return i;const{bodyAllowed:c}=l;return i.bodyString.length>0&&!c&&e.addWarning(`Bit '${r}' should not have a card body at card:${o+1}, side:${a+1}, variant:${s+1}.`),i}validateTagChainsRecursive(e,t,r,i,o,a,s){if(!i)return{validated:[]};let n;const l=[...i],c=this.convertTagsToTypeKeyMap(e,t,r,o),p=(e,t,r)=>{c.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};t===br?(a&&p(fr.CardSet,1,0),p(fr.TextFormat,1,0),p(fr.BodyText,u,0),p(fr.BodyTextPlain,u,0),p(fr.PlainTextDivider,u,0),p(fr.FooterDivider,u,0)):t===yr&&p(fr.CardText,u,0);for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:p,key:d}=o;let u=(0,_r.Enum)(fr).fromValue(p);if(!u)continue;let m=u;u!==fr.Property&&u!==fr.Resource||(m=d);let h=c.get(m);if(!h&&u===fr.Property){const t=d.replace(/^@/,"&");if((t===ce.resource_backgroundWallpaper||t===ce.resource_imagePlaceholder||t===ce.resource_platformIcon||t===ce.resource_platformLogo||t===ce.resource_platformBackgroundImage||t===ce.resource_coverImage)&&(h=c.get(t),h)){u=fr.Resource,o.type=fr.Resource;const r=`Falling back to '[${t}]' from '[${d}]'. Replace '[${d}]' with '[&${d}]' to avoid this warning.`;e.addWarning(r)}}const{validated:g,warning:f}=this.validateSingleTag(e,t,r,o,u,h,a);u===fr.Resource&&(s=fr.Resource);let b=!0;if(!g)if(t===kr&&s!==fr.Resource){n=o;const e=l.slice(i+1);e.length>0&&(n.chain=e),l.splice(i),b=!1}else l.splice(i,1,null);if(f&&b&&e.addWarning(f.warning??"",f.content,f.previousContent),t===kr&&h&&h.chain&&g&&!g.chain){const e=l.slice(i+1);e.length>0&&(g.chain=e),l.splice(i+1)}if(g&&Array.isArray(g.chain)&&g.chain.length>0)if(h&&h.chain){const{validated:t,remaining:o}=this.validateTagChainsRecursive(e,kr,r,g.chain,h.chain,void 0,g.type);t&&t.length>0?g.chain=t:g.chain=void 0,o&&l.splice(i+1,0,o)}else if(g.type!==fr.Resource){const e=g.chain[0];g.chain.length>1&&(e.chain=g.chain.slice(1)),l.splice(i+1,0,e),g.chain=void 0}}for(const t of c.values()){const{minCount:r,_seenCount:i}=t;if(null!=r&&i<r){const i=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(i)}}return{validated:l.filter(e=>null!=e),remaining:n}}validateSingleTag(e,t,r,i,o,a,s){const{type:n,key:l}=i,c=a?this.getTagSignature(a):this.getUnknownTagSignature(n,l),p=" It will be ignored";let d,u,m="";if(a)switch(a._seenCount++,o){case fr.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i);d=o,u=s;break}case fr.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i);d=o,u=s;break}case fr.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,s);d=t,u=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i);d=o,u=s}}else switch(o){case fr.Property:u={extraProperty:!0},t!==kr&&(d=i);break;case fr.Resource:u={excessResource:!0},d=i;break;default:u={invalid:!0}}if(u){const e=a?._previous;u.invalid||u.excessResource?m=`${c} is not valid here (incorrectly chained?).${p}`:null!=u.tooMany?(m=`${c} is included more than the required ${u.tooMany} time(s).`,0===u.tooMany&&o===fr.Resource&&(m+=` Did you forget the '${l}' in the bit header?`),u.tooMany>0&&(m+=" The earlier ones will be ignored")):u.extraProperty?m=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:u.unexpectedCardSet?m=`${c} is not expected here.${p}`:u.unexpectedCardSideVariant&&(m=`${c} has a card / side / variant that is not expected here.${p}`),u.warning=m,u.content=d,u.previousContent=e}return a&&(a._previous=i),{validated:d,warning:u}}validateStandardTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateResourceTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:a}=i,s=a;let n,l=0,c=0;for(const r of s.cards){l=0;for(const i of r.sides){c=0;for(const r of i.variants){const o=r.content;let a;const s=ve.getCardSetVariantConfig(t,l,c);if(s){a=this.validateTagChainsRecursive(e,yr,t,o,s.tags).validated}else n={unexpectedCardSideVariant:!0};a&&a.length>0?i.variants[c]={parser:r.parser,content:a}:i.variants[c]={parser:r.parser,content:[]},c++}l++}}return{content:i,warning:n}}checkBodyForCommonPotentialMistakes(e,t,r){if(!r)return;const{bitType:i}=e;for(const t of Cr)r.includes(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`);for(const t of wr)r.startsWith(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`);for(const t of Ar)r.endsWith(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`)}convertTagsToTypeKeyMap(e,t,r,i){const o=new Map;for(const e of Object.values(i)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===H,isProperty:e.type===U,isResource:e.type===G,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 r=(0,_r.Enum)(fr).fromValue(e.tag);r&&o.set(r,t)}}return o}getTagSignature(e){switch(e._type){case H:case U:case G:return`[${e._configKey}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case fr.Property:case fr.Resource:return`[${t}]`;default:return t?`'${e}' tag '${t}'`:`'${e}' tag`}}},Sr=new class{concatenatePlainTextWithAstTexts(e,t,r){if(Array.isArray(e)){if(r=r&&r.trim()){const i=r.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:qe.hardBreak});for(let e=0;e<i.length;e++){const t=i[e];t&&o.push({text:t,type:qe.text}),e<i.length-1&&o.push({type:qe.hardBreak})}const a=e[e.length-1];a&&a.type===qe.paragraph?a.content=[...a.content??[],...o]:e.push({type:qe.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${r??""}`}},Pr=new Mt,Ir=new class{process(e,t,r,i,o,a,s,n){const l=[];let c,p;const d=s.length>0?this.trimBodyParts(s):void 0,u=n?d:Br.checkBody(e,t,r,i,d);if(i===x.json&&u){c=u.reduce((e,t)=>{if(t.type===De.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="",r="",o=0;const a=e=>`[!${e}]`;if(u)for(let i=0;i<u.length;i++){const s=u[i];if(s.type===De.text){const i=s,o=i.data.bodyText;i.data.isPlain?t=dt.concatenate(t,o):e=dt.concatenate(e,o),r=dt.concatenate(r,o)}else{const t=a(o);e=dt.concatenate(e,t),l.push(s),o++}}const s=i===x.bitmarkText?Pr.toAst(e,{format:i,location:We}):dt.unbreakscape(e,{format:x.plainText,location:We}),n=dt.unbreakscape(t,{format:x.plainText,location:We}),d=se.countOccurrencesAtEnd(e,"\n")+se.countOccurrencesAtStart(t,"\n");c=Sr.concatenatePlainTextWithAstTexts(s,d,n),p=dt.unbreakscape(r,{format:i,location:We}).trim();const m=Array.isArray(c)?c:void 0;if(m&&u){o=0;for(let e=0;e<u.length;e++){const t=u[e];if(t.type===De.text)continue;const r=t;let i;switch(t.type){case De.gap:case De.mark:case De.select:case De.highlight:i=r}i&&this.replacePlaceholderWithBodyBit(m,i,o),o++}}}return{body:c,bodyBits:l.length>0?l:void 0,bodyString:p}}buildBodyText(e,t){return{type:De.text,data:{bodyText:e,isPlain:t}}}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,a)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[a]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}trimBodyParts(e){let t=!1,r=e.reduce((e,r)=>{const i=r;if(t||i.type!==De.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e},[]);return t=!1,r=r.reduceRight((e,r)=>{const i=r;if(t||i.type!==De.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e},[]),r}};function Lr(e,t,r,i,o,a,s,n){const{bitConfig:l}=e;e.DEBUG_CARD_SET&&e.debugPrint("card set",i);let c={};const p=function(e,t){const r={cards:[],internalComments:[]};if(!t)return r;const{bitType:i}=e;let o=0,a=0,s=0;for(const n of t.cards){const t={no:o++,sides:[],qualifier:n.qualifier};r.cards.push(t);for(const o of n.sides){const n={no:a++,variants:[],qualifier:o.qualifier};t.sides.push(n);for(const l of o.variants){const{parser:o,content:c}=l,p={parser:o,no:s++,qualifier:l.qualifier};n.variants.push(p);const d=ve.getTagsConfigForCardSet(i,a,s),u=e.bitContentProcessor(yr,d,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",u),u.cardBody=Br.checkCardBody(e,yr,i,u.cardBody,t.no,n.no,p.no),u.cardBodyStr=u.cardBody?.bodyString,p.data=u,u.internalComments&&r.internalComments.push(...u.internalComments)}s=0}a=0}return r}(e,i),u=l.cardSet?.configKey;switch(u){case _:case C:c=function(e,t,r){const i=[],o=[];let a,s,n,l="",c=[],p=0,u={};const m=t===d.flashcard1,h=Vr(r);for(let g=0;g<r.cards.length;g++){const f=r.cards[g];if(!h||0!==g){a=void 0,s=void 0,c=[],p=0,u={};for(const e of f.sides)for(const t of e.variants){const{cardBody:e,resources:r,...i}=t.data;u={...u,...i};const o=r&&r.length>0?r[0]:void 0,d=e?.body;0===p?(n=t,l=e?.bodyString??"",a={text:d,icon:o}):1===p?s={text:d,icon:o}:c.push({text:d,icon:o}),p++}if(0!==g&&m){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${l}'`,n);break}if(ve.isOfBitType(t,[d.flashcard])){const e={question:a,answer:s,alternativeAnswers:c,...u};e&&i.push(e)}else{const e={term:a,definition:s,alternativeDefinitions:c,...u};e&&o.push(e)}}}return{heading:h?.heading,flashcards:i.length>0?i:void 0,definitions:o.length>0?o:void 0}}(e,t,p);break;case w:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=t.cardBody?.body??t.cardBodyStr??dt.EMPTY_STRING;i.push(r)}return{elements:i.length>0?i:void 0}}(0,0,p);break;case A:c=function(e,t,r,i,o){const a=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{statements:t,statement:r,...i}=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,...i};t&&a.push(t)}}i&&a.push(i);Array.isArray(o)&&o.length>0&&a.push(...o);return{statements:a.length>0?a:void 0}}(0,0,p,o,a);break;case S:c=function(e,t,r){let i;const o=[],a=Vr(r);for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(!a||0!==e){i=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];for(const t of r.variants){const r=t.data,{cardBody:a,cardBodyStr:s,choices:n,...l}=r;if(0===e){const e=[];if(n&&n.length>0)for(const t of n){const{__isDefaultExample:r,example:i,...o}=t,a={choice:o.choice,requireReason:o.isCorrect,__isDefaultExample:r,example:i};e.push(a)}i={...r,choices:e},i&&o.push(i)}else if(1===e){const e={text:s??"",__textAst:a?.body,...l};i&&(i.reason=e)}}}}}return{heading:a?.heading,feedbacks:o.length>0?o:void 0}}(0,0,p);break;case B:c=function(e,t,r,i,o){const a=[],s=ve.isOfBitType(t,d.multipleChoice),n=ve.isOfBitType(t,d.multipleResponse);if(!s&&!n)return{};let l,c=!1;for(const e of r.cards){c=!1,l=void 0;for(const t of e.sides)for(const e of t.variants){const{__isDefaultExample:t,example:r,...i}=e.data;if(c=!0===t||c,l=r||l,i.trueFalse&&i.trueFalse.length>0){const e=[];for(const t of i.trueFalse){const{__isDefaultExample:r,example:i,...o}=t,a=r||c,s=i||l,p={isCorrect:o.isCorrect,__isDefaultExample:a,example:s};n?p.response=o.text:p.choice=o.text,p&&e.push(p)}n?i.responses=e:i.choices=e}const o={...i,choices:i.choices,responses:i.responses,__isDefaultExample:c,__defaultExample:l};o&&a.push(o)}}if(s&&Array.isArray(i)&&i.length>0){const e={choices:i};e&&a.push(e)}if(n&&Array.isArray(o)&&o.length>0){const e={responses:o};e&&a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,p,s,n);break;case P:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r={question:t.cardBody?.body??t.cardBodyStr??dt.EMPTY_STRING,...t};r&&i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,p);break;case I:c=function(e,t,r){const i=[];let o,a,s,n,l=[],c=[],p={},u=!1;const m=ve.isOfBitType(t,d.matchMatrix),h=Vr(r,m),g=h?.isDefaultExampleCardSet??!1;let f=h?.exampleCardSet;for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(h&&0===e)continue;o=void 0,l=[],c=[],a=void 0,s=void 0,p={},u=!1,n=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];for(const t of r.variants){const{cardBody:r,cardBodyStr:i,resources:d,__isDefaultExample:m,example:h,...f}=t.data;if(u=!0===m||u,n=h||n,0===e)if(Array.isArray(d)&&d.length>0){const e=d[0];e.type===ne.audio?a=e:e.type===ne.image&&(s=e)}else o=i;else{const e=i??"",t=r?.body;l.push(e),c.push(t),!g&&!u||n||(n=t),delete f.item,delete f.lead}p={...p,...f}}}u&&(f=void 0);const d=u||g,m=n||f,b={key:o??"",keyAudio:a,keyImage:s,values:l,__valuesAst:c,...p,__isDefaultExample:d,example:m};b&&i.push(b)}return{heading:h?.heading,pairs:i.length>0?i:void 0}}(0,t,p);break;case E:c=function(e,t,r){let i,o;const a=[];let s,n,l,c,p=[],d=[],u=[],m={},h=!1,g=!1;const f=Vr(r,!0),b=f?.isDefaultExampleCardSet??!1;let y=f?.exampleCardSet;for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(f&&0===e)continue;i=void 0,o=void 0,p=[],d=[],u=[],h=!1,s=void 0,l=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];d=[],u=[],m={},g=!1,n=void 0,c=void 0;for(const t of r.variants){const r=t.data,{cardBody:a,cardBodyStr:p,__isDefaultExample:f,example:y,isCaseSensitive:k,...v}=r;if(g=!0===f||g,n=y||n,Object.assign(m,v),0===e)i=p,o=v,h=!0===f||h,s=y||s,l=null!=k?k:l;else{const e=p??dt.EMPTY_STRING,t=a?.body;d.push(e),u.push(t),!b&&!g||n||(n=t),c=null!=k?k:l}}if(e>0){g&&(s=y=void 0),h&&(y=void 0);const e=g||h||b,t=n||s||y,r={values:d,__valuesAst:u,...m,__isDefaultExample:e,example:t,isCaseSensitive:c};r&&p.push(r)}}const k={key:i??dt.EMPTY_STRING,cells:p,...o};k&&a.push(k)}return{heading:f?.heading,matrix:a.length>0?a:void 0}}(0,0,p);break;case F:c=function(e,t,r){const i=[];let o=[];for(const e of r.cards){o=[];for(const t of e.sides)for(const e of t.variants){const t=e.data,{title:r,cardBody:i,resources:a}=t,s=r&&r[1].titleAst,n=a&&a.length>0?a.find(e=>e.type===ne.audio):void 0,l={title:s??[],body:i?.body??[],audio:n};o.push(l)}i.push(o)}return{pronunciationTable:{data:i}}}(0,0,p);break;case N:case R:c=function(e,t,r){const i={header:[],body:[],footer:[]},o=t=>{if(!t)return;const r=t.trim().toLowerCase();return"table-header"===r?"header":"table-body"===r?"body":"table-footer"===r?"footer":void e.addWarning(`Unknown table section qualifier '${t}', defaulting to body.`)},a=(e,t)=>0===t&&e.sides.some(e=>e.variants.some(e=>{const t=e.data.title;return Array.isArray(t)&&t[1]?.titleAst})),s=(e,t)=>{if(!e)return;const r=e[t];return Array.isArray(r)?r[0]:r},n=(e,t)=>{const r=e.extraProperties;if(r){for(const e of t)Object.prototype.hasOwnProperty.call(r,e)&&delete r[e];0===Object.keys(r).length&&delete e.extraProperties}},l=(t,r)=>{if("string"==typeof t){const i=t.trim().toLowerCase();if("th"===i||"td"===i)return i;e.addWarning(`Invalid table cell type '${t}', using default for section '${r}'.`)}return"body"===r?"td":"th"},c=(t,r)=>{if(null==t)return 1;const i=zt.asNumber(t);return null==i||!Number.isInteger(i)||i<1?(e.addWarning(`Invalid table ${r} '${t}', defaulting to 1.`),1):i},p=t=>{if(null==t)return;if("string"!=typeof t)return void e.addWarning(`Invalid table scope '${t}', ignoring.`);const r=t.trim().toLowerCase();switch(r){case"row":case"col":case"rowgroup":case"colgroup":return r;default:return void e.addWarning(`Invalid table scope '${t}', ignoring.`)}},d=(e,t)=>{const r=e.data,i=r.title&&r.title[1]?.titleAst,o=r.cardBody?.body??r.cardBodyStr??dt.EMPTY_STRING,a=i??o,d=r.tableCellType??s(r.extraProperties,"tableCellType"),u=r.tableRowSpan??s(r.extraProperties,"tableRowSpan"),m=r.tableColSpan??s(r.extraProperties,"tableColSpan"),h=r.tableScope??s(r.extraProperties,"tableScope");n(r,["tableCellType","tableRowSpan","tableColSpan","tableScope"]);const g=l(d,t),f=c(u,"rowspan"),b=c(m,"colspan"),y=p(h),k={content:a};return"th"===g&&(k.title=!0),f>1&&(k.rowspan=f),b>1&&(k.colspan=b),y&&(k.scope=y),k},u=e=>{const t=o(e.qualifier);if(t)return t;for(const t of e.sides){const e=o(t.qualifier);if(e)return e;for(const e of t.variants){const t=o(e.qualifier);if(t)return t}}};for(let e=0;e<r.cards.length;e++){const t=r.cards[e],o=u(t),s=o||(a(t,e)?"header":"body"),n=[];for(const e of t.sides)for(const t of e.variants)n.push(d(t,s));i[s].push({cells:n})}const m={},h=i.header.length>0,g=i.body.length>0,f=i.footer.length>0;h&&(m.header={rows:i.header});g&&(m.body={rows:i.body});f&&(m.footer={rows:i.footer});h||g||f||(m.header={rows:[]},m.body={rows:[]},m.footer={rows:[]});return{table:m}}(e,0,p);break;case O:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{__instructionString:t,__itemString:r,reaction:o,cardBodyStr:a,...s}=e.data,n={response:t??dt.EMPTY_STRING,reaction:o??dt.EMPTY_STRING,feedback:a??dt.EMPTY_STRING,...s,item:r??dt.EMPTY_STRING};n&&i.push(n)}return{botResponses:i.length>0?i:void 0}}(0,0,p);break;case q:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{title:t,__instructionString:r,unit:o,unitAbbr:a,decimalPlaces:s,disableCalculation:n,cardBodyStr:l,cardBody:c,...p}=e.data,d=Array.isArray(t)&&t.length>0?t[t.length-1].titleString:void 0;let u=!1,m=zt.asNumber(r);if(c&&c.bodyBits){const e=c.bodyBits.find(e=>e.type===De.select);e&&(m=e.__instructionString?zt.asNumber(e.__instructionString):m,e.options&&e.options.length>0&&(u=e.options[0].isCorrect))}const h={title:d,checked:u,ingredient:l,quantity:m,unit:o??dt.EMPTY_STRING,unitAbbr:a??dt.EMPTY_STRING,decimalPlaces:s??1,disableCalculation:n,...p};h&&i.push(h)}return{ingredients:i.length>0?i:void 0}}(0,0,p);break;case M:case D:case z:c=function(e,t,r,i){const o=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{cardBody:t,...r}=e.data,i={body:t,...r};i&&o.push(i)}return{cardBits:o.length>0?o:void 0}}(0,0,0,p)}return c.internalComments=p.internalComments.length>0?p.internalComments:void 0,c}function Vr(e,t=!1){let r,i,o=!1;const a=[];let s,n=!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 r=t.variants[0].data,{title:c,__isDefaultExample:p,example:d}=r,u=c&&c[1].titleString;null!=u&&(o=!0),0===e?o&&(i=u,n=!0===p||n,s=d||s):o&&(a.push(u??""),n=!0===p||n,s=d||s)}if(o){let e=a;e=t?a:a.length>=1?a[a.length-1]:"",r={forKeys:i??"",forValues:e}}return r?{heading:r,isDefaultExampleCardSet:n,exampleCardSet:s}:void 0}function Er(e,t,r,i,o){const{type:a,value:s}=i,{textFormat:n}=e,l=new Mt,c=se.trimmedString(s);switch(a){case fr.Instruction:o.instruction=l.toAst(c,{format:n,location:je}),o.__instructionString=dt.unbreakscape(c,{format:x.bitmarkText,location:je});break;case fr.Hint:o.hint=l.toAst(c,{format:n,location:je}),o.__hintString=dt.unbreakscape(c,{format:x.bitmarkText,location:je});break;case fr.Anchor:o.anchor=dt.unbreakscape(c,{format:x.bitmarkText,location:je});break;case fr.Reference:o.reference=dt.unbreakscape(c,{format:x.bitmarkText,location:je});break;case fr.SampleSolution:o.sampleSolution=dt.unbreakscape(c,{format:x.bitmarkText,location:je}),o.__sampleSolutionAst=l.toAst(c,{format:n,location:je}),e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",i)}}var Nr=new Mt,Rr=new class{process(e,t,r,i,o,a){const{textFormat:s}=e;let n;o=o.trimStart(),a=a.trimEnd();const l=!!o.trim(),c=!!a.trim();let p=0;if(l&&c&&(p=se.countOccurrencesAtEnd(o,"\n")+se.countOccurrencesAtStart(a,"\n")),o||a){const r=s===x.bitmarkText;o&&(o=Br.checkFooter(e,t,o));const i=r?Nr.toAst(o,{format:s,location:We}):dt.unbreakscape(o,{format:x.plainText,location:We}),l=dt.unbreakscape(a,{format:x.plainText,location:We});n=Sr.concatenatePlainTextWithAstTexts(i,p,l)}return n?{footer:n}:void 0}},Fr=r(722),Or=new Mt;function Dr(e,t,r,i,o,a){if(t===kr)!function(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=o.solutions,l=o.__solutionsAst;if(n&&l&&se.isString(s)){const e=se.trimmedString(s);n.push(dt.unbreakscape(e,{format:x.bitmarkText,location:je}));const t=Or.toAst(e,{format:a,location:je});l.push(t)}}(e,0,0,i,o);else{const t=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",i);const o=ve.getTagConfigForTag(r,(0,Fr.Enum)(f).fromValue(i.type)),a=[i,...i.chain??[]],s=e.bitContentProcessor(kr,o?.chain,a);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",s);const n={type:De.gap,...s};return n}(e,0,r,i);t&&a.push(t)}}var Mr=r(722);function qr(e,t,r,i,o){t===kr?function(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=new Mt,l=se.trimmedString(s);o.itemLead||(o.itemLead=[]);const c=n.toAst(l,{format:a,location:je});o.itemLead.push(c),o.__itemLeadString||(o.__itemLeadString=[]),o.__itemLeadString.push(dt.unbreakscape(l,{format:x.bitmarkText,location:je}))}(e,0,0,i,o):function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("item lead content",i);const a=ve.getTagConfigForTag(r,(0,Mr.Enum)(f).fromValue(i.type)),s=[i,...i.chain??[]],n=e.bitContentProcessor(kr,a?.chain,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("item lead TAGS",n);o.itemLead=n.itemLead,o.__itemLeadString=n.__itemLeadString}(e,0,r,i,o)}var zr=r(722);function $r(e,t,r,i,o,a){if(t===kr)!function(e,t,r,i){const{value:o}=r;se.isString(o)&&(i.solution=se.trimmedString(o))}(0,0,i,o);else{const t=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",i);const o=ve.getTagConfigForTag(r,(0,zr.Enum)(f).fromValue(i.type)),a=e.bitContentProcessor(kr,r,[i]),s=e.bitContentProcessor(kr,o?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",s);const{solution:n}=a,{mark:l,...c}=s,p={type:De.mark,solution:n??"",mark:ht.asSingle(l)??"",...c};return p}(e,0,r,i);t&&a.push(t)}}var Jr=r(722);function jr(e,t,r,i,o){t===kr||function(e,t,r,i,o){const{bitConfig:a}=e;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",i);const s=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:l}=s,c=dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:je}),p=a.tags[ce.property_book];if(p&&(p.maxCount===u||p.maxCount>1))return Array.isArray(o.book)||(o.book=[]),void o.book.push({book:c,reference:n??"",referenceEnd:l??void 0});o.book=c,o.reference=n,o.referenceEnd=l}(e,0,r,i,o)}var Wr=new Mt;function Hr(e,t,r,i){const{bitType:o}=e,{value:a}=r,s=a;ve.isOfBitType(o,[d.cloze,d.clozeAndMultipleChoiceText,d.multipleChoiceText,d.highlightText,d.trueFalse,d.trueFalse1,d.multipleResponse,d.multipleResponse1,d.multipleChoice,d.multipleChoice1])?function(e,t,r,i){const{bitType:o,textFormat:a}=e;let s;Array.isArray(i.trueFalse)&&i.trueFalse.length>0&&(s=i.trueFalse[i.trueFalse.length-1]??void 0);s?!0===r?(s.__isDefaultExample=!0,s.example=!!s.isCorrect):qt.isBooleanString(r)?s.example=qt.toBoolean(r):(s.__isDefaultExample=!0,s.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t)):Array.isArray(i.__solutionsAst)&&i.__solutionsAst.length>0?i.example=!0===r?i.__solutionsAst[i.__solutionsAst.length-1]??void 0:r?Wr.toAst(r,{format:a,location:je}):void 0:ve.isOfBitType(o,[d.multipleChoiceText,d.highlightText,d.trueFalse,d.trueFalse1,d.multipleResponse,d.multipleResponse1])?function(e,t,r,i){if(!0===r)i.__isDefaultExample=!0,i.example=void 0;else{const o=r?dt.unbreakscape(r,{format:x.bitmarkText,location:je}):void 0;qt.isBooleanString(o)?i.example=qt.toBoolean(o):(i.__isDefaultExample=!0,i.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t))}}(e,t,r,i):ve.isOfBitType(o,[d.clozeAndMultipleChoiceText,d.multipleChoice,d.multipleChoice1])?(i.__isDefaultExample=!0,i.example=void 0,!0!==r&&e.addWarning("At this level, only default [@example] is allowed, using default",t)):Ur(e,t,r,i)}(e,r,s,i):ve.isOfBitType(o,d.mark)?function(e,t,r,i){i.__isDefaultExample=!0,i.example=void 0,!0!==r&&e.addWarning("Only default [@example] is allowed, using default",t)}(e,r,s,i):Ur(e,r,s,i)}function Ur(e,t,r,i){const{textFormat:o}=e;!0===r||"true"===r?(i.__isDefaultExample=!0,i.example=void 0):i.example=r?Wr.toAst(r,{format:o,location:je}):void 0}var Gr=r(722);function Kr(e,t,r,i,o){t===kr?function(e,t,r,i,o){const{value:a}=i,s=dt.unbreakscape(se.trimmedString(a),{format:x.bitmarkText,location:je});o.imageSourceUrl=s}(0,0,0,i,o):function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",i);const{key:a}=i,s=ve.getTagConfigForTag(r,(0,Gr.Enum)(ce).fromValue(a)),n=e.bitContentProcessor(kr,r,[i]),l=e.bitContentProcessor(kr,s?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",l);const{imageSourceUrl:c}=n,{mockupId:p,...d}=l;c||e.addWarning("[@imageSource] is missing the image url",i);p||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",i);const u={url:c??"",mockupId:p??"",...d};o.imageSource=u}(e,0,r,i,o)}var Yr=r(722);function Qr(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("person content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("person TAGS",a);const{propertyTitle:s,resources:n}=a,l=dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:je}),c=se.trimmedString(s),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||ne.image!==e.type?i.push(e):r=e;i.length>0&&e.addWarning(`${i.length} excess resource(s) present in the [@person] chain.`);return r}(e,n),d={name:l,title:c,avatarImage:p};o.person=d}var Xr=new Mt;var Zr=new Mt;function ei(e,t,r,i,o){const{value:a}=i,{key:s}=i,n=t===kr,l=ve.getTagConfigForTag(r,(0,Jr.Enum)(ae).fromValue(s)),c=l?l.configKey:void 0;let p=de(s);if(c===ce.property_internalComment)return void function(e,t,r,i){if(!i.internalComments)return;const{value:o}=r,a=se.isString(o)?se.trimmedString(o):void 0;a&&i.internalComments.push(a)}(0,0,i,o);if(l){if(c===ce.property_example)return void Hr(e,0,i,o);if(c===ce.property_groupTag)return void function(e,t,r,i,o){const{value:a}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("groupTag content",i);const s=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("groupTag TAGS",s);const{tag:n}=s,l={name:se.trimmedString(a)??"",tags:n??[]};Array.isArray(o.groupTag)||(o.groupTag=[]),o.groupTag.push(l)}(e,0,l.chain,i,o);if(c===ce.property_ratingLevelStart||c===ce.property_ratingLevelEnd)return void function(e,t,r,i,o){const{textFormat:a}=e,{key:s,value:n}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("ratingLevel content",i);const l=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("ratingLevel TAGS",l);const{label:c}=l,p={level:zt.asNumber(n)??0,label:c?Xr.toAst(c,{format:a,location:je}):void 0};switch(s){case ce.property_ratingLevelStart:o.ratingLevelStart=p;break;case ce.property_ratingLevelEnd:o.ratingLevelEnd=p}}(e,0,l.chain,i,o);if(c===ce.property_technicalTerm)return void function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("technicalTerm content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("technicalTerm TAGS",a);const{lang:s}=a,n={technicalTerm:dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:je}),lang:s};o.technicalTerm=n}(e,0,l.chain,i,o);if(c===ce.property_servings)return void function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("servings content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("servings TAGS",a);const{unit:s,unitAbbr:n,decimalPlaces:l,disableCalculation:c,__hintString:p}=a,d={servings:zt.asNumber(i.value)??1,unit:s,unitAbbr:n,decimalPlaces:l??1,disableCalculation:c,hint:p};o.servings=d}(e,0,l.chain,i,o);if(c===ce.property_person||c===ce.property_partner)return void Qr(e,0,l.chain,i,o);if(c===ce.property_imageSource)return void Kr(e,t,r,i,o);if(c===ce.property_book)return void jr(e,t,l.chain,i,o);if(c===ce.property_mark&&!n)return void function(e,t,r,i,o){const{key:a}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",i);const s=o.markConfig;if(!s)return;const n=ve.getTagConfigForTag(r,(0,Yr.Enum)(ce).fromValue(a)),{mark:l,...c}=e.bitContentProcessor(kr,n?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const p={mark:dt.unbreakscape(se.trimmedString(i.value)??"unknown",{format:x.bitmarkText,location:je}),emphasis:"underline",...c};p&&s.push(p)}(e,0,r,i,o);c===ce.property_title&&n&&(p="propertyTitle")}const d=(e,t,r,i)=>{if(r=(e=>{if(null!=e){if(i)switch(i.format){case b:return dt.unbreakscape(se.isString(e)?se.trimmedString(e):void 0,{format:x.plainText,location:je});case k:return zt.asNumber(dt.unbreakscape(e,{format:x.plainText,location:je}));case v:return qt.toBoolean(dt.unbreakscape(e,{format:x.plainText,location:je}),!0);case T:return!qt.toBoolean(dt.unbreakscape(e,{format:x.plainText,location:je}),!0);case y:return e=se.isString(e)?e:"",Zr.toAst(e,{format:x.bitmarkText,location:je})}return dt.unbreakscape(e,{format:x.plainText,location:je})}})(r),null==i||i.array)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r];else e[t]=r};d(l?o:o.extraProperties,p,a,l),c===ce.property_sampleSolution&&d(o,"__sampleSolutionAst",a,new X({configKey:ce.property_sampleSolution,tag:"sampleSolution",maxCount:1,minCount:1,chain:void 0,jsonKey:void 0,format:y,defaultValue:void 0,deprecated:void 0}))}function ti(e,t,r,i,o,a){const{value:s}=i,n=se.trimmedString(s);a?o.referenceEnd=dt.unbreakscape(n,{format:x.bitmarkText,location:je}):o.reference=dt.unbreakscape(n,{format:x.bitmarkText,location:je})}var ri=r(722),ii=new Gt;function oi(e,t,r,i,o){const{type:a,key:s,value:n,chain:l}=i,c=o.resources;if(!c)return;const p=(0,ri.Enum)(ce).fromValue(s);if(!p)return;const d=(0,ri.Enum)(ne).fromKey(p.replace(/^&/,""))??ne.unknown,u=ve.getTagConfigForTag(r,p),{posterImage:m,...h}=e.bitContentProcessor(kr,u?.chain,l);let g;if(m){const{subConfig:t,subChain:r}=function(e,t,r){let i;e&&(i=e[r]?.chain);const o=t?.reduce((e,t)=>{if(e)return e;const i=t;return i.key===r?i.chain:void 0},void 0);return{subConfig:i,subChain:o}}(u?.chain,l,ce.property_posterImage),{posterImage:i,...o}=e.bitContentProcessor(kr,t,r);g=ii.resource(e,{type:ne.image,value:m,...o}).image}const f=ii.resource(e,{type:d,value:dt.unbreakscape(n,{format:x.bitmarkText,location:je}),posterImage:g,...h});f&&(p===ce.resource_backgroundWallpaper||p===ce.resource_imagePlaceholder||p===ce.resource_platformIcon||p===ce.resource_platformLogo||p===ce.resource_platformBackgroundImage||p===ce.resource_previewImage||p===ce.resource_previewVideo||p===ce.resource_coverImage?o.propertyStyleResources&&(o.propertyStyleResources[d]?(Array.isArray(o.propertyStyleResources[d])||(o.propertyStyleResources[d]=[o.propertyStyleResources[d]]),o.propertyStyleResources[d].push(f)):o.propertyStyleResources[d]=f):c.push(f))}var ai=new Mt;function si(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=o.title;if(!n)return;const l=s,c=se.trimmedString(l.title);n[l.level.length]={titleAst:ai.toAst(c??"",{format:a,location:je}),titleString:c??""}}var ni=new Mt;function li(e,t,r,i,o,a){t===kr?function(e,t,r,i){const{textFormat:o}=e,{type:a,value:s}=r,n=i.trueFalse;if(!n)return;const l=dt.unbreakscape(se.trimmedString(s),{format:x.bitmarkText,location:je}),c=ni.toAst(l??"",{format:o,location:je});n.push({text:l,textAst:c,isCorrect:a===fr.True,__isDefaultExample:!1})}(e,0,i,o):function(e,t,r,i,o,a){const{bitType:s}=e,n=[i,...i.chain??[]],l=o.statements,c=o.choices,p=o.responses;if(!(l&&c&&p&&a))return;if(ve.isOfBitType(s,d.trueFalse1))o.statement=function(e,t,r){const{bitType:i}=e;if(!ve.isOfBitType(i,d.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const{trueFalse:o,...a}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",a);let s,n;o&&o.length>0&&(n=o[0]);if(n){const{statement:e,...t}=a;s={...n,statement:n.text,...t}}return s}(e,r,n);else if(ve.isOfBitType(s,[d.trueFalse,d.multipleChoice,d.multipleChoice1,d.multipleResponse,d.multipleResponse1,d.feedback])){const t=function(e,t,r){const{bitType:i}=e,o=ve.isOfBitType(i,d.trueFalse),a=ve.isOfBitType(i,[d.multipleChoice,d.multipleChoice1,d.feedback]),s=ve.isOfBitType(i,[d.multipleResponse,d.multipleResponse1]);if(!o&&!a&&!s)return{};const n=[],l=[],c=[],p=e.splitBitContent(r,[fr.True,fr.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",p);for(const r of p){const{trueFalse:i,...p}=e.bitContentProcessor(kr,t,r);let d;if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",p),i&&i.length>0&&(d=i[0]),d)if(o){const{statement:e,...t}=p,r={...d,statement:d.textAst??[],...t};r&&n.push(r)}else if(a){const e={...d,choice:d.text,...p};e&&l.push(e)}else if(s){const e={...d,response:d.text,...p};e&&c.push(e)}}const u={};o?u.statements=n:a?u.choices=l:s&&(u.responses=c);return u}(e,r,n);t.statements&&l.push(...t.statements),t.choices&&c.push(...t.choices),t.responses&&p.push(...t.responses)}else if(ve.isOfBitType(s,d.highlightText)){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const{trueFalse:i,...o}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",{trueFalse:i,...o});const a=[];if(i)for(const e of i){const t={...e,isHighlighted:!1};t&&a.push(t)}const s={type:De.highlight,texts:a,...o};return s}(e,r,n);t&&a.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const{trueFalse:i,...o}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",{trueFalse:i,...o});const a=[];if(i)for(const e of i){const t=e;t&&a.push(t)}const s={type:De.select,options:a,...o};return s}(e,r,n);t&&a.push(t)}}(e,0,r,i,o,a)}var ci=!1,pi=!0,di=!0,ui=!0,mi=!0,hi=new Kt,gi=class{constructor(e){l(this,"context"),l(this,"nonFatalWarnings",[]),l(this,"nonFatalErrors",[]),l(this,"parser",{}),l(this,"parse"),l(this,"parserText"),l(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={bitConfig:ve.getBitConfig(d._error),bitType:d._error,textFormat:x.bitmarkText,DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:ci,DEBUG_BIT_CONTENT:pi,DEBUG_BIT_TAGS:di,DEBUG_BODY:ui,DEBUG_FOOTER:mi,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 r=[];for(const i of e){if(!i)continue;const e=i.value;e?t.push(e):r=r.concat(i.errors??[])}return hi.buildBitmark({bits:t,errors:r.length>0?r:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:o,bitLevel:a,isCommented:s}=e;if(!r||ve.isOfBitType(r,d._error))return this.invalidBit();const n=ve.getBitConfig(r);this.context.bitConfig=n,this.context.bitType=r,this.context.textFormat=i,this.context.resourceType=o;const l=ve.isOfBitType(r,d.trueFalse1),c=ve.isOfBitType(r,d.multipleChoice1),p=ve.isOfBitType(r,d.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=this.squashUnwantedInlineBodyBits(t),t=Br.validateBitTags(this.context,t);const{body:m,footer:h,cardSet:g,title:f,statement:b,statements:y,choices:k,responses:v,propertyStyleResources:T,resources:x,posterImage:_,internalComments:C,...w}=this.bitContentProcessor(br,n.tags,t);this.debugPrint("BIT TAGS",w),this.debugPrint("BIT BODY",m),this.debugPrint("BIT FOOTER",h);const A=function(e,t,r){if(r=r??[],ve.isOfBitType(t,d.chapter)){let e;return r.length>0&&(e=r[r.length-1]),{title:e?.titleAst??[],titleString:e?.titleString??"",level:r.length>0?r.length-1:void 0}}return Array.isArray(r)?{title:r[1]?.titleAst??void 0,titleString:r[1]?.titleString??void 0,subtitle:r[2]?.titleAst??void 0,subtitleString:r[2]?.titleString??void 0}:{title:void 0,titleString:r??void 0,subtitle:void 0,subtitleString:void 0}}(this.context,r,f),B=Lr(this.context,r,0,g,b,y,k,v),S=function(e,t,r){const{bitType:i}=e,o=[],a=[],s=(0,ri.Enum)(ne).fromValue(t),n=ve.getBitResourcesConfig(i,s),l=n.resourceAttachmentAllowed,c=n.getCountsMin(),p=n.getCountsMax();if(r)for(const t of r.reverse()){const r=t.__configKey;let i=c.get(r)??0,s=p.get(r)??0;i=Math.max(0,i-1),s===u?o.unshift(t):s>0?(o.unshift(t),s--):a.unshift(t),c.set(r,i),p.set(r,s),t.__invalid&&e.addWarning(`Resource type [&${t.type}] is not valid`)}if(!l&&t){const r=`Resource type [&${t}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(r)}else 0===o.length&&t&&e.addWarning(`Resource type [&${t}] is specified in the bit header, but no such resource is present`);return a.forEach(e=>{e.__excessResource=!0,o.push(e)}),o}(this.context,o,x),P=[...C??[],...B.internalComments??[]],I=this.buildBitLevelWarnings(),L=this.buildBitLevelErrors();I&&(this.parser.warnings=I),L&&(this.parser.errors=L);return{value:hi.buildBit({bitType:r,bitLevel:a,isCommented:s,textFormat:i,resourceType:o,...A,posterImage:_,statement:l?b:void 0,choices:c?k:void 0,responses:p?v:void 0,...w,...T,resources:S,...B,body:m,footer:h,internalComment:P,parser:this.parser})}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:hi.buildBit({bitType:ve.getBitType(d._error),bitLevel:1,parser:this.parser})}}buildBitHeader(e,t,r){const i=dt.unbreakscape(e,{format:x.plainText,location:je}),o=ve.getBitType(i),a=ve.isBitTypeCommented(i);ve.isOfBitType(o,d._error)&&this.addError(`Invalid bit type: '${i}'`);const s=ve.getBitConfig(o);t>ve.bitLevelMax?(this.addWarning(`Bit level of ${t} too high, setting to max value of ${ve.bitLevelMax}`),t=ve.bitLevelMax):t<ve.bitLevelMin&&(this.addWarning(`Bit level of ${t} too low, setting to min value of ${ve.bitLevelMin}`),t=ve.bitLevelMin);let n=(0,xr.Enum)(x).fromValue(r.textFormat);r.textFormat&&!n&&this.addWarning(`Invalid text format '${r.textFormat}', defaulting to '${He.bitmarkPlusPlus}'`);const l=(0,xr.Enum)(ut).fromValue(r.textFormat);l&&(n=x.bitmarkText,this.addWarning(`${l} text format is deprecated. Bit will be parsed as '${He.bitmarkPlusPlus}'`)),n=n??s.textFormatDefault;const c=(0,xr.Enum)(ne).fromValue(r.resourceType);return r.resourceType&&!c&&this.addWarning(`Invalid resource type '${r.resourceType}', it will be ignored`),{bitType:o,bitLevel:t,textFormat:n??s.textFormatDefault,resourceType:c,isCommented:a}}buildTextAndResourceType(e,t){const r={},i=e=>{if(e){const t=dt.unbreakscape(se.string(e.value),{format:x.plainText,location:je});e.type===fr.TextFormat?r.textFormat=t:r.resourceType=t}};return i(e),i(t),r}resetParserState(){this.context.state={}}squashUnwantedInlineBodyBits(e){const t=[];if(!e)return t;const{textFormat:r}=this.context,i=r===x.bitmarkText,o=(e,t="")=>{const{chain:r,parser:i}=e;if(t+=i.text,r)for(const e of r)t=o(e,t);return t};let a=!1;for(const r of e){const{type:e,value:s}=r,n=s??"";let l=!1;if(a||(e===fr.BodyText&&!i&&n&&n.trim()&&(a=!0),e===fr.PlainTextDivider&&(a=!0,l=!0)),l)t.push({type:fr.BodyText,value:"\n"});else if(a)if(e===fr.BodyText)t.push({type:fr.BodyTextPlain,value:s});else{const e=o(r);t.push({type:fr.BodyTextPlain,value:e})}else t.push(r)}return t}bitContentProcessor(e,t,r){const i={};if(!r)return i;const{bitType:o,textFormat:a}=this.context;i.title=[],i.solutions=[],i.__solutionsAst=[],i.statements=[],i.choices=[],i.responses=[],i.propertyStyleResources={},i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.internalComments=[];let s=!1,n=!1;const l=[];let c=dt.EMPTY_STRING,p=dt.EMPTY_STRING,d=dt.EMPTY_STRING,u=dt.EMPTY_STRING;const m=e===br,h=e===yr,g=e===kr,f=()=>{if(c){c=Br.checkBodyPart(this.context,e,c);const t=Ir.buildBodyText(c,!1);l.push(t)}c=dt.EMPTY_STRING};for(const o of r){const{type:r,value:a}=o;switch(r){case fr.ItemLead:qr(this.context,e,t,o,i);break;case fr.Instruction:case fr.Hint:case fr.Anchor:case fr.SampleSolution:Er(this.context,0,0,o,i);break;case fr.Reference:ti(this.context,0,0,o,i,s),s=!0;break;case fr.Title:si(this.context,0,0,o,i);break;case fr.Property:ei(this.context,e,t,o,i);break;case fr.Gap:g||f(),Dr(this.context,e,t,o,i,l);break;case fr.Mark:g||f(),$r(this.context,e,t,o,i,l);break;case fr.True:case fr.False:g||f(),li(this.context,e,t,o,i,l);break;case fr.Resource:oi(this.context,0,t,o,i);break;case fr.CardSet:i.cardSet=a,n=!0;break;case fr.BodyText:case fr.CardText:n?p=dt.concatenate(p,a):c=dt.concatenate(c,a);break;case fr.BodyTextPlain:n?u=dt.concatenate(u,a):d=dt.concatenate(d,a);break;case fr.FooterDivider:n&&(p=dt.concatenate(p,a)),n=!0}}f();const b=d?Ir.buildBodyText(d,!0):void 0;if(b&&l.push(b),i.itemLead){const e=i.itemLead.length;e>0&&(i.item=i.itemLead[0]),e>1&&(i.lead=i.itemLead[1]),e>2&&(i.pageNumber=i.itemLead[2]),e>3&&(i.marginNumber=i.itemLead[e-1])}if(i.__itemLeadString){const e=i.__itemLeadString.length;e>0&&(i.__itemString=i.__itemLeadString[0]),e>1&&(i.__leadString=i.__itemLeadString[1]),e>2&&(i.__pageNumberString=i.__itemLeadString[2]),e>3&&(i.__marginNumberString=i.__itemLeadString[e-1])}return m?i.body=Ir.process(this.context,e,o,a,t,i,l,!1):h&&(i.cardBody=Ir.process(this.context,e,o,a,t,i,l,!0)),i.footer=Rr.process(this.context,e,t,i,p,u),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===Object.keys(i.propertyStyleResources).length&&delete i.propertyStyleResources,0===i.resources.length&&delete i.resources,0===i.internalComments.length&&delete i.internalComments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}addWarning(e,t,r){const i={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:r?.parser??void 0};i.original||delete i.original,this.nonFatalWarnings.push(i)}addError(e,t,r){const i={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:r?.parser??void 0};i.original||delete i.original,this.nonFatalErrors.push(i)}debugPrint(e,t){}},fi=class extends SyntaxError{constructor(e,t,r,i){super(e),this.expected=t,this.found=r,this.location=i,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null;const i=e.find(e=>e.source===this.location.source);i&&(r=i.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,s=this.location.source+":"+a.line+":"+a.column;if(r){const e=this.location.end,i="".padEnd(a.line.toString().length," "),n=r[o.line-1],l=(o.line===e.line?e.column:n.length+1)-o.column||1;t+="\n --\x3e "+s+"\n"+i+" |\n"+a.line+" | "+n+"\n"+i+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}const i=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return i?e.replace(i,e=>"\\u{"+r(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function s(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}const n={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return n[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],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 bi=function e(t,r){const i={},o=(r=void 0!==r?r:{}).grammarSource,a={bitmark:nt,bit:function(){let e,t,r,o,a;e=He,t=[],r=Et();for(;r!==i;)t.push(r),r=Et();if(r=pt(),r!==i){for(o=[],a=Et();a!==i;)o.push(a),a=Et();Ue=e,e=r}else He=e,e=i;return e},cardContent:function(){let e,t,r;e=He,t=[],r=ht(),r===i&&(r=wt());for(;r!==i;)t.push(r),r=ht(),r===i&&(r=wt());return Ue=e,t=We(t),e=t,e}};let s=nt;const n="[.",l="]",c="[",p=":",d="&",u="$$$$",m="====",h="text",g="~~~~",f="footer",b=" ",y="--",k="++",v="===",T="==",x="[@id",_="#",C="[▼",w="[►",A="[@",B="[%",S="[!",P="[?",I="[+",L="[-",V="[$",E="[_",N="[=",R="[&",F="^]",O="id:",D=".",M="\n",q="\r\n",z=/^[^\]]/,$=/^[a-z]/,J=/^[a-z0-9\-]/,j=/^[^:\]]/,W=/^[^&:\]]/,H=/^[^\n\r\u2028\u2029]/,U=/^[ \t]/,G=/^[\r\u2028-\u2029]/,K=/^[ \t\n\r\u2028\u2029]/,Y=et("[.",!1),Q=tt(["]"],!0,!1,!1),X=et("]",!1),Z=et("[",!1),ee=et(":",!1),te=et("&",!1),re={type:"any"},ie=et("$$$$",!1),oe=et("====",!1),ae=et("text",!1),se=et("~~~~",!1),ne=et("footer",!1),le=et(" ",!1),ce=et("--",!1),pe=et("++",!1),de=et("===",!1),ue=et("==",!1),me=tt([["a","z"]],!1,!1,!1),he=tt([["a","z"],["0","9"],"-"],!1,!1,!1),ge=et("[@id",!1),fe=et("#",!1),be=et("[▼",!1),ye=et("[►",!1),ke=et("[@",!1),ve=et("[%",!1),Te=et("[!",!1),xe=et("[?",!1),_e=et("[+",!1),Ce=et("[-",!1),we=et("[$",!1),Ae=et("[_",!1),Be=et("[=",!1),Se=et("[&",!1),Pe=et("^]",!1),Ie=et("id:",!1),Le=tt([":","]"],!0,!1,!1),Ve=et(".",!1),Ee=tt(["&",":","]"],!0,!1,!1),Ne=rt("Character"),Re=tt(["\n","\r","\u2028","\u2029"],!0,!1,!1),Fe=rt("Blank Line"),Oe=tt([" ","\t"],!1,!1,!1),De=rt("Line Terminator"),Me=et("\n",!1),qe=et("\r\n",!1),ze=tt(["\r",["\u2028","\u2029"]],!1,!1,!1),$e=rt("Whitespace, then Line Terminator"),Je=rt("whitespace"),je=tt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1,!1);function We(e){return Mt.handleCardContent(e)}let He=0|r.peg$currPos,Ue=He;const Ge=[{line:1,column:1}];let Ke,Ye=He,Qe=r.peg$maxFailExpected||[],Xe=0|r.peg$silentFails;if(r.startRule){if(!(r.startRule in a))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=a[r.startRule]}function Ze(){return t.substring(Ue,He)}function et(e,t){return{type:"literal",text:e,ignoreCase:t}}function tt(e,t,r,i){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:i}}function rt(e){return{type:"other",description:e}}function it(e){let r,i=Ge[e];if(i)return i;if(e>=Ge.length)r=Ge.length-1;else for(r=e;!Ge[--r];);for(i=Ge[r],i={line:i.line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Ge[e]=i,i}function ot(e,t,r){const i=it(e),a=it(t),s={source:o,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:a.line,column:a.column}};return r&&o&&"function"==typeof o.offset&&(s.start=o.offset(s.start),s.end=o.offset(s.end)),s}function at(e){He<Ye||(He>Ye&&(Ye=He,Qe=[]),Qe.push(e))}function st(e,t,r){return new fi(fi.buildMessage(e,t),e,t,r)}function nt(){let e;return e=function(){let e,r,o,a;e=He,r=[],o=Ft();for(;o!==i;)r.push(o),o=Ft();return o=function(){let e,r,o,a;e=He,r=He,o=[],a=ct();for(;a!==i;)o.push(a),a=ct();return r=t.substring(r,He),Ue=e,r=function(e){return Mt.handleRawBit(e)}(r),e=r,e}(),a=function(){let e,t;e=[],t=lt();for(;t!==i;)e.push(t),t=lt();return e}(),Ue=e,e=function(e,t){return qt.buildBits([e,...t])}(o,a),e}(),e}function lt(){let e,r,o,a;for(e=He,r=[],o=Et();o!==i;)r.push(o),o=Et();return o=Nt(),o===i&&(o=null),a=function(){let e,r,o,a,s,c;if(e=He,r=He,o=He,a=function(){let e,r,o,a;e=He,t.substr(He,2)===n?(r=n,He+=2):(r=i,0===Xe&&at(Y));if(r!==i){for(o=[],a=t.charAt(He),z.test(a)?He++:(a=i,0===Xe&&at(Q));a!==i;)o.push(a),a=t.charAt(He),z.test(a)?He++:(a=i,0===Xe&&at(Q));93===t.charCodeAt(He)?(a=l,He++):(a=i,0===Xe&&at(X)),a!==i?(Ue=e,e=r):(He=e,e=i)}else He=e,e=i;return e}(),a!==i){for(s=[],c=ct();c!==i;)s.push(c),c=ct();a=[a,s],o=a}else He=o,o=i;r=o!==i?t.substring(r,He):o;r!==i&&(Ue=e,p=r,r=Mt.handleRawBit(p));var p;return e=r,e}(),a!==i?(Ue=e,e=a):(He=e,e=i),e}function ct(){let e,t,r,o;if(e=He,t=Nt(),t!==i?(r=He,Xe++,o=dt(),Xe--,o===i?r=void 0:(He=r,r=i),r!==i?(t=[t,r],e=t):(He=e,e=i)):(He=e,e=i),e===i)if(e=[],t=Lt(),t!==i)for(;t!==i;)e.push(t),t=Lt();else e=i;return e}function pt(){let e,r,o;var a,s,n;return e=He,r=dt(),r!==i?(o=function(){let e,t,r;e=He,t=[],r=yt(),r===i&&(r=vt(),r===i&&(r=xt(),r===i&&(r=ht(),r===i&&(r=bt()))));for(;r!==i;)t.push(r),r=yt(),r===i&&(r=vt(),r===i&&(r=xt(),r===i&&(r=ht(),r===i&&(r=bt()))));return Ue=e,t=function(e){return Mt.handleBitContent(e)}(t),e=t,e}(),Ue=e,a=r,s=o,e=qt.buildBit(a,s)):(He=e,e=i),e===i&&(e=He,r=He,o=function(){let e,r;Xe++,e=[],t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re));for(;r!==i;)e.push(r),t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re));return Xe--,e}(),r=t.substring(r,He),Ue=e,n=r,r=qt.invalidBit(n),e=r),e}function dt(){let e,r,o,a,s,n;var p,d,u;return e=He,91===t.charCodeAt(He)?(r=c,He++):(r=i,0===Xe&&at(Z)),r!==i?(o=function(){let e,r,o;e=He,r=[],46===t.charCodeAt(He)?(o=D,He++):(o=i,0===Xe&&at(Ve));if(o!==i)for(;o!==i;)r.push(o),46===t.charCodeAt(He)?(o=D,He++):(o=i,0===Xe&&at(Ve));else r=i;r!==i&&(Ue=e,r=r.length);return e=r,e}(),o!==i?(a=Pt(),s=function(){let e,t,r;e=He,t=ut(),t===i&&(t=mt());t===i&&(t=null);r=ut(),r===i&&(r=mt());r===i&&(r=null);return Ue=e,e=function(e,t){return qt.buildTextAndResourceType(e,t)}(t,r),e}(),93===t.charCodeAt(He)?(n=l,He++):(n=i,0===Xe&&at(X)),n!==i?(Ue=e,p=o,d=a,u=s,e=qt.buildBitHeader(d,p,u)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i),e}function ut(){let e,r,o;var a;return e=He,58===t.charCodeAt(He)?(r=p,He++):(r=i,0===Xe&&at(ee)),r!==i?(o=Pt(),Ue=e,a=o,e=Mt.handleTextFormat(a)):(He=e,e=i),e}function mt(){let e,r,o;var a;return e=He,38===t.charCodeAt(He)?(r=d,He++):(r=i,0===Xe&&at(te)),r!==i?(o=Pt(),Ue=e,a=o,e=Mt.handleResourceType(a)):(He=e,e=i),e}function ht(){let e,t,r,o,a;if(e=He,t=He,r=ft(),r!==i){for(o=[],a=gt();a!==i;)o.push(a),a=gt();r=[r,o],t=r}else He=t,t=i;var s;return t!==i&&(Ue=e,s=t,t=Mt.handleTagChain(s)),e=t,e}function gt(){let e,t;return e=He,t=ft(),t!==i&&(Ue=e),e=t,e}function ft(){let e,r;var o;return e=He,r=function(){let e,r,o,a;e=He,t.substr(He,4)===x?(r=x,He+=4):(r=i,0===Xe&&at(ge));r!==i?(o=It(),o!==i?(a=function(){let e;93===t.charCodeAt(He)?(e=l,He++):(e=i,0===Xe&&at(X));return e}(),a!==i?(Ue=e,s=o,e=Mt.handlePropertyTag("id",s)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=He,t.substr(He,2)===A?(r=A,He+=2):(r=i,0===Xe&&at(ke));r!==i?(o=Bt(),o!==i?(a=It(),a!==i?(s=St(),s!==i?(Ue=e,n=o,l=a,e=Mt.handlePropertyTag(n,l)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);var n,l;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=He,91===t.charCodeAt(He)?(r=c,He++):(r=i,0===Xe&&at(Z));if(r!==i){if(o=[],35===t.charCodeAt(He)?(a=_,He++):(a=i,0===Xe&&at(fe)),a!==i)for(;a!==i;)o.push(a),35===t.charCodeAt(He)?(a=_,He++):(a=i,0===Xe&&at(fe));else o=i;o!==i?(a=At(),s=St(),s!==i?(Ue=e,n=o,l=a,e=Mt.handleTag(fr.Title,{level:n,title:l})):(He=e,e=i)):(He=e,e=i)}else He=e,e=i;var n,l;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===C?(r=C,He+=2):(r=i,0===Xe&&at(be));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Anchor,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===w?(r=w,He+=2):(r=i,0===Xe&&at(ye));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Reference,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===B?(r=B,He+=2):(r=i,0===Xe&&at(ve));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.ItemLead,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===S?(r=S,He+=2):(r=i,0===Xe&&at(Te));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Instruction,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===P?(r=P,He+=2):(r=i,0===Xe&&at(xe));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Hint,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===E?(r=E,He+=2):(r=i,0===Xe&&at(Ae));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Gap,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===N?(r=N,He+=2):(r=i,0===Xe&&at(Be));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.Mark,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===V?(r=V,He+=2):(r=i,0===Xe&&at(we));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.SampleSolution,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===I?(r=I,He+=2):(r=i,0===Xe&&at(_e));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.True,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=He,t.substr(He,2)===L?(r=L,He+=2):(r=i,0===Xe&&at(Ce));r!==i?(o=At(),a=St(),a!==i?(Ue=e,s=o,e=Mt.handleTag(fr.False,s)):(He=e,e=i)):(He=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=He,t.substr(He,2)===R?(r=R,He+=2):(r=i,0===Xe&&at(Se));r!==i?(o=Bt(),o!==i?(a=It(),a!==i?(s=St(),s!==i?(Ue=e,n=o,l=a,e=Mt.handleResourceTag(n,l)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);var n,l;return e}()))))))))))))),r!==i&&(Ue=e,o=r,r=Mt.handleBitTag(o)),e=r,e}function bt(){let e,r;return e=He,t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re)),r!==i&&(Ue=e,r={type:fr.BodyChar,value:r}),e=r,e}function yt(){let e;return e=function(){let e,t,r,o,a;e=He,t=He,r=Nt(),r!==i?(o=kt(),o!==i?(a=Rt(),a!==i?(r=[r,o,a],t=r):(He=t,t=i)):(He=t,t=i)):(He=t,t=i);t!==i&&(Ue=e,s=t,t=Mt.handleFooterDivider(s));var s;return e=t,e}(),e===i&&(e=function(){let e,r,o,a,s;e=He,r=He,o=Nt(),o!==i?(a=function(){let e,r,o,a,s,n;t.substr(He,4)===u?(e=u,He+=4):(e=i,0===Xe&&at(ie));if(e===i)if(e=He,t.substr(He,4)===m?(r=m,He+=4):(r=i,0===Xe&&at(oe)),r!==i){if(o=[],a=Ft(),a!==i)for(;a!==i;)o.push(a),a=Ft();else o=i;if(o!==i)if(t.substr(He,4)===h?(a=h,He+=4):(a=i,0===Xe&&at(ae)),a!==i){if(s=[],n=Ft(),n!==i)for(;n!==i;)s.push(n),n=Ft();else s=i;s!==i?(t.substr(He,4)===m?(n=m,He+=4):(n=i,0===Xe&&at(oe)),n!==i?(r=[r,o,a,s,n],e=r):(He=e,e=i)):(He=e,e=i)}else He=e,e=i;else He=e,e=i}else He=e,e=i;return e}(),a!==i?(s=Rt(),s!==i?(o=[o,a,s],r=o):(He=r,r=i)):(He=r,r=i)):(He=r,r=i);r!==i&&(Ue=e,n=r,r=Mt.handlePlainTextDivider(n));var n;return e=r,e}()),e}function kt(){let e,r,o,a,s,n;if(t.substr(He,4)===g?(e=g,He+=4):(e=i,0===Xe&&at(se)),e===i)if(e=He,t.substr(He,4)===m?(r=m,He+=4):(r=i,0===Xe&&at(oe)),r!==i){if(o=[],a=Ft(),a!==i)for(;a!==i;)o.push(a),a=Ft();else o=i;if(o!==i)if(t.substr(He,6)===f?(a=f,He+=6):(a=i,0===Xe&&at(ne)),a!==i){if(s=[],n=Ft(),n!==i)for(;n!==i;)s.push(n),n=Ft();else s=i;s!==i?(t.substr(He,4)===m?(n=m,He+=4):(n=i,0===Xe&&at(oe)),n!==i?(r=[r,o,a,s,n],e=r):(He=e,e=i)):(He=e,e=i)}else He=e,e=i;else He=e,e=i}else He=e,e=i;return e}function vt(){let e,r,o,a,s;if(e=He,r=He,o=function(){let e,r,o,a;e=He,r=[],o=Rt(),o===i&&(o=Nt());if(o!==i)for(;o!==i;)r.push(o),o=Rt(),o===i&&(o=Nt());else r=i;r!==i?(o=He,Xe++,a=function(){let e,r,o,a,s,n,l;e=He,t.substr(He,4)===m?(r=m,He+=4):(r=i,0===Xe&&at(oe));r!==i?(o=He,32===t.charCodeAt(He)?(a=b,He++):(a=i,0===Xe&&at(le)),a!==i?(s=Ct(),s!==i?(32===t.charCodeAt(He)?(n=b,He++):(n=i,0===Xe&&at(le)),n!==i?(t.substr(He,4)===m?(l=m,He+=4):(l=i,0===Xe&&at(oe)),l!==i?(a=[a,s,n,l],o=a):(He=o,o=i)):(He=o,o=i)):(He=o,o=i)):(He=o,o=i),o===i&&(o=null),a=Rt(),a===i&&(a=Dt()),a!==i?(r=[r,o,a],e=r):(He=e,e=i)):(He=e,e=i);return e}(),Xe--,a!==i?(He=o,o=void 0):o=i,o!==i?(Ue=e,e=void Mt.handleCardSetStart()):(He=e,e=i)):(He=e,e=i);return e}(),o!==i){for(a=[],s=Tt();s!==i;)a.push(s),s=Tt();s=function(){let e,t,r,o,a;e=He,t=He,r=kt(),r===i&&(r=null);o=He,Xe++,a=Dt(),Xe--,a!==i?(He=o,o=void 0):o=i;o!==i?(r=[r,o],t=r):(He=t,t=i);t!==i&&(Ue=e,t=void Mt.handleCardSetEnd());return e=t,e}(),s!==i?(o=[o,a,s],r=o):(He=r,r=i)}else He=r,r=i;var n;return r!==i&&(Ue=e,n=r,r=Mt.handleCardSet(n[1].flat())),e=r,e}function Tt(){let e,r;var o;return e=He,r=function(){let e,r;e=He,r=function(){let e,r,o,a,s,n,l;e=He,t.substr(He,4)===m?(r=m,He+=4):(r=i,0===Xe&&at(oe));r!==i?(32===t.charCodeAt(He)?(o=b,He++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(He)?(s=b,He++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(He,4)===m?(n=m,He+=4):(n=i,0===Xe&&at(oe)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(Ue=e,e=["====",a]):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);e===i&&(e=He,t.substr(He,4)===m?(r=m,He+=4):(r=i,0===Xe&&at(oe)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(Ue=e,e=["===="]):(He=e,e=i)):(He=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n,l;e=He,t.substr(He,2)===y?(r=y,He+=2):(r=i,0===Xe&&at(ce));r!==i?(32===t.charCodeAt(He)?(o=b,He++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(He)?(s=b,He++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(He,2)===y?(n=y,He+=2):(n=i,0===Xe&&at(ce)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(Ue=e,e=["--",a]):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);e===i&&(e=He,t.substr(He,2)===y?(r=y,He+=2):(r=i,0===Xe&&at(ce)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(Ue=e,e=["--"]):(He=e,e=i)):(He=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n,l;e=He,t.substr(He,2)===k?(r=k,He+=2):(r=i,0===Xe&&at(pe));r!==i?(32===t.charCodeAt(He)?(o=b,He++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(He)?(s=b,He++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(He,2)===k?(n=k,He+=2):(n=i,0===Xe&&at(pe)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(Ue=e,e=["++",a]):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i)):(He=e,e=i);e===i&&(e=He,t.substr(He,2)===k?(r=k,He+=2):(r=i,0===Xe&&at(pe)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(Ue=e,e=["++"]):(He=e,e=i)):(He=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n;e=He,r=He,Xe++,o=He,a=kt(),a!==i?(s=Dt(),s!==i?(a=[a,s],o=a):(He=o,o=i)):(He=o,o=i);Xe--,o===i?r=void 0:(He=r,r=i);if(r!==i){if(o=He,a=He,s=Vt(),n=Nt(),n!==i?(s=[s,n],a=s):(He=a,a=i),a===i){if(a=He,s=[],n=Lt(),n!==i)for(;n!==i;)s.push(n),n=Lt();else s=i;s!==i?(n=Ot(),n!==i?(s=[s,n],a=s):(He=a,a=i)):(He=a,a=i)}o=a!==i?t.substring(o,He):a,o!==i?(Ue=e,l=o,e=Mt.handleCardLine(l)):(He=e,e=i)}else He=e,e=i;var l;return e}())));r!==i&&(Ue=e,o=r,r=Mt.handleCardLineOrDivider(o,2));var o;return e=r,e}(),r!==i&&(Ue=e,o=r,r=Mt.handleCards(o)),e=r,e}function xt(){let e,r,o,a,s;if(e=He,r=He,o=function(){let e,r,o,a,s,n;e=He,r=[],o=Rt(),o===i&&(o=Nt());if(o!==i)for(;o!==i;)r.push(o),o=Rt(),o===i&&(o=Nt());else r=i;r!==i?(o=He,Xe++,a=He,t.substr(He,3)===v?(s=v,He+=3):(s=i,0===Xe&&at(de)),s!==i?(n=Rt(),n!==i?(s=[s,n],a=s):(He=a,a=i)):(He=a,a=i),Xe--,a!==i?(He=o,o=void 0):o=i,o!==i?(Ue=e,e=void Mt.handleCardSetStart()):(He=e,e=i)):(He=e,e=i);return e}(),o!==i){for(a=[],s=_t();s!==i;)a.push(s),s=_t();s=function(){let e,t,r,o,a;e=He,t=He,r=kt(),r===i&&(r=null);o=He,Xe++,a=Dt(),Xe--,a!==i?(He=o,o=void 0):o=i;o!==i?(r=[r,o],t=r):(He=t,t=i);t!==i&&(Ue=e,t=void Mt.handleCardSetEnd());return e=t,e}(),s!==i?(o=[o,a,s],r=o):(He=r,r=i)}else He=r,r=i;var n;return r!==i&&(Ue=e,n=r,r=Mt.handleCardSet(n[1].flat())),e=r,e}function _t(){let e,r;var o;return e=He,r=function(){let e,r,o,a;e=He,r=He,t.substr(He,3)===v?(o=v,He+=3):(o=i,0===Xe&&at(de));o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(He=r,r=i)):(He=r,r=i);r===i&&(r=He,t.substr(He,2)===T?(o=T,He+=2):(o=i,0===Xe&&at(ue)),o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(He=r,r=i)):(He=r,r=i),r===i&&(r=He,t.substr(He,2)===y?(o=y,He+=2):(o=i,0===Xe&&at(ce)),o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(He=r,r=i)):(He=r,r=i),r===i&&(r=function(){let e,r,o,a,s,n;e=He,r=He,Xe++,o=He,a=kt(),a!==i?(s=Dt(),s!==i?(a=[a,s],o=a):(He=o,o=i)):(He=o,o=i);Xe--,o===i?r=void 0:(He=r,r=i);if(r!==i){if(o=He,a=He,s=Vt(),n=Nt(),n!==i?(s=[s,n],a=s):(He=a,a=i),a===i){if(a=He,s=[],n=Lt(),n!==i)for(;n!==i;)s.push(n),n=Lt();else s=i;s!==i?(n=Ot(),n!==i?(s=[s,n],a=s):(He=a,a=i)):(He=a,a=i)}o=a!==i?t.substring(o,He):a,o!==i?(Ue=e,l=o,e=Mt.handleCardLine(l)):(He=e,e=i)}else He=e,e=i;var l;return e}())));r!==i&&(Ue=e,s=r,r=Mt.handleCardLineOrDivider(s,1));var s;return e=r,e}(),r!==i&&(Ue=e,o=r,r=Mt.handleCards(o)),e=r,e}function Ct(){let e,r,o;return e=He,r=He,Xe++,t.substr(He,6)===f?(o=f,He+=6):(o=i,0===Xe&&at(ne)),o===i&&(t.substr(He,4)===h?(o=h,He+=4):(o=i,0===Xe&&at(ae))),Xe--,o===i?r=void 0:(He=r,r=i),r!==i?(o=function(){let e,r,o,a,s;e=He,r=He,o=t.charAt(He),$.test(o)?He++:(o=i,0===Xe&&at(me));if(o!==i){for(a=[],s=t.charAt(He),J.test(s)?He++:(s=i,0===Xe&&at(he));s!==i;)a.push(s),s=t.charAt(He),J.test(s)?He++:(s=i,0===Xe&&at(he));o=[o,a],r=o}else He=r,r=i;e=r!==i?t.substring(e,He):r;return e}(),o!==i?(Ue=e,e=o):(He=e,e=i)):(He=e,e=i),e}function wt(){let e,r;return e=He,t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re)),r!==i&&(Ue=e,r={type:fr.CardChar,value:r}),e=r,e}function At(){let e,r,o,a;for(e=He,r=He,o=[],t.substr(He,2)===F?(a=F,He+=2):(a=i,0===Xe&&at(Pe)),a===i&&(a=t.charAt(He),z.test(a)?He++:(a=i,0===Xe&&at(Q)));a!==i;)o.push(a),t.substr(He,2)===F?(a=F,He+=2):(a=i,0===Xe&&at(Pe)),a===i&&(a=t.charAt(He),z.test(a)?He++:(a=i,0===Xe&&at(Q)));return r=t.substring(r,He),Ue=e,e=r,e}function Bt(){let e,r,o,a,s;if(e=He,r=He,Xe++,t.substr(He,3)===O?(o=O,He+=3):(o=i,0===Xe&&at(Ie)),Xe--,o===i?r=void 0:(He=r,r=i),r!==i){for(o=He,a=[],s=t.charAt(He),j.test(s)?He++:(s=i,0===Xe&&at(Le));s!==i;)a.push(s),s=t.charAt(He),j.test(s)?He++:(s=i,0===Xe&&at(Le));o=t.substring(o,He),Ue=e,e=(n=o)?n.trim():""}else He=e,e=i;var n;return e}function St(){let e,r,o;if(93===t.charCodeAt(He)?(e=l,He++):(e=i,0===Xe&&at(X)),e===i){for(e=He,r=[],o=Ft();o!==i;)r.push(o),o=Ft();o=function(){let e,r;e=He,Xe++,t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re));Xe--,r===i?e=void 0:(He=e,e=i);return e}(),o!==i?(r=[r,o],e=r):(He=e,e=i)}return e}function Pt(){let e,r,o,a;for(e=He,r=He,o=[],a=t.charAt(He),W.test(a)?He++:(a=i,0===Xe&&at(Ee));a!==i;)o.push(a),a=t.charAt(He),W.test(a)?He++:(a=i,0===Xe&&at(Ee));var s;return r=t.substring(r,He),Ue=e,r=(s=r)?s.trim():null,e=r,e}function It(){let e,r,o;var a;return e=He,58===t.charCodeAt(He)?(r=p,He++):(r=i,0===Xe&&at(ee)),r!==i?(o=At(),Ue=e,e=(a=o)?a.trim():""):(He=e,e=i),e===i&&(e=He,r="",Ue=e,r=!0,e=r),e}function Lt(){let e,r;return Xe++,e=t.charAt(He),H.test(e)?He++:(e=i,0===Xe&&at(Re)),Xe--,e===i&&(r=i,0===Xe&&at(Ne)),e}function Vt(){let e,t;for(Xe++,e=[],t=Lt();t!==i;)e.push(t),t=Lt();return Xe--,e}function Et(){let e,r,o;for(Xe++,e=He,r=[],o=t.charAt(He),U.test(o)?He++:(o=i,0===Xe&&at(Oe));o!==i;)r.push(o),o=t.charAt(He),U.test(o)?He++:(o=i,0===Xe&&at(Oe));return o=Nt(),o!==i?(r=[r,o],e=r):(He=e,e=i),Xe--,e===i&&(r=i,0===Xe&&at(Fe)),e}function Nt(){let e,r;return Xe++,10===t.charCodeAt(He)?(e=M,He++):(e=i,0===Xe&&at(Me)),e===i&&(t.substr(He,2)===q?(e=q,He+=2):(e=i,0===Xe&&at(qe)),e===i&&(e=t.charAt(He),G.test(e)?He++:(e=i,0===Xe&&at(ze)))),Xe--,e===i&&(r=i,0===Xe&&at(De)),e}function Rt(){let e,r,o;for(Xe++,e=He,r=[],o=t.charAt(He),U.test(o)?He++:(o=i,0===Xe&&at(Oe));o!==i;)r.push(o),o=t.charAt(He),U.test(o)?He++:(o=i,0===Xe&&at(Oe));return o=Nt(),o!==i?(r=[r,o],e=r):(He=e,e=i),Xe--,e===i&&(r=i,0===Xe&&at($e)),e}function Ft(){let e,r;return Xe++,e=t.charAt(He),K.test(e)?He++:(e=i,0===Xe&&at(je)),Xe--,e===i&&(r=i,0===Xe&&at(Je)),e}function Ot(){let e,r;return e=Nt(),e===i&&(e=He,Xe++,t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re)),Xe--,r===i?e=void 0:(He=e,e=i)),e}function Dt(){let e,r;return e=Rt(),e===i&&(e=He,Xe++,t.length>He?(r=t.charAt(He),He++):(r=i,0===Xe&&at(re)),Xe--,r===i?e=void 0:(He=e,e=i)),e}const Mt=new Tr({parse:e,parserText:Ze,parserLocation:zt}),qt=new gi({parse:e,parserText:Ze,parserLocation:zt});function zt(){const e=ot(Ue,He);return e?(delete e.source,e):e}function ot(e,t,r){var i=it(e),a=it(t),s={source:o,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:a.line,column:a.column}};return o&&"function"==typeof o.offset&&(s.start=o.offset(s.start),s.end=o.offset(s.end)),s}Ke=s();const $t=Ke!==i&&He===t.length;function Jt(){throw Ke!==i&&He<t.length&&at({type:"end"}),st(Qe,Ye<t.length?function(e=He){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(Ye):null,Ye<t.length?ot(Ye,Ye+1):ot(Ye,Ye))}return r.peg$library?{peg$result:Ke,peg$currPos:He,peg$FAILED:i,peg$maxFailExpected:Qe,peg$maxFailPos:Ye,peg$success:$t,peg$throw:$t?void 0:Jt}:$t?Ke:void Jt()},yi=class{constructor(){l(this,"jsonParser",new hr)}toAst(e,t){return bi(e)}},ki={string:"string",file:"file"},vi={bitmark:"bitmark",json:"json",ast:"ast"},Ti=class{constructor(){l(this,"ast",new $e),l(this,"jsonParser",new hr),l(this,"bitmarkParser",new yi),l(this,"textParser",new Mt),l(this,"textGenerator",new Lt),l(this,"jsonStringifyPrettify",(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e})}version(){return Ee.appVersion.full}info(e){const t=Object.assign({},e),r=new lr;let i;const o=!t.outputFormat||t.outputFormat===pr.text,a=t.outputFormat===pr.json,s=t.type===dr.all,n=t.type===dr.deprecated,l=s||!n,c=s||n;if(t.type===dr.bit){const e=r.getSupportedBitConfigs().filter(e=>{if(!t.bit)return!0;return ve.getBitType(t.bit)===e.bitType});i=o?e.map(e=>e.toString({includeChains:!0,includeConfigs:!0})).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:c}).filter(e=>{if(!t.bit)return!0;const r=ve.getBitType(t.bit);return e.name===r||void 0});i=o?this.supportedBitsAsString(e):e}if(a){const e=!0===t.prettify?2:t.prettify||void 0;i=JSON.stringify(i,null,e)}return i}generateConfig(e){const t=Object.assign({},e);(new ConfigBuilder).build(t)}convert(e,t){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.outputFormat,s=a===vi.bitmark,n=a===vi.json,l=a===vi.ast,c=cr.peggy;let p=e;const d="string"==typeof e;if(Ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==ki.file||Ee.isNode&&d&&fs.existsSync(p)&&(p=fs.readFileSync(p,{encoding:"utf8"}));let u=this.ast.preprocessAst(p);const m=!!u;m||(u=this.jsonParser.toAst(p));const h=!!u?.bits,g=e=>{r=this.bitmarkParser.toAst(e,{parserType:c})},f=e=>{if(c===cr.peggy)if(u=this.bitmarkParser.toAst(e,{parserType:c}),i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(u)}else{const e=new sr(i).generateSync(u);r=this.jsonStringifyPrettify(e,o)}},b=e=>{if(i.outputFile){new BitmarkFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new rr(i);r=t.generateSync(e)}},y=e=>{r=this.jsonStringifyPrettify(e,o)},k=e=>{if(i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new sr(i).generateSync(e);r=this.jsonStringifyPrettify(t,o)}},v=e=>{r=this.jsonStringifyPrettify(e,o)};return d&&!h&&!m?s?(g(p),b(r)):l?g(p):f(p):m?l?y(u):n?k(u):b(u):h?n?k(u):l?v(u):(e=>{if(i.outputFile)new BitmarkFileGenerator(i.outputFile,i).generateSync(e);else{const t=new rr(i);r=t.generateSync(e)}})(u):r="",r}upgrade(e,t){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.bitmarkParserType;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let l=this.jsonParser.toAst(s);const c=!!l?.bits,p=e=>{if(i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new sr(i).generateSync(e);r=this.jsonStringifyPrettify(t,o)}};if(n&&!c)(e=>{const t=this.bitmarkParser.toAst(e,{parserType:a});if(i.outputFile){new BitmarkFileGenerator(i.outputFile,i).generateSync(t)}else{const e=new rr(i);r=e.generateSync(t)}})(s);else{if(!c)return;p(l)}return r}createAst(e,t){let r,i=e;const o="string"==typeof e,a=Object.assign({},t);a.inputFormat&&a.inputFormat!==ki.file||Ee.isNode&&o&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));let s=this.ast.preprocessAst(i);const n=!!s;n||(s=this.jsonParser.toAst(i));const l=!!s?.bits;return r=o&&!l&&!n?this.bitmarkParser.toAst(i):l?s:{},r}convertText(e,t){let r,i;const o=Object.assign({},t),a=Object.assign({},o.fileOptions),s=Object.assign({},o.jsonOptions),n=(0,Qt.Enum)(TextFormat).fromValue(o.textFormat)??TextFormat.bitmarkText,l=o.textLocation??TextLocation.body;let c=e;const p="string"==typeof e;if(Ee.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");o.inputFormat&&o.inputFormat!==ki.file||Ee.isNode&&p&&fs.existsSync(c)&&(c=fs.readFileSync(c,{encoding:"utf8"}));const d=this.textParser.preprocessAst(c),u=!!d;if(i=u?this.textGenerator.generateSync(d,n,l):this.textParser.toAst(c,{format:n,location:TextLocation.body}),o.outputFile){const e=o.outputFile.toString();let t=i;u||(t=this.jsonStringifyPrettify(i,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else r=u?i:this.jsonStringifyPrettify(i,s);return r}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions),o=(0,Qt.Enum)(TextFormat).fromValue(r.textFormat)??TextFormat.bitmarkText,a=r.textLocation??TextLocation.body;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));const l=Breakscape.breakscape(s,{format:o,location:a});if(!r.outputFile)return l;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions),o=(0,Qt.Enum)(TextFormat).fromValue(r.textFormat)??TextFormat.bitmarkText,a=r.textLocation??TextLocation.body;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));const l=Breakscape.unbreakscape(s,{format:o,location:a});if(!r.outputFile)return l;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n";return t}},xi=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new ar(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()}};Fe()}},t={};var r=function r(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}(922);return r})());
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={722:e=>{var t,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s={};((e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(s,{Enum:()=>l}),e.exports=(t=s,((e,t,s,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))a.call(e,l)||l===s||r(e,l,{get:()=>t[l],enumerable:!(n=i(t,l))||n.enumerable});return e})(r({},"__esModule",{value:!0}),t));var n=new WeakMap;function l(e){let t=n.get(e);const r=e;if(!t){const i=[];for(const t in e){const e=Number(t);!isNaN(e)&&r[r[e]]===e||i.push(t)}const o={_keys:i,_valueKeyMap:new Map};for(const e of o._keys){const t=r[e];o._valueKeyMap.set(t,e)}n.set(e,o),t=o}function i(){const e=new Map;for(const i of t._keys){const t=r[i];e.set(i,t)}return t._keyValueMap=e,e}function o(){const e=new Map;for(const i of t._keys){const t=r[i],o="string"==typeof t?t.toLowerCase():t;e.set(o,i)}return t._lcValueKeyMap=e,e}function a(){const e=new Map;return t._valueLabelMap=e,e}function s(e,r){if(r?.ignoreCase&&"string"==typeof e){const r=t._keyValueMap??i(),a=(t._lcValueKeyMap??o()).get(e.toLowerCase());if(!a)return;return r.get(a)}if(t._valueKeyMap.has(e))return e}function l(e,o){const a=t._keyValueMap??i();if(o?.ignoreCase&&"string"==typeof e){const i=t._lcKeyValueMap??function(){const e=new Map;for(const i of t._keys){const t=r[i];e.set(i.toLowerCase(),t)}return t._lcKeyValueMap=e,e}();return i.get(e.toLowerCase())}return a.get(`${e}`)}function c(){return t._values??function(){const e=t._keyValueMap??i();return t._values=t._keys.map(t=>e.get(t)),t._values}()}function p(){return t._entries??function(){const e=t._keyValueMap??i();return t._entries=t._keys.map(t=>[t,e.get(t)]),t._entries}()}return{fromValue:s,fromKey:l,keyFromValue:function(e,r){if(r?.ignoreCase&&"string"==typeof e){return(t._lcValueKeyMap??o()).get(e.toLowerCase())}return t._valueKeyMap.get(e)},hasKey:function(e,t){return null!=l(e,t)},hasValue:function(e,t){return null!=s(e,t)},keys:()=>t._keys,values:()=>c(),entries:()=>p(),[Symbol.iterator]:function*(){for(const e of c())yield e},setAllLabels:function(e){const r=t._valueLabelMap??a();for(const[t,i]of Object.entries(e)){const e=s(t);null!=e&&r.set(e,i)}},setLabels:function(e,r){(t._valueLabelMap??a()).set(e,r)},getLabels:function(e){return(t._valueLabelMap??a()).get(e)??{}},getLabel:function(e,r){const i=(t._valueLabelMap??a()).get(e)??{};if(!r)for(const t of Object.values(i))return t??`${e}`;return i[r]??`${e}`}}}l.fromArray=e=>{let t=e;Array.isArray(t)||(t=[]);return t.reduce((e,t)=>(e[t]=t,e),{})}},922:(e,t,r)=>{var i,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,l=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c={};((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})})(c,{Ast:()=>$e,BitType:()=>d,BitmarkGenerator:()=>tr,BitmarkParser:()=>yi,BitmarkParserGenerator:()=>Ti,BitmarkParserType:()=>cr,BitmarkStringGenerator:()=>rr,BitmarkVersion:()=>ft,BodyTextFormat:()=>We,Builder:()=>Kt,CardSetVersion:()=>Zt,InfoFormat:()=>pr,InfoType:()=>dr,Input:()=>ki,JsonGenerator:()=>ar,JsonParser:()=>hr,JsonStringGenerator:()=>xi,NodeType:()=>ze,Output:()=>vi,ResourceBuilder:()=>Gt,StringWriter:()=>Yt,TextMarkType:()=>Me,TextNodeType:()=>qe,bitmarkTextParse:()=>Dt}),e.exports=(i=c,((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))n.call(e,l)||l===r||o(e,l,{get:()=>t[l],enumerable:!(i=a(t,l))||i.enumerable});return e})(o({},"__esModule",{value:!0}),i));var p=r(722),d=(r(722),{_error:"_error",_comment:"_comment",_standard:"_standard",advertising:"advertising",advertisingAdvertorial:"advertising-advertorial",advertisingAdvertorialPage:"advertising-advertorial-page",advertisingCallToAction:"advertising-call-to-action",advertisingCallToActionMeeting:"advertising-call-to-action-meeting",advertisingBanner:"advertising-banner",advertisingSkyscraper:"advertising-skyscraper",advertisingRectangle:"advertising-rectangle",advertisingFullPage:"advertising-full-page",advertisingHalfPage:"advertising-half-page",advertisingQuarterPage:"advertising-quarter-page",advertisingClassifiedPage:"advertising-classified-page",advertisingLandscape:"advertising-landscape",advertisingPortrait:"advertising-portrait",aiChat:"ai-chat",aiEditor:"ai-editor",aiPrompt:"ai-prompt",aiTutor:"ai-tutor",aiWbt:"ai-wbt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appBitmarkFromJavascript:"app-bitmark-from-javascript",appCalculatorLatex:"app-calculator-latex",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",articleAuthor:"article-author",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",author:"author",authorContentBitGenerator:"author-content-bit-generator",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",bookAuthor:"book-author",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",brandColor:"brand-color",browserImage:"browser-image",bug:"bug",bugAlt:"bug-alt",bugCollapsible:"bug-collapsible",buttonCopyText:"button-copy-text",catalogItemBook:"catalog-item-book",catalogItemExternalBook:"catalog-item-external-book",catalogItemProduct:"catalog-item-product",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",extractorImage:"extractor-image",extractorImageCollapsible:"extractor-image-collapsible",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",nonProductionPrototypeIframe:"non-production-prototype-iframe",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",openBookChapter:"open-book-chapter",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",platform:"platform",platformBrandTarget:"platform-brand-target",platformHeader:"platform-header",platformMain:"platform-main",platformMainButton:"platform-main-button",platformMainInput:"platform-main-input",platformPath:"platform-path",platformSection:"platform-section",platformSectionButton:"platform-section-button",platformSectionChat:"platform-section-chat",platformSectionHeader:"platform-section-header",platformSectionInput:"platform-section-input",platformSystemIcon:"platform-system-icon",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",sandbox:"sandbox",sandboxOutputJson:"sandbox-output-json",sandboxOutputMarkup:"sandbox-output-markup",sandboxOutputRender:"sandbox-output-render",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",tableExtended:"table-extended",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",vendorDatadogDashboard:"vendor-datadog-dashboard",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",vendorLearndashEmbed:"vendor-learndash-embed",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"}),u=(r(722),"infinity"),m=(r(722),"string"),h="boolean",g=(r(722),{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:"&"}),f=g,b=(r(722),"plainText"),y="bitmarkText",k="number",v="boolean",T="invertedBoolean",x=(r(722),{plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkText:"bitmark++"}),_=(r(722),"flashcard"),C="definitionList",w="elements",A="statements",B="quiz",S="feedback",P="questions",I="matchPairs",L="matchAudioPairs",V="matchImagePairs",E="matchMatrix",N="table",R="tableExtended",F="pronunciationTable",O="botActionResponses",D="exampleBitList",M="clozeList",q="ingredients",z="bookReferenceList",$=(r(722),"standard"),J="resource",U="comboResource",j=(r(722),"unknown"),W="tag",H="property",G="resource",K="group",Y=class{constructor(e){l(this,"type"),l(this,"configKey"),l(this,"tag"),l(this,"maxCount"),l(this,"minCount"),l(this,"chain"),l(this,"jsonKey"),l(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}},Q=class extends Y{constructor(e){super({type:W,jsonKey:void 0,...e}),l(this,"type",W)}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},X=class extends Y{constructor(e){super({type:H,...e}),l(this,"type",H),l(this,"array"),l(this,"format"),l(this,"defaultValue"),this.array=e.maxCount===u||e.maxCount>1,this.format=e.format,this.defaultValue=e.defaultValue}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.array&&(r+=`, arr=${this.array}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},Z=class extends Y{constructor(e){super({type:G,...e}),l(this,"type",G)}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}},ee=class{constructor(e,t,r,i){l(this,"tags"),l(this,"bodyAllowed"),l(this,"bodyRequired"),l(this,"repeatCount"),this.tags=e,this.bodyAllowed=t??!0,this.bodyRequired=r,this.repeatCount=i}toString(e){const t=Object.assign({},e);let r="";const i=[];this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),null!=this.repeatCount&&i.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}},te=class{constructor(e,t){l(this,"configKey"),l(this,"variants"),this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",i=0,o=0;for(const e of this.variants){for(const a of e)r+=`[Card - Side ${i}, Variant ${o}]`,r+=`\n${a.toString(t)}`,o++;i++}return r}},re=class{constructor(e){l(this,"since"),l(this,"bitType"),l(this,"inheritedBitTypes"),l(this,"inheritedBitTypesSet"),l(this,"textFormatDefault"),l(this,"tags",{}),l(this,"cardSet"),l(this,"quizBit"),l(this,"deprecated"),l(this,"bodyAllowed"),l(this,"bodyRequired"),l(this,"footerAllowed"),l(this,"footerRequired"),l(this,"resourceAttachmentAllowed"),l(this,"rootExampleType"),l(this,"comboResourceConfigKey");const{since:t,bitType:r,inheritedBitTypes:i,textFormatDefault:o,tags:a,cardSet:s,quizBit:n,deprecated:c,bodyAllowed:p,bodyRequired:d,footerAllowed:u,footerRequired:m,resourceAttachmentAllowed:h,rootExampleType:g,comboResourceConfigKey:f}=e;this.since=t,this.bitType=r,this.inheritedBitTypes=i,this.inheritedBitTypesSet=new Set(i),this.textFormatDefault=o,this.tags=a,this.cardSet=s,this.quizBit=n,this.deprecated=c,this.bodyAllowed=p??!0,this.bodyRequired=d,this.footerAllowed=u??!0,this.footerRequired=m,this.resourceAttachmentAllowed=h??!0,this.rootExampleType=g,this.comboResourceConfigKey=f}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(r+="\n\n[Inheritance]",r+=`\n${this.inheritedBitTypes.join(" => ")}`),r+=`\n\n[Default text format]\n${this.textFormatDefault}`;const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceConfigKey&&i.push(`comboResourceConfigKey=${this.comboResourceConfigKey}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===u||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}},ie=r(722),oe=(r(722),r(722),{property_action:"@action",property_activityType:"@activityType",property_additionalSolutions:"@additionalSolutions",property_advertisingClickUrl:"@advertisingClickUrl",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_authorFullName:"@authorFullName",property_authorJobTitle:"@authorJobTitle",property_authorPseudonym:"@authorPseudonym",property_authorTitle:"@authorTitle",property_autoplay:"@autoplay",property_availableClassifications:"@availableClassifications",property_brandColor:"@brandColor",property_brandColorName:"@brandColorName",property_blockId:"@blockId",property_book:"@book",property_bookAlias:"@bookAlias",property_bookDiff:"@bookDiff",property_bot:"@bot",property_bubbleTag:"@bubbleTag",property_extractorTag:"@extractorTag",property_buttonCaption:"@buttonCaption",property_callToActionUrl:"@callToActionUrl",property_caption:"@caption",property_categoryTag:"@categoryTag",property_chatWithBook:"@chatWithBook",property_chatWithBookBrainKey:"@chatWithBookBrainKey",property_currency:"@currency",property_bookIsbn:"@bookIsbn",property_bookAuthor:"@bookAuthor",property_bookType:"@bookType",property_bookBindingType:"@bookBindingType",property_bookNumberOfPages:"@bookNumberOfPages",property_bookRating:"@bookRating",property_bookSeriesTitle:"@bookSeriesTitle",property_bookSeriesId:"@bookSeriesId",property_bookSeriesNumber:"@bookSeriesNumber",property_bookLanguage:"@bookLanguage",property_bookPublishingDate:"@bookPublishingDate",property_bookPublisher:"@bookPublisher",property_bookTranslator:"@bookTranslator",property_bookOriginalTitle:"@bookOriginalTitle",property_gmbExternalShop:"@gmbExternalShop",property_gmbExternalShopItems:"@gmbExternalShopItems",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_listPrice:"@listPrice",property_customerProductId:"@customerProductId",property_customerProductShopLink:"@customerProductShopLink",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_isEditable:"@isEditable",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_formula:"@formula",property_fullName:"@fullName",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_iframeSrc:"@iframeSrc",property_iframeName:"@iframeName",property_imageFirst:"@imageFirst",property_imageSource:"@imageSource",property_index:"@index",property_internalComment:"@internalComment",property_internalPrintPdf:"@internalPrintPdf",property_hasPrintRestriction:"@hasPrintRestriction",property_enforceUpdateOverUserInput:"@enforceUpdateOverUserInput",property_isCaseSensitive:"@isCaseSensitive",property_isInfoOnly:"@isInfoOnly",property_isPublic:"@isPublic",property_isTemplate:"@isTemplate",property_isTemplateStripTheme:"@isTemplateStripTheme",property_isTracked:"@isTracked",property_jobTitle:"@jobTitle",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_translationOf:"@translationOf",property_spansPageBreak:"@spansPageBreak",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_platformBackgroundColor:"@platformBackgroundColor",property_platformBorderColor:"@platformBorderColor",property_platformBrandTarget:"@platformBrandTarget",property_platformButtonBackgroundColor:"@platformButtonBackgroundColor",property_platformButtonPrimaryColor:"@platformButtonPrimaryColor",property_platformMessageBackgroundColor:"@platformMessageBackgroundColor",property_platformName:"@platformName",property_platformPlaceholderColor:"@platformPlaceholderColor",property_platformPrimaryColor:"@platformPrimaryColor",property_platformScrollbarColor:"@platformScrollbarColor",property_platformSecondaryColor:"@platformSecondaryColor",property_platformSelectionColor:"@platformSelectionColor",property_platformSelectionTextColor:"@platformSelectionTextColor",property_platformBaseLayerColor:"@platformBaseLayerColor",property_platformMargin:"@platformMargin",property_platformBorderRadius:"@platformBorderRadius",property_platformSelectionBorderRadius:"@platformSelectionBorderRadius",property_platformNeedsShadow:"@platformNeedsShadow",property_platformSeparatorColor:"@platformSeparatorColor",property_platformTextSelectionColor:"@platformTextSelectionColor",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_pseudonym:"@pseudonym",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_relatedBook:"@relatedBook",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_selected:"@selected",property_servings:"@servings",property_showInIndex:"@showInIndex",property_showSubtitles:"@showSubtitles",property_siteName:"@siteName",property_size:"@size",property_slug:"@slug",property_sourceDocument:"@sourceDocument",property_sourceRL:"@sourceRL",property_spaceId:"@spaceId",property_src1x:"@src1x",property_src2x:"@src2x",property_src3x:"@src3x",property_src4x:"@src4x",property_srcAlt:"@srcAlt",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_tableCellType:"@tableCellType",property_tableRowSpan:"@tableRowSpan",property_tableColSpan:"@tableColSpan",property_tableScope:"@tableScope",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"}),ae=oe,se=(r(722),r(722),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 r=0;for(;e.startsWith(t);)r++,e=e.substring(t.length);return r}countOccurrencesAtEnd(e,t){let r=0;for(;e.endsWith(t);)r++,e=e.substring(0,e.length-t.length);return r}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const a=e[i],s=i===o-1;r.push(a),s||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let a,s=0;for(;s<o;){let i;const o=s+t,n=e.indexOf("\n",s);if(n>-1&&n>s&&n<o){i=n-s,a=e.substr(s,i),s=s+i+1,r.push(a);continue}const l=e.lastIndexOf(" ",o);let c=0;l>-1&&l!=s-1?(i=l-s,i>0&&(c=s+i+1)):(i=t,c=s+t),a=e.slice(s,s+i),s=c,r.push(a.trim())}return s<i&&(a=e.slice(s),r.push(a)),r}kebabToCamel(e){return e?e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):e}camelToKebab(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e}}),ne={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",platformIcon:"platformIcon",platformLogo:"platformLogo",platformBackgroundImage:"platformBackgroundImage",previewImage:"previewImage",previewVideo:"previewVideo",coverImage:"coverImage"};function le(e){return`&${se.kebabToCamel(e)}`}var ce={_unknown:"_unknown",...g,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_platformBackgroundImage:"&platformBackgroundImage",resource_platformIcon:"&platformIcon",resource_platformLogo:"&platformLogo",resource_backgroundWallpaper:"&backgroundWallpaper",resource_imagePlaceholder:"&imagePlaceholder",resource_previewImage:"&previewImage",resource_previewVideo:"&previewVideo",resource_coverImage:"&coverImage",...oe,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_advertisingCommon:"group_advertisingCommon",group_platformStylesCommon:"group_platformStylesCommon",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",group_previewImages:"group_previewImages",group_previewVideos:"group_previewVideos"};function pe(e){return e?e.startsWith("@")?H:e.startsWith("&")?G:e.startsWith("group_")?K:W:j}function de(e){return e.replace(/^@/,"")}function ue(e){return(0,ie.Enum)(ne).fromKey(e.replace(/^&/,""))}var me=class{constructor(e,t,r,i){l(this,"tags"),l(this,"resourceAttachmentAllowed"),l(this,"resourceAttachmentConfigKey"),l(this,"comboResourceConfigKeysMap"),this.tags=e,this.resourceAttachmentAllowed=t??!1,this.resourceAttachmentConfigKey=r,this.comboResourceConfigKeysMap=i}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}},he=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 r=e;for(const e of t){if(null==r)return;r=r[e]}return r}setViaPath(e,t,r,i){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 r=t[e];if(null==o[r]){if(!i)return!1;o[r]={}}o=o[r]}return o[t[t.length-1]]=r,!0}flatMapPath(e,t){if(!e)return[];if(!t)return[];Array.isArray(t)||(t=[t]);const r=e,i=t.shift();if(null==i)return r;const o=r[i];return o?Array.isArray(o)?o.flatMap(e=>this.flatMapPath(e,t.slice())):[this.flatMapPath(o,t)].flat():[]}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}deepMerge(...e){return function e(...t){function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(t,i){for(const[o,a]of Object.entries(i)){const i=r(a);void 0!==t[o]&&r(t[o])===i&&["array","object"].includes(i)?t[o]=e(t[o],a):t[o]=structuredClone(a)}}let o=structuredClone(t.shift());for(const e of t){const t=r(e);r(o)===t?"array"===t?o=[...o,...structuredClone(e)]:"object"===t?i(o,e):o=e:o=structuredClone(e)}return o}(...e)}},ge=r(722),fe={[C]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the definition.",format:b},{key:ce.tag_title,description:"Title of the definition."},{key:ce.group_resourceIcon,description:"Icon resource for the definition."}],repeatCount:u}]]},[_]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the flashcard.",format:b},{key:ce.tag_title,description:"Title of the flashcard."},{key:ce.group_resourceIcon,description:"Icon resource for the flashcard."}],repeatCount:u}]]},[w]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the element.",format:b}],repeatCount:u}]]},[A]:{variants:[[{tags:[{key:ce.tag_true,description:"Tag for true statements.",maxCount:1},{key:ce.tag_false,description:"Tag for false statements.",maxCount:1},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the statement.",format:b}],bodyAllowed:!1}]]},[B]:{variants:[[{tags:[{key:ce.group_trueFalse,description:"Group for true/false questions."},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the quiz question.",format:b}],bodyAllowed:!1}]]},[S]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.group_trueFalse,description:"Group for true/false feedback."},{key:ce.tag_title,description:"Title of the feedback."}],bodyAllowed:!1}],[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k},{key:ce.property_example,description:"Example text for the feedback.",format:b},{key:ce.tag_title,description:"Title of the feedback."}],bodyAllowed:!0}]]},[P]:{variants:[[{tags:[{key:ce.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:k},{key:ce.tag_sampleSolution,description:"Sample solution for the question."},{key:ce.property_sampleSolution,description:"Property for sample solution text.",format:b},{key:ce.property_additionalSolutions,description:"Property for additional solutions.",format:b,maxCount:u},{key:ce.property_partialAnswer,description:"Property for partial answer text.",format:b},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the question.",format:b}],repeatCount:u}]]},[I]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the match pair.",format:b},{key:ce.tag_title,description:"Title of the match pair."},{key:ce.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:v}],repeatCount:u}]]},[L]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the audio match pair.",format:b},{key:ce.tag_title,description:"Title of the audio match pair."},{key:ce.resource_audio,description:"Audio resource for the match pair."}],repeatCount:u}]]},[V]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the image match pair.",format:b},{key:ce.tag_title,description:"Title of the image match pair."},{key:ce.resource_image,description:"Image resource for the match pair."}],repeatCount:u}]]},[E]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the match matrix.",format:b},{key:ce.tag_title,description:"Title of the match matrix."},{key:ce.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:v}],repeatCount:u}]]},[N]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the table."}],repeatCount:u}]]},[R]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the table."},{key:ce.property_tableCellType,description:"Table cell type (th/td).",format:b},{key:ce.property_tableRowSpan,description:"Number of rows the cell spans.",format:k},{key:ce.property_tableColSpan,description:"Number of columns the cell spans.",format:k},{key:ce.property_tableScope,description:"Scope attribute for header cells.",format:b}],repeatCount:u}]]},[F]:{variants:[[{tags:[{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.tag_title,description:"Title of the pronunciation table."},{key:ce.resource_audio,description:"Audio resource for the pronunciation table."}],repeatCount:u}]]},[O]:{variants:[[{tags:[{key:ce.property_reaction,description:"Reaction to the bot action.",format:b},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_example,description:"Example text for the bot action response.",format:b}]}]]},[M]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for cloze items."},{key:ce.group_gap,description:"Group for gap tags in cloze items."}]}]]},[D]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for example bits."},{key:ce.tag_title,description:"Title of the example bit."}],repeatCount:u}]]},[q]:{variants:[[{tags:[{key:ce.tag_title,description:"Title of the ingredient."},{key:ce.group_trueFalse,description:"Group for true/false properties of the ingredient."},{key:ce.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:ce.property_unit,description:"Unit of measurement for the ingredient.",format:b},{key:ce.property_unitAbbr,description:"Abbreviation for the unit of measurement.",format:b},{key:ce.property_decimalPlaces,description:"Number of decimal places for the ingredient quantity.",format:k,defaultValue:"1"},{key:ce.property_disableCalculation,description:"Disable calculation for the ingredient.",format:v}],repeatCount:u}]]},[z]:{variants:[[{tags:[{key:ce.group_standardTags,description:"Standard tags for book references."},{key:ce.property_refAuthor,description:"Author of the book.",format:b,maxCount:u},{key:ce.property_refBookTitle,description:"Title of the book.",format:b},{key:ce.property_refPublisher,description:"Publisher of the book.",format:b,maxCount:u},{key:ce.property_refPublicationYear,description:"Year of publication of the book.",format:b},{key:ce.property_citationStyle,description:"Citation style for the book reference.",format:b}],repeatCount:u}]]}},be={[ce.group_standardAllBits]:{name:"Standard",description:"Standard tags which apply to all bits",type:$,tags:[{key:ce.property_id,description:"The unique identifier(s) for the bit",format:b,maxCount:u},{key:ce.property_customerId,description:"The customer-specific identifier for the bit",format:b},{key:ce.property_externalId,description:"The external identifier for the bit",format:b,maxCount:u},{key:ce.property_sourceRL,description:"The original location of the information in the original source material",format:b},{key:ce.property_isTemplate,description:"If true, the bit is a template",format:v,defaultValue:"false"},{key:ce.property_isTemplateStripTheme,description:"If true, the bit is a template strip theme",format:v,defaultValue:"false"},{key:ce.property_aiGenerated,description:"If true, the bit is AI-generated",format:v},{key:ce.property_machineTranslated,description:"If true, the bit is machine-translated",format:b},{key:ce.property_translationOf,description:"Translation source reference",format:b},{key:ce.property_spansPageBreak,description:"If true, the bit spans a page break",format:v},{key:ce.property_searchIndex,description:"The search index(es) for the bit",format:b,maxCount:u},{key:ce.property_analyticsTag,description:"The analytics tag(s) for the bit",format:b,maxCount:u},{key:ce.property_categoryTag,description:"The category tag(s) for the bit",format:b,maxCount:u},{key:ce.property_topicTag,description:"The topic tag(s) for the bit",format:b,maxCount:u},{key:ce.property_reportTag,description:"The report tag(s) for the bit",format:b,maxCount:u},{key:ce.property_altLangTag,description:"The alternative language tag for the bit",format:b},{key:ce.property_feedbackEngine,description:"The feedback engine for the bit",format:b},{key:ce.property_feedbackType,description:"The feedback type for the bit",format:b},{key:ce.property_disableFeedback,description:"If true, feedback is disabled for the bit",format:v},{key:ce.property_diffTo,description:"The diff to version for the bit",format:b},{key:ce.property_diffOp,description:"The diff operation for the bit",format:b},{key:ce.property_diffRef,description:"The diff reference for the bit",format:b},{key:ce.property_diffContext,description:"The diff context for the bit",format:b},{key:ce.property_diffTime,description:"The diff time for the bit",format:k},{key:ce.property_ageRange,description:"The age range for the bit",format:b,maxCount:u},{key:ce.property_lang,description:"The language for the bit",format:b},{key:ce.property_publisher,description:"The publisher(s) of the bit",format:b,maxCount:u},{key:ce.property_publisherName,description:"The name of the publisher of the bit",format:b},{key:ce.property_theme,description:"The theme(s) for the bit",format:b,maxCount:u},{key:ce.property_target,description:"The target(s) for the bit",format:b,maxCount:u},{key:ce.property_tag,description:"The tag(s) for the bit",format:b,maxCount:u},{key:ce.property_groupTag,description:"The group tag(s) for the bit",format:b,maxCount:u,chain:[{key:ce.property_tag,description:"The tag(s) for the group",format:b,maxCount:u}]},{key:ce.property_reductionTag,description:"The reduction tag(s) for the bit",format:b,maxCount:u},{key:ce.property_bubbleTag,description:"The bubble tag(s) for the bit",format:b,maxCount:u},{key:ce.property_extractorTag,description:"The extractor tag(s) for the bit",format:b,maxCount:u},{key:ce.property_levelCEFRp,description:"The CEFRp level for the bit",format:b},{key:ce.property_levelCEFR,description:"The CEFR level for the bit",format:b},{key:ce.property_levelILR,description:"The ILR level for the bit",format:b},{key:ce.property_levelACTFL,description:"The ACTFL level for the bit",format:b},{key:ce.property_icon,description:"The icon for the bit",format:b},{key:ce.property_iconTag,description:"The icon tag for the bit",format:b},{key:ce.property_colorTag,description:"The color tag(s) for the bit",format:b,maxCount:u},{key:ce.tag_anchor,name:"Anchor",description:"The anchor for the bit"},{key:ce.property_search,description:"The search text for the bit",format:b},{key:ce.property_showInIndex,description:"If true, the bit is shown in the index",format:v,defaultValue:"false"},{key:ce.property_layer,description:"The layer(s) for the bit",format:b,maxCount:u},{key:ce.property_layerRole,description:"The layer role(s) for the bit",format:b,maxCount:u}]},[ce.group_standardItemLeadInstructionHint]:{type:$,description:"Standard group for item, lead, page number, source page number, margin number, instruction and hint tags",tags:[{key:ce.tag_item,description:"The item for the bit",chain:[{key:ce.tag_item,description:"The lead, page number, source page number, and margin number for the bit",maxCount:4}]},{key:ce.tag_instruction,name:"Instruction",description:"The instruction for the bit"},{key:ce.tag_hint,name:"Hint",description:"The hint for the bit"}]},[ce.group_standardTags]:{type:$,description:"Standard tags which apply to MOST (but not all) bits",tags:[{key:ce.group_standardAllBits,description:"All standard tags which apply to all bits"},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"The example(s) for the bit",format:b}]},[ce.group_imageSource]:{type:$,description:"Image source chain",tags:[{key:ce.property_imageSource,description:"The source of an image",format:b,chain:[{key:ce.property_mockupId,description:"The mockup ID for the image",format:b},{key:ce.property_size,description:"The size of the image",format:k},{key:ce.property_format,description:"The format of the image",format:b},{key:ce.property_trim,description:"If true, the image is trimmed",format:v}]}]},[ce.group_technicalTerm]:{type:$,description:"Technical term chain",tags:[{key:ce.property_technicalTerm,description:"The technical term",format:b,chain:[{key:ce.property_lang,description:"The language of the technical term",format:b}]}]},[ce.group_person]:{type:$,description:"Person chain",tags:[{key:ce.property_person,description:"A person",format:b,chain:[{key:ce.property_title,description:"The person's title",format:b},{key:ce.group_resourceImage,description:"The image of the person"}]},{key:ce.property_partner,description:"A partner",format:b,chain:[{key:ce.property_title,description:"The partner's title",format:b},{key:ce.group_resourceImage,description:"The image of the partner"}]}]},[ce.group_gap]:{type:$,description:"Gap chain",tags:[{key:ce.tag_gap,description:"The value of a gap in the content",maxCount:u,chain:[{key:ce.tag_gap,description:"Alternative values for the gaps in the content",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the gap",format:b},{key:ce.property_isCaseSensitive,description:"If true, the gap text is case sensitive",format:v}]}]},[ce.group_trueFalse]:{type:$,description:"True/False chain",tags:[{key:ce.tag_true,description:"True value for a true/false statement/question",maxCount:u,chain:[{key:ce.tag_true,description:"True values for a true/false statement/question",maxCount:u},{key:ce.tag_false,description:"False values for a true/false statement/question",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the true/false statement/question",format:b}]},{key:ce.tag_false,description:"False value for a true/false statement/question",maxCount:u,chain:[{key:ce.tag_true,description:"True values for a true/false statement/question",maxCount:u},{key:ce.tag_false,description:"False values for a true/false statement/question",maxCount:u},{key:ce.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:ce.property_example,description:"An example for the true/false statement/question",format:b}]}]},[ce.group_markConfig]:{type:$,description:"Mark configuration chain",tags:[{key:ce.property_mark,description:"The mark configuration",format:b,maxCount:u,chain:[{key:ce.property_color,description:"The color of the mark",format:b},{key:ce.property_emphasis,description:"The emphasis of the mark",format:b}]}]},[ce.group_mark]:{type:$,description:"Mark chain",tags:[{key:ce.tag_mark,description:"The marked content",maxCount:u,chain:[{key:ce.property_mark,description:"The mark configuration",format:b},{key:ce.property_example,description:"An example for the marked content",format:b}]}]},[ce.group_bookCommon]:{type:$,description:"Common book tags",tags:[{key:ce.property_language,description:"The language of the book",format:b,maxCount:u},{key:ce.property_customerExternalId,description:"The customer-specific external identifier for the book",format:b},{key:ce.property_spaceId,description:"The space ID for the book",format:b,maxCount:u},{key:ce.property_kind,description:"The kind of the book",format:b},{key:ce.property_hasMarkAsDone,description:'If true, the book has a "Mark as done" feature',format:v,defaultValue:"false"},{key:ce.property_processHandIn,description:"If true, the book will be processed when upon hand-in",format:v,defaultValue:"false"},{key:ce.property_processHandInLocation,description:"The location where the book was handed-in",format:b},{key:ce.property_isPublic,description:"If true, the book is public",format:v,defaultValue:"false"},{key:ce.property_isTemplate,description:"If true, the book is a template",format:v,defaultValue:"false"},{key:ce.property_isTemplateStripTheme,description:"If true, the book is a template strip theme",format:v,defaultValue:"false"},{key:ce.property_isEditable,description:"If true, the book is editable",format:v,defaultValue:"false"},{key:ce.property_chatWithBook,description:"If true, the user can chat about the book with an AI assistant",format:v,defaultValue:"false"},{key:ce.property_chatWithBookBrainKey,description:"The BookBrain key for the book chat",format:b},{key:ce.tag_title,name:"Title",description:"The title of the book",maxCount:2},{key:ce.property_subtype,description:"The subtype of the book",format:b},{key:ce.property_coverImage,description:"The cover image(s) of the book",format:b,maxCount:u},{key:ce.resource_coverImage,description:"The cover image of the book",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_coverColor,description:"The cover color of the book",format:b},{key:ce.property_subject,description:"The subject(s) of the book",format:b,maxCount:u},{key:ce.property_author,description:"The author(s) of the book",format:b,maxCount:u},{key:ce.property_publications,description:"The publication(s) of the book",format:b,maxCount:u},{key:ce.property_relatedBook,description:"Books related to this book",format:b,maxCount:u},{key:ce.property_duration,description:"The duration of the book",format:b},{key:ce.property_maxTocChapterLevel,description:"The maximum table of contents chapter level",format:k},{key:ce.property_sourceDocument,description:"Url of the source document for the book (for example, a PDF file)",format:b},{key:ce.property_internalPrintPdf,description:"Url of the internal print PDF for the book",format:b},{key:ce.property_hasPrintRestriction,description:"If true, the book has print restrictions",format:v,defaultValue:"true"},{key:ce.property_enforceUpdateOverUserInput,description:"If true, prioritize new content over legacy content from the instance API",format:v,defaultValue:"false"}]},[ce.group_learningPathCommon]:{type:$,description:"Common learning path tags",tags:[{key:ce.property_action,description:"The action for the learning path",format:b},{key:ce.property_duration,description:"The duration of the learning path",format:b},{key:ce.property_date,description:"The date of the learning path",format:b},{key:ce.property_dateEnd,description:"The end date of the learning path",format:b},{key:ce.property_location,description:"The location of the learning path",format:b},{key:ce.property_list,description:"The list of items in the learning path",format:b,maxCount:u},{key:ce.property_textReference,description:"The text reference for the learning path",format:b},{key:ce.property_isTracked,description:"If true, the learning path is tracked",format:v},{key:ce.property_isInfoOnly,description:"If true, the learning path is info only",format:v},{key:ce.property_deeplink,description:"The deeplink(s) for the learning path",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"The caption for the button of the learning path",format:b},{key:ce.property_book,description:"The book(s) associated with the learning path",format:b,chain:[{key:ce.tag_reference,description:"The reference(s) for the book(s) in the learning path",maxCount:2}]}]},[ce.group_advertisingCommon]:{type:$,description:"Common advertising tags",tags:[{key:ce.property_advertisingClickUrl,description:"The URL to which the advertisement should link",format:b}]},[ce.group_platformStylesCommon]:{type:$,description:"Common platform styles",tags:[{key:ce.property_platformPrimaryColor,description:"The platform system primary color",format:b},{key:ce.property_platformSecondaryColor,description:"The platform section secondary color",format:b},{key:ce.property_platformBackgroundColor,description:"The platform system background color",format:b},{key:ce.property_platformButtonPrimaryColor,description:"The platform section header button primary color",format:b},{key:ce.property_platformButtonBackgroundColor,description:"The platform section header button background color",format:b},{key:ce.property_platformScrollbarColor,description:"The platform main scrollbar color",format:b},{key:ce.property_platformSelectionColor,description:"The platform main selection color",format:b},{key:ce.property_platformTextSelectionColor,description:"The platform main input text selection color",format:b},{key:ce.property_platformSeparatorColor,description:"The platform main separator color",format:b},{key:ce.property_platformPlaceholderColor,description:"The platform main input placeholder color",format:b},{key:ce.property_platformMessageBackgroundColor,description:"The platform section chat message background color",format:b},{key:ce.property_platformBorderColor,description:"The platform border color",format:b},{key:ce.property_platformSelectionTextColor,description:"The platform selection text color",format:b},{key:ce.property_platformBaseLayerColor,description:"The platform base layer color",format:b},{key:ce.property_platformMargin,description:"The platform margin",format:k},{key:ce.property_platformBorderRadius,description:"The platform border radius",format:k},{key:ce.property_platformSelectionBorderRadius,description:"The platform selection border radius",format:k},{key:ce.property_platformNeedsShadow,description:"If true, the platform needs shadow",format:v}]},[ce.group_quizCommon]:{type:$,description:"Common quiz tags",tags:[{key:ce.property_revealSolutions,description:"If true, the quiz solutions are revealed",format:v},{key:ce.property_additionalSolutions,description:"Additional solutions",format:b,maxCount:u}]},[ce.group_resourceBitTags]:{type:$,description:"Resource bit tags",tags:[{key:ce.resource_imagePlaceholder,description:"Placeholder image for the resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the placeholder image"}],maxCount:1}]},[ce.group_resourceCommon]:{type:$,description:"Common resource properties",tags:[{key:ce.property_license,description:"The license for the resource",format:b},{key:ce.property_copyright,description:"The copyright information for the resource",format:b},{key:ce.property_caption,description:"The caption for the resource",format:y},{key:ce.property_showInIndex,description:"If true, the resource is shown in the index",format:v,defaultValue:"false"},{key:ce.property_search,description:"The search text for the resource",format:b},{key:ce.property_selected,description:"If true, the resource is selected",format:v,defaultValue:"false"},{key:ce.property_srcAlt,description:"An alternative source for the resource",format:b,maxCount:u}]},[ce.group_resourceImageCommon]:{type:$,description:"Common properties for image resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_src1x,description:"The source URL for the image at 1x resolution",format:b},{key:ce.property_src2x,description:"The source URL for the image at 2x resolution",format:b},{key:ce.property_src3x,description:"The source URL for the image at 3x resolution",format:b},{key:ce.property_src4x,description:"The source URL for the image at 4x resolution",format:b},{key:ce.property_width,description:"The width of the image",format:k},{key:ce.property_height,description:"The height of the image",format:k},{key:ce.property_alt,description:"The alternative text for the image",format:b},{key:ce.property_zoomDisabled,description:"If true, zooming is disabled for the image",format:v}]},[ce.group_resourceAudioCommon]:{type:$,description:"Common properties for audio resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_duration,description:"The duration of the audio resource",format:b},{key:ce.property_mute,description:"If true, the audio is muted",format:v},{key:ce.property_autoplay,description:"If true, the audio plays automatically",format:v}]},[ce.group_resourceVideoCommon]:{type:$,description:"Common properties for video resources",tags:[{key:ce.group_resourceCommon,description:"Common resource properties"},{key:ce.property_width,description:"The width of the video",format:k},{key:ce.property_height,description:"The height of the video",format:k},{key:ce.property_duration,description:"The duration of the video",format:b},{key:ce.property_mute,description:"If true, the video is muted",format:v},{key:ce.property_autoplay,description:"If true, the video plays automatically",format:v},{key:ce.property_allowSubtitles,description:"If true, subtitles are allowed for the video",format:v},{key:ce.property_showSubtitles,description:"If true, subtitles are shown in the video",format:v},{key:ce.property_alt,description:"The alternative text for the video",format:b},{key:ce.property_posterImage,description:"The poster image for the video",format:b,chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the poster image"}]},{key:ce.property_src1x,description:"The source URL for the video at 1x resolution",format:b},{key:ce.property_src2x,description:"The source URL for the video at 2x resolution",format:b},{key:ce.property_src3x,description:"The source URL for the video at 3x resolution",format:b},{key:ce.property_src4x,description:"The source URL for the video at 4x resolution",format:b}]},[ce.group_resourceIcon]:{type:$,description:"Common properties for icon resources",tags:[{key:ce.resource_icon,description:"The icon resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the icon resource"}]}]},[ce.group_resourceImage]:{type:J,description:"Common properties for image resources",tags:[{key:ce.resource_image,description:"The image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[ce.group_resourceImagePortrait]:{type:J,description:"Portrait image resource",tags:[{key:ce.resource_imagePortrait,description:"The portrait image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the portrait image resource"}]}]},[ce.group_resourceImageLandscape]:{type:J,description:"Landscape image resource",tags:[{key:ce.resource_imageLandscape,description:"The landscape image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the landscape image resource"}]}]},[ce.group_resourceImageEmbed]:{type:J,description:"Embedded image resource",tags:[{key:ce.resource_imageEmbed,description:"The embedded image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the embedded image resource"}]}]},[ce.group_resourceImageLink]:{type:J,description:"Link to an image resource",tags:[{key:ce.resource_imageLink,description:"The link to the image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the linked image resource"}]}]},[ce.group_resourceAudio]:{type:J,description:"Audio resource",tags:[{key:ce.resource_audio,description:"The audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the audio resource"}]}]},[ce.group_resourceAudioEmbed]:{type:J,description:"Embedded audio resource",tags:[{key:ce.resource_audioEmbed,description:"The embedded audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the embedded audio resource"}]}]},[ce.group_resourceAudioLink]:{type:J,description:"Link to an audio resource",tags:[{key:ce.resource_audioLink,description:"The link to the audio resource",chain:[{key:ce.group_resourceAudioCommon,description:"Common audio properties for the linked audio resource"}]}]},[ce.group_resourceVideo]:{type:J,description:"Video resource",tags:[{key:ce.resource_video,description:"The video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the video resource"}]}]},[ce.group_resourceVideoEmbed]:{type:J,description:"Embedded video resource",tags:[{key:ce.resource_videoEmbed,description:"The embedded video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the embedded video resource"}]}]},[ce.group_resourceVideoLink]:{type:J,description:"Link to a video resource",tags:[{key:ce.resource_videoLink,description:"The link to the video resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the linked video resource"}]}]},[ce.group_resourceStillImageFilmEmbed]:{type:J,description:"Embedded still image film resource",tags:[{key:ce.resource_stillImageFilmEmbed,description:"The embedded still image film resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the embedded still image film resource"}]}]},[ce.group_resourceStillImageFilmLink]:{type:J,description:"Link to a still image film resource",tags:[{key:ce.resource_stillImageFilmLink,description:"The link to the still image film resource",chain:[{key:ce.group_resourceVideoCommon,description:"Common video properties for the linked still image film resource"}]}]},[ce.group_resourceArticle]:{type:J,description:"Article resource",tags:[{key:ce.resource_article,description:"The article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the article resource"}]}]},[ce.group_resourceArticleEmbed]:{type:J,description:"Embedded article resource",tags:[{key:ce.resource_articleEmbed,description:"The embedded article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the embedded article resource"}]}]},[ce.group_resourceArticleLink]:{type:J,description:"Link to an article resource",tags:[{key:ce.resource_articleLink,description:"The link to the article resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked article resource"}]}]},[ce.group_resourceDocument]:{type:J,description:"Document resource",tags:[{key:ce.resource_document,description:"The document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the document resource"}]}]},[ce.group_resourceDocumentEmbed]:{type:J,description:"Embedded document resource",tags:[{key:ce.resource_documentEmbed,description:"The embedded document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the embedded document resource"}]}]},[ce.group_resourceDocumentLink]:{type:J,description:"Link to a document resource",tags:[{key:ce.resource_documentLink,description:"The link to the document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked document resource"}]}]},[ce.group_resourceDocumentDownload]:{type:J,description:"Downloadable document resource",tags:[{key:ce.resource_documentDownload,description:"The downloadable document resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the downloadable document resource"}]}]},[ce.group_resourceAppLink]:{type:J,description:"Link to an app resource",tags:[{key:ce.resource_appLink,description:"The link to the app resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked app resource"}]}]},[ce.group_resourceWebsiteLink]:{type:J,description:"Link to a website resource",tags:[{key:ce.resource_websiteLink,description:"The link to the website resource",chain:[{key:ce.group_resourceCommon,description:"Common resource properties for the linked website resource"}]}]},[ce.group_resourceStillImageFilm]:{type:U,description:"Resource for still image film",comboResourceConfigKey:ce.resource_stillImageFilm,tags:[{key:ce.group_resourceImage,description:"The image resource for the still image film",maxCount:1,minCount:1},{key:ce.group_resourceAudio,description:"The audio resource for the still image film",maxCount:1,minCount:1}]},[ce.group_resourceImageResponsive]:{type:U,description:"Responsive image resource",comboResourceConfigKey:ce.resource_imageResponsive,tags:[{key:ce.group_resourceImagePortrait,description:"The portrait image resource",maxCount:1,minCount:1},{key:ce.group_resourceImageLandscape,description:"The landscape image resource",maxCount:1,minCount:1}]},[ce.group_previewImages]:{type:J,description:"Array of preview images for catalog items",tags:[{key:ce.resource_previewImage,description:"The preview image resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[ce.group_previewVideos]:{type:J,description:"Array of preview videos for catalog items",tags:[{key:ce.resource_previewVideo,description:"The preview video resource",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]}},ye=new class{hydrateTagsConfig(e){const t={tags:{}};for(const r of e){let e;switch(pe(r.key)){case W:e=this.hydrateTagConfig(r);break;case H:e=this.hydratePropertyTagConfig(r);break;case G:e=this.hydrateResourceTagConfig(r);break;case K:e=this.hydrateTagGroupConfig(r);break;default:throw new Error(`Unknown tag type for config key '${r.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=fe[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new te(e,r)}hydrateTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a}=e,s=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!s)throw new Error(`No tag key found for config key '${s}'`);const n=(0,ge.Enum)(f).fromValue(s);if(!n)throw new Error(`No tag found for tag config key '${s}'`);let l;o&&(l=this.hydrateTagsConfig(o).tags);const c=new Q({configKey:s,tag:n,maxCount:r??1,minCount:i??0,chain:l,deprecated:a});return{tags:{[s]:c}}}hydratePropertyTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a,format:s,defaultValue:n,jsonKey:l}=e,c=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!c)throw new Error(`No property key found for config key '${c}'`);const p=t.substring(1);let d;o&&(d=this.hydrateTagsConfig(o).tags);const u=new X({configKey:c,tag:p,maxCount:r??1,minCount:i??0,chain:d,jsonKey:l,format:s,defaultValue:n,deprecated:a});return{tags:{[c]:u}}}hydrateResourceTagConfig(e){const{key:t,maxCount:r,minCount:i,chain:o,deprecated:a,jsonKey:s}=e,n=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!n)throw new Error(`No resource key found for config key '${n}'`);const l=t.substring(1);let c;o&&(c=this.hydrateTagsConfig(o).tags);const p=new Z({configKey:n,tag:l,maxCount:r??1,minCount:i??0,chain:c,jsonKey:s,deprecated:a});return{tags:{[n]:p}}}hydrateTagGroupConfig(e){const{key:t}=e,r=(0,ge.Enum)(ce).fromValue(t)||ce._unknown;if(!r)throw new Error(`No group key found for config key '${r}'`);const i=be[r];if(!i)throw new Error(`No config found for group config key '${t}'`);const{tags:o}=i,a=this.hydrateTagsConfig(o).tags,s=Object.values(a);if(s.length>0){const t=s[0],r=t;r.maxCount=e.maxCount??t.maxCount,r.minCount=e.minCount??t.minCount}return{tags:a,info:{comboResourceConfigKey:i.comboResourceConfigKey}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:i,repeatCount:o}=e,a=this.hydrateTagsConfig(t);return new ee(a.tags,r,i,o)}},ke={[d._error]:{since:"1.3.0",description:"An error bit, rendered when the bit cannot be interpreted"},[d._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]"},[d._standard]:{since:"3.2.0",description:"The standard bit type, used as a base for other bits, should not be used directly",tags:[{key:ce.group_standardTags,description:"Standard tags for (almost) all bits"}]},[d.appFlashcards]:{since:"1.3.0",baseBitType:d._standard,description:"App flashcards bit, used for flashcard quizzes in the app",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.tag_title,description:"The title of the flashcard quiz"},{key:ce.property_flashcardSet,description:"The flashcard set to use for the app flashcards",format:b,maxCount:u}],rootExampleType:m},[d.appFlashcardsQuiz]:{since:"1.3.0",baseBitType:d.appFlashcards,description:"App flashcards quiz bit"},[d.appFlashcardsLearn]:{since:"1.3.0",baseBitType:d.appFlashcards,description:"App flashcards learn bit"},[d.appLink]:{since:"1.3.0",baseBitType:d._standard,description:"App link bit, used to link to other bits in the app",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAppLink,description:"Tags for the app link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.author]:{since:"4.2.0",baseBitType:d._standard,description:"Represents an author of something",tags:[{key:ce.property_fullName,description:"Full name of the author"},{key:ce.property_pseudonym,description:"A pseudonym of the author, if any"},{key:ce.property_title,description:'The title of the author, e.g. "Dr.", "Prof.", etc.',jsonKey:"title"},{key:ce.property_jobTitle,description:'The job title of the author, e.g. "Software Engineer", "Professor", etc.'}]},[d.bookAuthor]:{since:"4.2.0",baseBitType:d.author,description:"Represents an author of a book"},[d.articleAuthor]:{since:"4.2.0",baseBitType:d.author,description:"Represents an author of a book"},[d.article]:{since:"1.3.0",baseBitType:d._standard,description:"Article bit, used for articles / paragraphs",tags:[{key:ce.tag_title,description:"The title of the article"}]},[d.articleAlt]:{since:"1.15.0",baseBitType:d.article,description:"Alternative article bit"},[d.articleResponsive]:{since:"1.21.0",baseBitType:d.article,description:"Responsive article bit, used for articles that adapt to the screen size",tags:[{key:ce.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:v,defaultValue:"true"}]},[d.articleResponsiveAlt]:{since:"2.0.0",baseBitType:d.articleResponsive,description:"Alternative responsive article bit"},[d.standardArticleNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard normative article bit"},[d.standardArticleNonNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard non-normative article bit"},[d.smartStandardArticleNormative]:{since:"1.28.0",baseBitType:d.standardArticleNormative,description:"Smart standard normative article bit"},[d.smartStandardArticleNonNormative]:{since:"1.28.0",baseBitType:d.standardArticleNonNormative,description:"Smart standard non-normative article bit"},[d.smartStandardArticleNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardArticleNormative,description:"Smart standard normative article bit that is collapsible"},[d.smartStandardArticleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardArticleNonNormative,description:"Smart standard non-normative article bit that is collapsible"},[d.statement]:{since:"1.3.0",baseBitType:d.article,description:"Statement bit, used for statements in documents"},[d.pageArticle]:{since:"1.15.0",baseBitType:d.article,description:"Page article bit"},[d.pageArticleAlt]:{since:"1.15.0",baseBitType:d.article,description:"Alternative page article bit"},[d.pageArticleResponsive]:{since:"1.21.0",baseBitType:d.article,description:"Responsive page article bit, used for articles that adapt to the screen size",tags:[{key:ce.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:v,defaultValue:"true"}]},[d.buttonCopyText]:{since:"1.4.3",baseBitType:d.article,description:"Button copy text bit, used to create a button that copies text to the clipboard",tags:[{key:ce.property_buttonCaption,description:"The caption of the button",format:b}]},[d.catalogItemBook]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item book bit, used to represent a book product in a catalog with cover and description",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.resource_coverImage,description:"Cover image of the catalog item",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_content2Buy,description:"Content to buy identifier",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.catalogItemExternalBook]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item external book bit, used to represent an external book product in a catalog with link to external shop",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.resource_coverImage,description:"Cover image of the catalog item",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the cover image resource"}]},{key:ce.property_customerProductShopLink,description:"Link to external shop for the product",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.catalogItemProduct]:{since:"4.15.0",baseBitType:d._standard,description:"Catalog item product bit, used to represent a general product in a catalog with cover and description",tags:[{key:ce.tag_title,description:"Title and subtitle of the catalog item",maxCount:2},{key:ce.property_coverImage,description:"Cover image of the catalog item",format:b},{key:ce.property_content2Buy,description:"Content to buy identifier",format:b},{key:ce.property_listPrice,description:"List price of the catalog item",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button",format:b},{key:ce.property_customerProductId,description:"Customer-specific product identifier",format:b},{key:ce.property_currency,description:"Currency for the catalog item",format:b},{key:ce.property_bookIsbn,description:"ISBN for iBook version",format:b},{key:ce.property_bookAuthor,description:"Author of the book",format:b},{key:ce.property_bookType,description:"Type of the book",format:b},{key:ce.property_bookBindingType,description:"Binding type of the book",format:b},{key:ce.property_bookNumberOfPages,description:"Number of pages in the book",format:b},{key:ce.property_bookRating,description:"Rating of the book",format:b},{key:ce.property_bookSeriesTitle,description:"Title of the book series",format:b},{key:ce.property_bookSeriesId,description:"ID of the book series",format:b},{key:ce.property_bookSeriesNumber,description:"Number in the book series",format:b},{key:ce.property_bookLanguage,description:"Language of the book",format:b},{key:ce.property_bookPublishingDate,description:"Publishing date of the book",format:b},{key:ce.property_bookPublisher,description:"Publisher of the book",format:b},{key:ce.property_bookTranslator,description:"Translator of the book",format:b},{key:ce.property_bookOriginalTitle,description:"Original title of the book",format:b},{key:ce.property_gmbExternalShop,description:"External shop identifier",format:b},{key:ce.property_gmbExternalShopItems,description:"Array of external shop items",format:b,maxCount:u},{key:ce.group_imageSource,description:"Image source chain"},{key:ce.group_previewImages,description:"Array of preview images for the catalog item",maxCount:u},{key:ce.group_previewVideos,description:"Array of preview videos for the catalog item",maxCount:u}],rootExampleType:m},[d.callToAction]:{since:"1.15.0",baseBitType:d._standard,description:"Call to action bit, used to create a call to action button",tags:[{key:ce.property_buttonCaption,description:"The caption of the call to action button",format:b},{key:ce.property_callToActionUrl,description:"The URL to navigate to when the call to action button is clicked",format:b,minCount:1}]},[d.callToActionSubscribe]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action subscribe bit"},[d.callToActionContact]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action contact bit"},[d.callToActionJoin]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action join bit"},[d.callToActionMail]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action mail bit"},[d.callToActionLearnMore]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action learn more bit"},[d.callToActionSeeMore]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action see more bit"},[d.callToActionWatch]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action watch bit"},[d.callToActionStartNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action start now bit"},[d.callToActionGetOffer]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action get offer bit"},[d.callToActionBookNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action book now bit"},[d.callToActionShopNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action shop now bit"},[d.callToActionGetNow]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action get now bit"},[d.callToActionDownload]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action download bit"},[d.callToActionCreateAccount]:{since:"1.15.0",baseBitType:d.callToAction,description:"Call to action create account bit"},[d.appBitmarkFromJavascript]:{since:"1.4.5",baseBitType:d._standard,description:"App bitmark from JavaScript, used to create bits from JavaScript in the app",tags:[{key:ce.property_maxCreatedBits,description:"The maximum number of bits that can be created from this bit",format:k}],textFormatDefault:x.plainText},[d.appBitmarkFromEditor]:{since:"1.4.5",baseBitType:d.appBitmarkFromJavascript,description:"App bitmark from editor, used to create bits from the editor in the app"},[d.articleEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Article embed bit, used to embed articles from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceArticleEmbed,description:"Tags for the article embed resource",minCount:1}],resourceAttachmentAllowed:!1},[d.articleLink]:{since:"1.3.0",baseBitType:d._standard,description:"Article link bit, used to link to articles from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceArticleLink,description:"Tags for the article link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audio]:{since:"1.3.0",baseBitType:d._standard,description:"Audio bit, used for audio files",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudio,description:"Tags for the audio resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audioEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Audio embed bit, used to embed audio files from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudioEmbed,description:"Tags for the audio embed resource",minCount:1}],resourceAttachmentAllowed:!1},[d.audioLink]:{since:"1.3.0",baseBitType:d._standard,description:"Audio link bit, used to link to audio files from other sources",tags:[{key:ce.group_resourceBitTags,description:"Tags for the resource bit"},{key:ce.group_resourceAudioLink,description:"Tags for the audio link resource",minCount:1}],resourceAttachmentAllowed:!1},[d.bitAlias]:{since:"1.3.0",baseBitType:d._standard,description:"Bit alias, used to create an alias for a bit",tags:[{key:ce.tag_reference,description:"The reference to the bit that this alias points to"},{key:ce.tag_anchor,description:"The anchor for the bit alias, used for linking"}]},[d.diff]:{since:"3.13.0",baseBitType:d._standard,description:"Diff bit, used to show differences between two bits",tags:[{key:ce.property_diffTo,description:"The reference to the bit that this diff compares to",format:b}]},[d.book]:{since:"1.3.0",baseBitType:d._standard,description:"Book bit, used to represent a book",tags:[{key:ce.group_bookCommon,description:"Common tags for book bits"}]},[d.bookEnd]:{since:"3.27.0",baseBitType:d.article,description:"End of book bit"},[d.bookAcknowledgements]:{since:"1.17.0",baseBitType:d.article,description:"Acknowledgements section of a book"},[d.bookAddendum]:{since:"1.3.0",baseBitType:d.article,description:"Addendum section of a book"},[d.bookAfterword]:{since:"1.3.0",baseBitType:d.article,description:"Afterword section of a book"},[d.bookAppendix]:{since:"1.3.0",baseBitType:d.article,description:"Appendix section of a book"},[d.bookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Article section of a book"},[d.bookAutherBio]:{since:"1.3.0",baseBitType:d.article,description:"Author biography section of a book"},[d.bookBibliography]:{since:"1.3.0",baseBitType:d.article,description:"Bibliography section of a book"},[d.bookComingSoon]:{since:"1.3.0",baseBitType:d.article,description:"Coming soon section of a book"},[d.bookConclusion]:{since:"1.3.0",baseBitType:d.article,description:"Conclusion section of a book"},[d.bookCopyright]:{since:"1.3.0",baseBitType:d.article,description:"Copyright section of a book"},[d.bookCopyrightPermissions]:{since:"1.3.0",baseBitType:d.article,description:"Copyright permissions section of a book"},[d.bookDedication]:{since:"1.3.0",baseBitType:d.article,description:"Dedication section of a book"},[d.bookEndnotes]:{since:"1.3.0",baseBitType:d.article,description:"Endnotes section of a book"},[d.bookEpigraph]:{since:"1.3.0",baseBitType:d.article,description:"Epigraph section of a book"},[d.bookEpilogue]:{since:"1.3.0",baseBitType:d.article,description:"Epilogue section of a book"},[d.bookForword]:{since:"1.3.0",baseBitType:d.article,description:"Foreword section of a book"},[d.bookFrontispiece]:{since:"1.3.0",baseBitType:d.article,description:"Frontispiece section of a book"},[d.bookImprint]:{since:"1.3.0",baseBitType:d.article,description:"Imprint section of a book"},[d.bookIncitingIncident]:{since:"1.3.0",baseBitType:d.article,description:"Inciting incident section of a book"},[d.bookIntroduction]:{since:"1.3.0",baseBitType:d.article,description:"Introduction section of a book"},[d.bookListOfContributors]:{since:"1.3.0",baseBitType:d.article,description:"List of contributors section of a book"},[d.bookNotes]:{since:"1.3.0",baseBitType:d.article,description:"Notes section of a book"},[d.bookPostscript]:{since:"1.3.0",baseBitType:d.article,description:"Postscript section of a book"},[d.bookPreface]:{since:"1.3.0",baseBitType:d.article,description:"Preface section of a book"},[d.bookPrologue]:{since:"1.3.0",baseBitType:d.article,description:"Prologue section of a book"},[d.bookReadMore]:{since:"1.3.0",baseBitType:d.article,description:"Read more section of a book"},[d.bookReferenceList]:{since:"3.2.0",baseBitType:d._standard,description:"Book reference list, used to list references in a book",cardSet:z},[d.bookRequestForABookReview]:{since:"1.3.0",baseBitType:d.article,description:"Request for a book review section of a book"},[d.bookSummary]:{since:"1.3.0",baseBitType:d.article,description:"Summary section of a book"},[d.bookTeaser]:{since:"1.3.0",baseBitType:d.article,description:"Teaser section of a book"},[d.bookTitle]:{since:"1.3.0",baseBitType:d.article,description:"Title section of a book"},[d.bookCover]:{since:"3.27.0",baseBitType:d.image,description:"Cover image of a book",tags:[{key:ce.tag_title,description:"The title of the book cover",maxCount:2},{key:ce.property_coverColor,description:"The color of the book cover",format:b}]},[d.bookAlias]:{since:"1.4.3",baseBitType:d.book,description:"Book alias, used to create an alias for a book",tags:[{key:ce.property_bookAlias,description:"The alias for the book",format:b,maxCount:u}]},[d.bookDiff]:{since:"3.10.0",baseBitType:d.book,description:"Book diff, used to show differences between two book versions",tags:[{key:ce.property_bookDiff,description:"The reference to the book that this diff compares to",format:b}]},[d.bookClose]:{since:"1.18.0",baseBitType:d.article,description:"Close section of a book, used to close the book",tags:[{key:ce.property_buttonCaption,description:"The caption of the close button",format:b}]},[d.bookReference]:{since:"2.2.0",baseBitType:d.article,description:"Book reference, used to reference a book in another book",tags:[{key:ce.property_refAuthor,description:"The author of the referenced book",format:b,maxCount:u},{key:ce.property_refBookTitle,description:"The title of the referenced book",format:b},{key:ce.property_refPublisher,description:"The publisher of the referenced book",format:b,maxCount:u},{key:ce.property_refPublicationYear,description:"The publication year of the referenced book",format:b},{key:ce.property_citationStyle,description:"The citation style to use for the book reference",format:b}]},[d.botActionResponse]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action response bit, used to define responses for bot actions",cardSet:O},[d.botActionSend]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action send bit, used to define actions for sending messages",tags:[{key:ce.property_date,description:"The date when the message should be sent",format:b}]},[d.browserImage]:{since:"1.3.0",baseBitType:d.image,description:"Browser image bit, used to display images in the browser",tags:[{key:ce.property_focusX,description:"The X coordinate for focusing the image in the browser",format:k},{key:ce.property_focusY,description:"The Y coordinate for focusing the image in the browser",format:k}]},[d.card1]:{since:"1.3.0",baseBitType:d._standard,description:"Card bit, used for cards in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"}]},[d.question1]:{since:"1.3.0",baseBitType:d.card1,description:"Question card bit"},[d.survey1]:{since:"1.3.0",baseBitType:d.card1,description:"Survey card bit"},[d.surveyAnonymous1]:{since:"1.3.0",baseBitType:d.card1,description:"Anonymous survey card bit"},[d.chapter]:{since:"1.3.0",baseBitType:d._standard,description:"Chapter bit, used to define chapters in books or articles",tags:[{key:ce.tag_anchor,description:"The anchor for the chapter, used for linking"},{key:ce.tag_title,description:"The title of the chapter"},{key:ce.property_toc,description:"If the chapter should be included in the table of contents",format:v,defaultValue:"true"},{key:ce.property_progress,description:"The progress of the chapter, used for tracking reading progress",format:v,defaultValue:"true"}]},[d.clozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:d._standard,description:"Cloze and multiple choice text bit, used for quizzes with cloze and multiple choice questions",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.group_gap,description:"Tags for gaps in cloze and multiple choice text bits"},{key:ce.group_trueFalse,description:"Tags for true/false questions in cloze and multiple choice text bits"}]},[d.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:d.clozeAndMultipleChoiceText,description:"Coach call to action cloze and multiple choice text bit"},[d.cloze]:{since:"1.3.0",baseBitType:d._standard,description:"Cloze bit, used for fill-in-the-blank questions in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.property_isCaseSensitive,description:"If the cloze answers are case sensitive",format:v},{key:ce.property_quizCountItems,description:"The number of items in the cloze quiz",format:v},{key:ce.property_quizStrikethroughSolutions,description:"If the cloze solutions should be strikethrough",format:v},{key:ce.group_gap,description:"Tags for gaps in cloze bits"}]},[d.clozeInstructionGrouped]:{since:"1.3.0",baseBitType:d.cloze,description:"Cloze instruction grouped bit, used for cloze questions with grouped instructions"},[d.clozeSolutionGrouped]:{since:"1.3.0",baseBitType:d.cloze,description:"Cloze solution grouped bit, used for cloze questions with grouped solutions"},[d.clozeSeveral]:{since:"3.5.0",baseBitType:d.cloze,description:"Cloze several bit, used for cloze questions with multiple answers"},[d.gapText]:{since:"1.5.15",baseBitType:d.cloze,description:"Gap text bit, used for fill-in-the-blank questions in quizzes with text gaps"},[d.gapTextInstructionGrouped]:{since:"1.5.15",baseBitType:d.clozeInstructionGrouped,description:"Gap text instruction grouped bit, used for fill-in-the-blank questions with grouped instructions"},[d.coachSelfReflectionCloze]:{since:"1.3.0",baseBitType:d.cloze,description:"Coach self-reflection cloze bit, used for self-reflection questions in coaching"},[d.coachCallToActionCloze]:{since:"1.3.0",baseBitType:d.cloze,description:"Coach call to action cloze bit, used for call to action questions in coaching"},[d.clozeList]:{since:"1.4.13",baseBitType:d._standard,description:"Cloze list bit, used for lists of cloze questions in quizzes",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"}],cardSet:M},[d.code]:{since:"1.3.0",baseBitType:d._standard,description:"Code bit, used for code snippets in articles or documents",tags:[{key:ce.property_computerLanguage,description:"The programming language of the code snippet",format:b},{key:ce.property_codeLineNumbers,description:"If line numbers should be displayed for the code snippet",format:v},{key:ce.property_codeMinimap,description:"If a minimap should be displayed for the code snippet",format:v}],textFormatDefault:x.plainText},[d.formula]:{since:"1.35.0",baseBitType:d._standard,description:"Formula bit, used for mathematical formulas in articles or documents",textFormatDefault:x.latex},[d.smartStandardFormula]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard formula bit, used for mathematical formulas in smart standards"},[d.smartStandardFormulaNonNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard non-normative formula bit, used for mathematical formulas in smart standards that are non-normative"},[d.smartStandardFormulaNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard normative formula bit, used for mathematical formulas in smart standards that are normative"},[d.smartStandardRemarkFormula]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard remark formula bit, used for mathematical formulas in smart standards remarks"},[d.smartStandardRemarkFormulaNonNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard non-normative remark formula bit, used for mathematical formulas in smart standards remarks that are non-normative"},[d.smartStandardRemarkFormulaNormative]:{since:"3.11.0",baseBitType:d.formula,description:"Smart standard normative remark formula bit, used for mathematical formulas in smart standards remarks that are normative"},[d.appCodeCell]:{since:"1.4.3",baseBitType:d.code,description:"App code cell, used to create code cells in the app editor"},[d.appCodeEditor]:{since:"1.4.3",baseBitType:d.code,description:"App code editor, used to create code editors in the app editor"},[d.appCodeIde]:{since:"1.4.3",baseBitType:d.code,description:"App code IDE, used to create code IDEs in the app editor"},[d.codeRuntime]:{since:"1.4.3",baseBitType:d.code,description:"Code runtime, used to define the runtime environment for code snippets"},[d.consoleLog]:{since:"1.4.3",baseBitType:d.code,description:"Console log, used to log messages to the console in code snippets"},[d.output]:{since:"1.4.3",baseBitType:d.code,description:"Output bit, used to display output from code snippets"},[d.stdout]:{since:"1.4.3",baseBitType:d.code,description:"Standard output bit, used to display standard output from code snippets"},[d.sandbox]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox bit, used to create a sandboxed environment for code execution"},[d.sandboxOutputJson]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output JSON bit, used to display JSON output from sandboxed code"},[d.sandboxOutputMarkup]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output markup bit, used to display markup output from sandboxed code"},[d.sandboxOutputRender]:{since:"4.10.0",baseBitType:d.code,description:"A sandbox output render bit, used to display rendered output from sandboxed code"},[d.step]:{since:"1.5.1",baseBitType:d.article,description:"Step bit, used to define steps in a process or guide"},[d.stepImageScreenshot]:{since:"1.5.1",baseBitType:d.image,description:"Step image screenshot bit, used to display screenshots in steps"},[d.stepImageScreenshotWithPointer]:{since:"1.5.1",baseBitType:d.image,description:"Step image screenshot with pointer bit, used to display screenshots with pointers in steps",tags:[{key:ce.property_pointerTop,description:"The top position of the pointer in the screenshot",format:b,minCount:1,maxCount:1},{key:ce.property_pointerLeft,description:"The left position of the pointer in the screenshot",format:b,minCount:1,maxCount:1}]},[d.milestone]:{since:"1.20.0",baseBitType:d.step,description:"Milestone bit, used to define milestones in a process or guide"},[d.conversationLeft1]:{since:"1.3.0",baseBitType:d._standard,description:"Conversation left bit, used to create a conversation on the left side of the screen",tags:[{key:ce.group_person,description:"Tags for the person in the conversation"}]},[d.conversationLeft1Scream]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation left scream bit, used to create a conversation with a scream on the left side of the screen"},[d.conversationLeft1Thought]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation left thought bit, used to create a conversation with a thought on the left side of the screen"},[d.conversationRight1]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right bit, used to create a conversation on the right side of the screen"},[d.conversationRight1Scream]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right scream bit, used to create a conversation with a scream on the right side of the screen"},[d.conversationRight1Thought]:{since:"1.3.0",baseBitType:d.conversationLeft1,description:"Conversation right thought bit, used to create a conversation with a thought on the right side of the screen"},[d.clozeAndMultipleChoiceTextConversationLeft1]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationLeft1Scream]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationLeft1Thought]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1Scream]:{since:"1.3.0",baseBitType:d.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"},[d.clozeAndMultipleChoiceTextConversationRight1Thought]:{since:"1.3.0",baseBitType:d.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"},[d.advertising]:{since:"4.2.0",baseBitType:d.article,description:"General advertising content bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingAdvertorial]:{since:"4.2.0",baseBitType:d.article,description:"Advertorial content bit (sponsored article)",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingCallToAction]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for advertising",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingCallToActionMeeting]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for meeting or appointment",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingBanner]:{since:"4.2.0",baseBitType:d.image,description:"Banner advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingSkyscraper]:{since:"4.2.0",baseBitType:d.image,description:"Skyscraper (vertical) advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingRectangle]:{since:"4.2.0",baseBitType:d.image,description:"Rectangle advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingFullPage]:{since:"4.2.0",baseBitType:d.image,description:"Full-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingHalfPage]:{since:"4.2.0",baseBitType:d.image,description:"Half-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingQuarterPage]:{since:"4.2.0",baseBitType:d.image,description:"Quarter-page advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingClassifiedPage]:{since:"4.2.0",baseBitType:d.image,description:"Classifieds advertisement page bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingLandscape]:{since:"4.2.0",baseBitType:d.image,description:"Landscape format advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.advertisingPortrait]:{since:"4.2.0",baseBitType:d.image,description:"Portrait format advertisement bit",tags:[{key:ce.group_advertisingCommon,description:"Common advertising tags"}]},[d.cookPreparation]:{since:"1.3.0",baseBitType:d.article,description:"Cook preparation bit"},[d.cookStep]:{since:"1.3.0",baseBitType:d.article,description:"Cook step bit"},[d.cookIngredients]:{since:"1.5.16",baseBitType:d._standard,description:"Cook ingredients bit, used to define ingredients for recipes",tags:[{key:ce.group_technicalTerm,description:"Tags for technical terms related to ingredients"},{key:ce.property_servings,description:"The number of servings for the ingredients",format:k,chain:[{key:ce.property_unit,description:"The unit of measurement for the ingredients",format:b},{key:ce.property_unitAbbr,description:"The abbreviation for the unit of measurement",format:b},{key:ce.property_decimalPlaces,description:"The number of decimal places for the ingredient quantity",format:k,defaultValue:"1"},{key:ce.property_disableCalculation,description:"If the ingredient quantity calculation should be disabled",format:v},{key:ce.tag_hint,description:"Hint for the ingredient, used to provide additional information"}]}],cardSet:q},[d.recipe]:{since:"1.5.24",baseBitType:d.cookIngredients,description:"Recipe bit, used to define a recipe"},[d.cookRemark]:{since:"1.3.0",baseBitType:d.article,description:"Cook remark bit, used to add remarks to recipes"},[d.cookVariation]:{since:"1.3.0",baseBitType:d.article,description:"Cook variation bit, used to define variations of recipes"},[d.cookInsert]:{since:"1.3.0",baseBitType:d.article,description:"Cook insert bit, used to insert additional content in recipes"},[d.cookNoteOnQuantity]:{since:"3.27.0",baseBitType:d.article,description:"Cook note on quantity bit, used to add notes on ingredient quantities in recipes"},[d.cookArrangement]:{since:"1.3.0",baseBitType:d.article,description:"Cook arrangement bit, used to arrange ingredients or steps in recipes"},[d.cookPracticeAdvise]:{since:"1.3.0",baseBitType:d.article,description:"Cook practice advice bit, used to provide practical advice in recipes"},[d.cookPlate]:{since:"1.3.0",baseBitType:d.article,description:"Cook plate bit, used to define the presentation of a dish"},[d.cookRecommendation]:{since:"1.3.0",baseBitType:d.article,description:"Cook recommendation bit, used to recommend dishes or ingredients"},[d.cookPersonalRecommendation]:{since:"1.3.0",baseBitType:d.article,description:"Cook personal recommendation bit, used to provide personal recommendations for dishes or ingredients"},[d.cookSideDrink]:{since:"1.3.0",baseBitType:d.article,description:"Cook side drink bit, used to define side drinks for dishes"},[d.cookSideDish]:{since:"1.3.0",baseBitType:d.article,description:"Cook side dish bit, used to define side dishes for main courses"},[d.cookTimer]:{since:"1.3.0",baseBitType:d.article,description:"Cook timer bit, used to set timers for cooking steps"},[d.document]:{since:"1.3.0",baseBitType:d._standard,description:"Document bit, used to define documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize documents"},{key:ce.group_resourceDocument,description:"Tags for document resources, used to define documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.documentDownload]:{since:"1.3.0",baseBitType:d._standard,description:"Document download bit, used to define downloadable documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize downloadable documents"},{key:ce.group_resourceDocumentDownload,description:"Tags for downloadable document resources, used to define downloadable documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.leDocumentDownload]:{since:"3.18.0",baseBitType:d.documentDownload,description:"LE Document download bit, used to define downloadable documents in learning experiences"},[d.documentEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Document embed bit, used to embed documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize embedded documents"},{key:ce.group_resourceDocumentEmbed,description:"Tags for embedded document resources, used to define embedded documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.documentLink]:{since:"1.3.0",baseBitType:d._standard,description:"Document link bit, used to link to documents in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Tags for resource bits, used to categorize document links"},{key:ce.group_resourceDocumentLink,description:"Tags for document link resources, used to define links to documents in articles or books",minCount:1}],resourceAttachmentAllowed:!1},[d.essay]:{since:"1.3.0",baseBitType:d._standard,description:"Essay bit, used to define essays in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common tags for quiz bits"},{key:ce.property_reasonableNumOfChars,description:"The reasonable number of characters for the essay",format:k},{key:ce.property_sampleSolution,description:"Sample solution for the essay, used as a reference answer",format:b},{key:ce.property_partialAnswer,description:"Partial answer for the essay, used to indicate incomplete answers",format:b},{key:ce.property_reference,description:"Reference for the essay, used to link to external resources",format:b,maxCount:u}],rootExampleType:m},[d.coachSelfReflectionEssay]:{since:"1.3.0",baseBitType:d.essay,description:"Coach self-reflection essay bit"},[d.coachCallToActionEssay]:{since:"1.3.0",baseBitType:d.essay,description:"Coach call to action essay bit"},[d.example]:{since:"1.3.0",baseBitType:d._standard,description:"Example bit, used to provide examples in articles or books",tags:[{key:ce.tag_title,description:"The title of the example"}],rootExampleType:m},[d.exampleAlt]:{since:"1.16.0",baseBitType:d.example,description:"Alternative example bit, used to provide alternative examples in articles or books"},[d.standardExampleNormative]:{since:"1.16.0",baseBitType:d.example,description:"Standard normative example bit, used to provide normative examples in articles or books"},[d.standardExampleNonNormative]:{since:"1.16.0",baseBitType:d.example,description:"Standard non-normative example bit, used to provide non-normative examples in articles or books"},[d.smartStandardExampleNormative]:{since:"1.28.0",baseBitType:d.standardExampleNormative,description:"Smart standard normative example bit, used to provide normative examples in smart standards"},[d.smartStandardExampleNonNormative]:{since:"1.28.0",baseBitType:d.standardExampleNonNormative,description:"Smart standard non-normative example bit, used to provide non-normative examples in smart standards"},[d.smartStandardExampleNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardExampleNormative,description:"Smart standard normative example collapsible bit, used to provide normative examples in smart standards that can be collapsed"},[d.smartStandardExampleNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardExampleNonNormative,description:"Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"},[d.authorContentBitGenerator]:{since:"4.2.0",baseBitType:d.article,description:"Body contains the content of one or more bits to be created by the bit generator",tags:[{key:ce.property_classification,description:"Classification for the created bits",format:b,maxCount:u}]},[d.appAiPrompt]:{since:"1.3.0",baseBitType:d.article,description:"App AI prompt bit, used to create AI prompts in the app editor"},[d.aiPrompt]:{since:"1.3.0",baseBitType:d.article,description:"AI prompt bit, used to create AI prompts in articles or books"},[d.aiChat]:{since:"4.2.0",baseBitType:d.article,description:"AI chat bit, used to create an AI chat"},[d.aiEditor]:{since:"4.2.0",baseBitType:d.article,description:"AI editor bit, used to create an AI editor"},[d.aiTutor]:{since:"4.2.0",baseBitType:d.article,description:"AI tutor bit, used to create an AI tutor"},[d.aiWbt]:{since:"4.2.0",baseBitType:d.article,description:"AI WBT bit, used to create an AI WBT (Web-Based Training)"},[d.articleAi]:{since:"1.3.0",baseBitType:d.article,description:"Article AI bit, used to create AI-generated articles"},[d.articleAttachment]:{since:"1.3.0",baseBitType:d.article,description:"Article attachment bit, used to attach files to articles"},[d.assignment]:{since:"1.3.0",baseBitType:d.essay,description:"Assignment bit, used to define assignments in articles or books"},[d.audioTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Audio transcript bit, used to provide transcripts for audio files in articles or books"},[d.bitmarkExample]:{since:"1.3.0",baseBitType:d.example,description:"Bitmark example bit, used to provide examples for bitmarks in articles or books"},[d.blogArticle]:{since:"1.3.0",baseBitType:d.article,description:"Blog article bit, used to define blog articles in articles or books"},[d.bug]:{since:"1.3.0",baseBitType:d.article,description:"Bug bit, used to report bugs in articles or books"},[d.bugAlt]:{since:"1.16.0",baseBitType:d.bug,description:"Alternative bug bit, used to report bugs in articles or books with alternative styling"},[d.checklist]:{since:"1.3.0",baseBitType:d.article,description:"Checklist bit, used to create checklists in articles or books"},[d.coachAudioTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Coach audio transcript bit, used to provide transcripts for audio files in coaching articles or books"},[d.coachCallToActionChecklist]:{since:"1.3.0",baseBitType:d.article,description:"Coach call to action checklist bit, used to create checklists in coaching articles or books"},[d.coachHomeRules]:{since:"1.3.0",baseBitType:d.article,description:"Coach home rules bit, used to define home rules in coaching articles or books"},[d.coachVideoTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Coach video transcript bit, used to provide transcripts for video files in coaching articles or books"},[d.correction]:{since:"1.3.0",baseBitType:d.article,description:"Correction bit, used to provide corrections in articles or books"},[d.danger]:{since:"1.3.0",baseBitType:d.article,description:"Danger bit, used to highlight dangerous or critical information in articles or books"},[d.dangerAlt]:{since:"1.16.0",baseBitType:d.article,description:"Alternative danger bit, used to highlight dangerous or critical information in articles or books with alternative styling"},[d.definitionTerm]:{since:"1.34.0",baseBitType:d.article,description:"Definition term bit, used to define terms in articles or books"},[d.deleted]:{since:"3.9.0",baseBitType:d.article,description:"Deleted bit, used to indicate deleted content in articles or books"},[d.details1]:{since:"1.3.0",baseBitType:d.article,description:"Details bit, used to provide additional details in articles or books"},[d.details]:{since:"1.3.0",baseBitType:d.article,description:"Details bit, used to provide additional details in articles or books"},[d.qAndA]:{since:"3.5.0",baseBitType:d.article,description:"Q&A bit, used to create question and answer sections in articles or books"},[d.editorial]:{since:"1.3.0",baseBitType:d.article,description:"Editorial bit, used to provide editorial content in articles or books"},[d.editorNote]:{since:"1.3.0",baseBitType:d.article,description:"Editor note bit, used to provide notes from the editor in articles or books"},[d.featured]:{since:"1.3.0",baseBitType:d.article,description:"Featured bit, used to highlight featured content in articles or books"},[d.glossaryTerm]:{since:"1.33.0",baseBitType:d.article,description:"Glossary term bit, used to define glossary terms in articles or books"},[d.help]:{since:"1.3.0",baseBitType:d.article,description:"Help bit, used to provide help or support information in articles or books"},[d.helpAlt]:{since:"1.16.0",baseBitType:d.help,description:"Alternative help bit, used to provide help or support information in articles or books with alternative styling"},[d.hint]:{since:"1.3.0",baseBitType:d.article,description:"Hint bit, used to provide hints or tips in articles or books"},[d.hintAlt]:{since:"1.16.0",baseBitType:d.hint,description:"Alternative hint bit, used to provide hints or tips in articles or books with alternative styling"},[d.indexTerm]:{since:"1.33.0",baseBitType:d.article,description:"Index term bit, used to define index terms in articles or books"},[d.info]:{since:"1.3.0",baseBitType:d.article,description:"Info bit, used to provide informational content in articles or books"},[d.infoAlt]:{since:"1.16.0",baseBitType:d.info,description:"Alternative info bit, used to provide informational content in articles or books with alternative styling"},[d.langLearningOutcomes]:{since:"1.3.0",baseBitType:d.article,description:"Language learning outcomes bit, used to define learning outcomes in language articles or books"},[d.langEnablingLanguageSkills]:{since:"1.3.0",baseBitType:d.article,description:"Language enabling skills bit, used to define enabling language skills in language articles or books"},[d.langLifeSkills]:{since:"1.3.0",baseBitType:d.article,description:"Language life skills bit, used to define life skills in language articles or books"},[d.langEnglishAroundWorld]:{since:"1.3.0",baseBitType:d.article,description:"Language English around the world bit, used to provide information about English usage around the world in language articles or books"},[d.langGoodToKnow]:{since:"1.3.0",baseBitType:d.article,description:"Language good to know bit, used to provide useful information in language articles or books"},[d.langLearningGoal]:{since:"1.3.0",baseBitType:d.article,description:"Language learning goal bit, used to define learning goals in language articles or books"},[d.langLearningStrategy]:{since:"1.3.0",baseBitType:d.article,description:"Language learning strategy bit, used to define learning strategies in language articles or books"},[d.langLikeALocal]:{since:"1.3.0",baseBitType:d.article,description:"Language like a local bit, used to provide tips for speaking like a local in language articles or books"},[d.langMaterial]:{since:"1.3.0",baseBitType:d.article,description:"Language material bit, used to provide language learning materials in language articles or books"},[d.langUsefulPhrases]:{since:"1.3.0",baseBitType:d.article,description:"Language useful phrases bit, used to provide useful phrases in language articles or books"},[d.langLevelDown]:{since:"1.3.0",baseBitType:d.article,description:"Language level down bit, used to provide information about lower language levels in language articles or books"},[d.langLevelUp]:{since:"1.3.0",baseBitType:d.article,description:"Language level up bit, used to provide information about higher language levels in language articles or books"},[d.langExtraActivity]:{since:"1.3.0",baseBitType:d.article,description:"Language extra activity bit, used to provide additional activities in language articles or books"},[d.langVideoScript]:{since:"1.3.0",baseBitType:d.article,description:"Language video script bit, used to provide scripts for language learning videos in articles or books"},[d.langAudioScript]:{since:"1.3.0",baseBitType:d.article,description:"Language audio script bit, used to provide scripts for language learning audio files in articles or books"},[d.langVocabulary]:{since:"1.3.0",baseBitType:d.article,description:"Language vocabulary bit, used to provide vocabulary lists in language articles or books"},[d.langHomework]:{since:"1.3.0",baseBitType:d.article,description:"Language homework bit, used to define homework assignments in language articles or books"},[d.langTeacherNote]:{since:"1.3.0",baseBitType:d.article,description:"Language teacher note bit, used to provide notes for teachers in language articles or books"},[d.langTeacherPronunciation]:{since:"1.3.0",baseBitType:d.article,description:"Language teacher pronunciation bit, used to provide pronunciation guidance for teachers in language articles or books"},[d.list]:{since:"1.22.0",baseBitType:d.article,description:"List bit, used to create lists in articles or books"},[d.standardList]:{since:"1.22.0",baseBitType:d.article,description:"Standard list bit, used to create standard lists in articles or books"},[d.smartStandardList]:{since:"1.28.0",baseBitType:d.standardList,description:"Smart standard list bit, used to create smart standard lists in articles or books"},[d.smartStandardListCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardList,description:"Smart standard list collapsible bit, used to create collapsible smart standard lists in articles or books"},[d.message]:{since:"1.3.0",baseBitType:d.article,description:"Message bit, used to create messages in articles or books"},[d.newspaperArticle]:{since:"1.3.0",baseBitType:d.article,description:"Newspaper article bit, used to define newspaper articles in articles or books"},[d.note]:{since:"1.3.0",baseBitType:d.article,description:"Note bit, used to provide notes in articles or books"},[d.noteAlt]:{since:"1.16.0",baseBitType:d.note,description:"Alternative note bit, used to provide notes in articles or books with alternative styling"},[d.standardNoteNormative]:{since:"1.16.0",baseBitType:d.note,description:"Standard normative note bit, used to provide normative notes in articles or books"},[d.standardNoteNonNormative]:{since:"1.16.0",baseBitType:d.note,description:"Standard non-normative note bit, used to provide non-normative notes in articles or books"},[d.smartStandardNoteNormative]:{since:"1.28.0",baseBitType:d.standardNoteNormative,description:"Smart standard normative note bit, used to provide normative notes in smart standards"},[d.smartStandardNoteNonNormative]:{since:"1.28.0",baseBitType:d.standardNoteNonNormative,description:"Smart standard non-normative note bit, used to provide non-normative notes in smart standards"},[d.smartStandardNoteNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardNoteNormative,description:"Smart standard normative note collapsible bit, used to provide normative notes in smart standards that can be collapsed"},[d.smartStandardNoteNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardNoteNonNormative,description:"Smart standard non-normative note collapsible bit, used to provide non-normative notes in smart standards that can be collapsed"},[d.noteAi]:{since:"1.3.0",baseBitType:d.note,description:"Note AI bit, used to create AI-generated notes in articles or books"},[d.notebookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Notebook article bit, used to define notebook articles in articles or books"},[d.preparationNote]:{since:"1.3.0",baseBitType:d.article,description:"Preparation note bit, used to provide preparation notes in articles or books"},[d.releaseNotesSummary]:{since:"1.3.0",baseBitType:d.article,description:"Release notes summary bit, used to summarize release notes in articles or books"},[d.remark]:{since:"1.3.0",baseBitType:d.article,description:"Remark bit, used to provide remarks in articles or books"},[d.remarkAlt]:{since:"1.16.0",baseBitType:d.remark,description:"Alternative remark bit, used to provide remarks in articles or books with alternative styling"},[d.standardRemarkNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard normative remark bit, used to provide normative remarks in articles or books"},[d.standardRemarkNonNormative]:{since:"1.16.0",baseBitType:d.article,description:"Standard non-normative remark bit, used to provide non-normative remarks in articles or books"},[d.smartStandardRemarkNormative]:{since:"1.28.0",baseBitType:d.standardRemarkNormative,description:"Smart standard normative remark bit, used to provide normative remarks in smart standards"},[d.smartStandardRemarkNonNormative]:{since:"1.28.0",baseBitType:d.standardRemarkNonNormative,description:"Smart standard non-normative remark bit, used to provide non-normative remarks in smart standards"},[d.smartStandardRemarkNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkNormative,description:"Smart standard normative remark collapsible bit, used to provide normative remarks in smart standards that can be collapsed"},[d.smartStandardRemarkNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkNonNormative,description:"Smart standard non-normative remark collapsible bit, used to provide non-normative remarks in smart standards that can be collapsed"},[d.selfAssessment]:{since:"1.3.0",baseBitType:d.article,description:"Self-assessment bit, used to create self-assessment sections in articles or books"},[d.separator]:{since:"1.4.15",baseBitType:d.article,description:"Separator bit, used to create visual separators in articles or books"},[d.separatorAlt]:{since:"1.16.0",baseBitType:d.separator,description:"Alternative separator bit, used to create visual separators in articles or books with alternative styling"},[d.sticker]:{since:"1.5.28",baseBitType:d.article,description:"Sticker bit, used to create stickers in articles or books"},[d.sideNote]:{since:"1.3.0",baseBitType:d.article,description:"Side note bit, used to provide side notes in articles or books"},[d.summary]:{since:"1.3.0",baseBitType:d.article,description:"Summary bit, used to provide summaries in articles or books"},[d.summaryAi]:{since:"1.3.0",baseBitType:d.summary,description:"AI-generated summary bit"},[d.videoTranscript]:{since:"1.3.0",baseBitType:d.article,description:"Video transcript bit, used to provide transcripts for video files in articles or books"},[d.warning]:{since:"1.3.0",baseBitType:d.article,description:"Warning bit, used to highlight warnings in articles or books"},[d.warningAlt]:{since:"1.16.0",baseBitType:d.warning,description:"Alternative warning bit, used to highlight warnings in articles or books with alternative styling"},[d.workbookArticle]:{since:"1.3.0",baseBitType:d.article,description:"Workbook article bit, used to define workbook articles in articles or books"},[d.collapsible]:{since:"1.21.0",baseBitType:d.article,description:"Collapsible bit, used to create collapsible sections in articles or books"},[d.sideNoteCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Side note collapsible bit, used to create collapsible side notes in articles or books"},[d.infoCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Info collapsible bit, used to create collapsible informational sections in articles or books"},[d.remarkCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Remark collapsible bit, used to create collapsible remarks in articles or books"},[d.warningCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Warning collapsible bit, used to create collapsible warnings in articles or books"},[d.dangerCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Danger collapsible bit, used to create collapsible danger sections in articles or books"},[d.noteCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Note collapsible bit, used to create collapsible notes in articles or books"},[d.exampleCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Example collapsible bit, used to create collapsible examples in articles or books"},[d.hintCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Hint collapsible bit, used to create collapsible hints in articles or books"},[d.bugCollapsible]:{since:"1.21.0",baseBitType:d.article,description:"Bug collapsible bit, used to create collapsible bug reports in articles or books"},[d.platformPath]:{since:"3.14.1",baseBitType:d._standard,description:"Platform path bit, used to define paths in the platform",tags:[{key:ce.property_path,description:"The path for the platform, used to define navigation paths",format:b}]},[d.appCalculatorLatex]:{since:"4.10.0",baseBitType:d.article,description:"A LaTeX calculator bit, used to create a calculator that can interpret LaTeX expressions",tags:[{key:ce.property_formula,description:"The LaTeX formula for the calculator, used to define the calculation logic",format:b}]},[d.container]:{since:"1.9.0",baseBitType:d.article,description:"Container bit, used to group bits together in articles or books",tags:[{key:ce.property_allowedBit,description:"Allowed bits in the container, used to define which bits can be placed inside",format:b,maxCount:u}]},[d.containerWrap]:{since:"1.9.0",baseBitType:d.container,description:"Container wrap bit, used to wrap content in a container"},[d.containerNowrap]:{since:"1.9.0",baseBitType:d.container,description:"Container nowrap bit, used to prevent wrapping of content in a container"},[d.containerNowrapStretch]:{since:"1.9.0",baseBitType:d.container,description:"Container nowrap stretch bit, used to stretch content without wrapping in a container"},[d.containerGroup]:{since:"1.9.0",baseBitType:d.container,description:"Container group bit, used to group multiple containers together"},[d.containerFolder]:{since:"1.9.0",baseBitType:d.container,description:"Container folder bit, used to create folders for organizing bits"},[d.containerCarousel]:{since:"1.11.0",baseBitType:d.container,description:"Container carousel bit, used to create carousels for displaying bits"},[d.containerCards]:{since:"1.11.0",baseBitType:d.container,description:"Container cards bit, used to create card layouts for displaying bits"},[d.containerGrid]:{since:"1.11.0",baseBitType:d.container,description:"Container grid bit, used to create grid layouts for displaying bits"},[d.containerStack]:{since:"1.11.0",baseBitType:d.container,description:"Container stack bit, used to create stacked layouts for displaying bits"},[d.containerSlides]:{since:"1.11.0",baseBitType:d.container,description:"Container slides bit, used to create slide presentations for displaying bits"},[d.containerGallery]:{since:"1.11.0",baseBitType:d.container,description:"Container gallery bit, used to create galleries for displaying bits"},[d.containerScroller]:{since:"1.11.0",baseBitType:d.container,description:"Container scroller bit, used to create scrolling sections for displaying bits"},[d.containerTabs]:{since:"1.11.0",baseBitType:d.container,description:"Container tabs bit, used to create tabbed sections for displaying bits"},[d.containerAccordionTabs]:{since:"1.11.0",baseBitType:d.container,description:"Container accordion tabs bit, used to create accordion-style tabbed sections for displaying bits"},[d.containerFolderAll]:{since:"1.11.0",baseBitType:d.container,description:"Container folder all bit, used to create folders that can contain all types of bits"},[d.containerBits2]:{since:"1.11.0",baseBitType:d.container,description:"Container bits 2 bit, used to create a container for bits with additional features"},[d.containerCookRecipe]:{since:"1.11.0",baseBitType:d.container,description:"Container cook recipe bit, used to create recipe containers for displaying cooking recipes"},[d.containerNewsArticle]:{since:"1.11.0",baseBitType:d.container,description:"Container news article bit, used to create containers for news articles"},[d.containerPreview]:{since:"1.11.0",baseBitType:d.container,description:"Container preview bit, used to create preview sections for displaying bits"},[d.pageContainer]:{since:"1.9.0",baseBitType:d.container,description:"Page container bit, used to create containers for pages in articles or books"},[d.pageContainerWrap]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container wrap bit, used to wrap content in a page container"},[d.pageContainerNowrap]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container nowrap bit, used to prevent wrapping of content in a page container"},[d.pageContainerNowrapStretch]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container nowrap stretch bit, used to stretch content without wrapping in a page container"},[d.pageContainerFolder]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container folder bit, used to create folders for organizing bits in a page container"},[d.pageContainerGroup]:{since:"1.9.0",baseBitType:d.pageContainer,description:"Page container group bit, used to group multiple page containers together"},[d.metalevelExplanation]:{since:"1.10.0",baseBitType:d.article,description:"Metalevel explanation bit, used to provide explanations for metalevels in articles or books"},[d.module]:{since:"1.5.26",baseBitType:d.article,description:"Module bit, used to define modules in articles or books",tags:[{key:ce.property_hasBookNavigation,description:"Indicates if the module has book navigation",format:v,defaultValue:"true"},{key:ce.property_productId,description:"Product ID for the module, used to link to a specific product",format:b,minCount:1,maxCount:u},{key:ce.property_duration,description:"Duration of the module, used to indicate how long it takes to complete",format:b}]},[d.moduleProduct]:{since:"1.9.0",baseBitType:d.module,description:"Module product bit, used to define products in modules",tags:[{key:ce.property_productId,description:"Product ID for the module product, used to link to a specific product",format:b,minCount:1,maxCount:u}]},[d.exampleList]:{since:"1.4.13",baseBitType:d.example,description:"Example list bit, used to create lists of examples in articles or books",cardSet:D,rootExampleType:m},[d.extractorPage]:{since:"1.5.17",baseBitType:d.image,description:"Extractor page bit, used to extract pages from images"},[d.extractorPageCollapsible]:{since:"1.30.0",baseBitType:d.extractorPage,description:"Collapsible extractor page bit, used to extract pages from images with collapsible functionality"},[d.extractorPageWithBlocks]:{since:"1.5.21",baseBitType:d.image,description:"Extractor page with blocks bit, used to extract pages with blocks from images"},[d.extractorPageWithBlocksCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageWithBlocks,description:"Collapsible extractor page with blocks bit, used to extract pages with blocks from images with collapsible functionality"},[d.extractorConfiguration]:{since:"1.7.1",baseBitType:d._standard,description:"Extractor configuration bit, used to configure extractors in articles or books",textFormatDefault:x.plainText},[d.extractorImage]:{since:"4.3.0",baseBitType:d._standard,description:"Extractor images bit, used for images extracted from PDFs",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:u}],resourceAttachmentAllowed:!1,textFormatDefault:x.plainText},[d.extractorImageCollapsible]:{since:"4.3.0",baseBitType:d.extractorImage,description:"Collapsible extractor images bit, used for images extracted from PDFs"},[d.extractorInformation]:{since:"3.8.0",baseBitType:d._standard,description:"Extractor information bit, used to provide information about extractors in articles or books",textFormatDefault:x.json},[d.extractorAiChat]:{since:"3.19.0",baseBitType:d._standard,description:"Extractor AI chat bit, used to create AI chat interfaces for extractors in articles or books"},[d.extractorBlock]:{since:"1.5.16",baseBitType:d._standard,description:"Extractor block bit, used to define blocks within extractor pages",tags:[{key:ce.property_blockId,description:"Unique identifier for the block, used to reference the block in extractor pages",format:b},{key:ce.property_pageNo,description:"Page number for the block, used to indicate the page on which the block appears",format:k},{key:ce.property_x,description:"X-coordinate for the block, used to position the block on the page",format:k},{key:ce.property_y,description:"Y-coordinate for the block, used to position the block on the page",format:k},{key:ce.property_width,description:"Width of the block, used to define the size of the block on the page",format:k},{key:ce.property_height,description:"Height of the block, used to define the size of the block on the page",format:k},{key:ce.property_index,description:"Index of the block, used to order blocks within the extractor page",format:k},{key:ce.property_classification,description:"Classification for the block, used to categorize the block within the extractor",format:b},{key:ce.property_availableClassifications,description:"Available classifications for the block, used to define possible classifications",format:b,maxCount:u},{key:ce.group_resourceImage,description:"Resource image for the block, used to attach images to the block",minCount:1}],resourceAttachmentAllowed:!1},[d.extractorRepeatedText]:{since:"1.5.21",baseBitType:d.article,description:"Extractor repeated text bit, used to define repeated text in extractor pages"},[d.extractorPageNumber]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page number bit, used to define page numbers in extractor pages"},[d.extractorPageNumberCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageNumber,description:"Collapsible extractor page number bit, used to define page numbers in extractor pages with collapsible functionality"},[d.extractorPageHeader]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page header bit, used to define headers in extractor pages"},[d.extractorPageHeaderCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageHeader,description:"Collapsible extractor page header bit, used to define headers in extractor pages with collapsible functionality"},[d.extractorPageFooter]:{since:"1.5.21",baseBitType:d.article,description:"Extractor page footer bit, used to define footers in extractor pages"},[d.extractorPageFooterCollapsible]:{since:"1.30.0",baseBitType:d.extractorPageFooter,description:"Collapsible extractor page footer bit, used to define footers in extractor pages with collapsible functionality"},[d.pageOpenBook]:{since:"1.5.10",baseBitType:d.article,description:"Page open book bit, used to create pages that open books in articles or books",tags:[{key:ce.property_slug,description:"Slug for the book, used to identify the book in the system",format:b},{key:ce.property_book,description:"Book reference for the page, used to link to a specific book",format:b,chain:[{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system"},{key:ce.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button"},{key:ce.property_authorFullName,description:"Full name of the author",format:b},{key:ce.property_authorPseudonym,description:"A pseudonym of the author, if any",format:b},{key:ce.property_authorTitle,description:'The title of the author, e.g. "Dr.", "Prof.", etc.',format:b},{key:ce.property_authorJobTitle,description:'The job title of the author, e.g. "Software Engineer", "Professor", etc.',format:b}]},[d.openBookChapter]:{since:"4.16.0",baseBitType:d.pageOpenBook,description:"Open book chapter bit, derived from page-open-book, used to create chapter pages that open books"},[d.pageOpenBookList]:{since:"2.1.0",baseBitType:d.article,description:"Page open book list bit, used to create pages that open lists of books in articles or books",tags:[{key:ce.property_book,description:"Book reference for the page, used to link to a specific book",maxCount:u,chain:[{key:ce.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:ce.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button",format:b}]},[d.pageSubscribe]:{since:"1.5.10",baseBitType:d.article,description:"Page subscribe bit, used to create pages that allow users to subscribe to content",tags:[{key:ce.property_slug,description:"Slug for the subscription page, used to identify the page in the system",format:b},{key:ce.property_buttonCaption,description:"Caption for the subscription button, used to define the text displayed on the button",format:b},{key:ce.property_mailingList,description:"Mailing list for the subscription, used to link to a specific mailing list",format:b}]},[d.assignmentList]:{since:"1.4.13",baseBitType:d.exampleList,description:"Assignment list bit, used to create lists of assignments in articles or books"},[d.pageFooter]:{since:"1.4.13",baseBitType:d.article,description:"Page footer bit, used to create footers in articles or books",tags:[{key:ce.property_slug,description:"Slug for the footer, used to identify the footer in the system",format:b}],cardSet:D},[d.legend]:{since:"3.12.0",baseBitType:d._standard,description:"Legend bit, used to provide legends in articles or books",cardSet:C},[d.smartStandardLegend]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard legend bit, used to provide smart standard legends in articles or books"},[d.smartStandardLegendNonNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard non-normative legend bit, used to provide non-normative smart standard legends in articles or books"},[d.smartStandardLegendNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard normative legend bit, used to provide normative smart standard legends in articles or books"},[d.smartStandardRemarkLegend]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard remark legend bit, used to provide smart standard remarks in legends"},[d.smartStandardRemarkLegendNonNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard non-normative remark legend bit, used to provide non-normative smart standard remarks in legends"},[d.smartStandardRemarkLegendNormative]:{since:"3.12.0",baseBitType:d.legend,description:"Smart standard normative remark legend bit, used to provide normative smart standard remarks in legends"},[d.definitionList]:{since:"1.34.0",baseBitType:d._standard,description:"Definition list bit, used to create lists of definitions in articles or books",cardSet:C},[d.metaSearchDefaultTerms]:{since:"3.12.0",baseBitType:d._standard,description:"Meta search default terms bit, used to define default search terms in articles",cardSet:C},[d.metaSearchDefaultTopics]:{since:"3.12.0",baseBitType:d.metaSearchDefaultTerms,description:"Meta search default topics bit, used to define default search topics in articles"},[d.flashcard]:{since:"1.3.0",baseBitType:d._standard,description:"Flashcard bit, used to create flashcards in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for flashcards"}],cardSet:_},[d.flashcard1]:{since:"1.3.0",baseBitType:d.flashcard,description:"Flashcard 1 bit"},[d.qAndACard]:{since:"3.25.0",baseBitType:d.flashcard1,description:"Q&A card bit, used to create question and answer cards in articles or books"},[d.focusImage]:{since:"1.3.0",baseBitType:d.image,description:"Focus image bit, used to create images with focus points in articles or books",tags:[{key:ce.property_focusX,description:"X-coordinate for the focus point, used to define the focus area in the image",format:k},{key:ce.property_focusY,description:"Y-coordinate for the focus point, used to define the focus area in the image",format:k}]},[d.highlightText]:{since:"1.3.0",baseBitType:d._standard,description:"Highlight text bit, used to create highlighted text in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for highlighted text"},{key:ce.group_trueFalse,description:"True/False quiz tags for highlighted text"}]},[d.image]:{since:"1.3.0",baseBitType:d._standard,description:"Image bit, used to create images in articles or books",tags:[{key:ce.resource_backgroundWallpaper,description:"Background wallpaper for the image, used to set a background for the image",chain:[{key:ce.group_resourceImageCommon,description:"Common resource image tags for images"}]},{key:ce.group_resourceBitTags,description:"Resource bit tags for images, used to define additional properties for images"},{key:ce.group_resourceImage,description:"Resource image tags for images, used to attach images to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.appCreateBitsFromImage]:{since:"1.3.0",baseBitType:d.image,description:"App create bits from image bit, used to create bits from images in the app"},[d.appGetScreenshot]:{since:"1.3.0",baseBitType:d.image,description:"App get screenshot bit, used to capture screenshots in the app"},[d.detailsImage]:{since:"1.3.0",baseBitType:d.image,description:"Details image bit, used to create detailed images in articles or books"},[d.figure]:{since:"1.3.0",baseBitType:d.image,description:"Figure bit, used to create figures in articles or books",cardSet:C},[d.imageBanner]:{since:"1.3.0",baseBitType:d.image,description:"Image banner bit, used to create banners in articles or books"},[d.imageFigure]:{since:"1.3.0",baseBitType:d.image,description:"Image figure bit, used to create figures with images in articles or books",cardSet:C},[d.imageFigureAlt]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Alternative image figure bit, used to create figures with alternative images in articles or books"},[d.standardImageFigureNormative]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Standard normative image figure bit, used to create normative image figures in articles or books"},[d.standardImageFigureNonNormative]:{since:"1.16.0",baseBitType:d.imageFigure,description:"Standard non-normative image figure bit, used to create non-normative image figures in articles or books"},[d.smartStandardImageFigureNormative]:{since:"1.28.0",baseBitType:d.standardImageFigureNormative,description:"Smart standard normative image figure bit, used to create smart standard normative image figures in articles or books"},[d.smartStandardImageFigureNonNormative]:{since:"1.28.0",baseBitType:d.standardImageFigureNonNormative,description:"Smart standard non-normative image figure bit, used to create smart standard non-normative image figures in articles or books"},[d.smartStandardImageFigureNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardImageFigureNormative,description:"Collapsible smart standard normative image figure bit, used to create collapsible smart standard normative image figures in articles or books"},[d.smartStandardImageFigureNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardImageFigureNonNormative,description:"Collapsible smart standard non-normative image figure bit, used to create collapsible smart standard non-normative image figures in articles or books"},[d.imageLandscape]:{since:"1.3.0",baseBitType:d.image,description:"Image landscape bit, used to create landscape images in articles or books"},[d.imageMood]:{since:"1.3.0",baseBitType:d.image,description:"Image mood bit, used to create mood images in articles or books"},[d.imagePortrait]:{since:"1.3.0",baseBitType:d.image,description:"Image portrait bit, used to create portrait images in articles or books"},[d.imagePrototype]:{since:"1.3.0",baseBitType:d.image,description:"Image prototype bit, used to create prototype images in articles or books"},[d.imageSeparator]:{since:"1.4.15",baseBitType:d.image,description:"Image separator bit, used to create separators in articles or books"},[d.imageSeparatorAlt]:{since:"1.16.0",baseBitType:d.imageSeparator,description:"Alternative image separator bit, used to create alternative separators in articles or books"},[d.imageScreenshot]:{since:"1.3.0",baseBitType:d.image,description:"Image screenshot bit, used to create screenshots in articles or books"},[d.imageStyled]:{since:"1.3.0",baseBitType:d.image,description:"Image styled bit, used to create styled images in articles or books"},[d.imageSuperWide]:{since:"1.3.0",baseBitType:d.image,description:"Image super wide bit, used to create super wide images in articles or books"},[d.imageZoom]:{since:"1.3.0",baseBitType:d.image,description:"Image zoom bit, used to create zoomable images in articles or books"},[d.langLifeSkillIcon]:{since:"1.3.0",baseBitType:d.image,description:"Language life skill icon bit, used to create icons for life skills in articles or books"},[d.lifeSkillSticker]:{since:"1.3.0",baseBitType:d.image,description:"Life skill sticker bit, used to create stickers for life skills in articles or books"},[d.pageBanner]:{since:"1.4.3",baseBitType:d.image,description:"Page banner bit, used to create banners for pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the page banner, used to identify the banner in the system",format:b}]},[d.pageHero]:{since:"1.11.0",baseBitType:d.pageBanner,description:"Page hero bit, used to create hero sections in articles or books"},[d.screenshot]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:d.image,description:"Screenshot bit, used to create screenshots in articles or books"},[d.tableImage]:{since:"1.5.15",baseBitType:d.image,description:"Table image bit, used to create images in tables in articles or books",tags:[{key:ce.property_caption,description:"Caption for the table image, used to provide a description for the image",format:y}]},[d.tableImageAlt]:{since:"1.16.0",baseBitType:d.tableImage,description:"Alternative table image bit, used to create alternative images in tables in articles or books"},[d.standardTableImageNormative]:{since:"1.16.0",baseBitType:d.tableImage,description:"Standard normative table image bit, used to create normative images in tables in articles or books"},[d.standardTableImageNonNormative]:{since:"1.16.0",baseBitType:d.tableImage,description:"Standard non-normative table image bit, used to create non-normative images in tables in articles or books"},[d.standardRemarkTableImageNormative]:{since:"1.17.0",baseBitType:d.tableImage,description:"Standard normative remark table image bit, used to create normative remark images in tables in articles or books"},[d.standardRemarkTableImageNonNormative]:{since:"1.17.0",baseBitType:d.tableImage,description:"Standard non-normative remark table image bit, used to create non-normative remark images in tables in articles or books"},[d.smartStandardTableImageNormative]:{since:"1.28.0",baseBitType:d.standardTableImageNormative,description:"Smart standard normative table image bit, used to create smart standard normative images in tables in articles or books"},[d.smartStandardTableImageNonNormative]:{since:"1.28.0",baseBitType:d.standardTableImageNonNormative,description:"Smart standard non-normative table image bit, used to create smart standard non-normative images in tables in articles or books"},[d.smartStandardRemarkTableImageNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableImageNormative,description:"Smart standard normative remark table image bit, used to create smart standard normative remark images in tables in articles or books"},[d.smartStandardRemarkTableImageNonNormative]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableImageNormative,description:"Collapsible smart standard normative table image bit, used to create collapsible smart standard normative images in tables in articles or books"},[d.smartStandardTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardRemarkTableImageNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.smartStandardRemarkTableImageNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.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"},[d.imageLink]:{since:"1.3.0",baseBitType:d._standard,description:"Image link bit, used to create links with images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for image links, used to define additional properties"},{key:ce.group_resourceImageLink,description:"Resource image link tags, used to attach images to the link",minCount:1}],resourceAttachmentAllowed:!1},[d.imageOnDevice]:{since:"1.3.0",baseBitType:d._standard,description:"Image on device bit, used to create images stored on the device in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for images on device, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for images on device, used to attach images"},{key:ce.group_imageSource,description:"Image source tags for images on device, used to define the source of the image"}],resourceAttachmentAllowed:!1},[d.imageResponsive]:{since:"1.3.0",baseBitType:d._standard,description:"Responsive image bit, used to create responsive images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for responsive images, used to define additional properties"},{key:ce.group_resourceImageResponsive,description:"Resource image responsive tags, used to attach responsive images"}],resourceAttachmentAllowed:!1},[d.imagesLogoGrave]:{since:"1.5.11",baseBitType:d._standard,description:"Logo grave images bit, used to create logo grave images in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:ce.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:u}],resourceAttachmentAllowed:!1},[d.prototypeImages]:{since:"1.6.1",baseBitType:d.imagesLogoGrave,description:"Prototype images bit, used to create prototype images in articles or books"},[d.internalLink]:{since:"1.3.0",baseBitType:d._standard,description:"Internal link bit, used to create links to other bits in articles or books",tags:[{key:ce.tag_reference,description:"Reference tag for the internal link, used to link to the target bit"}]},[d.interview]:{since:"1.3.0",baseBitType:d._standard,description:"Interview bit, used to create interviews in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for interviews"},{key:ce.property_reasonableNumOfChars,description:"Reasonable number of characters for the interview, used to limit input size",format:k}],cardSet:P},[d.interviewInstructionGrouped]:{since:"1.3.0",baseBitType:d.interview,description:"Grouped interview instruction bit"},[d.botInterview]:{since:"1.3.0",baseBitType:d.interview,description:"Bot interview bit, used to create bot interviews in articles or books"},[d.brandColor]:{since:"4.12.0",baseBitType:d._standard,description:"Brand color bit, used to define brand colors",tags:[{key:ce.property_brandColor,description:"The brand color",format:b},{key:ce.property_brandColorName,description:"The brand color name",format:b}]},[d.learningPathBook]:{since:"1.3.0",baseBitType:d._standard,description:"Learning path book bit, used to create learning paths in articles or books",tags:[{key:ce.group_learningPathCommon,description:"Common tags for learning path books, used to define properties of learning paths"}]},[d.bookLink]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Book link bit, used to create links to books in learning paths"},[d.bookLinkNext]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Next book link bit, used to create links to the next book in learning paths"},[d.bookLinkPrev]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Previous book link bit, used to create links to the previous book in learning paths"},[d.learningPathClassroomEvent]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path classroom event bit, used to create classroom events in learning paths"},[d.learningPathClassroomTraining]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path classroom training bit, used to create classroom training in learning paths"},[d.learningPathClosing]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path closing bit, used to close learning paths"},[d.learningPathFeedback]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path feedback bit, used to provide feedback in learning paths"},[d.learningPathLearningGoal]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path learning goal bit, used to define learning goals in learning paths"},[d.learningPathLti]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path LTI bit, used to integrate LTI tools in learning paths"},[d.learningPathSign]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path sign bit, used to create signs in learning paths"},[d.learningPathStep]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path step bit, used to create steps in learning paths"},[d.learningPathBotTraining]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path bot training bit, used to create bot training in learning paths",tags:[{key:ce.property_bot,description:"Bot reference for the training, used to link to a specific bot",format:b}]},[d.learningPathExternalLink]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path external link bit, used to create external links in learning paths",tags:[{key:ce.property_externalLink,description:"External link for the learning path, used to link to external resources",format:b},{key:ce.property_externalLinkText,description:"Text for the external link, used to define the link text displayed",format:b}]},[d.learningPathVideoCall]:{since:"1.3.0",baseBitType:d.learningPathBook,description:"Learning path video call bit, used to create video calls in learning paths",tags:[{key:ce.property_videoCallLink,description:"Video call link for the learning path, used to link to video calls",format:b}]},[d.leLearningObjectives]:{since:"1.25.0",baseBitType:d.learningPathLearningGoal,description:"Learning objectives bit, used to define learning objectives in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the learning objectives, used to categorize the activity",format:b}]},[d.leVideoCall]:{since:"1.25.0",baseBitType:d.learningPathVideoCall,description:"Video call bit, used to create video calls in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the video call, used to categorize the activity",format:b}]},[d.leClassroomEvent]:{since:"1.25.0",baseBitType:d.learningPathClassroomEvent,description:"Classroom event bit, used to create classroom events in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the classroom event, used to categorize the activity",format:b}]},[d.leMultiDayEvent]:{since:"3.32.0",baseBitType:d.leClassroomEvent,description:"Multi-day event bit, used to create multi-day events in learning paths"},[d.leCompletion]:{since:"1.25.0",baseBitType:d.learningPathClosing,description:"Completion bit, used to mark the completion of learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the completion, used to categorize the activity",format:b}]},[d.leExternalLink]:{since:"1.25.0",baseBitType:d.learningPathExternalLink,description:"External link bit, used to create external links in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the external link, used to categorize the activity",format:b}]},[d.leReadBook]:{since:"1.25.0",baseBitType:d.learningPathBook,description:"Read book bit, used to create reading tasks in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the reading task, used to categorize the activity",format:b}]},[d.leLearningStep]:{since:"1.25.0",baseBitType:d.learningPathStep,description:"Learning step bit, used to create steps in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the learning step, used to categorize the activity",format:b}]},[d.lePreparationTask]:{since:"1.26.0",baseBitType:d.learningPathBook,description:"Preparation task bit, used to create preparation tasks in learning paths",tags:[{key:ce.property_activityType,format:b,description:"Activity type for the preparation task, used to categorize the activity"}]},[d.leRead]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Read task bit, used to create reading tasks in learning paths"},[d.leTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Task bit, used to create tasks in learning paths"},[d.leTodo]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Todo bit, used to create todo tasks in learning paths"},[d.leFollowUpTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Follow-up task bit, used to create follow-up tasks in learning paths"},[d.leFinishingTask]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Finishing task bit, used to create finishing tasks in learning paths"},[d.leAssignment]:{since:"1.27.0",baseBitType:d.lePreparationTask,description:"Assignment bit, used to create assignments in learning paths"},[d.leWatchVideoEmbed]:{since:"1.27.0",baseBitType:d.learningPathBook,description:"Watch video embed bit, used to embed videos in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the video embed, used to categorize the activity",format:b},{key:ce.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:ce.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.leListenAudioEmbed]:{since:"1.27.0",baseBitType:d.learningPathBook,description:"Listen audio embed bit, used to embed audio in learning paths",tags:[{key:ce.property_activityType,description:"Activity type for the audio embed, used to categorize the activity",format:b},{key:ce.group_resourceBitTags,description:"Resource bit tags for audio embeds, used to define additional properties"},{key:ce.group_resourceAudioEmbed,description:"Resource audio embed tags, used to attach audio embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.listItem]:{since:"1.22.0",baseBitType:d.article,description:"List item bit, used to create list items in articles or books",tags:[{key:ce.property_listItemIndent,description:"Indentation level for the list item, used to define the hierarchy of the list",format:k,defaultValue:"0"}]},[d.standardListItem]:{since:"1.22.0",baseBitType:d.listItem,description:"Standard list item bit, used to create standard list items in articles or books"},[d.smartStandardListItem]:{since:"1.28.0",baseBitType:d.standardListItem,description:"Smart standard list item bit, used to create smart standard list items in articles or books"},[d.smartStandardListItemCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardListItem,description:"Collapsible smart standard list item bit, used to create collapsible smart standard list items in articles or books"},[d.mark]:{since:"1.3.0",baseBitType:d._standard,description:"Mark bit, used to create marks in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for marks"},{key:ce.group_markConfig,description:"Configuration tags for marks, used to define properties of marks"},{key:ce.group_mark,description:"Mark tags, used to define the content of marks"}]},[d.match]:{since:"1.3.0",baseBitType:d._standard,description:"Match bit, used to create matching pairs in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for matching pairs"},{key:ce.property_isCaseSensitive,description:"Case sensitivity for matching pairs, used to define if matches are case-sensitive",format:v}],cardSet:I},[d.matchAll]:{since:"1.3.0",baseBitType:d.match,description:"Match all bit, used to create matching pairs with all options in articles or books"},[d.matchReverse]:{since:"1.3.0",baseBitType:d.match,description:"Match reverse bit, used to create matching pairs with reversed options in articles or books"},[d.matchAllReverse]:{since:"1.3.0",baseBitType:d.match,description:"Match all reverse bit, used to create matching pairs with all options and reversed in articles or books"},[d.matchSolutionGrouped]:{since:"1.3.0",baseBitType:d.match,description:"Grouped match solution bit, used to create grouped matching solutions in articles or books"},[d.matchMatrix]:{since:"1.3.0",baseBitType:d.match,description:"Match matrix bit, used to create matching pairs in a matrix format in articles or books",cardSet:E},[d.matchAudio]:{since:"1.3.0",baseBitType:d.match,description:"Match audio bit, used to create matching pairs with audio in articles or books",cardSet:L},[d.matchPicture]:{since:"1.3.0",baseBitType:d.match,description:"Match picture bit, used to create matching pairs with pictures in articles or books",cardSet:V},[d.feedback]:{since:"3.13.0",baseBitType:d._standard,description:"Feedback bit, used to provide feedback in articles or books",tags:[{key:ce.property_reasonableNumOfChars,description:"Reasonable number of characters for feedback, used to limit input size",format:k}],cardSet:S},[d.learningDocumentationFeedback]:{since:"3.13.0",baseBitType:d.feedback,description:"Feedback for learning documentation"},[d.handInFeedbackExpert]:{since:"3.30.0",baseBitType:d.feedback,description:"Feedback for expert hand-in"},[d.handInFeedbackSelf]:{since:"3.30.0",baseBitType:d.feedback,description:"Self-feedback for hand-in"},[d.multipleChoice1]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice 1 bit, used to create single-choice questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice 1 questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice 1 questions"}]},[d.coachSelfReflectionMultipleChoice1]:{since:"1.3.0",baseBitType:d.multipleChoice1,description:"Coach self-reflection multiple choice 1 bit, used for self-reflection in coaching"},[d.multipleChoice]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice bit, used to create multiple-choice questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice questions"}],cardSet:B},[d.coachSelfReflectionMultipleChoice]:{since:"1.3.0",baseBitType:d.multipleChoice,description:"Coach self-reflection multiple choice bit, used for self-reflection in coaching"},[d.multipleChoiceText]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple choice text bit, used to create multiple-choice questions with text in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple choice text questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple choice text questions"}]},[d.coachCallToActionMultipleChoiceText]:{since:"1.3.0",baseBitType:d.multipleChoiceText,description:"Coach call to action multiple choice text bit, used for self-reflection in coaching"},[d.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0",baseBitType:d.multipleChoiceText,description:"Coach self-reflection multiple choice text bit, used for self-reflection in coaching"},[d.multipleResponse1]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple response 1 bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple response 1 questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple response 1 questions"}]},[d.coachSelfReflectionMultipleResponse1]:{since:"1.3.0",baseBitType:d.multipleResponse1,description:"Coach self-reflection multiple response 1 bit, used for self-reflection in coaching"},[d.multipleResponse]:{since:"1.3.0",baseBitType:d._standard,description:"Multiple response bit, used to create multiple-response questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for multiple response questions"},{key:ce.group_trueFalse,description:"True/False tags for multiple response questions"}],cardSet:B},[d.coachSelfReflectionMultipleResponse]:{since:"1.3.0",baseBitType:d.multipleResponse,description:"Coach self-reflection multiple response bit, used for self-reflection in coaching"},[d.page]:{since:"1.3.0",baseBitType:d._standard,description:"Page bit, used to create pages in articles or books",tags:[{key:ce.tag_title,description:"Title of the page, used to display the page title"},{key:ce.property_thumbImage,description:"Thumbnail image for the page, used to display a small image representation",format:b}]},[d.pageCollapsible]:{since:"1.30.0",baseBitType:d.page,description:"Collapsible page bit, used to create collapsible sections in pages"},[d.pageCoverImage]:{since:"1.22.0",baseBitType:d.page,description:"Page cover image bit, used to create cover images for pages"},[d.advertisingAdvertorialPage]:{since:"4.5.0",baseBitType:d.page,description:"Advertorial Page bit, used to create advertorial pages"},[d.pageBuyButton]:{since:"1.4.3",baseBitType:d._standard,description:"Page buy button bit, used to create buy buttons on pages",tags:[{key:ce.property_slug,description:"Slug for the page, used to identify the page in URLs",format:b},{key:ce.property_content2Buy,description:"Content to buy for the page, used to define what is being sold",format:b},{key:ce.property_buttonCaption,description:"Caption for the buy button, used to define the text displayed on the button",format:b}]},[d.pageBuyButtonAlt]:{since:"1.31.0",baseBitType:d.pageBuyButton,description:"Alternative page buy button bit, used to create alternative buy buttons on pages"},[d.pageBuyButtonPromotion]:{since:"1.5.11",baseBitType:d.pageBuyButton,description:"Page buy button for promotions, used to create buy buttons on promotional pages"},[d.pageSubpage]:{since:"1.6.6",baseBitType:d._standard,description:"Page subpage bit, used to create subpages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the subpage, used to identify the subpage in URLs",format:b},{key:ce.property_page,description:"Page reference for the subpage, used to link to the parent page",format:b}]},[d.pageShopInShop]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page shop-in-shop bit, used to create shop-in-shop pages in articles or books"},[d.pageCategory]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page category bit, used to create category pages in articles or books"},[d.pageAcademy]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page academy bit, used to create academy pages in articles or books"},[d.pagePromotion]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page promotion bit, used to create promotional pages in articles or books"},[d.pageSpecial]:{since:"1.6.6",baseBitType:d.pageSubpage,description:"Page special bit, used to create special pages in articles or books"},[d.pagePerson]:{since:"1.5.16",baseBitType:d._standard,description:"Page person bit, used to create person pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the person page, used to identify the person in URLs",format:b},{key:ce.group_person,description:"Person tags, used to define properties of the person"},{key:ce.property_buttonCaption,description:"Caption for the button on the person page, used to define the text displayed",format:b}]},[d.pageProduct]:{since:"1.4.17",baseBitType:d._standard,description:"Page product bit, used to create product pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product page, used to identify the product in URLs",format:b},{key:ce.property_product,description:"Product reference for the product page, used to link to the product",format:b}]},[d.pageProductList]:{since:"1.4.17",baseBitType:d._standard,description:"Page product list bit, used to create product lists in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product list page, used to identify the product list in URLs",format:b},{key:ce.property_product,description:"Product reference for the product list, used to link to the product",format:b,maxCount:u}]},[d.pageProductVideo]:{since:"1.4.17",baseBitType:d._standard,description:"Page product video bit, used to create product video pages in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product video page, used to identify the product video in URLs",format:b},{key:ce.property_productVideo,description:"Product video reference for the product video page, used to link to the video",format:b}]},[d.pageProductVideoList]:{since:"1.4.17",baseBitType:d._standard,description:"Page product video list bit, used to create product video lists in articles or books",tags:[{key:ce.property_slug,description:"Slug for the product video list page, used to identify the product video list in URLs",format:b},{key:ce.property_productVideo,description:"Product video reference for the product video list, used to link to the video",format:b,maxCount:u}]},[d.pageSectionFolder]:{since:"1.4.17",baseBitType:d._standard,description:"Page section folder bit, used to create section folders in articles or books",tags:[{key:ce.property_slug,description:"Slug for the section folder page, used to identify the section in URLs",format:b},{key:ce.property_productFolder,description:"Product folder reference for the section folder page, used to link to the folder",format:b}]},[d.photo]:{since:"1.3.0",baseBitType:d.image,description:"Photo bit, used to create photo bits in articles or books"},[d.platform]:{since:"4.12.0",baseBitType:d._standard,description:"Platform bit, used to define platform properties",tags:[{key:ce.property_platformName,description:"The platform name",format:b},{key:ce.resource_platformIcon,description:"The platform icon",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform icon resource"}],maxCount:1},{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformBrandTarget]:{since:"4.15.0",baseBitType:d._standard,description:"Platform brand target bit, used to define the brand target for publishing",tags:[{key:ce.property_platformBrandTarget,description:'The platform brand target (typically "light", "dark" or "none")',format:b}]},[d.platformHeader]:{since:"4.12.0",baseBitType:d._standard,description:"Platform header bit, used to define platform header properties",tags:[{key:ce.resource_platformLogo,description:"The platform logo",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform logo resource"}],maxCount:1},{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMain]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main bit, used to define platform main properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMainButton]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main button bit, used to define platform main button properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformMainInput]:{since:"4.12.0",baseBitType:d._standard,description:"Platform main input bit, used to define platform main input properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSection]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section bit, used to define platform section properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionButton]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section button bit, used to define platform section button properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionChat]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section chat bit, used to define platform section chat properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"},{key:ce.resource_platformBackgroundImage,description:"The platform section chat background image",chain:[{key:ce.group_resourceImageCommon,description:"Common image properties for the platform background image resource"}]}]},[d.platformSectionHeader]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section header bit, used to define platform section header properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSectionInput]:{since:"4.12.0",baseBitType:d._standard,description:"Platform section input bit, used to define platform section input properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.platformSystemIcon]:{since:"4.12.0",baseBitType:d._standard,description:"Platform system icon bit, used to define platform system icon properties",tags:[{key:ce.group_platformStylesCommon,description:"Common platform styles"}]},[d.quote]:{since:"1.3.0",baseBitType:d._standard,description:"Quote bit, used to create quotes in articles or books",tags:[{key:ce.property_quotedPerson,description:"Quoted person for the quote, used to define who is being quoted",format:b}]},[d.rating]:{since:"1.3.0",baseBitType:d._standard,description:"Rating bit, used to create rating bits in articles or books"},[d.coachSelfReflectionRating]:{since:"1.3.0",baseBitType:d.rating,description:"Coach self-reflection rating bit, used for self-reflection in coaching"},[d.releaseNote]:{since:"1.3.0",baseBitType:d._standard,description:"Release note bit, used to create release notes in articles or books",tags:[{key:ce.property_releaseVersion,description:"Release version for the release note, used to define the version of the release",format:b},{key:ce.property_releaseKind,description:"Release kind for the release note, used to define the type of release",format:b},{key:ce.property_releaseDate,description:"Release date for the release note, used to define when the release was made",format:b}]},[d.reviewNote]:{since:"1.3.0",baseBitType:d._standard,description:"Review note bit, used to create review notes in articles or books",tags:[{key:ce.tag_title,description:"Title of the review note, used to display the note title"},{key:ce.property_resolved,description:"Resolved status for the review note, used to indicate if the note is resolved",format:v},{key:ce.property_resolvedDate,description:"Resolved date for the review note, used to define when the note was resolved",format:b},{key:ce.property_resolvedBy,description:"Resolved by for the review note, used to define who resolved the note",format:b}],rootExampleType:m},[d.reviewAuthorNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Author review note bit, used to create author notes in reviews"},[d.reviewCustomerNote]:{since:"3.5.0",baseBitType:d.reviewNote,description:"Customer review note bit, used to create customer notes in reviews"},[d.reviewReviewerNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Reviewer review note bit, used to create reviewer notes in reviews"},[d.reviewRequestForReviewNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Request for review note bit, used to create notes requesting reviews"},[d.reviewApprovedNote]:{since:"1.3.0",baseBitType:d.reviewNote,description:"Approved review note bit, used to create notes for approved reviews"},[d.sampleSolution]:{since:"1.3.0",baseBitType:d._standard,description:"Sample solution bit, used to create sample solutions in articles or books",tags:[{key:ce.tag_anchor,description:"Anchor for the sample solution, used to link to the solution"},{key:ce.tag_reference,description:"Reference for the sample solution, used to link to the source of the solution"}]},[d.sequence]:{since:"1.3.0",baseBitType:d._standard,description:"Sequence bit, used to create sequences in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for sequences"}],cardSet:w,rootExampleType:h},[d.stillImageFilm]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film bit, used to create still image films in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilm,description:"Resource still image film tags, used to attach still image films to the bit"}],resourceAttachmentAllowed:!1},[d.stillImageFilmEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film embed bit, used to embed still image films in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilmEmbed,description:"Resource still image film embed tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.stillImageFilmLink]:{since:"1.3.0",baseBitType:d._standard,description:"Still image film link bit, used to create still image film links in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:ce.group_resourceStillImageFilmLink,description:"Resource still image film link tags, used to attach still image films to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.surveyAnonymous]:{since:"1.3.0",baseBitType:d._standard,description:"Anonymous survey bit, used to create anonymous surveys in articles or books"},[d.survey]:{since:"1.3.0",baseBitType:d._standard,description:"Survey bit, used to create surveys in articles or books"},[d.surveyMatrix]:{since:"1.6.2",baseBitType:d.image,description:"Survey matrix bit, used to create survey matrices in articles or books",tags:[{key:ce.property_pointerTop,description:"Pointer for the top of the survey matrix, used to define the top label",format:b,minCount:1,maxCount:1},{key:ce.property_pointerLeft,description:"Pointer for the left of the survey matrix, used to define the left label",format:b,minCount:1,maxCount:1},{key:ce.property_buttonCaption,description:"Caption for the button in the survey matrix, used to define the button text",format:b,minCount:1,maxCount:1}]},[d.surveyMatrixMe]:{since:"1.6.2",baseBitType:d.surveyMatrix,description:"Survey matrix me bit, used to create personal survey matrices in articles or books"},[d.surveyRating]:{since:"1.6.0",baseBitType:d._standard,description:"Survey rating bit, used to create rating surveys in articles or books",tags:[{key:ce.property_ratingLevelStart,description:"Start level for the rating survey, used to define the lowest rating",format:k,chain:[{key:ce.property_label,description:"Label for the start level of the rating survey, used to define the text displayed",format:y}]},{key:ce.property_ratingLevelEnd,description:"End level for the rating survey, used to define the highest rating",format:k,chain:[{key:ce.property_label,description:"Label for the end level of the rating survey, used to define the text displayed",format:y}]},{key:ce.property_ratingLevelSelected,description:"Selected level for the rating survey, used to define the default rating",format:k},{key:ce.property_buttonCaption,description:"Caption for the button in the rating survey, used to define the button text",format:b}]},[d.surveyRatingOnce]:{since:"1.6.0",baseBitType:d.surveyRating,description:"Survey rating once bit, used to create one-time rating surveys in articles or books"},[d.surveyRatingDisplay]:{since:"1.6.0",baseBitType:d.surveyRating,description:"Survey rating display bit, used to display rating surveys in articles or books"},[d.scorm]:{since:"1.5.11",baseBitType:d._standard,description:"SCORM bit, used to embed SCORM content in articles or books",tags:[{key:ce.property_scormSource,description:"Source for the SCORM content, used to define the SCORM package URL",format:b},{key:ce.property_posterImage,description:"Poster image for the SCORM content, used to display a preview image",format:b}]},[d.pronunciationTable]:{since:"3.1.0",baseBitType:d._standard,description:"Pronunciation table bit, used to create pronunciation tables in articles or books",cardSet:F},[d.table]:{since:"1.5.19",baseBitType:d._standard,description:"Table bit, used to create tables in articles or books",tags:[{key:ce.property_caption,description:"Caption for the table, used to define the title of the table",format:y},{key:ce.property_tableFixedHeader,description:"Fixed header for the table, used to keep the header visible while scrolling",format:v},{key:ce.property_tableHeaderWhitespaceNoWrap,description:"No wrap for table header whitespace, used to prevent header text wrapping",format:v},{key:ce.property_tableSearch,description:"Search functionality for the table, used to enable searching within the table",format:v},{key:ce.property_tableSort,description:"Sorting functionality for the table, used to enable sorting of table columns",format:v},{key:ce.property_tablePagination,description:"Pagination for the table, used to limit the number of rows displayed at once",format:v},{key:ce.property_tablePaginationLimit,description:"Pagination limit for the table, used to define the number of rows per page",format:k,defaultValue:"0"},{key:ce.property_tableHeight,description:"Height for the table, used to define the height of the table in pixels",format:k,defaultValue:"0"},{key:ce.property_tableWhitespaceNoWrap,description:"No wrap for table whitespace, used to prevent text wrapping in table cells",format:v},{key:ce.property_tableAutoWidth,description:"Auto width for table columns, used to automatically adjust column widths",format:v},{key:ce.property_tableResizableColumns,description:"Resizable columns for the table, used to allow users to resize table columns",format:v},{key:ce.property_tableColumnMinWidth,description:"Minimum width for table columns, used to define the minimum width of columns",format:k}],cardSet:N},[d.tableExtended]:{since:"4.14.0",baseBitType:d.table,description:"Extended table bit, used to create complex tables with all HTML table features",cardSet:R},[d.tableAlt]:{since:"1.16.0",baseBitType:d.table,description:"Alternative table bit, used to create alternative tables in articles or books"},[d.standardTableNormative]:{since:"1.16.0",baseBitType:d.table,description:"Standard normative table bit, used to create standard normative tables in articles or books"},[d.standardTableNonNormative]:{since:"1.16.0",baseBitType:d.table,description:"Standard non-normative table bit, used to create standard non-normative tables in articles or books"},[d.standardRemarkTableNormative]:{since:"1.17.0",baseBitType:d.table,description:"Standard normative remark table bit, used to create standard normative remark tables in articles or books"},[d.standardRemarkTableNonNormative]:{since:"1.17.0",baseBitType:d.table,description:"Standard non-normative remark table bit, used to create standard non-normative remark tables in articles or books"},[d.smartStandardTableNormative]:{since:"1.28.0",baseBitType:d.standardTableNormative,description:"Smart standard normative table bit, used to create smart standard normative tables in articles or books"},[d.smartStandardTableNonNormative]:{since:"1.28.0",baseBitType:d.standardTableNonNormative,description:"Smart standard non-normative table bit, used to create smart standard non-normative tables in articles or books"},[d.smartStandardRemarkTableNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableNormative,description:"Smart standard normative remark table bit, used to create smart standard normative remark tables in articles or books"},[d.smartStandardRemarkTableNonNormative]:{since:"1.28.0",baseBitType:d.standardRemarkTableNonNormative,description:"Smart standard non-normative remark table bit, used to create smart standard non-normative remark tables in articles or books"},[d.smartStandardTableNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableNormative,description:"Collapsible smart standard normative table bit, used to create collapsible smart standard normative tables in articles or books"},[d.smartStandardTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardTableNonNormative,description:"Collapsible smart standard non-normative table bit, used to create collapsible smart standard non-normative tables in articles or books"},[d.smartStandardRemarkTableNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkTableNormative,description:"Collapsible smart standard normative remark table bit, used to create collapsible smart standard normative remark tables in articles or books"},[d.smartStandardRemarkTableNonNormativeCollapsible]:{since:"1.28.0",baseBitType:d.smartStandardRemarkTableNonNormative,description:"Collapsible smart standard non-normative remark table bit, used to create collapsible smart standard non-normative remark tables in articles or books"},[d.parameters]:{since:"1.18.0",baseBitType:d.table,description:"Parameters bit, used to create parameter tables in articles or books"},[d.toc]:{since:"1.3.0",baseBitType:d._standard,description:"Table of contents bit, used to create a table of contents in articles or books"},[d.tocChapter]:{since:"1.5.5",baseBitType:d.toc,description:"Table of contents chapter bit, used to create chapters in the table of contents",tags:[{key:ce.property_maxDisplayLevel,description:"Maximum display level for the chapter in the table of contents",format:k}]},[d.tocInline]:{since:"3.24.0",baseBitType:d.toc,description:"Inline table of contents bit, used to create inline tables of contents in articles or books",tags:[{key:ce.property_maxTocChapterLevel,description:"Maximum chapter level for the inline table of contents",format:k}]},[d.tocResource]:{since:"3.31.0",baseBitType:d.toc,description:"Table of contents resource bit, used to create resources in the table of contents",tags:[{key:ce.property_tocResource,description:"Resource content for the table of contents, used to define the resource",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"Caption for the button in the table of contents resource, used to define the text displayed on the button",format:b}]},[d.tocContent]:{since:"3.31.0",baseBitType:d.toc,description:"Table of contents content bit, used to create content sections in the table of contents",tags:[{key:ce.property_tocContent,description:"Content for the table of contents, used to define the content section",format:b,maxCount:u},{key:ce.property_buttonCaption,description:"Caption for the button in the table of contents content, used to define the text displayed on the button",format:b}]},[d.anchor]:{since:"1.3.0",baseBitType:d._standard,description:"Anchor bit, used to create anchors in articles or books"},[d.bitBookEnding]:{since:"1.3.0",baseBitType:d._standard,description:"Bit book ending bit, used to create endings in articles or books"},[d.bitBookSummary]:{since:"1.3.0",baseBitType:d._standard,description:"Bit book summary bit, used to create summaries in articles or books"},[d.botActionAnnounce]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action announce bit, used to create announcements in articles or books"},[d.botActionRatingNumber]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action rating number bit, used to create rating number actions in articles or books"},[d.botActionRemind]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action remind bit, used to create reminders in articles or books"},[d.botActionSave]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action save bit, used to create save actions in articles or books"},[d.botActionTrueFalse]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action true/false bit, used to create true/false actions in articles or books"},[d.chapterSubjectMatter]:{since:"1.3.0",baseBitType:d._standard,description:"Chapter subject matter bit, used to create subject matter chapters in articles or books"},[d.chat]:{since:"1.3.0",baseBitType:d._standard,description:"Chat bit, used to create chat sections in articles or books"},[d.conclusion]:{since:"1.3.0",baseBitType:d._standard,description:"Conclusion bit, used to create conclusions in articles or books"},[d.conclusionAlt]:{since:"1.16.0",baseBitType:d.conclusion,description:"Alternative conclusion bit, used to create alternative conclusions in articles or books"},[d.documentUpload]:{since:"1.3.0",baseBitType:d._standard,description:"Document upload bit, used to create document upload sections in articles or books"},[d.footNote]:{since:"1.3.0",baseBitType:d._standard,description:"Footnote bit, used to create footnotes in articles or books"},[d.groupBorn]:{since:"1.3.0",baseBitType:d._standard,description:"Group born bit, used to create group born sections in articles or books"},[d.groupDied]:{since:"1.3.0",baseBitType:d._standard,description:"Group died bit, used to create group died sections in articles or books"},[d.recordAudio]:{since:"1.3.0",baseBitType:d._standard,description:"Record audio bit, used to create audio recording sections in articles or books"},[d.recordVideo]:{since:"1.5.24",baseBitType:d._standard,description:"Record video bit, used to create video recording sections in articles or books"},[d.stickyNote]:{since:"1.3.0",baseBitType:d._standard,description:"Sticky note bit, used to create sticky notes in articles or books"},[d.takePicture]:{since:"1.3.0",baseBitType:d._standard,description:"Take picture bit, used to create picture taking sections in articles or books"},[d.handInAudio]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in audio bit, used to create audio submission sections in articles or books"},[d.handInContact]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in contact bit, used to create contact submission sections in articles or books"},[d.handInDocument]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in document bit, used to create document submission sections in articles or books"},[d.handInFile]:{since:"3.2.0",baseBitType:d._standard,description:"Hand in file bit, used to create file submission sections in articles or books",tags:[{key:ce.property_handInAcceptFileType,description:"Accepted file types for the hand-in file, used to define allowed file formats",format:b,maxCount:u}]},[d.handInLocation]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in location bit, used to create location submission sections in articles or books"},[d.handInPhoto]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in photo bit, used to create photo submission sections in articles or books"},[d.handInScan]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in scan bit, used to create scan submission sections in articles or books"},[d.handInSubmit]:{since:"3.2.0",baseBitType:d._standard,description:"Hand in submit bit, used to create submission sections in articles or books",tags:[{key:ce.property_handInRequirement,description:"Requirement for the hand-in submission, used to define what is needed",format:b,maxCount:u},{key:ce.property_handInInstruction,description:"Instruction for the hand-in submission, used to guide the user",format:b},{key:ce.property_buttonCaption,description:"Caption for the button in the hand-in submission, used to define the button text",format:b}]},[d.handInVideo]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in video bit, used to create video submission sections in articles or books"},[d.handInVoice]:{since:"1.5.15",baseBitType:d._standard,description:"Hand in voice bit, used to create voice submission sections in articles or books"},[d.trueFalse1]:{since:"1.3.0",baseBitType:d._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:ce.property_labelTrue,description:"Label for the true option in the true/false question",format:b},{key:ce.property_labelFalse,description:"Label for the false option in the true/false question",format:b},{key:ce.tag_true,description:"Tag for the true option in the true/false question"},{key:ce.tag_false,description:"Tag for the false option in the true/false question"}],rootExampleType:h},[d.trueFalse]:{since:"1.3.0",baseBitType:d._standard,description:"True/False bit, used to create true/false questions in articles or books",quizBit:!0,tags:[{key:ce.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:ce.property_labelTrue,description:"Label for the true option in the true/false question",format:b},{key:ce.property_labelFalse,description:"Label for the false option in the true/false question",format:b}],cardSet:A},[d.vendorAmcharts5Chart]:{since:"1.5.8",baseBitType:d.code,description:"AmCharts 5 chart bit, used to embed AmCharts 5 charts in articles or books",textFormatDefault:x.json},[d.vendorDatadogDashboard]:{since:"5.2.0",baseBitType:d.nonProductionPrototypeIframe,description:"A Datadog dashboard bit, used to embed Datadog dashboards"},[d.vendorDatadogDashboardEmbed]:{since:"3.12.0",baseBitType:d.code,description:"Datadog dashboard embed bit, used to embed Datadog dashboards in articles or books",tags:[{key:ce.property_vendorDashboardId,description:"Dashboard ID for the Datadog dashboard, used to define which dashboard to embed",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksEmbed]:{since:"3.8.0",baseBitType:d.code,description:"Formbricks embed bit, used to embed Formbricks surveys in articles or books",tags:[{key:ce.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to embed",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksEmbedAnonymous]:{since:"3.9.0",baseBitType:d.vendorFormbricksEmbed,description:"Anonymous Formbricks embed bit, used to embed anonymous Formbricks surveys in articles or books"},[d.vendorFormbricksLink]:{since:"3.8.0",baseBitType:d.code,description:"Formbricks link bit, used to create links to Formbricks surveys in articles or books",tags:[{key:ce.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to link to",format:b}],textFormatDefault:x.plainText},[d.vendorFormbricksLinkAnonymous]:{since:"3.9.0",baseBitType:d.vendorFormbricksLink,description:"Anonymous Formbricks link bit, used to create links to anonymous Formbricks surveys in articles or books"},[d.vendorHighchartsChart]:{since:"1.5.28",baseBitType:d.vendorAmcharts5Chart,description:"Highcharts chart bit, used to embed Highcharts charts in articles or books"},[d.vendorIframelyEmbed]:{since:"1.5.10",baseBitType:d.code,description:"Iframely embed bit, used to embed content from various sources in articles or books",tags:[{key:ce.property_width,description:"Width for the embedded content, used to define the width in pixels",format:k},{key:ce.property_height,description:"Height for the embedded content, used to define the height in pixels",format:k},{key:ce.property_vendorUrl,description:"URL for the content to be embedded, used to define the source URL",format:b}],textFormatDefault:x.plainText},[d.vendorIframelyCard]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely card bit, used to create cards for embedded content in articles or books"},[d.vendorIframelyPreview]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely preview bit, used to create previews for embedded content in articles or books"},[d.vendorIframelyPreviewMini]:{since:"1.5.10",baseBitType:d.vendorIframelyEmbed,description:"Iframely preview mini bit, used to create mini previews for embedded content in articles or books"},[d.vendorJupyterOutput]:{since:"1.4.3",baseBitType:d.code,description:"Jupyter output bit, used to embed Jupyter notebook outputs in articles or books",tags:[{key:ce.property_jupyterId,description:"Jupyter ID for the notebook, used to define which notebook to embed",format:b},{key:ce.property_jupyterExecutionCount,description:"Execution count for the Jupyter output, used to define the execution order",format:k}],textFormatDefault:x.plainText},[d.vendorJupyterCellCode]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell code bit, used to embed Jupyter notebook cell code in articles or books"},[d.vendorJupyterCellMarkdown]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell markdown bit, used to embed Jupyter notebook cell markdown in articles or books"},[d.vendorJupyterCellRaw]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter cell raw bit, used to embed Jupyter notebook cell raw content in articles or books"},[d.vendorJupyterIpynb]:{since:"1.4.3",baseBitType:d.vendorJupyterOutput,description:"Jupyter IPYNB bit, used to embed Jupyter notebook files in articles or books"},[d.vendorPadletEmbed]:{since:"1.3.0",baseBitType:d.code,description:"Padlet embed bit, used to embed Padlet boards in articles or books",tags:[{key:ce.property_padletId,description:"Padlet ID for the board, used to define which Padlet to embed",format:b}],textFormatDefault:x.plainText},[d.vendorStripePricingTable]:{since:"1.20.0",baseBitType:d.article,description:"Stripe pricing table bit, used to embed Stripe pricing tables in articles or books",tags:[{key:ce.property_stripePricingTableId,description:"Stripe pricing table ID, used to define which pricing table to embed",format:b,minCount:1},{key:ce.property_stripePublishableKey,description:"Stripe publishable key, used to authenticate the Stripe pricing table",format:b,minCount:1}]},[d.vendorStripePricingTableExternal]:{since:"3.13.0",baseBitType:d.vendorStripePricingTable,description:"External Stripe pricing table bit, used to embed external Stripe pricing tables in articles or books"},[d.video]:{since:"1.3.0",baseBitType:d._standard,description:"Video bit, used to embed videos in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for videos, used to define additional properties"},{key:ce.group_resourceVideo,description:"Resource video tags, used to attach videos to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoLandscape]:{since:"1.3.0",baseBitType:d.video,description:"Landscape video bit, used to embed landscape videos in articles or books"},[d.videoPortrait]:{since:"1.3.0",baseBitType:d.video,description:"Portrait video bit, used to embed portrait videos in articles or books"},[d.videoEmbed]:{since:"1.3.0",baseBitType:d._standard,description:"Video embed bit, used to embed videos from external sources in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:ce.group_resourceVideoEmbed,description:"Resource video embed tags, used to attach video embeds to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoEmbedLandscape]:{since:"1.3.0",baseBitType:d.videoEmbed,description:"Landscape video embed bit, used to embed landscape videos from external sources in articles or books"},[d.videoEmbedPortrait]:{since:"1.3.0",baseBitType:d.videoEmbed,description:"Portrait video embed bit, used to embed portrait videos from external sources in articles or books"},[d.videoLink]:{since:"1.3.0",baseBitType:d._standard,description:"Video link bit, used to create links to videos in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for video links, used to define additional properties"},{key:ce.group_resourceVideoLink,description:"Resource video link tags, used to attach video links to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.videoLinkLandscape]:{since:"1.3.0",baseBitType:d.videoLink,description:"Landscape video link bit, used to create links to landscape videos in articles or books"},[d.videoLinkPortrait]:{since:"1.3.0",baseBitType:d.videoLink,description:"Portrait video link bit, used to create links to portrait videos in articles or books"},[d.websiteLink]:{since:"1.3.0",baseBitType:d._standard,description:"Website link bit, used to create links to websites in articles or books",tags:[{key:ce.group_resourceBitTags,description:"Resource bit tags for website links, used to define additional properties"},{key:ce.group_resourceWebsiteLink,description:"Resource website link tags, used to attach website links to the bit",minCount:1}],resourceAttachmentAllowed:!1},[d.nonProductionPrototypeIframe]:{since:"4.20.0",baseBitType:d._standard,description:"A non-production prototype iframe bit, used to embed prototype iframes",tags:[{key:ce.property_iframeSrc,description:"Iframe source URL, used to define the source of the iframe",minCount:1},{key:ce.property_iframeName,description:"Iframe name, used to define the name of the iframe"}]},[d.vendorLearndashEmbed]:{since:"5.0.0",baseBitType:d.nonProductionPrototypeIframe,description:"Learndash embed bit, used to embed Learndash content in an iframe"}},ve=new class{constructor(){l(this,"bitLevelMin",1),l(this,"bitLevelMax",7),l(this,"bitCache",new Map),l(this,"allResourcesCache"),l(this,"comboResourcesCache",new Map)}getBitType(e){return e?.startsWith("|")&&(e=e.substring(1)),(0,p.Enum)(d).fromValue(e)??d._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const r=this.getBitConfig(e);if(!r)return!1;if(Array.isArray(t)){for(const e of t)if(r.inheritedBitTypesSet.has(e))return!0;return!1}return r.inheritedBitTypesSet.has(t)}isBitTypeCommented(e){return!!e?.startsWith("|")}getBitConfig(e){let t=this.bitCache.get(e);if(!t){const r=()=>{throw new Error(`No config found for bit: ${e}`)},i=[],o=[];let a=e;for(;a;){const e=ke[a];e||r(),i.push(a),o.push(e),a=e.baseBitType}o.reverse();const s=o.reduce((e,t)=>e=he.deepMerge(e,t),{}),{since:n,textFormatDefault:l,quizBit:c,tags:p,cardSet:d,deprecated:m,bodyAllowed:h,bodyRequired:g,footerAllowed:f,footerRequired:y,resourceAttachmentAllowed:k,rootExampleType:v}=s;p?.push({key:ce.property_internalComment,description:"Internal comment for the bit.",format:b,maxCount:u,minCount:0});const T=this.getAllResourcesTagsWithZeroCounts(),_=ye.hydrateTagsConfig(p??[]),C=ye.hydrateCardSetConfig(d),w=_.info?.comboResourceConfigKey,A={..._.tags};for(const[e,t]of Object.entries(T))A[e]||(A[e]=t);t=new re({since:n,bitType:e,inheritedBitTypes:i,textFormatDefault:l??x.bitmarkText,tags:A,cardSet:C,quizBit:c,deprecated:m,bodyAllowed:h,bodyRequired:g,footerAllowed:f,footerRequired:y,resourceAttachmentAllowed:k,rootExampleType:v,comboResourceConfigKey:w}),this.bitCache.set(e,t)}return t}getTagConfigForTag(e,t){if(e)return e[t]}getTagsConfigForCardSet(e,t,r){const i=this.getCardSetVariantConfig(e,t,r);if(i)return i.tags}getCardSetVariantConfig(e,t,r){let i;const o=this.getBitConfig(e);if(!o)return;const a=o.cardSet?.variants;if(!a)return;const s=a[Math.min(t,a.length-1)],n=s.length-1;return i=r>n?s[n]:s[r],i}getBitResourcesConfig(e,t){let r={};const i=new Map,o=t?le(t):void 0,a=this.getBitConfig(e),s={};for(const[e,t]of Object.entries(a.tags))t.type===G&&(s[e]=t);const n=a.comboResourceConfigKey??(a.resourceAttachmentAllowed?o:void 0);if(n){const e=new Map,o=this.getComboResource(n);if(o){const t=Object.values(o).filter(e=>e.type===G);t.map(e=>e.configKey).forEach(r=>{const i=t.find(e=>e.configKey===r);i&&e.set(r,i)});const r=this.getComboResourceConfigKeys(n);r&&r.length>0&&i.set(n,r)}if(t)for(const[t,i]of Object.entries(s)){const o=n===i.configKey,a=!!e&&e.has(i.configKey);if(o){const e=new Z({configKey:i.configKey,tag:i.tag,minCount:1,maxCount:1,chain:i.chain,jsonKey:i.jsonKey,deprecated:i.deprecated});r[t]=e}else if(a){if(e){const o=e.get(i.configKey);o&&(r[t]=o)}}else r[t]=i}else r=s}else r=s;return new me(r,a.resourceAttachmentAllowed,o,i)}getComboResourceConfigKeys(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter(e=>e.type===G).map(e=>e.configKey)}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(be).filter(t=>t.type===U&&t.comboResourceConfigKey===e).forEach(e=>{t={...t,...ye.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(be).filter(e=>e.type===J).forEach(t=>{e={...e,...ye.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}},Te="@gmb/bitmark-parser-generator",xe="5.2.0",_e="ISC",Ce=(r(722),""),we="node",Ae="chrome",Be="safari",Se="firefox",Pe=(r(722),""),Ie="macos";function Le(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:Ce,os:Pe},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce((e,t)=>(t&&e.push(t),e),[]),r={keys:new Set,versions:{}};let i="";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?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),i=t.keys.has("chrome"),o=t.keys.has("chromium"),a=t.keys.has("safari"),s=i,n=r,l=t.keys.has("macintosh");return a&&!i&&!o?(e.browser=Be,e.browserVersion=t.versions.version):s?(e.browser=Ae,e.browserVersion=t.versions.chrome):n&&(e.browser=Se,e.browserVersion=t.versions.firefox),l&&(e.os=Ie,e.osVersion=t.versions.x),e}var Ve={full:"",major:"",minor:"",patch:"",build:""},Ee=new class{constructor(){l(this,"bootTimestamp"),l(this,"app"),l(this,"appVersion"),l(this,"environment"),l(this,"environmentVersion"),l(this,"os"),l(this,"osVersion"),l(this,"isBrowser"),l(this,"isNode"),l(this,"isCI"),l(this,"NODE_ENV"),l(this,"userAgentInfo"),Object.defineProperty(this,"userAgentInfo",{value:Le(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=Ve,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===we,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?we:Ce}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):Ve}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,Pe)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):Ve}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 Ve;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",a="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?a=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:a,build:o}}},Ne=Ee.init.bind(Ee),Re=!1;function Fe(){Re||(Ne(Te,xe),Re=!0)}var Oe=r(722),De=(r(722),{text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"}),Me=(r(722),{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",colorPicker:"colorPicker",comment:"comment"}),qe=(r(722),{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"}),ze=(r(722),{unknown:"unknown",__isDefaultExample:"__isDefaultExample",__typeAlias:"__typeAlias",action:"action",actionValue:"actionValue",activityType:"activityType",activityTypeValue:"activityTypeValue",additionalSolutions:"additionalSolutions",additionalSolutionsValue:"additionalSolutionsValue",advertisingClickUrl:"advertisingClickUrl",advertisingClickUrlValue:"advertisingClickUrlValue",ageRange:"ageRange",brandColor:"brandColor",brandColorValue:"brandColorValue",brandColorName:"brandColorName",brandColorNameValue:"brandColorNameValue",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",authorFullName:"authorFullName",authorFullNameValue:"authorFullNameValue",authorJobTitle:"authorJobTitle",authorJobTitleValue:"authorJobTitleValue",authorPseudonym:"authorPseudonym",authorPseudonymValue:"authorPseudonymValue",authorTitle:"authorTitle",authorTitleValue:"authorTitleValue",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",bookAuthor:"bookAuthor",bookBindingType:"bookBindingType",bookDiff:"bookDiff",bookDiffValue:"bookDiffValue",bookIsbn:"bookIsbn",bookLanguage:"bookLanguage",bookNumberOfPages:"bookNumberOfPages",bookOriginalTitle:"bookOriginalTitle",bookPublisher:"bookPublisher",bookPublishingDate:"bookPublishingDate",bookRating:"bookRating",bookSeriesId:"bookSeriesId",bookSeriesNumber:"bookSeriesNumber",bookSeriesTitle:"bookSeriesTitle",bookTranslator:"bookTranslator",bookType:"bookType",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",currency:"currency",customerExternalId:"customerExternalId",customerId:"customerId",customerIdValue:"customerIdValue",customerProductId:"customerProductId",customerProductShopLink:"customerProductShopLink",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",elementsValueValue:"elementsValueValue",emphasis:"emphasis",end:"end",errors:"errors",errorsValue:"errorsValue",example:"example",exampleValue:"exampleValue",externalId:"externalId",externalIdValue:"externalIdValue",externalLink:"externalLink",externalLinkText:"externalLinkText",extractorTag:"extractorTag",extractorTagValue:"extractorTagValue",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",footerValue:"footerValue",footerText:"footerText",forKeys:"forKeys",format:"format",formula:"formula",formulaValue:"formulaValue",forValues:"forValues",forValuesValue:"forValuesValue",fullName:"fullName",fullNameValue:"fullNameValue",gap:"gap",gmbExternalShop:"gmbExternalShop",gmbExternalShopItems:"gmbExternalShopItems",groupTag:"groupTag",groupTagValue:"groupTagValue",handInAcceptFileType:"handInAcceptFileType",handInAcceptFileTypeValue:"handInAcceptFileTypeValue",handInInstruction:"handInInstruction",handInInstructionValue:"handInInstructionValue",handInRequirement:"handInRequirement",handInRequirementValue:"handInRequirementValue",hasBookNavigation:"hasBookNavigation",hasBookNavigationValue:"hasBookNavigationValue",hasMarkAsDone:"hasMarkAsDone",hasMarkAsDoneValue:"hasMarkAsDoneValue",head:"head",heading:"heading",height:"height",heightValue:"heightValue",highlight:"highlight",hint:"hint",hintValue:"hintValue",href:"href",icon:"icon",iconTag:"iconTag",iconTagValue:"iconTagValue",iconValue:"iconValue",id:"id",idValue:"idValue",iframeSrc:"iframeSrc",iframeName:"iframeName",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",instructionValue:"instructionValue",internalComment:"internalComment",internalCommentValue:"internalCommentValue",internalPrintPdf:"internalPrintPdf",internalPrintPdfValue:"internalPrintPdfValue",hasPrintRestriction:"hasPrintRestriction",hasPrintRestrictionValue:"hasPrintRestrictionValue",enforceUpdateOverUserInput:"enforceUpdateOverUserInput",enforceUpdateOverUserInputValue:"enforceUpdateOverUserInputValue",isCaseSensitive:"isCaseSensitive",isCommented:"isCommented",isCorrect:"isCorrect",isEditable:"isEditable",isEditableValue:"isEditableValue",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",itemValue:"itemValue",itemLead:"itemLead",jobTitle:"jobTitle",jobTitleValue:"jobTitleValue",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",leadValue:"leadValue",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",listPrice:"listPrice",listValue:"listValue",location:"location",locationValue:"locationValue",machineTranslated:"machineTranslated",machineTranslatedValue:"machineTranslatedValue",translationOf:"translationOf",translationOfValue:"translationOfValue",spansPageBreak:"spansPageBreak",spansPageBreakValue:"spansPageBreakValue",mailingList:"mailingList",marginNumber:"marginNumber",marginNumberValue:"marginNumberValue",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",pageNumberValue:"pageNumberValue",pageValue:"pageValue",pairs:"pairs",pairsValue:"pairsValue",parent:"parent",parser:"parser",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",path:"path",pathValue:"pathValue",platformBrandTarget:"platformBrandTarget",platformBrandTargetValue:"platformBrandTargetValue",platformName:"platformName",platformNameValue:"platformNameValue",platformIcon:"platformIcon",platformIconValue:"platformIconValue",platformLogo:"platformLogo",platformLogoValue:"platformLogoValue",platformPrimaryColor:"platformPrimaryColor",platformPrimaryColorValue:"platformPrimaryColorValue",platformSecondaryColor:"platformSecondaryColor",platformSecondaryColorValue:"platformSecondaryColorValue",platformBackgroundColor:"platformBackgroundColor",platformBackgroundColorValue:"platformBackgroundColorValue",platformScrollbarColor:"platformScrollbarColor",platformScrollbarColorValue:"platformScrollbarColorValue",platformSelectionColor:"platformSelectionColor",platformSelectionColorValue:"platformSelectionColorValue",platformSeparatorColor:"platformSeparatorColor",platformSeparatorColorValue:"platformSeparatorColorValue",platformPlaceholderColor:"platformPlaceholderColor",platformPlaceholderColorValue:"platformPlaceholderColorValue",platformTextSelectionColor:"platformTextSelectionColor",platformTextSelectionColorValue:"platformTextSelectionColorValue",platformButtonPrimaryColor:"platformButtonPrimaryColor",platformButtonPrimaryColorValue:"platformButtonPrimaryColorValue",platformButtonBackgroundColor:"platformButtonBackgroundColor",platformButtonBackgroundColorValue:"platformButtonBackgroundColorValue",platformMessageBackgroundColor:"platformMessageBackgroundColor",platformMessageBackgroundColorValue:"platformMessageBackgroundColorValue",platformBackgroundImage:"platformBackgroundImage",platformBackgroundImageValue:"platformBackgroundImageValue",platformBorderColor:"platformBorderColor",platformBorderColorValue:"platformBorderColorValue",platformSelectionTextColor:"platformSelectionTextColor",platformSelectionTextColorValue:"platformSelectionTextColorValue",platformBaseLayerColor:"platformBaseLayerColor",platformBaseLayerColorValue:"platformBaseLayerColorValue",platformMargin:"platformMargin",platformMarginValue:"platformMarginValue",platformBorderRadius:"platformBorderRadius",platformBorderRadiusValue:"platformBorderRadiusValue",platformSelectionBorderRadius:"platformSelectionBorderRadius",platformSelectionBorderRadiusValue:"platformSelectionBorderRadiusValue",platformNeedsShadow:"platformNeedsShadow",platformNeedsShadowValue:"platformNeedsShadowValue",person:"person",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",posterImage:"posterImage",posterImageValue:"posterImageValue",postfix:"postfix",prefix:"prefix",previewImage:"previewImage",previewImageValue:"previewImageValue",previewVideo:"previewVideo",previewVideoValue:"previewVideoValue",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",pseudonym:"pseudonym",pseudonymValue:"pseudonymValue",publications:"publications",publicationsValue:"publicationsValue",publisher:"publisher",publisherName:"publisherName",publisherNameValue:"publisherNameValue",publisherValue:"publisherValue",quantity:"quantity",question:"question",questionValue:"questionValue",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",relatedBook:"relatedBook",relatedBookValue:"relatedBookValue",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",rows:"rows",rowsValue:"rowsValue",rubric:"rubric",rubricValue:"rubricValue",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",scormSource:"scormSource",scormSourceValue:"scormSourceValue",search:"search",searchIndex:"searchIndex",searchIndexValue:"searchIndexValue",searchValue:"searchValue",section:"section",select:"select",selected:"selected",servings:"servings",servingsValue:"servingsValue",showInIndex:"showInIndex",showInIndexValue:"showInIndexValue",size:"size",slug:"slug",slugValue:"slugValue",solution:"solution",solutions:"solutions",solutionsValue:"solutionsValue",sourceDocument:"sourceDocument",sourceDocumentValue:"sourceDocumentValue",sourceRL:"sourceRL",sourceRLValue:"sourceRLValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",srcAlt:"srcAlt",srcAltValue:"srcAltValue",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",subtitleValue:"subtitleValue",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",titleValue:"titleValue",titleString:"titleString",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"}),$e=class{constructor(){Fe()}walk(e,t,r,i){this.walkRecursive(e,[{index:0,key:t,value:e}],r,i)}getRouteKey(e){return e.reduce((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t),"")}printTree(e,t=ze.bitmarkAst){this.walkRecursive(e,[{index:0,key:t,value:e}],{enter:(e,t)=>(console.log("Enter: "+this.getRouteKey(t)),t[t.length-1].key!==ze.bodyJson),between:(e,t,r,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t)=>{console.log("Exit: "+this.getRouteKey(t))},leaf:(e,t)=>{console.log("Leaf: "+this.getRouteKey(t))}},void 0)}preprocessAst(e){if(se.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i){const{enter:o,between:a,exit:s,leaf:n}=r,l=t[t.length-1].key,c=!this.isValue(e),p=t[t.length-1];if(c){if(o){if(!1===o(p,t,i))return}}else n&&n(p,t,i);if(c){const o=this.isArray(e),s=Object.keys(e);for(let n=0,c=s.length;n<c;n++){const d=s[n],u=n===c-1,m=e,h=m[d];if(null!=h){const e={key:this.getAstKey(d,l,o),index:n,value:h},c=t.slice();if(c.push(e),this.walkRecursive(h,c,r,i),!u){const r=s[n+1],c=m[r],d={key:this.getAstKey(r,l,o),index:n+1,value:c};if(a){if(!1===a(p,e,d,t,i))break}}}}}c&&s&&s(p,t,i)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),(0,Oe.Enum)(ze).fromKey(i)||`unknown(${i})`}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)}},Je=r(722),Ue=(r(722),"tag"),je="body",We=(r(722),{plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"}),He=/([*`_!=])(?=\1)/,Ge=/(\^*])/,Ke=/(\^+)/,Ye=`${Ge.source}|${Ke.source}`,Qe=`${He.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}|${Ke.source}`,Xe=`${/^(\[)(\^*)(\.)/.source}`,Ze=new RegExp(`${He.source}|${Ge.source}|${Ke.source}`,"gm"),et=new RegExp(Ye,"gm"),tt=new RegExp(Qe,"gm"),rt=new RegExp(Xe,"gm"),it=new RegExp("^(?:(\\[)(\\^*)(\\.))|(\\^+)","gm"),ot=new RegExp("\\^([\\^]*)","gm"),at=new RegExp("^(\\[)\\^(\\^*)(\\.)","gm"),st=new RegExp("^(\\||•|#)","gm"),nt={format:We.bitmarkPlusPlus,location:je,v2:!1};function lt(e){return"string"==typeof e||e instanceof String}var ct={format:x.bitmarkText,location:je,inPlaceArray:!1,v2:!1},pt=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t={}){if(null==e)return;const r=Object.assign({},nt,t);if(Array.isArray(e))return e.map(e=>this.breakscape(e,r));if(!lt(e))return e;const{regex:i,replacer:o}=function(e,t,r=!1){return t===Ue?r||e!==We.bitmarkPlusPlus?{regex:et,replacer:"$2^$1"}:{regex:Ze,replacer:"$1$3^$2"}:e===We.bitmarkPlusPlus?r?{regex:it,replacer:"$1$4^$2$3"}:{regex:tt,replacer:"$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14"}:{regex:rt,replacer:"$1^$2$3"}}(r.format,r.location,r.v2);let a=e;return a=a.replace(i,o),a}unbreakscape(e,t={}){if(null==e)return;const r=Object.assign({},nt,t);if(Array.isArray(e))return e.map(e=>this.unbreakscape(e,r));if(!lt(e))return e;const{regex:i,replacer:o}=function(e,t){const r=e!==We.bitmarkPlusPlus;return t===je&&r?{regex:at,replacer:"$1$2$3"}:{regex:ot,replacer:"$1"}}(r.format,r.location);let a=e;return a=a.replace(i,o),a}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},nt,t),i=e=>e?e.replace(st,"$1^"):e;if(Array.isArray(e)){const t=r.inPlaceArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];lt(r)&&(e[t]=i(r))}e=t}else lt(e)&&(e=i(e));return e}version(){return xe}license(){return _e}},dt=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t){const r=Object.assign({},ct,t);return pt.breakscape(e,{format:r.format,location:r.location,inPlaceArray:r.inPlaceArray,v2:r.v2})}unbreakscape(e,t){const r=Object.assign({},ct,t);return pt.unbreakscape(e,r)}breakscapeCode(e,t){const r=Object.assign({},ct,t);return pt.breakscapeCode(e,r)}concatenate(e,t){return e+t}},ut=(r(722),{bitmarkMinusMinus:"bitmark--"});function mt(e,t){if(function(e){const t=e,r=!(!t.columns&&!t.data),i=!!(t.header||t.body||t.footer);return r&&i}(t)){const e=t;delete e.columns,delete e.data}const r=ve.isOfBitType(e,d.tableExtended);return r&&function(e){const t=e;return!(!t.columns&&!t.data||t.header||t.body||t.footer)}(t)?function(e){const t={};return e.columns&&e.columns.length>0&&(t.header={rows:[{cells:e.columns.map(e=>({content:e,title:!0}))}]}),e.data&&e.data.length>0&&(t.body={rows:e.data.map(e=>({cells:e.map(e=>({content:e}))}))}),t}(t):!r&&function(e){const t=e;return!!(t.header||t.body||t.footer)}(t)?function(e){const t={},r=e=>e&&Array.isArray(e.cells)?e.cells.map(e=>e?.content).filter(e=>void 0!==e):[],i=[],o=e.header?.rows??[];if(o.length>0){const e=r(o[0]);e.length>0&&(t.columns=e),o.slice(1).forEach(e=>{const t=r(e);t.length>0&&i.push(t)})}const a=e=>{e&&Array.isArray(e.rows)&&e.rows.forEach(e=>{const t=r(e);t.length>0&&i.push(t)})};return a(e.body),a(e.footer),i.length>0&&(t.data=i),t}(t):t}var ht=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 r=new Set;let i=0;for(let o=0;o<e.length;o++){const a=e[o],s=t?t(a):a;r.has(s)||(r.add(s),i!==o&&(e[i]=a),i++)}return i<e.length&&(e.length=i),e}},gt=r(722),ft=(r(722),{v2:2,v3:3}),bt=ft.v3,yt=class{constructor(){l(this,"ast",new $e),l(this,"debugGenerationInline",!1),l(this,"printed",!1)}enter(e,t,r){let i;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]&&(i=o[a](e,t,r)),i}between(e,t,r,i,o){let a;const s=this,n=`between_${e.key}`;return this.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[n]&&(a=s[n](e,t,r,i,o)),a}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}getParentNode(e,t=1){if(e.length>t)return e[e.length-t-1]}},kt={bodyBitCallback:void 0,debugGenerationInline:!1},vt="==",Tt=["*","`","_","!","="],xt={[Me.bold]:"**",[Me.light]:"``",[Me.italic]:"__",[Me.highlight]:"!!"},_t=[Me.bold,Me.light,Me.italic,Me.highlight],Ct=[Me.strike,Me.subscript,Me.superscript,Me.ins,Me.del,Me.underline,Me.doubleUnderline,Me.circle,Me.languageEmRed,Me.languageEmOrange,Me.languageEmYellow,Me.languageEmGreen,Me.languageEmBlue,Me.languageEmPurple,Me.languageEmPink,Me.languageEmBrown,Me.languageEmBlack,Me.languageEmWhite,Me.languageEmGray,Me.languageEm,Me.userUnderline,Me.userDoubleUnderline,Me.userStrike,Me.userCircle,Me.userHighlight,Me.notranslate,Me.link,Me.ref,Me.xref,Me.extref,Me.footnote,Me.footnoteStar,Me.symbol,Me.var,Me.code,Me.timer,Me.duration,Me.color,Me.colorPicker,Me.comment],wt=new RegExp(/(\n|\r\n)/,"g"),At=new RegExp(/https?:\/\/|mailto:(.*)/,"g"),Bt=new RegExp(/\]/,"g"),St="enter",Pt="between",It="exit",Lt=class e extends yt{constructor(t,r){super(),l(this,"ast",new $e),l(this,"bitmarkVersion"),l(this,"options"),l(this,"internalTextGenerator",null),l(this,"generateOptions",{}),l(this,"textFormat",x.bitmarkText),l(this,"textLocation",je),l(this,"writerText",""),l(this,"nodeIndex",0),l(this,"currentIndent",0),l(this,"prevIndent",0),l(this,"indentationStringCache",""),l(this,"inParagraph",!1),l(this,"inHeading",!1),l(this,"inCodeBlock",!1),l(this,"exitedCodeBlock",!1),l(this,"inBulletList",!1),l(this,"inInline",!1),l(this,"markDepth",0),l(this,"textDepth",0),l(this,"placeholderIndex",0),l(this,"placeholders",{}),l(this,"rootParagraphNodeContentIndex",0),l(this,"previousRootParagraphContextType",qe.text),l(this,"inPreText",!1),l(this,"thisNodeIsPreText",!1),l(this,"preTextIndexTemp",-1),l(this,"havePreText",!1),l(this,"preTextIndex",-1),this.bitmarkVersion=(0,gt.Enum)(ft).fromValue(t)??bt,this.options={...kt,...r},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion,ft.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),this.options.isInternal||(this.internalTextGenerator=new e(t,{...this.options,writeCallback:void 0,isInternal:!0}))}async generate(e,t,r,i){return this.generateSync(e,t,r,i)}generateSync(e,t,r,i){if(this.generateOptions=Object.assign({},i),this.validateGenerateOptions(e),this.generateOptions.plainTextDividerAllowed){const i=this.options.writeCallback,o=this.options.bodyBitCallback;this.options.writeCallback=void 0,this.options.bodyBitCallback=void 0,this.resetState(t,r),this.walkAndWrite(e),this.options.writeCallback=i,this.options.bodyBitCallback=o;const a=this.havePreText,s=this.preTextIndex;this.resetState(t,r),this.havePreText=a,this.preTextIndex=s,this.walkAndWrite(e)}else this.resetState(t,r),this.walkAndWrite(e);return this.writerText}getPlaceholders(){return this.placeholders}resetState(e,t){this.printed=!1,this.textFormat=e??x.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.markDepth=0,this.textDepth=0,this.placeholderIndex=0,this.placeholders={},this.rootParagraphNodeContentIndex=0,this.previousRootParagraphContextType=qe.hardBreak,this.inPreText=!1,this.thisNodeIsPreText=!1,this.preTextIndexTemp=-1,this.havePreText=!1,this.preTextIndex=-1}walkAndWrite(e){this.ast.walk(e,ze.textAst,this,void 0)}enter_textAstValue(e,t){return this.handleEnterNode(e.value,t)}between_textAstValue(e,t,r,i){return this.handleBetweenNode(e.value,t,r,i)}exit_textAstValue(e,t){return this.handleExitNode(e.value,t)}enter_contentValue(e,t){return this.handleEnterContentValueNode(e,t)}between_contentValue(e,t,r,i){this.handleBetweenContentValueNode(e,t,r,i)}exit_contentValue(e,t){this.handleExitContentValueNode(e,t)}enter_contentValueValue(e,t){return this.handleEnterNode(e.value,t)}between_contentValueValue(e,t,r,i){this.handleBetweenNode(e.value,t,r,i)}exit_contentValueValue(e,t){return this.handleExitNode(e.value,t)}enter_marks(e,t){this.markDepth++}exit_marks(e,t){this.markDepth--}handleEnterNode(e,t){if(!(this.markDepth>0)){switch(this.handleEnterNodePreTextCheck(e,t),this.handleIndent(e),e.type){case qe.paragraph:this.inParagraph=!0,this.writeParagraph(e);break;case qe.hardBreak:this.writeHardBreak(e);break;case qe.text:this.writeMarks(e,St),this.writeText(e),this.writeMarks(e,Pt),0===this.textDepth&&(this.inInline=!0),this.textDepth++;break;case qe.heading:this.writeHeading(e),this.inHeading=!0;break;case qe.section:this.writeSection(e);break;case qe.listItem:case qe.taskItem:this.writeBullet(e,t);break;case qe.image:case qe.imageInline:this.writeImage(e);break;case qe.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case qe.latex:this.writeLatex(e);break;case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.inBulletList=!0;break;case qe.gap:case qe.select:case qe.highlight:case qe.mark:return this.writeBodyBit(e,t),!1}this.exitedCodeBlock=!1}}handleBetweenNode(e,t,r,i){e.type}handleExitNode(e,t){if(!(this.markDepth>0)){switch(e.type){case qe.text:this.textDepth--,0===this.textDepth&&(this.inInline=!1),this.writeMarks(e,It);break;case qe.paragraph:this.writeNL(),this.inParagraph=!1;break;case qe.heading:this.inHeading=!1;case qe.section:case qe.image:this.inParagraph||(this.writeNL(),this.writeNL());break;case qe.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent<=1&&(this.writeNL(),this.inBulletList=!1)}this.handleDedent(e),this.nodeIndex++}}handleIndent(e){switch(e.type){case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case qe.noBulletList:case qe.bulletList:case qe.orderedList:case qe.orderedListRoman:case qe.orderedListRomanLower:case qe.letteredList:case qe.letteredListLower:case qe.taskList:this.currentIndent--}}handleEnterContentValueNode(e,t){3===t.length&&(this.thisNodeIsPreText=!0,this.inPreText=!1,this.previousRootParagraphContextType=qe.hardBreak)}handleBetweenContentValueNode(e,t,r,i){if(3===i.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===qe.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===qe.hardBreak)return;if(e.type===qe.text)return}this.thisNodeIsPreText=!1}getLinkHref(e){if(e.type===qe.text&&e.marks){const t=e.marks.reduce((e,t)=>{if(t.type===Me.link){const e=t,r=e.attrs?.href;if(r)return r}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 r=`[!${this.placeholderIndex}]`;if(this.placeholders[r]=e,this.options.bodyBitCallback){const r=this.options.bodyBitCallback(e,this.placeholderIndex,t);this.write(r)}else this.write(r);this.placeholderIndex++}writeText(e){if(null==e.text)return;const t=this.inCodeBlock;let r=e.text;const i=this.getLinkText(e);if(i&&(r=i),r=i||this.breakscape(r,{format:this.textFormat,location:this.textLocation}),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(wt,`$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:x.plainText,location:this.textLocation});this.write(t)}else this.write(r);(this.currentIndent>1||t)&&(this.thisNodeIsPreText=!1),this.inPreText||e.text!==r||(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(At,"$1")===e.text}return!1}getLinkText(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r;return r=t.replace(At,"$1")===e.text?t:e.text,r=(r??"").replace(Bt,"^]"),r}return!1}getInterTextBreakscape(e){if(this.bitmarkVersion===ft.v2)return"";if(this.textFormat===x.plainText)return"";const t=this.writerText.slice(-1),r=e.slice(0,1);return t===r&&-1!==Tt.indexOf(t)||this.textLocation===je&&"["===t&&-1!=="@#▼►%!?+-$_=&".indexOf(r)?"^":""}validateGenerateOptions(e){this.generateOptions.plainTextDividerAllowed&&(1!==e.length||1===e.length&&e[0].type!==qe.paragraph)&&(this.generateOptions.plainTextDividerAllowed=!1)}writeMarks(e,t){if(e.marks){const r=this.generateOptions.forceInline||!(!this.inInline&&!this.inHeading);this.thisNodeIsPreText=!1;if(0===e.marks.length)return void this.writeMarkTextWrapper(vt);const i=1===e.marks.length&&r,o=e.marks.reduce((e,t)=>e||(-1!==_t.indexOf(t.type)?i?xt[t.type]:vt:-1!==Ct.indexOf(t.type)?vt:e),void 0),a=this.isSimpleLink(e);if(null!=o&&!a){if(t!=St&&t!=Pt||this.writeMarkTextWrapper(o),t==Pt)for(const t of e.marks)-1!==_t.indexOf(t.type)?i||(this.writeInlineMarkStartEnd(),this.writeInlineMark(t)):Me.comment===t.type?(this.writeInlineMarkStartEnd(),this.writeCommentMark(t)):Me.link===t.type?(this.writeInlineMarkStartEnd(),this.writeLinkMark(t)):Me.ref===t.type?(this.writeInlineMarkStartEnd(),this.writeRefMark(t)):Me.xref===t.type?(this.writeInlineMarkStartEnd(),this.writeXRefMark(t)):Me.extref===t.type?(this.writeInlineMarkStartEnd(),this.writeExtRefMark(t)):Me.footnote===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteMark(t)):Me.footnoteStar===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteStarMark(t)):Me.symbol===t.type?(this.writeInlineMarkStartEnd(),this.writeSymbolMark(t)):-1!==Ct.indexOf(t.type)&&(this.writeInlineMarkStartEnd(),this.writeInlineMark(t));if(t==It){let t=!1;for(const r of e.marks)-1!==_t.indexOf(r.type)?i||(t=!0):Me.comment!==r.type&&Me.link!==r.type&&Me.ref!==r.type&&Me.xref!==r.type&&Me.footnote!==r.type&&Me.footnoteStar!==r.type&&-1===Ct.indexOf(r.type)||(t=!0);t&&this.writeInlineMarkStartEnd()}}}}writeParagraph(e){if(this.textFormat===x.bitmarkText){if(this.inBulletList)return;const t=e.content?.length??0;if(0===this.nodeIndex){if(1===t){const t=e.content?.[0].type===qe.text,r=e.content?.[0].text??"";if(!t||""!==r)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 r=e.attrs?.level??1;for(let e=0;e<+r;e++)t+="#";t+=" ",this.write(t)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e,t){let r=this.getIndentationString();const i=this.getParentNode(t,2),o=i?.value,a=o?.type,s=o?.attrs?.start??1;if(a===qe.bulletList)r+="• ";else if(a===qe.noBulletList)r+="•_ ";else if(a===qe.orderedList)r+=`•${s} `;else if(a===qe.orderedListRoman)r+=`•${s}I `;else if(a===qe.orderedListRomanLower)r+=`•${s}i `;else if(a===qe.letteredList)r+="•A ";else if(a===qe.letteredListLower)r+="•a ";else if(a===qe.taskList){const t=e;r+=t.attrs?.checked??!1?"•+ ":"•- "}r&&this.write(r)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs,r=e.type===qe.imageInline,i=this.getMediaAttrs(r?"imageInline":"image",t,{ignoreAttributes:r?new Set(["alt","zoomDisabled","title"]):void 0});let o="";r&&(o=`==${t.alt??""}==`),o+=i?`|${i}|`:"",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,r=`==${this.breakscape(t.formula,{format:this.textFormat,location:this.textLocation})}==|latex|`;this.write(r)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,i]of Object.entries(e.attrs))("language"===r&&"plain text"!==i||"color"===r||"propertyRef"===r||"name"===r||"duration"===r)&&(t=`${t}:${i}`);this.write(t)}writeCommentMark(e){const t=`#${e.comment||""}`;this.write(t)}writeLinkMark(e){const t=`link:${((e.attrs?.href||"")??"").replace(Bt,"^]")}`;this.write(t)}writeRefMark(e){const t=`►${e.attrs?.reference??""}`;this.write(t)}writeXRefMark(e){const t=e.attrs?.xref??"",r=e.attrs?.reference??"";let i=`xref:${t}`;r&&(i+=`|►${r}`),this.write(i)}writeExtRefMark(e){const t=e.attrs?.extref??"",r=e.attrs?.references??[],i=e.attrs?.provider??"";let o=`extref:${t}`;for(const e of r)o+=`|►${e??""}`;o+=`|provider:${i}`,this.write(o)}writeFootnoteMark(e){this.write("footnote:");const t=this.internalTextGenerator?.generateSync(e.attrs?.content,this.textFormat,this.textLocation,{...this.generateOptions,forceInline:!0})??"";this.write(t)}writeFootnoteStarMark(e){this.write("footnote*:");const t=this.internalTextGenerator?.generateSync(e.attrs?.content,this.textFormat,this.textLocation,{...this.generateOptions,forceInline:!0})??"";this.write(t)}writeSymbolMark(e){if(null==e.attrs)return;const t=e.attrs,r=this.getMediaAttrs("symbol",t)??"";this.write(r)}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 r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getMediaAttrs(e,t,r){if(!e)return;const i=Object.assign({},r).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,r]=a[e];if(!i.has(t))switch(t){case"textAlign":"left"!==r&&(o+=`|captionAlign:${r}`);break;case"alignment":"center"!==r&&r&&(o+=`|alignment:${r}`);break;case"title":r&&(o+=`|caption:${r}`);break;case"class":"center"!==r&&r&&(o+=`|align:${r}`);break;case"comment":r&&(o+=`|#${r}`);break;case"":se.isString(r)?o+=`|:${r}`:o+="|";break;case"zoomDisabled":r||(o+="|zoomDisabled:false");break;default:t&&r&&(o+=`|${t}:${r}`)}}return o}breakscape(e,t){return this.generateOptions.noBreakscaping?e:dt.breakscape(e,t)}getBitType(e){for(const t of e)if(t.key===ze.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 r of e)this.write(`${r}${t??""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}};function Vt(e){return"string"!=typeof e?null:dt.unbreakscape(e)}function Et(e){e&&"object"==typeof e&&(delete e._tempParsingParent,delete e._tempListStart,Object.keys(e).forEach(t=>{Et(e[t])}))}function Nt(e){const t=e=>e&&"text"===e.type&&!e.text;function r(e){for(let i=e.length-1;i>=0;i--){const o=e[i];t(o)?e.splice(i,1):o&&Array.isArray(o.content)&&r(o.content)}}return Array.isArray(e)?r(e):e&&Array.isArray(e.content)&&r(e.content),e}function Rt(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):Ot(e,{startRule:"bitmarkPlusString"})}var Ft=class extends SyntaxError{constructor(e,t,r,i){super(e),this.expected=t,this.found=r,this.location=i,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null;const i=e.find(e=>e.source===this.location.source);i&&(r=i.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,s=this.location.source+":"+a.line+":"+a.column;if(r){const e=this.location.end,i="".padEnd(a.line.toString().length," "),n=r[o.line-1],l=(o.line===e.line?e.column:n.length+1)-o.column||1;t+="\n --\x3e "+s+"\n"+i+" |\n"+a.line+" | "+n+"\n"+i+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}const i=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return i?e.replace(i,e=>"\\u{"+r(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function s(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}const n={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return n[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],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 Ot(e,t){const r={},i=(t=void 0!==t?t:{}).grammarSource,o={version:sa,bitmarkPlusPlus:function(){let e,t;if(Xo++,e=[],t=na(),t!==r)for(;t!==r;)e.push(t),t=na();else e=r;e===r&&(e=function(){let e,t;return e=Wo,t="",Ho=e,t=[],e=t,e}());Xo--,e===r&&(t=r,0===Xo&&oa(Zt));return e},bitmarkPlus:function(){let e,t;return Xo++,e=Wo,t=Ra(),Ho=e,t=Uo(t),e=t,Xo--,e},bitmarkMinusMinus:function(){let e,t;return Xo++,e=Wo,t=Ua(),Ho=e,t=jo(t),e=t,Xo--,e},bitmarkPlusString:function(){let e;return Xo++,e=Ra(),Xo--,e},bitmarkMinusMinusString:Ua};let a=sa;const s="|",n="### ",l="## ",c="# ",p="code",d=":",u="bitmark++",m="bitmark--",h="JavaScript",g="• ",f="•_ ",b="•",y=" ",k="I ",v="i ",T="•A ",x="•a ",_="•+ ",C="•- ",w="\t",A="image",B="#",S="@",P="width",I="height",L="alignment",V="captionAlign",E="left",N="center",R="right",F="alt",O="caption",D="zoomDisabled",M="true",q="false",z="=",$="|latex|",J="|imageInline:",U="srcAlt",j="alignmentVertical",W="size",H="top",G="middle",K="bottom",Y="baseline",Q="sub",X="super",Z="text-bottom",ee="text-top",te="line-height",re="font-height",ie="explicit",oe="link:",ae="extref:",se="provider:",ne="xref:",le="►",ce="symbol:",pe="footnote:",de="footnote*:",ue="var:",me="code:",he="timer",ge="timer:",fe="duration:",be="P",ye="color:",ke="colorPicker:",ve="|►",Te="bold",xe="italic",_e="light",Ce="highlightOrange",we="highlightYellow",Ae="highlightGreen",Be="highlightBlue",Se="highlightPurple",Pe="highlightPink",Ie="highlightBrown",Le="highlightBlack",Ve="highlightWhite",Ee="highlightGray",Ne="highlight",Re="strike",Fe="subscript",Oe="superscript",De="ins",Me="del",qe="underline",ze="doubleUnderline",$e="circle",Je="languageEmRed",Ue="languageEmOrange",je="languageEmYellow",We="languageEmGreen",He="languageEmBlue",Ge="languageEmPurple",Ke="languageEmPink",Ye="languageEmBrown",Qe="languageEmBlack",Xe="languageEmWhite",Ze="languageEmGray",et="languageEm",tt="userUnderline",rt="userDoubleUnderline",it="userStrike",ot="userCircle",at="userHighlight",st="notranslate",nt="aqua",lt="black",ct="blue",pt="brown",dt="fuchsia",ut="lightgrey",mt="gray",ht="darkgray",gt="green",ft="lime",bt="magenta",yt="maroon",kt="navy",vt="olive",Tt="orange",xt="pink",_t="purple",Ct="red",wt="silver",At="teal",Bt="violet",St="white",Pt="yellow",It="*",Lt="_",Ot="`",Dt="!",Mt="[!",qt="]",zt="\n",$t="\r\n",Jt="http",Ut="s",jt="://",Wt="mailto:",Ht=/^[ \t]/,Gt=/^[0-9]/,Kt=/^[\r\u2028-\u2029]/,Yt=/^[^\n\r\u2028\u2029]/,Qt=/^[!#-;=?-[\]-_a-{}-~]/,Xt={type:"any"},Zt=ta("StyledText"),er=Zo("|",!1),tr=Zo("### ",!1),rr=Zo("## ",!1),ir=Zo("# ",!1),or=Zo("code",!1),ar=ea([" ","\t"],!1,!1,!1),sr=Zo(":",!1),nr=Zo("bitmark++",!1),lr=Zo("bitmark--",!1),cr=Zo("JavaScript",!1),pr=Zo("• ",!1),dr=Zo("•_ ",!1),ur=Zo("•",!1),mr=ea([["0","9"]],!1,!1,!1),hr=Zo(" ",!1),gr=Zo("I ",!1),fr=Zo("i ",!1),br=Zo("•A ",!1),yr=Zo("•a ",!1),kr=Zo("•+ ",!1),vr=Zo("•- ",!1),Tr=Zo("\t",!1),xr=Zo("image",!1),_r=Zo("#",!1),Cr=Zo("@",!1),wr=Zo("width",!1),Ar=Zo("height",!1),Br=Zo("alignment",!1),Sr=Zo("captionAlign",!1),Pr=Zo("left",!1),Ir=Zo("center",!1),Lr=Zo("right",!1),Vr=Zo("alt",!1),Er=Zo("caption",!1),Nr=Zo("zoomDisabled",!1),Rr=Zo("true",!1),Fr=Zo("false",!1),Or=Zo("=",!1),Dr=Zo("|latex|",!1),Mr=Zo("|imageInline:",!1),qr=Zo("srcAlt",!1),zr=Zo("alignmentVertical",!1),$r=Zo("size",!1),Jr=Zo("top",!1),Ur=Zo("middle",!1),jr=Zo("bottom",!1),Wr=Zo("baseline",!1),Hr=Zo("sub",!1),Gr=Zo("super",!1),Kr=Zo("text-bottom",!1),Yr=Zo("text-top",!1),Qr=Zo("line-height",!1),Xr=Zo("font-height",!1),Zr=Zo("explicit",!1),ei=Zo("link:",!1),ti=Zo("extref:",!1),ri=Zo("provider:",!1),ii=Zo("xref:",!1),oi=Zo("►",!1),ai=Zo("symbol:",!1),si=Zo("footnote:",!1),ni=Zo("footnote*:",!1),li=Zo("var:",!1),ci=Zo("code:",!1),pi=Zo("timer",!1),di=Zo("timer:",!1),ui=Zo("duration:",!1),mi=Zo("P",!1),hi=Zo("color:",!1),gi=Zo("colorPicker:",!1),fi=Zo("|►",!1),bi=Zo("bold",!1),yi=Zo("italic",!1),ki=Zo("light",!1),vi=Zo("highlightOrange",!1),Ti=Zo("highlightYellow",!1),xi=Zo("highlightGreen",!1),_i=Zo("highlightBlue",!1),Ci=Zo("highlightPurple",!1),wi=Zo("highlightPink",!1),Ai=Zo("highlightBrown",!1),Bi=Zo("highlightBlack",!1),Si=Zo("highlightWhite",!1),Pi=Zo("highlightGray",!1),Ii=Zo("highlight",!1),Li=Zo("strike",!1),Vi=Zo("subscript",!1),Ei=Zo("superscript",!1),Ni=Zo("ins",!1),Ri=Zo("del",!1),Fi=Zo("underline",!1),Oi=Zo("doubleUnderline",!1),Di=Zo("circle",!1),Mi=Zo("languageEmRed",!1),qi=Zo("languageEmOrange",!1),zi=Zo("languageEmYellow",!1),$i=Zo("languageEmGreen",!1),Ji=Zo("languageEmBlue",!1),Ui=Zo("languageEmPurple",!1),ji=Zo("languageEmPink",!1),Wi=Zo("languageEmBrown",!1),Hi=Zo("languageEmBlack",!1),Gi=Zo("languageEmWhite",!1),Ki=Zo("languageEmGray",!1),Yi=Zo("languageEm",!1),Qi=Zo("userUnderline",!1),Xi=Zo("userDoubleUnderline",!1),Zi=Zo("userStrike",!1),eo=Zo("userCircle",!1),to=Zo("userHighlight",!1),ro=Zo("notranslate",!1),io=Zo("aqua",!1),oo=Zo("black",!1),ao=Zo("blue",!1),so=Zo("brown",!1),no=Zo("fuchsia",!1),lo=Zo("lightgrey",!1),co=Zo("gray",!1),po=Zo("darkgray",!1),uo=Zo("green",!1),mo=Zo("lime",!1),ho=Zo("magenta",!1),go=Zo("maroon",!1),fo=Zo("navy",!1),bo=Zo("olive",!1),yo=Zo("orange",!1),ko=Zo("pink",!1),vo=Zo("purple",!1),To=Zo("red",!1),xo=Zo("silver",!1),_o=Zo("teal",!1),Co=Zo("violet",!1),wo=Zo("white",!1),Ao=Zo("yellow",!1),Bo=Zo("*",!1),So=Zo("_",!1),Po=Zo("`",!1),Io=Zo("!",!1),Lo=Zo("[!",!1),Vo=Zo("]",!1),Eo=ta("Line Terminator"),No=Zo("\n",!1),Ro=Zo("\r\n",!1),Fo=ea(["\r",["\u2028","\u2029"]],!1,!1,!1),Oo=ea(["\n","\r","\u2028","\u2029"],!0,!1,!1),Do=Zo("http",!1),Mo=Zo("s",!1),qo=Zo("://",!1),zo=Zo("mailto:",!1),$o=ea(["!",["#",";"],"=",["?","["],["]","_"],["a","{"],["}","~"]],!1,!1,!1);function Jo(e){let t={...e};Et(t);return Nt(t)}function Uo(e){return[{type:"paragraph",content:e,attrs:{}}]}function jo(e){return[{type:"paragraph",content:e,attrs:{}}]}let Wo=0|t.peg$currPos,Ho=Wo;const Go=[{line:1,column:1}];let Ko,Yo=Wo,Qo=t.peg$maxFailExpected||[],Xo=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 Zo(e,t){return{type:"literal",text:e,ignoreCase:t}}function ea(e,t,r,i){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:i}}function ta(e){return{type:"other",description:e}}function ra(t){let r,i=Go[t];if(i)return i;if(t>=Go.length)r=Go.length-1;else for(r=t;!Go[--r];);for(i=Go[r],i={line:i.line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Go[t]=i,i}function ia(e,t,r){const o=ra(e),a=ra(t),s={source:i,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:a.line,column:a.column}};return r&&i&&"function"==typeof i.offset&&(s.start=i.offset(s.start),s.end=i.offset(s.end)),s}function oa(e){Wo<Yo||(Wo>Yo&&(Yo=Wo,Qo=[]),Qo.push(e))}function aa(e,t,r){return new Ft(Ft.buildMessage(e,t),e,t,r)}function sa(){let t,i,o;for(t=Wo,i=[],e.length>Wo?(o=e.charAt(Wo),Wo++):(o=r,0===Xo&&oa(Xt));o!==r;)i.push(o),e.length>Wo?(o=e.charAt(Wo),Wo++):(o=r,0===Xo&&oa(Xt));return Ho=t,i="8.37.3",t=i,t}function na(){let t,i;var o;return t=Wo,i=function(){let t,i,o,a,s;if(t=Wo,i=pa(),i!==r){for(o=Wo,a=[],s=as();s!==r;)a.push(s),s=as();o=e.substring(o,Wo),a=ss(),a!==r?(s=os(),s===r&&(s=null),Ho=t,n=i,t={type:"heading",content:Rt(o),attrs:{level:n.length-1}}):(Wo=t,t=r)}else Wo=t,t=r;var n;return t}(),i!==r&&(Ho=t,o=i,i=Nt({...o})),t=i,t===r&&(t=Wo,i=function(){let e,t,i,o;if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=ha(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"bulletList"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,a=t,s=i,e={...a,content:s,attrs:{}}):(Wo=e,e=r)}else Wo=e,e=r;var a,s;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=ga(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"noBulletList"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=fa(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"orderedList"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=ba(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"orderedListRoman"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=ya(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"orderedListRomanLower"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=ka(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"letteredList"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r){if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=va(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"letteredListLower"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r;if(e===r)if(e=Wo,t=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=Ta(),Xo--,i!==r?(Wo=t,t=void 0):t=r;t!==r&&(Ho=e,t={type:"taskList"});return e=t,e}(),t!==r){if(i=[],o=_a(),o!==r)for(;o!==r;)i.push(o),o=_a();else i=r;i!==r?(o=os(),o===r&&(o=null),Ho=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,i)):(Wo=e,e=r)}else Wo=e,e=r}}}}}}return e}(),i!==r&&(Ho=t,i=Jo(i)),t=i,t===r&&(t=Wo,i=Ia(),i!==r&&(Ho=t,i=function(e){return{...e}}(i)),t=i,t===r&&(t=Wo,i=function(){let t,i,o;t=Wo,i=ua(),i!==r?(o=function(){let t,i,o,a;t=Wo,i=Wo,o=[],a=ma();for(;a!==r;)o.push(a),a=ma();return i=e.substring(i,Wo),Ho=t,i=function(e){return[{type:"text",text:Vt(e.trim())}]}(i),t=i,t}(),Ho=t,t=function(e,t){return{...e,content:t}}(i,o)):(Wo=t,t=r);return t}(),i!==r&&(Ho=t,i=function(e){return{...e}}(i)),t=i,t===r&&(t=Wo,i=function(){let e,t,i;e=Wo,t=Wo,Xo++,i=la(),Xo--,i===r?t=void 0:(Wo=t,t=r);t!==r?(i=Aa(),i!==r?(Ho=e,e={type:"paragraph",content:Rt(i.trim()),attrs:{}}):(Wo=e,e=r)):(Wo=e,e=r);e===r&&(e=Wo,t=Sa(),t!==r?(i=Aa(),i!==r?(Ho=e,e=function(e){return{type:"paragraph",content:Rt(e.trim()),attrs:{}}}(i)):(Wo=e,e=r)):(Wo=e,e=r),e===r&&(e=Wo,t=Sa(),t!==r?(i="",Ho=e,e=function(e){return{type:"paragraph",content:Rt(e.trim()),attrs:{}}}(i)):(Wo=e,e=r)));return e}(),i!==r&&(Ho=t,i=function(e){return Nt({...e})}(i)),t=i)))),t}function la(){let e;return e=pa(),e===r&&(e=xa(),e===r&&(e=Ia(),e===r&&(e=ua(),e===r&&(e=Sa())))),e}function ca(){let t;return 124===e.charCodeAt(Wo)?(t=s,Wo++):(t=r,0===Xo&&oa(er)),t}function pa(){let t;return e.substr(Wo,4)===n?(t=n,Wo+=4):(t=r,0===Xo&&oa(tr)),t===r&&(e.substr(Wo,3)===l?(t=l,Wo+=3):(t=r,0===Xo&&oa(rr)),t===r&&(e.substr(Wo,2)===c?(t=c,Wo+=2):(t=r,0===Xo&&oa(ir)))),t}function da(){let t,i,o;return t=Wo,i=ca(),i!==r?(o=function(){let t;return e.substr(Wo,4)===p?(t=p,Wo+=4):(t=r,0===Xo&&oa(or)),t}(),o!==r?(Ho=t,t=o):(Wo=t,t=r)):(Wo=t,t=r),t}function ua(){let t,i,o,a,s,n,l,c;if(t=Wo,i=da(),i!==r){for(o=Wo,a=Wo,s=[],n=e.charAt(Wo),Ht.test(n)?Wo++:(n=r,0===Xo&&oa(ar));n!==r;)s.push(n),n=e.charAt(Wo),Ht.test(n)?Wo++:(n=r,0===Xo&&oa(ar));n=ss(),n!==r?(s=[s,n],a=s):(Wo=a,a=r),o=a!==r?e.substring(o,Wo):a,o!==r?(Ho=t,t={type:"codeBlock",language:""}):(Wo=t,t=r)}else Wo=t,t=r;if(t===r)if(t=Wo,i=da(),i!==r)if(58===e.charCodeAt(Wo)?(o=d,Wo++):(o=r,0===Xo&&oa(sr)),o!==r)if(a=function(){let t,i,o;e.substr(Wo,9)===u?(t=u,Wo+=9):(t=r,0===Xo&&oa(nr));if(t===r&&(e.substr(Wo,9)===m?(t=m,Wo+=9):(t=r,0===Xo&&oa(lr)),t===r&&(e.substr(Wo,10)===h?(t=h,Wo+=10):(t=r,0===Xo&&oa(cr)),t===r))){if(t=Wo,i=[],o=as(),o!==r)for(;o!==r;)i.push(o),o=as();else i=r;t=i!==r?e.substring(t,Wo):i,t===r&&(t="")}return t}(),a!==r){for(s=Wo,n=Wo,l=[],c=e.charAt(Wo),Ht.test(c)?Wo++:(c=r,0===Xo&&oa(ar));c!==r;)l.push(c),c=e.charAt(Wo),Ht.test(c)?Wo++:(c=r,0===Xo&&oa(ar));c=ss(),c!==r?(l=[l,c],n=l):(Wo=n,n=r),s=n!==r?e.substring(s,Wo):n,s!==r?(Ho=t,t={type:"codeBlock",attrs:{language:a.trim().toLowerCase()}}):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;else Wo=t,t=r;return t}function ma(){let t,i,o,a,s,n;if(t=Wo,i=Wo,Xo++,o=la(),Xo--,o===r?i=void 0:(Wo=i,i=r),i!==r){if(o=Wo,a=Wo,s=[],n=as(),n!==r)for(;n!==r;)s.push(n),n=as();else s=r;s!==r?(n=ss(),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r),o=a!==r?e.substring(o,Wo):a,o!==r?(Ho=t,t=o):(Wo=t,t=r)}else Wo=t,t=r;return t===r&&(t=os()),t}function ha(){let t;return e.substr(Wo,2)===g?(t=g,Wo+=2):(t=r,0===Xo&&oa(pr)),t}function ga(){let t;return e.substr(Wo,3)===f?(t=f,Wo+=3):(t=r,0===Xo&&oa(dr)),t}function fa(){let t,i,o,a,s;if(t=Wo,i=Wo,8226===e.charCodeAt(Wo)?(o=b,Wo++):(o=r,0===Xo&&oa(ur)),o!==r){if(a=[],s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr));else a=r;a!==r?(32===e.charCodeAt(Wo)?(s=y,Wo++):(s=r,0===Xo&&oa(hr)),s!==r?(o=[o,a,s],i=o):(Wo=i,i=r)):(Wo=i,i=r)}else Wo=i,i=r;return t=i!==r?e.substring(t,Wo):i,t}function ba(){let t,i,o,a,s;if(t=Wo,i=Wo,8226===e.charCodeAt(Wo)?(o=b,Wo++):(o=r,0===Xo&&oa(ur)),o!==r){if(a=[],s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr));else a=r;a!==r?(e.substr(Wo,2)===k?(s=k,Wo+=2):(s=r,0===Xo&&oa(gr)),s!==r?(o=[o,a,s],i=o):(Wo=i,i=r)):(Wo=i,i=r)}else Wo=i,i=r;return t=i!==r?e.substring(t,Wo):i,t}function ya(){let t,i,o,a,s;if(t=Wo,i=Wo,8226===e.charCodeAt(Wo)?(o=b,Wo++):(o=r,0===Xo&&oa(ur)),o!==r){if(a=[],s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr));else a=r;a!==r?(e.substr(Wo,2)===v?(s=v,Wo+=2):(s=r,0===Xo&&oa(fr)),s!==r?(o=[o,a,s],i=o):(Wo=i,i=r)):(Wo=i,i=r)}else Wo=i,i=r;return t=i!==r?e.substring(t,Wo):i,t}function ka(){let t;return e.substr(Wo,3)===T?(t=T,Wo+=3):(t=r,0===Xo&&oa(br)),t}function va(){let t;return e.substr(Wo,3)===x?(t=x,Wo+=3):(t=r,0===Xo&&oa(yr)),t}function Ta(){let t;return e.substr(Wo,3)===_?(t=_,Wo+=3):(t=r,0===Xo&&oa(kr)),t===r&&(e.substr(Wo,3)===C?(t=C,Wo+=3):(t=r,0===Xo&&oa(vr))),t}function xa(){let e;return e=ha(),e===r&&(e=ga(),e===r&&(e=fa(),e===r&&(e=ba(),e===r&&(e=ya(),e===r&&(e=ka(),e===r&&(e=va(),e===r&&(e=Ta()))))))),e}function _a(){let t,i,o,a,s,n,l,c,p;if(t=Wo,i=wa(),i!==r)if(o=xa(),o!==r){for(a=Wo,s=Wo,n=[],l=Wo,c=Wo,Xo++,p=os(),Xo--,p===r?c=void 0:(Wo=c,c=r),c!==r?(e.length>Wo?(p=e.charAt(Wo),Wo++):(p=r,0===Xo&&oa(Xt)),p!==r?(c=[c,p],l=c):(Wo=l,l=r)):(Wo=l,l=r);l!==r;)n.push(l),l=Wo,c=Wo,Xo++,p=os(),Xo--,p===r?c=void 0:(Wo=c,c=r),c!==r?(e.length>Wo?(p=e.charAt(Wo),Wo++):(p=r,0===Xo&&oa(Xt)),p!==r?(c=[c,p],l=c):(Wo=l,l=r)):(Wo=l,l=r);for(l=os(),l===r&&(l=null),n=[n,l],s=n,a=e.substring(a,Wo),s=[],n=Ca();n!==r;)s.push(n),n=Ca();if(n=Wo,l=function(){let t,i,o,a;t=Wo,Xo++,i=Wo,o=[],9===e.charCodeAt(Wo)?(a=w,Wo++):(a=r,0===Xo&&oa(Tr));if(a!==r)for(;a!==r;)o.push(a),9===e.charCodeAt(Wo)?(a=w,Wo++):(a=r,0===Xo&&oa(Tr));else o=r;o!==r?(Ho=Wo,a=o.length>ps.length,a=a?void 0:r,a!==r?(Ho=i,i=function(e){cs.push(ps),ps=e.join("")}(o)):(Wo=i,i=r)):(Wo=i,i=r);Xo--,i!==r?(Wo=t,t=void 0):t=r;return t}(),l!==r){for(c=[],p=_a();p!==r;)c.push(p),p=_a();p=function(){let e;Ho=Wo,e=function(){return ps=cs.pop(),!0}(),e=e?void 0:r;return e}(),p!==r?(Ho=n,n=c):(Wo=n,n=r)}else Wo=n,n=r;n===r&&(n=null),Ho=t,t=function(e,t,r,i){let o="bulletList";const a=e.match(/•([0-9]+)([Ii]?) /);let s=1;if(a&&(o="orderedList",a.length>1&&(s=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 n=[{type:"paragraph",attrs:{},content:Rt((t+r.join("")).trim())}];if(i&&i[0]&&i[0]._tempParsingParent){let e={type:i[0]._tempParsingParent,attrs:{start:s},content:i};if((e.type.startsWith("orderedList")||e.type.startsWith("letteredList"))&&i[0]._tempListStart){const t=i[0]._tempListStart;t>1&&(e.attrs.start=t)}n.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:n,_tempParsingParent:o,_tempListStart:s}:{type:l,content:n,_tempParsingParent:o,_tempListStart:s}}(o,a,s,n)}else Wo=t,t=r;else Wo=t,t=r;return t}function Ca(){let t,i,o,a,s,n,l,c,p,d;if(t=Wo,i=Wo,Xo++,o=function(){let t,i,o;t=Wo,i=[],o=e.charAt(Wo),Ht.test(o)?Wo++:(o=r,0===Xo&&oa(ar));for(;o!==r;)i.push(o),o=e.charAt(Wo),Ht.test(o)?Wo++:(o=r,0===Xo&&oa(ar));o=os(),o!==r?(i=[i,o],t=i):(Wo=t,t=r);return t}(),Xo--,o===r?i=void 0:(Wo=i,i=r),i!==r)if(o=wa(),o!==r)if(a=Wo,Xo++,s=xa(),Xo--,s===r?a=void 0:(Wo=a,a=r),a!==r){if(s=Wo,n=Wo,l=[],c=Wo,p=Wo,Xo++,d=os(),Xo--,d===r?p=void 0:(Wo=p,p=r),p!==r?(e.length>Wo?(d=e.charAt(Wo),Wo++):(d=r,0===Xo&&oa(Xt)),d!==r?(p=[p,d],c=p):(Wo=c,c=r)):(Wo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Wo,p=Wo,Xo++,d=os(),Xo--,d===r?p=void 0:(Wo=p,p=r),p!==r?(e.length>Wo?(d=e.charAt(Wo),Wo++):(d=r,0===Xo&&oa(Xt)),d!==r?(p=[p,d],c=p):(Wo=c,c=r)):(Wo=c,c=r);else l=r;l!==r?(c=ss(),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r),s=n!==r?e.substring(s,Wo):n,s!==r?(Ho=t,t=s):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;else Wo=t,t=r;return t}function wa(){let t,i,o;for(t=Wo,i=[],9===e.charCodeAt(Wo)?(o=w,Wo++):(o=r,0===Xo&&oa(Tr));o!==r;)i.push(o),9===e.charCodeAt(Wo)?(o=w,Wo++):(o=r,0===Xo&&oa(Tr));return Ho=Wo,o=i.join("")===ps,o=o?void 0:r,o!==r?(i=[i,o],t=i):(Wo=t,t=r),t}function Aa(){let t,i,o;if(t=Wo,i=[],o=Ba(),o!==r)for(;o!==r;)i.push(o),o=Ba();else i=r;return t=i!==r?e.substring(t,Wo):i,t}function Ba(){let t,i,o,a,s,n;if(t=Wo,i=Wo,Xo++,o=la(),Xo--,o===r?i=void 0:(Wo=i,i=r),i!==r){if(o=Wo,a=Wo,s=[],n=as(),n!==r)for(;n!==r;)s.push(n),n=as();else s=r;s!==r?(n=ss(),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r),o=a!==r?e.substring(o,Wo):a,o!==r?(i=[i,o],t=i):(Wo=t,t=r)}else Wo=t,t=r;return t===r&&(t=os()),t}function Sa(){let t,i,o,a,s,n;if(t=Wo,i=ca(),i!==r){for(o=Wo,a=Wo,s=[],n=e.charAt(Wo),Ht.test(n)?Wo++:(n=r,0===Xo&&oa(ar));n!==r;)s.push(n),n=e.charAt(Wo),Ht.test(n)?Wo++:(n=r,0===Xo&&oa(ar));n=ss(),n!==r?(s=[s,n],a=s):(Wo=a,a=r),o=a!==r?e.substring(o,Wo):a,o!==r?(a=os(),a===r&&(a=null),i=[i,o,a],t=i):(Wo=t,t=r)}else Wo=t,t=r;return t}function Pa(){let t,i,o;return t=Wo,i=ca(),i!==r?(o=function(){let t;return e.substr(Wo,5)===A?(t=A,Wo+=5):(t=r,0===Xo&&oa(xr)),t}(),o!==r?(Ho=t,t=o):(Wo=t,t=r)):(Wo=t,t=r),t}function Ia(){let t,i,o,a,s,n,l,c,p,u,m,h;if(t=Wo,i=Pa(),i!==r)if(58===e.charCodeAt(Wo)?(o=d,Wo++):(o=r,0===Xo&&oa(sr)),o!==r)if(32===e.charCodeAt(Wo)?(a=y,Wo++):(a=r,0===Xo&&oa(hr)),a===r&&(a=null),s=function(){let t,i,o,a,s,n,l,c,p;t=Wo,i=Wo,e.substr(Wo,4)===Jt?(o=Jt,Wo+=4):(o=r,0===Xo&&oa(Do));if(o!==r)if(115===e.charCodeAt(Wo)?(a=Ut,Wo++):(a=r,0===Xo&&oa(Mo)),a===r&&(a=null),e.substr(Wo,3)===jt?(s=jt,Wo+=3):(s=r,0===Xo&&oa(qo)),s!==r){for(n=[],l=Wo,c=Wo,Xo++,p=ca(),Xo--,p===r?c=void 0:(Wo=c,c=r),c!==r?(p=ls(),p!==r?(c=[c,p],l=c):(Wo=l,l=r)):(Wo=l,l=r);l!==r;)n.push(l),l=Wo,c=Wo,Xo++,p=ca(),Xo--,p===r?c=void 0:(Wo=c,c=r),c!==r?(p=ls(),p!==r?(c=[c,p],l=c):(Wo=l,l=r)):(Wo=l,l=r);o=[o,a,s,n],i=o}else Wo=i,i=r;else Wo=i,i=r;t=i!==r?e.substring(t,Wo):i;return t}(),s!==r){for(n=[],32===e.charCodeAt(Wo)?(l=y,Wo++):(l=r,0===Xo&&oa(hr));l!==r;)n.push(l),32===e.charCodeAt(Wo)?(l=y,Wo++):(l=r,0===Xo&&oa(hr));if(l=ca(),l!==r){for(c=La(),p=Wo,u=Wo,m=[],h=e.charAt(Wo),Ht.test(h)?Wo++:(h=r,0===Xo&&oa(ar));h!==r;)m.push(h),h=e.charAt(Wo),Ht.test(h)?Wo++:(h=r,0===Xo&&oa(ar));h=ss(),h!==r?(m=[m,h],u=m):(Wo=u,u=r),p=u!==r?e.substring(p,Wo):u,p!==r?(u=os(),u===r&&(u=null),Ho=t,t=function(e,t,r){const i=Object.assign({},...r);let o=i.alignment||"center";delete i.alignment;let a=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let l=i.align||"center";delete i.align;let c=void 0===i.zoomDisabled||("boolean"==typeof i.zoomDisabled?i.zoomDisabled:"true"===String(i.zoomDisabled).toLowerCase());return delete i.zoomDisabled,{type:e,attrs:{alignment:o,textAlign:a,src:t,alt:Vt(s),title:Vt(n),class:l,zoomDisabled:c,...i}}}(i,s,c)):(Wo=t,t=r)}else Wo=t,t=r}else Wo=t,t=r;else Wo=t,t=r;else Wo=t,t=r;return t}function La(){let e,t,i;for(e=Wo,t=[],i=Va();i!==r;)t.push(i),i=Va();return Ho=e,e=t,e}function Va(){let t,i,o,a,s,n,l,c,p,u;if(t=Wo,35===e.charCodeAt(Wo)?(i=B,Wo++):(i=r,0===Xo&&oa(_r)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t={comment:o.trim()}):(Wo=t,t=r)}else Wo=t,t=r;var m,h;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Ea(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));if(n=Wo,l=[],c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=e.charAt(Wo),Gt.test(u)?Wo++:(u=r,0===Xo&&oa(mr)),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=e.charAt(Wo),Gt.test(u)?Wo++:(u=r,0===Xo&&oa(mr)),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);else l=r;if(n=l!==r?e.substring(n,Wo):l,n!==r){for(l=[],32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c!==r;)l.push(c),32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c=ca(),c!==r?(Ho=t,m=o,h=n,t={[m]:parseInt(h)}):(Wo=t,t=r)}else Wo=t,t=r}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=function(){let t;e.substr(Wo,3)===F?(t=F,Wo+=3):(t=r,0===Xo&&oa(Vr));t===r&&(e.substr(Wo,7)===O?(t=O,Wo+=7):(t=r,0===Xo&&oa(Er)));return t}(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));for(n=Wo,l=[],c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);c!==r;)l.push(c),c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);n=e.substring(n,Wo),l=ca(),l!==r?(Ho=t,t=function(e,t){return{[e]:t.trim()}}(o,n)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=function(){let t;e.substr(Wo,9)===L?(t=L,Wo+=9):(t=r,0===Xo&&oa(Br));t===r&&(e.substr(Wo,12)===V?(t=V,Wo+=12):(t=r,0===Xo&&oa(Sr)));return t}(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));if(n=function(){let t;e.substr(Wo,4)===E?(t=E,Wo+=4):(t=r,0===Xo&&oa(Pr));t===r&&(e.substr(Wo,6)===N?(t=N,Wo+=6):(t=r,0===Xo&&oa(Ir)),t===r&&(e.substr(Wo,5)===R?(t=R,Wo+=5):(t=r,0===Xo&&oa(Lr))));return t}(),n!==r){for(l=[],32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c!==r;)l.push(c),32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c=ca(),c!==r?(Ho=t,t=function(e,t){return{[e]:t}}(o,n)):(Wo=t,t=r)}else Wo=t,t=r}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Na(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));if(n=function(){let t;e.substr(Wo,4)===M?(t=M,Wo+=4):(t=r,0===Xo&&oa(Rr));t===r&&(e.substr(Wo,5)===q?(t=q,Wo+=5):(t=r,0===Xo&&oa(Fr)));return t}(),n!==r){for(l=[],32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c!==r;)l.push(c),32===e.charCodeAt(Wo)?(c=y,Wo++):(c=r,0===Xo&&oa(hr));c=ca(),c!==r?(Ho=t,t=function(e,t){return{[e]:t}}(o,n)):(Wo=t,t=r)}else Wo=t,t=r}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Na(),o!==r){for(a=[],32===e.charCodeAt(Wo)?(s=y,Wo++):(s=r,0===Xo&&oa(hr));s!==r;)a.push(s),32===e.charCodeAt(Wo)?(s=y,Wo++):(s=r,0===Xo&&oa(hr));s=ca(),s!==r?(Ho=t,t=function(e){return{[e]:!0}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r&&(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=ca(),o!==r?(Ho=t,t=void 0):(Wo=t,t=r),t===r)){for(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{error:"Found unknown property or invalid value: "+e}}(o)):(Wo=t,t=r)}}}}}}return t}function Ea(){let t;return e.substr(Wo,5)===P?(t=P,Wo+=5):(t=r,0===Xo&&oa(wr)),t===r&&(e.substr(Wo,6)===I?(t=I,Wo+=6):(t=r,0===Xo&&oa(Ar))),t}function Na(){let t;return e.substr(Wo,12)===D?(t=D,Wo+=12):(t=r,0===Xo&&oa(Nr)),t}function Ra(){let e,t,i,o;for(e=Wo,t=Fa(),t===r&&(t=null),i=[],o=Ma(),o===r&&(o=Fa());o!==r;)i.push(o),o=Ma(),o===r&&(o=Fa());var a,s;return Ho=e,s=i,e=Nt((a=t)?[a,...s.flat()]:s.flat()),e}function Fa(){let t,i,o,a,s,n,l;if(t=Wo,i=os(),i!==r&&(Ho=t,i={type:"hardBreak"}),t=i,t===r){if(t=Wo,i=Wo,o=[],a=Wo,s=qa(),s===r&&(s=null),n=Wo,Xo++,l=Ma(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(s=[s,n,l],a=s):(Wo=a,a=r)):(Wo=a,a=r),a===r&&(a=Wo,s=qa(),s!==r?(n=Wo,Xo++,l=Ma(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r)),a!==r)for(;a!==r;)o.push(a),a=Wo,s=qa(),s===r&&(s=null),n=Wo,Xo++,l=Ma(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(s=[s,n,l],a=s):(Wo=a,a=r)):(Wo=a,a=r),a===r&&(a=Wo,s=qa(),s!==r?(n=Wo,Xo++,l=Ma(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r));else o=r;i=o!==r?e.substring(i,Wo):o,i!==r&&(Ho=t,i={text:Vt(i),type:"text"}),t=i}return t}function Oa(){let t;return 61===e.charCodeAt(Wo)?(t=z,Wo++):(t=r,0===Xo&&oa(Or)),t}function Da(){let e,t,i;return e=Wo,t=Oa(),t!==r?(i=Oa(),i!==r?(t=[t,i],e=t):(Wo=e,e=r)):(Wo=e,e=r),e}function Ma(){let t,i,o,a,n,l,c,p;if(t=Wo,i=es(),i!==r){if(o=Wo,a=[],n=e.charAt(Wo),Gt.test(n)?Wo++:(n=r,0===Xo&&oa(mr)),n!==r)for(;n!==r;)a.push(n),n=e.charAt(Wo),Gt.test(n)?Wo++:(n=r,0===Xo&&oa(mr));else a=r;o=a!==r?e.substring(o,Wo):a,o!==r?(a=ts(),a!==r?(Ho=t,t={index:+o,type:"bit"}):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;var d,u;if(t===r){if(t=Wo,i=Da(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Da(),a!==r?(e.substr(Wo,7)===$?(n=$,Wo+=7):(n=r,0===Xo&&oa(Dr)),n!==r?(Ho=t,t=function(e){return{attrs:{formula:Vt(e)},type:"latex"}}(o)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Da(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Da(),a!==r?(e.substr(Wo,13)===J?(n=J,Wo+=13):(n=r,0===Xo&&oa(Mr)),n!==r?(l=ns(),l!==r?(124===e.charCodeAt(Wo)?(c=s,Wo++):(c=r,0===Xo&&oa(er)),c!==r?(p=function(){let e,t,i;e=Wo,t=[],i=za();for(;i!==r;)t.push(i),i=za();return Ho=e,e=t,e}(),Ho=t,u=p,t={attrs:{alt:o,src:((d=l).pr+d.t).trim(),...Object.assign({},...u),zoomDisabled:!0},type:"imageInline"}):(Wo=t,t=r)):(Wo=t,t=r)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Da(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Da(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Da(),a!==r?(n=function(){let t,i,o,a;t=Wo,124===e.charCodeAt(Wo)?(i=s,Wo++):(i=r,0===Xo&&oa(er));if(i!==r){if(o=[],a=$a(),a!==r)for(;a!==r;)o.push(a),a=$a();else o=r;o!==r?(Ho=t,t=o):(Wo=t,t=r)}else Wo=t,t=r;return t}(),n!==r?(Ho=t,t=function(e,t){return t||(t=[]),{marks:t,text:Vt(e),type:"text"}}(o,n)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Ya(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Ya(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Ya(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Ya(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"bold"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Qa(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Qa(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Qa(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Qa(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"italic"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Xa(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Xa(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Xa(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Xa(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"light"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Za(),i!==r){for(o=Wo,a=[],n=Wo,l=Wo,Xo++,c=Za(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);n!==r;)a.push(n),n=Wo,l=Wo,Xo++,c=Za(),Xo--,c===r?l=void 0:(Wo=l,l=r),l!==r?(e.length>Wo?(c=e.charAt(Wo),Wo++):(c=r,0===Xo&&oa(Xt)),c!==r?(l=[l,c],n=l):(Wo=n,n=r)):(Wo=n,n=r);o=e.substring(o,Wo),a=Za(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"highlight"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;t===r&&(t=Wo,i=ns(),i!==r&&(Ho=t,i=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}}(i)),t=i)}}}}}}}return t}function qa(){let t,i,o,a,s;if(t=Wo,i=Wo,o=Da(),o!==r){if(a=[],s=Oa(),s!==r)for(;s!==r;)a.push(s),s=Oa();else a=r;a!==r?(o=[o,a],i=o):(Wo=i,i=r)}else Wo=i,i=r;if(t=i!==r?e.substring(t,Wo):i,t===r){if(t=Wo,i=Wo,o=Xa(),o!==r){if(a=[],s=Ga(),s!==r)for(;s!==r;)a.push(s),s=Ga();else a=r;a!==r?(o=[o,a],i=o):(Wo=i,i=r)}else Wo=i,i=r;if(t=i!==r?e.substring(t,Wo):i,t===r){if(t=Wo,i=Wo,o=Za(),o!==r){if(a=[],s=Ka(),s!==r)for(;s!==r;)a.push(s),s=Ka();else a=r;a!==r?(o=[o,a],i=o):(Wo=i,i=r)}else Wo=i,i=r;t=i!==r?e.substring(t,Wo):i}}return t}function za(){let t,i,o,a,s,n,l,c,p,u;if(t=Wo,35===e.charCodeAt(Wo)?(i=B,Wo++):(i=r,0===Xo&&oa(_r)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t={comment:o}):(Wo=t,t=r)}else Wo=t,t=r;var m,h;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),e.substr(Wo,6)===U?(o=U,Wo+=6):(o=r,0===Xo&&oa(qr)),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));for(n=Wo,l=[],c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);c!==r;)l.push(c),c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);n=e.substring(n,Wo),l=ca(),l!==r?(Ho=t,m=o,h=n,t={[m]:h}):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Ea(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));if(n=Wo,l=[],c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=e.charAt(Wo),Gt.test(u)?Wo++:(u=r,0===Xo&&oa(mr)),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r),c!==r)for(;c!==r;)l.push(c),c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=e.charAt(Wo),Gt.test(u)?Wo++:(u=r,0===Xo&&oa(mr)),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);else l=r;n=l!==r?e.substring(n,Wo):l,n!==r?(l=ca(),l!==r?(Ho=t,t=function(e,t){return{[e]:parseInt(t)}}(o,n)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),o=Ea(),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));for(n=Wo,l=[],c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);c!==r;)l.push(c),c=Wo,p=Wo,Xo++,u=ca(),Xo--,u===r?p=void 0:(Wo=p,p=r),p!==r?(u=as(),u!==r?(p=[p,u],c=p):(Wo=c,c=r)):(Wo=c,c=r);n=e.substring(n,Wo),l=ca(),l!==r?(Ho=t,t=function(e,t){return{type:"error",msg:e+" must be a positive integer.",found:t}}(o,n)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;if(t===r){if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),e.substr(Wo,17)===j?(o=j,Wo+=17):(o=r,0===Xo&&oa(zr)),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n=function(){let t;e.substr(Wo,3)===H?(t=H,Wo+=3):(t=r,0===Xo&&oa(Jr));t===r&&(e.substr(Wo,6)===G?(t=G,Wo+=6):(t=r,0===Xo&&oa(Ur)),t===r&&(e.substr(Wo,6)===K?(t=K,Wo+=6):(t=r,0===Xo&&oa(jr)),t===r&&(e.substr(Wo,8)===Y?(t=Y,Wo+=8):(t=r,0===Xo&&oa(Wr)),t===r&&(e.substr(Wo,3)===Q?(t=Q,Wo+=3):(t=r,0===Xo&&oa(Hr)),t===r&&(e.substr(Wo,5)===X?(t=X,Wo+=5):(t=r,0===Xo&&oa(Gr)),t===r&&(e.substr(Wo,11)===Z?(t=Z,Wo+=11):(t=r,0===Xo&&oa(Kr)),t===r&&(e.substr(Wo,8)===ee?(t=ee,Wo+=8):(t=r,0===Xo&&oa(Yr)))))))));return t}(),n!==r?(l=ca(),l!==r?(Ho=t,t=function(e,t){return{[e]:t}}(o,n)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r;if(t===r)if(t=Wo,64===e.charCodeAt(Wo)?(i=S,Wo++):(i=r,0===Xo&&oa(Cr)),i===r&&(i=null),e.substr(Wo,4)===W?(o=W,Wo+=4):(o=r,0===Xo&&oa($r)),o!==r)if(58===e.charCodeAt(Wo)?(a=d,Wo++):(a=r,0===Xo&&oa(sr)),a!==r){for(s=[],32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n!==r;)s.push(n),32===e.charCodeAt(Wo)?(n=y,Wo++):(n=r,0===Xo&&oa(hr));n=function(){let t;e.substr(Wo,11)===te?(t=te,Wo+=11):(t=r,0===Xo&&oa(Qr));t===r&&(e.substr(Wo,11)===re?(t=re,Wo+=11):(t=r,0===Xo&&oa(Xr)),t===r&&(e.substr(Wo,5)===X?(t=X,Wo+=5):(t=r,0===Xo&&oa(Gr)),t===r&&(e.substr(Wo,3)===Q?(t=Q,Wo+=3):(t=r,0===Xo&&oa(Hr)),t===r&&(e.substr(Wo,8)===ie?(t=ie,Wo+=8):(t=r,0===Xo&&oa(Zr))))));return t}(),n!==r?(l=ca(),l!==r?(Ho=t,t=function(e,t){return{[e]:t}}(o,n)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r}}}}return t}function $a(){let t,i,o,a,s,n,l,c,d,u,m;if(t=Wo,e.substr(Wo,5)===oe?(i=oe,Wo+=5):(i=r,0===Xo&&oa(ei)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t={type:"link",attrs:{href:o.trim(),target:"_blank"}}):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,7)===ae?(i=ae,Wo+=7):(i=r,0===Xo&&oa(ti)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);if(o=e.substring(o,Wo),a=function(){let e,t;e=[],t=Ja();for(;t!==r;)e.push(t),t=Ja();return e}(),s=ca(),s!==r)if(e.substr(Wo,9)===se?(n=se,Wo+=9):(n=r,0===Xo&&oa(ri)),n!==r){for(l=Wo,c=[],d=Wo,u=Wo,Xo++,m=ca(),Xo--,m===r?u=void 0:(Wo=u,u=r),u!==r?(m=as(),m!==r?(u=[u,m],d=u):(Wo=d,d=r)):(Wo=d,d=r);d!==r;)c.push(d),d=Wo,u=Wo,Xo++,m=ca(),Xo--,m===r?u=void 0:(Wo=u,u=r),u!==r?(m=as(),m!==r?(u=[u,m],d=u):(Wo=d,d=r)):(Wo=d,d=r);l=e.substring(l,Wo),c=ca(),c!==r?(Ho=t,t=function(e,t,r){return{type:"extref",attrs:{extref:e.trim(),references:t,provider:r.trim()}}}(o,a,l)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,5)===ne?(i=ne,Wo+=5):(i=r,0===Xo&&oa(ii)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);if(o=e.substring(o,Wo),a=ca(),a!==r)if(9658===e.charCodeAt(Wo)?(s=le,Wo++):(s=r,0===Xo&&oa(oi)),s!==r){for(n=Wo,l=[],c=Wo,d=Wo,Xo++,u=ca(),Xo--,u===r?d=void 0:(Wo=d,d=r),d!==r?(u=as(),u!==r?(d=[d,u],c=d):(Wo=c,c=r)):(Wo=c,c=r);c!==r;)l.push(c),c=Wo,d=Wo,Xo++,u=ca(),Xo--,u===r?d=void 0:(Wo=d,d=r),d!==r?(u=as(),u!==r?(d=[d,u],c=d):(Wo=c,c=r)):(Wo=c,c=r);n=e.substring(n,Wo),l=ca(),l!==r?(Ho=t,t=function(e,t){return{type:"xref",attrs:{xref:e.trim(),reference:t.trim()}}}(o,n)):(Wo=t,t=r)}else Wo=t,t=r;else Wo=t,t=r}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,5)===ne?(i=ne,Wo+=5):(i=r,0===Xo&&oa(ii)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"xref",attrs:{xref:e.trim(),reference:""}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,9658===e.charCodeAt(Wo)?(i=le,Wo++):(i=r,0===Xo&&oa(oi)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"ref",attrs:{reference:e.trim()}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,7)===ce?(i=ce,Wo+=7):(i=r,0===Xo&&oa(ai)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(s=La(),Ho=t,t=function(e,t){const r=Object.assign({},...t);return{type:"symbol",attrs:{src:e.trim(),...r}}}(o,s)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,9)===pe?(i=pe,Wo+=9):(i=r,0===Xo&&oa(si)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"footnote",attrs:{content:Rt(e.trim())}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,10)===de?(i=de,Wo+=10):(i=r,0===Xo&&oa(ni)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"footnote*",attrs:{content:Rt(e.trim())}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,4)===ue?(i=ue,Wo+=4):(i=r,0===Xo&&oa(li)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"var",attrs:{name:e.trim()}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r&&(t=Wo,e.substr(Wo,4)===p?(i=p,Wo+=4):(i=r,0===Xo&&oa(or)),i!==r?(o=ca(),o!==r?(Ho=t,t={type:"code",attrs:{language:"plain text"}}):(Wo=t,t=r)):(Wo=t,t=r),t===r)){if(t=Wo,e.substr(Wo,5)===me?(i=me,Wo+=5):(i=r,0===Xo&&oa(ci)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t={type:"code",attrs:{language:o.trim().toLowerCase()}}):(Wo=t,t=r)}else Wo=t,t=r;if(t===r&&(t=Wo,e.substr(Wo,5)===he?(i=he,Wo+=5):(i=r,0===Xo&&oa(pi)),i!==r?(o=ca(),o!==r?(Ho=t,t={type:"timer",attrs:{name:""}}):(Wo=t,t=r)):(Wo=t,t=r),t===r)){if(t=Wo,e.substr(Wo,6)===ge?(i=ge,Wo+=6):(i=r,0===Xo&&oa(di)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"timer",attrs:{name:e.trim()}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,e.substr(Wo,9)===fe?(i=fe,Wo+=9):(i=r,0===Xo&&oa(ui)),i!==r){if(o=Wo,a=Wo,80===e.charCodeAt(Wo)?(s=be,Wo++):(s=r,0===Xo&&oa(mi)),s!==r){for(n=Wo,l=[],c=Wo,d=Wo,Xo++,u=ca(),Xo--,u===r?d=void 0:(Wo=d,d=r),d!==r?(u=as(),u!==r?(d=[d,u],c=d):(Wo=c,c=r)):(Wo=c,c=r);c!==r;)l.push(c),c=Wo,d=Wo,Xo++,u=ca(),Xo--,u===r?d=void 0:(Wo=d,d=r),d!==r?(u=as(),u!==r?(d=[d,u],c=d):(Wo=c,c=r)):(Wo=c,c=r);n=e.substring(n,Wo),s=[s,n],a=s}else Wo=a,a=r;o=a!==r?e.substring(o,Wo):a,o!==r?(a=ca(),a!==r?(Ho=t,t=function(e){return{type:"duration",attrs:{duration:e}}}(o)):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r&&(t=Wo,e.substr(Wo,6)===ye?(i=ye,Wo+=6):(i=r,0===Xo&&oa(hi)),i!==r?(o=function(){let t;e.substr(Wo,4)===nt?(t=nt,Wo+=4):(t=r,0===Xo&&oa(io));t===r&&(e.substr(Wo,5)===lt?(t=lt,Wo+=5):(t=r,0===Xo&&oa(oo)),t===r&&(e.substr(Wo,4)===ct?(t=ct,Wo+=4):(t=r,0===Xo&&oa(ao)),t===r&&(e.substr(Wo,5)===pt?(t=pt,Wo+=5):(t=r,0===Xo&&oa(so)),t===r&&(e.substr(Wo,7)===dt?(t=dt,Wo+=7):(t=r,0===Xo&&oa(no)),t===r&&(e.substr(Wo,9)===ut?(t=ut,Wo+=9):(t=r,0===Xo&&oa(lo)),t===r&&(e.substr(Wo,4)===mt?(t=mt,Wo+=4):(t=r,0===Xo&&oa(co)),t===r&&(e.substr(Wo,8)===ht?(t=ht,Wo+=8):(t=r,0===Xo&&oa(po)),t===r&&(e.substr(Wo,5)===gt?(t=gt,Wo+=5):(t=r,0===Xo&&oa(uo)),t===r&&(e.substr(Wo,4)===ft?(t=ft,Wo+=4):(t=r,0===Xo&&oa(mo)),t===r&&(e.substr(Wo,7)===bt?(t=bt,Wo+=7):(t=r,0===Xo&&oa(ho)),t===r&&(e.substr(Wo,6)===yt?(t=yt,Wo+=6):(t=r,0===Xo&&oa(go)),t===r&&(e.substr(Wo,4)===kt?(t=kt,Wo+=4):(t=r,0===Xo&&oa(fo)),t===r&&(e.substr(Wo,5)===vt?(t=vt,Wo+=5):(t=r,0===Xo&&oa(bo)),t===r&&(e.substr(Wo,6)===Tt?(t=Tt,Wo+=6):(t=r,0===Xo&&oa(yo)),t===r&&(e.substr(Wo,4)===xt?(t=xt,Wo+=4):(t=r,0===Xo&&oa(ko)),t===r&&(e.substr(Wo,6)===_t?(t=_t,Wo+=6):(t=r,0===Xo&&oa(vo)),t===r&&(e.substr(Wo,3)===Ct?(t=Ct,Wo+=3):(t=r,0===Xo&&oa(To)),t===r&&(e.substr(Wo,6)===wt?(t=wt,Wo+=6):(t=r,0===Xo&&oa(xo)),t===r&&(e.substr(Wo,4)===At?(t=At,Wo+=4):(t=r,0===Xo&&oa(_o)),t===r&&(e.substr(Wo,6)===Bt?(t=Bt,Wo+=6):(t=r,0===Xo&&oa(Co)),t===r&&(e.substr(Wo,5)===St?(t=St,Wo+=5):(t=r,0===Xo&&oa(wo)),t===r&&(e.substr(Wo,6)===Pt?(t=Pt,Wo+=6):(t=r,0===Xo&&oa(Ao))))))))))))))))))))))));return t}(),o!==r?(a=ca(),a!==r?(Ho=t,t={type:"color",attrs:{color:o}}):(Wo=t,t=r)):(Wo=t,t=r)):(Wo=t,t=r),t===r)){if(t=Wo,e.substr(Wo,12)===ke?(i=ke,Wo+=12):(i=r,0===Xo&&oa(gi)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"colorPicker",attrs:{propertyRef:e.trim()}}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r&&(t=Wo,i=function(){let t;e.substr(Wo,4)===Te?(t=Te,Wo+=4):(t=r,0===Xo&&oa(bi));t===r&&(e.substr(Wo,6)===xe?(t=xe,Wo+=6):(t=r,0===Xo&&oa(yi)),t===r&&(e.substr(Wo,5)===_e?(t=_e,Wo+=5):(t=r,0===Xo&&oa(ki)),t===r&&(e.substr(Wo,15)===Ce?(t=Ce,Wo+=15):(t=r,0===Xo&&oa(vi)),t===r&&(e.substr(Wo,15)===we?(t=we,Wo+=15):(t=r,0===Xo&&oa(Ti)),t===r&&(e.substr(Wo,14)===Ae?(t=Ae,Wo+=14):(t=r,0===Xo&&oa(xi)),t===r&&(e.substr(Wo,13)===Be?(t=Be,Wo+=13):(t=r,0===Xo&&oa(_i)),t===r&&(e.substr(Wo,15)===Se?(t=Se,Wo+=15):(t=r,0===Xo&&oa(Ci)),t===r&&(e.substr(Wo,13)===Pe?(t=Pe,Wo+=13):(t=r,0===Xo&&oa(wi)),t===r&&(e.substr(Wo,14)===Ie?(t=Ie,Wo+=14):(t=r,0===Xo&&oa(Ai)),t===r&&(e.substr(Wo,14)===Le?(t=Le,Wo+=14):(t=r,0===Xo&&oa(Bi)),t===r&&(e.substr(Wo,14)===Ve?(t=Ve,Wo+=14):(t=r,0===Xo&&oa(Si)),t===r&&(e.substr(Wo,13)===Ee?(t=Ee,Wo+=13):(t=r,0===Xo&&oa(Pi)),t===r&&(e.substr(Wo,9)===Ne?(t=Ne,Wo+=9):(t=r,0===Xo&&oa(Ii)),t===r&&(e.substr(Wo,6)===Re?(t=Re,Wo+=6):(t=r,0===Xo&&oa(Li)),t===r&&(e.substr(Wo,9)===Fe?(t=Fe,Wo+=9):(t=r,0===Xo&&oa(Vi)),t===r&&(e.substr(Wo,11)===Oe?(t=Oe,Wo+=11):(t=r,0===Xo&&oa(Ei)),t===r&&(e.substr(Wo,3)===De?(t=De,Wo+=3):(t=r,0===Xo&&oa(Ni)),t===r&&(e.substr(Wo,3)===Me?(t=Me,Wo+=3):(t=r,0===Xo&&oa(Ri)),t===r&&(e.substr(Wo,9)===qe?(t=qe,Wo+=9):(t=r,0===Xo&&oa(Fi)),t===r&&(e.substr(Wo,15)===ze?(t=ze,Wo+=15):(t=r,0===Xo&&oa(Oi)),t===r&&(e.substr(Wo,6)===$e?(t=$e,Wo+=6):(t=r,0===Xo&&oa(Di)),t===r&&(e.substr(Wo,13)===Je?(t=Je,Wo+=13):(t=r,0===Xo&&oa(Mi)),t===r&&(e.substr(Wo,16)===Ue?(t=Ue,Wo+=16):(t=r,0===Xo&&oa(qi)),t===r&&(e.substr(Wo,16)===je?(t=je,Wo+=16):(t=r,0===Xo&&oa(zi)),t===r&&(e.substr(Wo,15)===We?(t=We,Wo+=15):(t=r,0===Xo&&oa($i)),t===r&&(e.substr(Wo,14)===He?(t=He,Wo+=14):(t=r,0===Xo&&oa(Ji)),t===r&&(e.substr(Wo,16)===Ge?(t=Ge,Wo+=16):(t=r,0===Xo&&oa(Ui)),t===r&&(e.substr(Wo,14)===Ke?(t=Ke,Wo+=14):(t=r,0===Xo&&oa(ji)),t===r&&(e.substr(Wo,15)===Ye?(t=Ye,Wo+=15):(t=r,0===Xo&&oa(Wi)),t===r&&(e.substr(Wo,15)===Qe?(t=Qe,Wo+=15):(t=r,0===Xo&&oa(Hi)),t===r&&(e.substr(Wo,15)===Xe?(t=Xe,Wo+=15):(t=r,0===Xo&&oa(Gi)),t===r&&(e.substr(Wo,14)===Ze?(t=Ze,Wo+=14):(t=r,0===Xo&&oa(Ki)),t===r&&(e.substr(Wo,10)===et?(t=et,Wo+=10):(t=r,0===Xo&&oa(Yi)),t===r&&(e.substr(Wo,13)===tt?(t=tt,Wo+=13):(t=r,0===Xo&&oa(Qi)),t===r&&(e.substr(Wo,19)===rt?(t=rt,Wo+=19):(t=r,0===Xo&&oa(Xi)),t===r&&(e.substr(Wo,10)===it?(t=it,Wo+=10):(t=r,0===Xo&&oa(Zi)),t===r&&(e.substr(Wo,10)===ot?(t=ot,Wo+=10):(t=r,0===Xo&&oa(eo)),t===r&&(e.substr(Wo,13)===at?(t=at,Wo+=13):(t=r,0===Xo&&oa(to)),t===r&&(e.substr(Wo,11)===st?(t=st,Wo+=11):(t=r,0===Xo&&oa(ro)))))))))))))))))))))))))))))))))))))))));return t}(),i!==r?(o=ca(),o!==r?(Ho=t,t={type:i}):(Wo=t,t=r)):(Wo=t,t=r),t===r))if(t=Wo,35===e.charCodeAt(Wo)?(i=B,Wo++):(i=r,0===Xo&&oa(_r)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=ca(),a!==r?(Ho=t,t=function(e){return{type:"comment",comment:e}}(o)):(Wo=t,t=r)}else Wo=t,t=r}}}}}}}}}}}}return t}function Ja(){let t,i,o,a,s,n,l;if(t=Wo,e.substr(Wo,2)===ve?(i=ve,Wo+=2):(i=r,0===Xo&&oa(fi)),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),Ho=t,t=o.trim()}else Wo=t,t=r;return t}function Ua(){let e,t,i,o;for(Xo++,e=Wo,t=ja(),t===r&&(t=null),i=[],o=rs(),o===r&&(o=ja());o!==r;)i.push(o),o=rs(),o===r&&(o=ja());var a,s;return Ho=e,s=i,e=Nt((a=t)?[a,...s.flat()]:s.flat()),Xo--,e}function ja(){let t,i,o,a,s,n,l;if(t=Wo,i=os(),i!==r&&(Ho=t,i={type:"hardBreak"}),t=i,t===r){if(t=Wo,i=Wo,o=[],a=Wo,s=is(),s===r&&(s=null),n=Wo,Xo++,l=rs(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(s=[s,n,l],a=s):(Wo=a,a=r)):(Wo=a,a=r),a===r&&(a=Wo,s=is(),s!==r?(n=Wo,Xo++,l=rs(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r)),a!==r)for(;a!==r;)o.push(a),a=Wo,s=is(),s===r&&(s=null),n=Wo,Xo++,l=rs(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=as(),l!==r?(s=[s,n,l],a=s):(Wo=a,a=r)):(Wo=a,a=r),a===r&&(a=Wo,s=is(),s!==r?(n=Wo,Xo++,l=rs(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(s=[s,n],a=s):(Wo=a,a=r)):(Wo=a,a=r));else o=r;i=o!==r?e.substring(i,Wo):o,i!==r&&(Ho=t,i={text:Vt(i),type:"text"}),t=i}return t}function Wa(){let t;return 42===e.charCodeAt(Wo)?(t=It,Wo++):(t=r,0===Xo&&oa(Bo)),t}function Ha(){let t;return 95===e.charCodeAt(Wo)?(t=Lt,Wo++):(t=r,0===Xo&&oa(So)),t}function Ga(){let t;return 96===e.charCodeAt(Wo)?(t=Ot,Wo++):(t=r,0===Xo&&oa(Po)),t}function Ka(){let t;return 33===e.charCodeAt(Wo)?(t=Dt,Wo++):(t=r,0===Xo&&oa(Io)),t}function Ya(){let e,t,i;return e=Wo,t=Wa(),t!==r?(i=Wa(),i!==r?(t=[t,i],e=t):(Wo=e,e=r)):(Wo=e,e=r),e}function Qa(){let e,t,i;return e=Wo,t=Ha(),t!==r?(i=Ha(),i!==r?(t=[t,i],e=t):(Wo=e,e=r)):(Wo=e,e=r),e}function Xa(){let e,t,i;return e=Wo,t=Ga(),t!==r?(i=Ga(),i!==r?(t=[t,i],e=t):(Wo=e,e=r)):(Wo=e,e=r),e}function Za(){let e,t,i;return e=Wo,t=Ka(),t!==r?(i=Ka(),i!==r?(t=[t,i],e=t):(Wo=e,e=r)):(Wo=e,e=r),e}function es(){let t;return e.substr(Wo,2)===Mt?(t=Mt,Wo+=2):(t=r,0===Xo&&oa(Lo)),t}function ts(){let t;return 93===e.charCodeAt(Wo)?(t=qt,Wo++):(t=r,0===Xo&&oa(Vo)),t}function rs(){let t,i,o,a,s,n,l;if(t=Wo,i=es(),i!==r){if(o=Wo,a=[],s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr)),s!==r)for(;s!==r;)a.push(s),s=e.charAt(Wo),Gt.test(s)?Wo++:(s=r,0===Xo&&oa(mr));else a=r;o=a!==r?e.substring(o,Wo):a,o!==r?(a=ts(),a!==r?(Ho=t,t={index:+o,type:"bit"}):(Wo=t,t=r)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Ya(),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=Ya(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=Ya(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=Ya(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"bold"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Qa(),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=Qa(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=Qa(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=Qa(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"italic"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r){if(t=Wo,i=Xa(),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=Xa(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=Xa(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=Xa(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"light"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r;if(t===r)if(t=Wo,i=Za(),i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=Za(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=Za(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(e.length>Wo?(l=e.charAt(Wo),Wo++):(l=r,0===Xo&&oa(Xt)),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),a=Za(),a!==r?(Ho=t,t=function(e){return{marks:[{type:"highlight"}],text:Vt(e),type:"text"}}(o)):(Wo=t,t=r)}else Wo=t,t=r}}}return t}function is(){let t,i,o,a,s;if(t=Wo,i=Wo,o=Xa(),o!==r){if(a=[],s=Ga(),s!==r)for(;s!==r;)a.push(s),s=Ga();else a=r;a!==r?(o=[o,a],i=o):(Wo=i,i=r)}else Wo=i,i=r;if(t=i!==r?e.substring(t,Wo):i,t===r){if(t=Wo,i=Wo,o=Za(),o!==r){if(a=[],s=Ka(),s!==r)for(;s!==r;)a.push(s),s=Ka();else a=r;a!==r?(o=[o,a],i=o):(Wo=i,i=r)}else Wo=i,i=r;t=i!==r?e.substring(t,Wo):i}return t}function os(){let t,i;return Xo++,10===e.charCodeAt(Wo)?(t=zt,Wo++):(t=r,0===Xo&&oa(No)),t===r&&(e.substr(Wo,2)===$t?(t=$t,Wo+=2):(t=r,0===Xo&&oa(Ro)),t===r&&(t=e.charAt(Wo),Kt.test(t)?Wo++:(t=r,0===Xo&&oa(Fo)))),Xo--,t===r&&(i=r,0===Xo&&oa(Eo)),t}function as(){let t;return t=e.charAt(Wo),Yt.test(t)?Wo++:(t=r,0===Xo&&oa(Oo)),t}function ss(){let t,i;return t=os(),t===r&&(t=Wo,Xo++,e.length>Wo?(i=e.charAt(Wo),Wo++):(i=r,0===Xo&&oa(Xt)),Xo--,i===r?t=void 0:(Wo=t,t=r)),t}function ns(){let t,i,o,a,s,n,l;if(t=Wo,i=Wo,o=Wo,e.substr(Wo,4)===Jt?(a=Jt,Wo+=4):(a=r,0===Xo&&oa(Do)),a!==r?(115===e.charCodeAt(Wo)?(s=Ut,Wo++):(s=r,0===Xo&&oa(Mo)),s===r&&(s=null),e.substr(Wo,3)===jt?(n=jt,Wo+=3):(n=r,0===Xo&&oa(qo)),n!==r?(a=[a,s,n],o=a):(Wo=o,o=r)):(Wo=o,o=r),o===r&&(e.substr(Wo,7)===Wt?(o=Wt,Wo+=7):(o=r,0===Xo&&oa(zo))),i=o!==r?e.substring(i,Wo):o,i!==r){for(o=Wo,a=[],s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=ls(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);s!==r;)a.push(s),s=Wo,n=Wo,Xo++,l=ca(),Xo--,l===r?n=void 0:(Wo=n,n=r),n!==r?(l=ls(),l!==r?(n=[n,l],s=n):(Wo=s,s=r)):(Wo=s,s=r);o=e.substring(o,Wo),Ho=t,t={pr:i,t:o}}else Wo=t,t=r;return t}function ls(){let t;return t=e.charAt(Wo),Qt.test(t)?Wo++:(t=r,0===Xo&&oa($o)),t}var cs=[],ps="";e=e.trimStart(),Ko=a();const ds=Ko!==r&&Wo===e.length;function us(){throw Ko!==r&&Wo<e.length&&oa({type:"end"}),aa(Qo,Yo<e.length?function(t=Wo){const r=e.codePointAt(t);return void 0===r?"":String.fromCodePoint(r)}(Yo):null,Yo<e.length?ia(Yo,Yo+1):ia(Yo,Yo))}return t.peg$library?{peg$result:Ko,peg$currPos:Wo,peg$FAILED:r,peg$maxFailExpected:Qo,peg$maxFailPos:Yo,peg$success:ds,peg$throw:ds?void 0:us}:ds?Ko:void us()}var Dt=Ot,Mt=class{version(){return Dt("",{startRule:"version"})}preprocessAst(e){if(se.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 r=e??"";if(!r)return[];let i="bitmarkPlusPlus";return Object.assign({},t).location===Ue&&(i="bitmarkPlus"),r=r.trim(),Dt(r,{startRule:i})}extractBodyBits(e){if(!Array.isArray(e))return[];const t=[],r=e;for(const e of r)switch(e.type){case qe.gap:case qe.select:case qe.highlight:case qe.mark:t.push(e);break;default:{const r=this.extractBodyBits(e.content);for(const e of r)t.push(e)}}return t}walkBodyBits(e,t){if(!Array.isArray(e))return;const r=e;for(let e=0;e<r.length;e++){const i=r[e];switch(i.type){case qe.gap:case qe.select:case qe.highlight:case qe.mark:t(r,e,i);break;default:this.walkBodyBits(i.content,t)}}}},qt=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}},zt=new class{asNumber(e,t){if(null==e)return t??void 0;const r=+e;return Number.isNaN(r)||!isFinite(r)?t??void 0:r}isNumeric(e){if(null==e)return!1;const t=+e;return!Number.isNaN(t)&&isFinite(t)}},$t=class{constructor(){l(this,"textParser"),l(this,"textGenerator"),this.textParser=new Mt,this.textGenerator=new Lt}toExample(e,t,r){if(null!=t){let e;return e=qt.isBoolean(r)?qt.toBoolean(t):t,{isExample:!0,example:e,__defaultExample:r??null}}return e?{isExample:!0,example:r??null,__defaultExample:r??null}:{isExample:!1,example:null,__defaultExample:r??null}}toAstProperty(e,t,r,i){if(null==r)return;let o=ve.getBitConfig(e).tags;if(i?.cardSet){const{sideNo:t,variantNo:r}=i.cardSet;o=ve.getTagsConfigForCardSet(e,t,r)??o}const a=ve.getTagConfigForTag(o,t);a?.array&&!Array.isArray(r)?r=[r]:!a?.array&&Array.isArray(r)&&(r=r[r.length-1]);const s=e=>{if(null==e)return;switch(a?.format??b){case b:return null!=zt.asNumber(e)&&(e=`${e}`),se.isString(e)?se.trimmedString(e):void 0;case k:return zt.asNumber(e);case v:return qt.toBoolean(e,!0);case T:return!qt.toBoolean(e,!0)}return e};if(Array.isArray(r)){const e=r;for(let t=0,r=e.length;t<r;t++)e[t]=s(e[t])}else r=s(r);return r}getEmptyTextAst(e){return this.handleJsonText(e,Ue," ")}handleJsonText(e,t,r){let i;const{textFormat:o}=e;if(null==r)i=[];else if(this.textParser.isAst(r))i=r;else{if(Array.isArray(r)){const e=[];for(let i=0,a=r.length;i<a;i++){const a=r[i];this.textParser.isAst(a)?e[i]=a:se.isString(a)?(e[i]=this.textParser.toAst(dt.breakscape(a,{format:o,location:t}),{format:o,location:t}),e[i].__tag="text"):e[i]=[]}return e}i=se.isString(r)?this.textParser.toAst(dt.breakscape(r,{format:o,location:t,v2:!0}),{format:o,location:t}):[]}return i.__tag="text",i}},Jt=new Mt,Ut=new class{fillStringExample(e,t,r,i,o){if(t){Array.isArray(t)||(t=[t]);for(const a of t)if(!a.isExample&&(r?(a.example=a.__defaultExample,a.isExample=!0):a.example=i?Jt.toAst(i,{format:e,location:Ue}):void 0,o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!i||o.isCorrect)&&(t?(o.example=o.__defaultExample,o.isExample=!0):o.example=qt.toBoolean(r),i))break}}},jt=r(722),Wt=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}},Ht=new class{validateBit(e){if(!e)return e;return e}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;const t=e;let r=!0;switch(e.type){case ne.image:{const t=e.image;se.isString(t.src)||(t.src="");break}case ne.imageLink:{const t=e.imageLink;se.isString(t.url)||(t.url="");break}case ne.audio:{const t=e.audio;se.isString(t.src)||(t.src="");break}case ne.audioEmbed:{const t=e.audioEmbed;se.isString(t.src)||(t.src="");break}case ne.audioLink:{const t=e.audioLink;se.isString(t.url)||(t.url="");break}case ne.video:{const t=e.video;se.isString(t.src)||(t.src="");break}case ne.videoEmbed:{const t=e.videoEmbed;se.isString(t.url)||(t.url="");break}case ne.videoLink:{const t=e.videoLink;se.isString(t.url)||(t.url="");break}case ne.stillImageFilm:{const t=e;se.isString(t.image.src)||(t.image.src=""),se.isString(t.audio.src)||(t.audio.src="");break}case ne.stillImageFilmEmbed:{const t=e.stillImageFilmEmbed;se.isString(t.url)||(t.url="");break}case ne.stillImageFilmLink:{const t=e.stillImageFilmLink;se.isString(t.url)||(t.url="");break}case ne.article:{const t=e.article;se.isString(t.body)||(t.body="");break}case ne.document:{const t=e.document;se.isString(t.url)||(t.url="");break}case ne.documentEmbed:{const t=e.documentEmbed;se.isString(t.url)||(t.url="");break}case ne.documentLink:{const t=e.documentLink;se.isString(t.url)||(t.url="");break}case ne.documentDownload:{const t=e.documentDownload;se.isString(t.url)||(t.url="");break}case ne.appLink:{const t=e.appLink;se.isString(t.url)||(t.url="");break}case ne.websiteLink:{const t=e.websiteLink;se.isString(t.url)||(t.url="");break}default:r=!1}return r||e.type&&(e.__invalid=!0),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(!se.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!se.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!se.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!se.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(!se.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`)}},Gt=class extends $t{resourceFromResourceJson(e,t){if(!t)return;const r=[];Array.isArray(t)||(t=[t]);for(const i of t){let t=(0,jt.Enum)(ne).fromValue(i.type);if(!t)return;const o=(0,jt.Enum)(ne).keyFromValue(t);if(!o)return;let a;if(t=(0,jt.Enum)(ne).fromValue(i.__typeAlias)??t,t===ne.imageResponsive){const t=i,o=this.resourceFromResourceDataJson(e,ne.imagePortrait,t.imagePortrait),a=this.resourceFromResourceDataJson(e,ne.imageLandscape,t.imageLandscape);o&&r.push(o),a&&r.push(a)}else if(t===ne.stillImageFilm){const t=i,o=this.resourceFromResourceDataJson(e,ne.image,t.image),a=this.resourceFromResourceDataJson(e,ne.audio,t.audio);o&&r.push(o),a&&r.push(a)}else{if(a=i[o],!a)return;const s=this.resourceFromResourceDataJson(e,t,a);s&&r.push(s)}}return 0!==r.length?1===r.length?r[0]:r:void 0}resourceFromResourceDataJson(e,t,r){if(!r)return;if(!(t=(0,jt.Enum)(ne).fromValue(t)))return;const i=se.isString(r)?r:void 0,o=r.url||r.src||r.body||i,a=r.posterImage?this.resourceFromResourceDataJson(e,ne.image,r.posterImage)?.image:void 0,s=r.thumbnails?r.thumbnails.map(t=>this.resourceFromResourceDataJson(e,ne.image,t)?.image):void 0;return this.resource(e,{type:t,value:o,srcAlt:r.srcAlt,format:r.format,src1x:r.src1x,src2x:r.src2x,src3x:r.src3x,src4x:r.src4x,caption:this.handleJsonText(e,Ue,r.caption),width:r.width??void 0,height:r.height??void 0,alt:r.alt,zoomDisabled:r.zoomDisabled,duration:r.duration,mute:r.mute,autoplay:r.autoplay,allowSubtitles:r.allowSubtitles,showSubtitles:r.showSubtitles,posterImage:a,thumbnails:s,siteName:void 0,license:r.license,copyright:r.copyright,showInIndex:r.showInIndex,search:r.search,selected:r.selected})}resource(e,t){let r;const{type:i,value:o,format:a,...s}=t,n={type:i,value:o??dt.EMPTY_STRING,format:a??dt.EMPTY_STRING,...s};switch(i){case ne.video:case ne.videoEmbed:case ne.videoLink:case ne.stillImageFilmEmbed:case ne.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const o of r){const r=t[o];if(r){const t=this.resource(e,{type:ne.image,value:r});t&&i.push(t.image)}}n.thumbnails=[...n.thumbnails||[],...i]}}switch(i){case ne.image:case ne.imagePortrait:case ne.imageLandscape:case ne.backgroundWallpaper:case ne.imagePlaceholder:case ne.icon:case ne.platformIcon:case ne.platformLogo:case ne.platformBackgroundImage:case ne.previewImage:case ne.coverImage:r=this.imageResource(e,n,i);break;case ne.imageLink:r=this.imageLinkResource(e,n);break;case ne.audio:r=this.audioResource(e,n);break;case ne.audioEmbed:r=this.audioEmbedResource(e,n);break;case ne.audioLink:r=this.audioLinkResource(e,n);break;case ne.video:case ne.previewVideo:r=this.videoResource(e,n);break;case ne.videoEmbed:r=this.videoEmbedResource(e,n);break;case ne.videoLink:r=this.videoLinkResource(e,n);break;case ne.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(e,n);break;case ne.stillImageFilmLink:r=this.stillImageFilmLinkResource(e,n);break;case ne.article:r=this.articleResource(e,n);break;case ne.document:r=this.documentResource(e,n);break;case ne.documentEmbed:r=this.documentEmbedResource(e,n);break;case ne.documentLink:r=this.documentLinkResource(e,n);break;case ne.documentDownload:r=this.documentDownloadResource(e,n);break;case ne.appLink:r=this.appLinkResource(e,n);break;case ne.websiteLink:r=this.websiteLinkResource(e,n)}return r}imageResource(e,t,r){const{value:i,srcAlt:o,src1x:a,src2x:s,src3x:n,src4x:l,width:c,height:p,alt:u,zoomDisabled:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,{bitType:v}=e;let T=!1;ve.isOfBitType(v,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages,d.extractorImage])&&(T=!0);const x={type:ne.image,__typeAlias:r??ne.image,__configKey:le(r??ne.image),image:{format:Wt.fileExtensionFromUrl(i)??void 0,provider:Wt.domainFromUrl(i)??void 0,src:i??"",srcAlt:o??void 0,src1x:a??void 0,src2x:s??void 0,src3x:n??void 0,src4x:l??void 0,width:c??null,height:p??null,alt:u??"",zoomDisabled:m??T,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(x.image,{ignoreFalse:["zoomDisabled","showInIndex","selected"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","alt","license","copyright"]}),Ht.validateResource(x)}imageLinkResource(e,t){const{value:r,srcAlt:i,src1x:o,src2x:a,src3x:s,src4x:n,width:l,height:c,alt:p,zoomDisabled:d,license:u,copyright:m,showInIndex:h,caption:g,search:f,selected:b}=t,y={type:ne.imageLink,__typeAlias:ne.imageLink,__configKey:le(ne.imageLink),imageLink:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,src1x:o??void 0,src2x:a??void 0,src3x:s??void 0,src4x:n??void 0,width:l??null,height:c??null,alt:p??"",zoomDisabled:d??!1,license:u??"",copyright:m??"",showInIndex:h??!1,caption:this.handleJsonText(e,Ue,g),search:f??void 0,selected:b??!1}};return he.removeUnwantedProperties(y.imageLink,{ignoreFalse:["zoomDisabled","showInIndex","selected"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","alt","license","copyright"]}),Ht.validateResource(y)}audioResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audio,__typeAlias:ne.audio,__configKey:le(ne.audio),audio:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,Ue,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audio,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(m)}audioEmbedResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audioEmbed,__typeAlias:ne.audioEmbed,__configKey:le(ne.audioEmbed),audioEmbed:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,Ue,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audioEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(m)}audioLinkResource(e,t){const{value:r,srcAlt:i,duration:o,mute:a,autoplay:s,license:n,copyright:l,showInIndex:c,caption:p,search:d,selected:u}=t,m={type:ne.audioLink,__typeAlias:ne.audioLink,__configKey:le(ne.audioLink),audioLink:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,duration:o??void 0,mute:a??void 0,autoplay:s??void 0,license:n??"",copyright:l??"",showInIndex:c??!1,caption:this.handleJsonText(e,Ue,p),search:d??void 0,selected:u??!1}};return he.removeUnwantedProperties(m.audioLink,{ignoreEmptyString:["url"],ignoreFalse:["selected"]}),Ht.validateResource(m)}videoResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.video,__typeAlias:ne.video,__configKey:le(ne.video),video:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,src:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1,posterImage:u??void 0,thumbnails:m??void 0}};return he.removeUnwantedProperties(v.video,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(v)}videoEmbedResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.videoEmbed,__typeAlias:ne.videoEmbed,__configKey:le(ne.videoEmbed),videoEmbed:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.videoEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(v)}videoLinkResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.videoLink,__typeAlias:ne.videoLink,__configKey:le(ne.videoLink),videoLink:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.videoLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(v)}stillImageFilmEmbedResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.stillImageFilmEmbed,__typeAlias:ne.stillImageFilmEmbed,__configKey:le(ne.stillImageFilmEmbed),stillImageFilmEmbed:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.stillImageFilmEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(v)}stillImageFilmLinkResource(e,t){const{value:r,srcAlt:i,width:o,height:a,duration:s,mute:n,autoplay:l,allowSubtitles:c,showSubtitles:p,alt:d,posterImage:u,thumbnails:m,license:h,copyright:g,showInIndex:f,caption:b,search:y,selected:k}=t,v={type:ne.stillImageFilmLink,__typeAlias:ne.stillImageFilmLink,__configKey:le(ne.stillImageFilmLink),stillImageFilmLink:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,width:o??null,height:a??null,duration:s??void 0,mute:n??void 0,autoplay:l??void 0,allowSubtitles:c??void 0,showSubtitles:p??void 0,alt:d??"",posterImage:u??void 0,thumbnails:m??void 0,license:h??"",copyright:g??"",showInIndex:f??!1,caption:this.handleJsonText(e,Ue,b),search:y??void 0,selected:k??!1}};return he.removeUnwantedProperties(v.stillImageFilmLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(v)}articleResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.article,__typeAlias:ne.article,__configKey:le(ne.article),article:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,body:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.article,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["body","alt","license","copyright"],ignoreFalse:["selected"]}),Ht.validateResource(p)}documentResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.document,__typeAlias:ne.document,__configKey:le(ne.document),document:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.document,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}documentEmbedResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentEmbed,__typeAlias:ne.documentEmbed,__configKey:le(ne.documentEmbed),documentEmbed:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}documentLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentLink,__typeAlias:ne.documentLink,__configKey:le(ne.documentLink),documentLink:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}documentDownloadResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.documentDownload,__typeAlias:ne.documentDownload,__configKey:le(ne.documentDownload),documentDownload:{format:Wt.fileExtensionFromUrl(r)??void 0,provider:Wt.domainFromUrl(r)??void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.documentDownload,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}appLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.appLink,__typeAlias:ne.appLink,__configKey:le(ne.appLink),appLink:{provider:void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.appLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}websiteLinkResource(e,t){const{value:r,srcAlt:i,license:o,copyright:a,showInIndex:s,caption:n,search:l,selected:c}=t,p={type:ne.websiteLink,__typeAlias:ne.websiteLink,__configKey:le(ne.websiteLink),websiteLink:{provider:void 0,url:r??"",srcAlt:i??void 0,license:o??"",copyright:a??"",showInIndex:s??!1,caption:this.handleJsonText(e,Ue,n),search:l??void 0,selected:c??!1}};return he.removeUnwantedProperties(p.websiteLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex","selected"]}),Ht.validateResource(p)}},Kt=class extends $t{constructor(){super(...arguments),l(this,"resourceBuilder",new Gt)}buildBitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return he.removeUnwantedProperties(i),i}buildBit(e,t){const r=(e=structuredClone(e)).bitType,i=ve.getBitConfig(r),o=(0,Je.Enum)(ut).fromValue(e.textFormat);let a=(0,Je.Enum)(x).fromValue(e.textFormat)??i.textFormatDefault;o===ut.bitmarkMinusMinus&&(a=x.bitmarkText);const s={bitConfig:i,bitType:r,textFormat:a},n=this.buildCardNode(s,e),l=ve.isOfBitType(e.bitType,d.essay)?this.toAstProperty(r,ce.property_reasonableNumOfChars,e.reasonableNumOfChars,t):void 0,c={...this.toExample(e.__isDefaultExample,e.example)},p={bitType:r,bitLevel:e.bitLevel,textFormat:a,resourceType:(0,Je.Enum)(ne).fromValue(e.resourceType),isCommented:e.isCommented,id:this.toAstProperty(r,ce.property_id,e.id,t),internalComment:this.toAstProperty(r,ce.property_internalComment,e.internalComment,t),customerId:this.toAstProperty(r,ce.property_customerId,e.customerId,t),customerExternalId:this.toAstProperty(r,ce.property_customerExternalId,e.customerExternalId,t),externalId:this.toAstProperty(r,ce.property_externalId,e.externalId,t),spaceId:this.toAstProperty(r,ce.property_spaceId,e.spaceId,t),padletId:this.toAstProperty(r,ce.property_padletId,e.padletId,t),jupyterId:this.toAstProperty(r,ce.property_jupyterId,e.jupyterId,t),jupyterExecutionCount:this.toAstProperty(r,ce.property_jupyterExecutionCount,e.jupyterExecutionCount,t),sourceRL:this.toAstProperty(r,ce.property_sourceRL,e.sourceRL,t),isPublic:this.toAstProperty(r,ce.property_isPublic,e.isPublic,t),isTemplate:this.toAstProperty(r,ce.property_isTemplate,e.isTemplate,t),isTemplateStripTheme:this.toAstProperty(r,ce.property_isTemplateStripTheme,e.isTemplateStripTheme,t),isEditable:this.toAstProperty(r,ce.property_isEditable,e.isEditable,t),aiGenerated:this.toAstProperty(r,ce.property_aiGenerated,e.aiGenerated,t),machineTranslated:this.toAstProperty(r,ce.property_machineTranslated,e.machineTranslated,t),translationOf:this.toAstProperty(r,ce.property_translationOf,e.translationOf,t),spansPageBreak:this.toAstProperty(r,ce.property_spansPageBreak,e.spansPageBreak,t),searchIndex:this.toAstProperty(r,ce.property_searchIndex,e.searchIndex,t),analyticsTag:this.toAstProperty(r,ce.property_analyticsTag,e.analyticsTag,t),categoryTag:this.toAstProperty(r,ce.property_categoryTag,e.categoryTag,t),topicTag:this.toAstProperty(r,ce.property_topicTag,e.topicTag,t),reportTag:this.toAstProperty(r,ce.property_reportTag,e.reportTag,t),altLangTag:this.toAstProperty(r,ce.property_altLangTag,e.altLangTag,t),feedbackEngine:this.toAstProperty(r,ce.property_feedbackEngine,e.feedbackEngine,t),feedbackType:this.toAstProperty(r,ce.property_feedbackType,e.feedbackType,t),disableFeedback:this.toAstProperty(r,ce.property_disableFeedback,e.disableFeedback,t),diffTo:this.toAstProperty(r,ce.property_diffTo,e.diffTo,t),diffOp:this.toAstProperty(r,ce.property_diffOp,e.diffOp,t),diffRef:this.toAstProperty(r,ce.property_diffRef,e.diffRef,t),diffContext:this.toAstProperty(r,ce.property_diffContext,e.diffContext,t),diffTime:this.toAstProperty(r,ce.property_diffTime,e.diffTime,t),path:this.toAstProperty(r,ce.property_path,e.path,t),releaseVersion:this.toAstProperty(r,ce.property_releaseVersion,e.releaseVersion,t),releaseKind:this.toAstProperty(r,ce.property_releaseKind,e.releaseKind,t),releaseDate:this.toAstProperty(r,ce.property_releaseDate,e.releaseDate,t),iframeSrc:this.toAstProperty(r,ce.property_iframeSrc,e.iframeSrc,t),iframeName:this.toAstProperty(r,ce.property_iframeName,e.iframeName,t),book:this.buildBooks(s,e.book),ageRange:this.toAstProperty(r,ce.property_ageRange,e.ageRange,t),lang:this.toAstProperty(r,ce.property_lang,e.lang,t),language:this.toAstProperty(r,ce.property_language,e.language,t),publisher:this.toAstProperty(r,ce.property_publisher,e.publisher,t),publisherName:this.toAstProperty(r,ce.property_publisherName,e.publisherName,t),theme:this.toAstProperty(r,ce.property_theme,e.theme,t),computerLanguage:this.toAstProperty(r,ce.property_computerLanguage,e.computerLanguage,t),target:this.toAstProperty(r,ce.property_target,e.target,t),slug:this.toAstProperty(r,ce.property_slug,e.slug,t),tag:this.toAstProperty(r,ce.property_tag,e.tag,t),groupTag:this.buildGroupTags(s,e.groupTag),reductionTag:this.toAstProperty(r,ce.property_reductionTag,e.reductionTag,t),bubbleTag:this.toAstProperty(r,ce.property_bubbleTag,e.bubbleTag,t),extractorTag:this.toAstProperty(r,ce.property_extractorTag,e.extractorTag,t),levelCEFRp:this.toAstProperty(r,ce.property_levelCEFRp,e.levelCEFRp,t),levelCEFR:this.toAstProperty(r,ce.property_levelCEFR,e.levelCEFR,t),levelILR:this.toAstProperty(r,ce.property_levelILR,e.levelILR,t),levelACTFL:this.toAstProperty(r,ce.property_levelACTFL,e.levelACTFL,t),icon:this.toAstProperty(r,ce.property_icon,e.icon,t),iconTag:this.toAstProperty(r,ce.property_iconTag,e.iconTag,t),colorTag:this.toAstProperty(r,ce.property_colorTag,e.colorTag,t),flashcardSet:this.toAstProperty(r,ce.property_flashcardSet,e.flashcardSet,t),subtype:this.toAstProperty(r,ce.property_subtype,e.subtype,t),bookAlias:this.toAstProperty(r,ce.property_bookAlias,e.bookAlias,t),bookDiff:this.toAstProperty(r,ce.property_bookDiff,e.bookDiff,t),coverImage:"string"==typeof e.coverImage||Array.isArray(e.coverImage)?this.toAstProperty(r,ce.property_coverImage,ht.asArray(e.coverImage),t):this.toImageResource(s,e.coverImage),coverColor:this.toAstProperty(r,ce.property_coverColor,e.coverColor,t),publications:this.toAstProperty(r,ce.property_publications,e.publications,t),relatedBook:this.toAstProperty(r,ce.property_relatedBook,e.relatedBook,t),author:this.toAstProperty(r,ce.property_author,e.author,t),subject:this.toAstProperty(r,ce.property_subject,e.subject,t),date:this.toAstProperty(r,ce.property_date,e.date,t),dateEnd:this.toAstProperty(r,ce.property_dateEnd,e.dateEnd,t),location:this.toAstProperty(r,ce.property_location,e.location,t),kind:this.toAstProperty(r,ce.property_kind,e.kind,t),hasMarkAsDone:this.toAstProperty(r,ce.property_hasMarkAsDone,e.hasMarkAsDone,t),processHandIn:this.toAstProperty(r,ce.property_processHandIn,e.processHandIn,t),processHandInLocation:this.toAstProperty(r,ce.property_processHandInLocation,e.processHandInLocation,t),chatWithBook:this.toAstProperty(r,ce.property_chatWithBook,e.chatWithBook,t),chatWithBookBrainKey:this.toAstProperty(r,ce.property_chatWithBookBrainKey,e.chatWithBookBrainKey,t),currency:this.toAstProperty(r,ce.property_currency,e.currency,t),bookIsbn:this.toAstProperty(r,ce.property_bookIsbn,e.bookIsbn,t),bookAuthor:this.toAstProperty(r,ce.property_bookAuthor,e.bookAuthor,t),bookType:this.toAstProperty(r,ce.property_bookType,e.bookType,t),bookBindingType:this.toAstProperty(r,ce.property_bookBindingType,e.bookBindingType,t),bookNumberOfPages:this.toAstProperty(r,ce.property_bookNumberOfPages,e.bookNumberOfPages,t),bookRating:this.toAstProperty(r,ce.property_bookRating,e.bookRating,t),bookSeriesTitle:this.toAstProperty(r,ce.property_bookSeriesTitle,e.bookSeriesTitle,t),bookSeriesId:this.toAstProperty(r,ce.property_bookSeriesId,e.bookSeriesId,t),bookSeriesNumber:this.toAstProperty(r,ce.property_bookSeriesNumber,e.bookSeriesNumber,t),bookLanguage:this.toAstProperty(r,ce.property_bookLanguage,e.bookLanguage,t),bookPublishingDate:this.toAstProperty(r,ce.property_bookPublishingDate,e.bookPublishingDate,t),bookPublisher:this.toAstProperty(r,ce.property_bookPublisher,e.bookPublisher,t),bookTranslator:this.toAstProperty(r,ce.property_bookTranslator,e.bookTranslator,t),bookOriginalTitle:this.toAstProperty(r,ce.property_bookOriginalTitle,e.bookOriginalTitle,t),gmbExternalShop:this.toAstProperty(r,ce.property_gmbExternalShop,e.gmbExternalShop,t),gmbExternalShopItems:this.toAstProperty(r,ce.property_gmbExternalShopItems,e.gmbExternalShopItems,t),action:this.toAstProperty(r,ce.property_action,e.action,t),showInIndex:this.toAstProperty(r,ce.property_showInIndex,e.showInIndex,t),refAuthor:this.toAstProperty(r,ce.property_refAuthor,e.refAuthor,t),refBookTitle:this.toAstProperty(r,ce.property_refBookTitle,e.refBookTitle,t),refPublisher:this.toAstProperty(r,ce.property_refPublisher,e.refPublisher,t),refPublicationYear:this.toAstProperty(r,ce.property_refPublicationYear,e.refPublicationYear,t),citationStyle:this.toAstProperty(r,ce.property_citationStyle,e.citationStyle,t),blockId:this.toAstProperty(r,ce.property_blockId,e.blockId,t),pageNo:this.toAstProperty(r,ce.property_pageNo,e.pageNo,t),x:this.toAstProperty(r,ce.property_x,e.x,t),y:this.toAstProperty(r,ce.property_y,e.y,t),width:this.toAstProperty(r,ce.property_width,e.width,t),height:this.toAstProperty(r,ce.property_height,e.height,t),index:this.toAstProperty(r,ce.property_index,e.index,t),classification:this.toAstProperty(r,ce.property_classification,e.classification,t),availableClassifications:this.toAstProperty(r,ce.property_availableClassifications,e.availableClassifications,t),allowedBit:this.toAstProperty(r,ce.property_allowedBit,e.allowedBit,t),authorFullName:this.toAstProperty(r,ce.property_authorFullName,e.authorFullName,t),authorPseudonym:this.toAstProperty(r,ce.property_authorPseudonym,e.authorPseudonym,t),authorTitle:this.toAstProperty(r,ce.property_authorTitle,e.authorTitle,t),authorJobTitle:this.toAstProperty(r,ce.property_authorJobTitle,e.authorJobTitle,t),tableFixedHeader:this.toAstProperty(r,ce.property_tableFixedHeader,e.tableFixedHeader,t),tableHeaderWhitespaceNoWrap:this.toAstProperty(r,ce.property_tableHeaderWhitespaceNoWrap,e.tableHeaderWhitespaceNoWrap,t),tableSearch:this.toAstProperty(r,ce.property_tableSearch,e.tableSearch,t),tableSort:this.toAstProperty(r,ce.property_tableSort,e.tableSort,t),tablePagination:this.toAstProperty(r,ce.property_tablePagination,e.tablePagination,t),tablePaginationLimit:this.toAstProperty(r,ce.property_tablePaginationLimit,e.tablePaginationLimit,t),tableHeight:this.toAstProperty(r,ce.property_tableHeight,e.tableHeight,t),tableWhitespaceNoWrap:this.toAstProperty(r,ce.property_tableWhitespaceNoWrap,e.tableWhitespaceNoWrap,t),tableAutoWidth:this.toAstProperty(r,ce.property_tableAutoWidth,e.tableAutoWidth,t),tableResizableColumns:this.toAstProperty(r,ce.property_tableResizableColumns,e.tableResizableColumns,t),tableColumnMinWidth:this.toAstProperty(r,ce.property_tableColumnMinWidth,e.tableColumnMinWidth,t),quizCountItems:this.toAstProperty(r,ce.property_quizCountItems,e.quizCountItems,t),quizStrikethroughSolutions:this.toAstProperty(r,ce.property_quizStrikethroughSolutions,e.quizStrikethroughSolutions,t),codeLineNumbers:this.toAstProperty(r,ce.property_codeLineNumbers,e.codeLineNumbers,t),codeMinimap:this.toAstProperty(r,ce.property_codeMinimap,e.codeMinimap,t),stripePricingTableId:this.toAstProperty(r,ce.property_stripePricingTableId,e.stripePricingTableId,t),stripePublishableKey:this.toAstProperty(r,ce.property_stripePublishableKey,e.stripePublishableKey,t),thumbImage:this.toAstProperty(r,ce.property_thumbImage,e.thumbImage,t),scormSource:this.toAstProperty(r,ce.property_scormSource,e.scormSource,t),posterImage:this.toAstProperty(r,ce.property_posterImage,e.posterImage,t),focusX:this.toAstProperty(r,ce.property_focusX,e.focusX,t),focusY:this.toAstProperty(r,ce.property_focusY,e.focusY,t),pointerLeft:this.toAstProperty(r,ce.property_pointerLeft,e.pointerLeft,t),pointerTop:this.toAstProperty(r,ce.property_pointerTop,e.pointerTop,t),listItemIndent:this.toAstProperty(r,ce.property_listItemIndent,e.listItemIndent,t),backgroundWallpaper:this.toImageResource(s,e.backgroundWallpaper),hasBookNavigation:this.toAstProperty(r,ce.property_hasBookNavigation,e.hasBookNavigation,t),duration:this.toAstProperty(r,ce.property_duration,e.duration,t),deeplink:this.toAstProperty(r,ce.property_deeplink,e.deeplink,t),externalLink:this.toAstProperty(r,ce.property_externalLink,e.externalLink,t),externalLinkText:this.toAstProperty(r,ce.property_externalLinkText,e.externalLinkText,t),videoCallLink:this.toAstProperty(r,ce.property_videoCallLink,e.videoCallLink,t),vendorDashboardId:this.toAstProperty(r,ce.property_vendorDashboardId,e.vendorDashboardId,t),vendorSurveyId:this.toAstProperty(r,ce.property_vendorSurveyId,e.vendorSurveyId,t),vendorUrl:this.toAstProperty(r,ce.property_vendorUrl,e.vendorUrl,t),search:this.toAstProperty(r,ce.property_search,e.search,t),list:this.toAstProperty(r,ce.property_list,e.list,t),layer:this.toAstProperty(r,ce.property_layer,e.layer,t),layerRole:this.toAstProperty(r,ce.property_layerRole,e.layerRole,t),textReference:this.toAstProperty(r,ce.property_textReference,e.textReference,t),isTracked:this.toAstProperty(r,ce.property_isTracked,e.isTracked,t),isInfoOnly:this.toAstProperty(r,ce.property_isInfoOnly,e.isInfoOnly,t),imageFirst:this.toAstProperty(r,ce.property_imageFirst,e.imageFirst,t),activityType:this.toAstProperty(r,ce.property_activityType,e.activityType,t),labelTrue:this.toAstProperty(r,ce.property_labelTrue,e.labelTrue,t),labelFalse:this.toAstProperty(r,ce.property_labelFalse,e.labelFalse,t),content2Buy:this.toAstProperty(r,ce.property_content2Buy,e.content2Buy,t),listPrice:this.toAstProperty(r,ce.property_listPrice,e.listPrice,t),customerProductId:this.toAstProperty(r,ce.property_customerProductId,e.customerProductId,t),customerProductShopLink:this.toAstProperty(r,ce.property_customerProductShopLink,e.customerProductShopLink,t),mailingList:this.toAstProperty(r,ce.property_mailingList,e.mailingList,t),buttonCaption:this.toAstProperty(r,ce.property_buttonCaption,e.buttonCaption,t),callToActionUrl:this.toAstProperty(r,ce.property_callToActionUrl,e.callToActionUrl,t),advertisingClickUrl:this.toAstProperty(r,ce.property_advertisingClickUrl,e.advertisingClickUrl,t),brandColor:this.toAstProperty(r,ce.property_brandColor,e.brandColor,t),brandColorName:this.toAstProperty(r,ce.property_brandColorName,e.brandColorName,t),caption:this.handleJsonText(s,Ue,e.caption),quotedPerson:this.toAstProperty(r,ce.property_quotedPerson,e.quotedPerson,t),reasonableNumOfChars:l,resolved:this.toAstProperty(r,ce.property_resolved,e.resolved,t),resolvedDate:this.toAstProperty(r,ce.property_resolvedDate,e.resolvedDate,t),resolvedBy:this.toAstProperty(r,ce.property_resolvedBy,e.resolvedBy,t),handInAcceptFileType:this.toAstProperty(r,ce.property_handInAcceptFileType,e.handInAcceptFileType,t),handInRequirement:this.toAstProperty(r,ce.property_handInRequirement,e.handInRequirement,t),handInInstruction:this.toAstProperty(r,ce.property_handInInstruction,e.handInInstruction,t),maxCreatedBits:this.toAstProperty(r,ce.property_maxCreatedBits,e.maxCreatedBits,t),maxDisplayLevel:this.toAstProperty(r,ce.property_maxDisplayLevel,e.maxDisplayLevel,t),maxTocChapterLevel:this.toAstProperty(r,ce.property_maxTocChapterLevel,e.maxTocChapterLevel,t),sourceDocument:this.toAstProperty(r,ce.property_sourceDocument,e.sourceDocument,t),internalPrintPdf:this.toAstProperty(r,ce.property_internalPrintPdf,e.internalPrintPdf,t),hasPrintRestriction:this.toAstProperty(r,ce.property_hasPrintRestriction,e.hasPrintRestriction,t),enforceUpdateOverUserInput:this.toAstProperty(r,ce.property_enforceUpdateOverUserInput,e.enforceUpdateOverUserInput,t),tocResource:this.toAstProperty(r,ce.property_tocResource,e.tocResource,t),tocContent:this.toAstProperty(r,ce.property_tocContent,e.tocContent,t),page:this.toAstProperty(r,ce.property_page,e.page,t),platformBrandTarget:this.toAstProperty(r,ce.property_platformBrandTarget,e.platformBrandTarget,t),platformName:this.toAstProperty(r,ce.property_platformName,e.platformName,t),platformIcon:this.toImageResource(s,e.platformIcon),platformLogo:this.toImageResource(s,e.platformLogo),platformPrimaryColor:this.toAstProperty(r,ce.property_platformPrimaryColor,e.platformPrimaryColor,t),platformSecondaryColor:this.toAstProperty(r,ce.property_platformSecondaryColor,e.platformSecondaryColor,t),platformBackgroundColor:this.toAstProperty(r,ce.property_platformBackgroundColor,e.platformBackgroundColor,t),platformScrollbarColor:this.toAstProperty(r,ce.property_platformScrollbarColor,e.platformScrollbarColor,t),platformSelectionColor:this.toAstProperty(r,ce.property_platformSelectionColor,e.platformSelectionColor,t),platformSeparatorColor:this.toAstProperty(r,ce.property_platformSeparatorColor,e.platformSeparatorColor,t),platformPlaceholderColor:this.toAstProperty(r,ce.property_platformPlaceholderColor,e.platformPlaceholderColor,t),platformTextSelectionColor:this.toAstProperty(r,ce.property_platformTextSelectionColor,e.platformTextSelectionColor,t),platformButtonPrimaryColor:this.toAstProperty(r,ce.property_platformButtonPrimaryColor,e.platformButtonPrimaryColor,t),platformButtonBackgroundColor:this.toAstProperty(r,ce.property_platformButtonBackgroundColor,e.platformButtonBackgroundColor,t),platformMessageBackgroundColor:this.toAstProperty(r,ce.property_platformMessageBackgroundColor,e.platformMessageBackgroundColor,t),platformBackgroundImage:this.toImageResource(s,e.platformBackgroundImage),platformBorderColor:this.toAstProperty(r,ce.property_platformBorderColor,e.platformBorderColor,t),platformSelectionTextColor:this.toAstProperty(r,ce.property_platformSelectionTextColor,e.platformSelectionTextColor,t),platformBaseLayerColor:this.toAstProperty(r,ce.property_platformBaseLayerColor,e.platformBaseLayerColor,t),platformMargin:this.toAstProperty(r,ce.property_platformMargin,e.platformMargin,t),platformBorderRadius:this.toAstProperty(r,ce.property_platformBorderRadius,e.platformBorderRadius,t),platformSelectionBorderRadius:this.toAstProperty(r,ce.property_platformSelectionBorderRadius,e.platformSelectionBorderRadius,t),platformNeedsShadow:this.toAstProperty(r,ce.property_platformNeedsShadow,e.platformNeedsShadow,t),productId:this.toAstProperty(r,ce.property_productId,e.productId,t),product:this.toAstProperty(r,ce.property_product,e.product,t),productVideo:this.toAstProperty(r,ce.property_productVideo,e.productVideo,t),productFolder:this.toAstProperty(r,ce.property_productFolder,e.productFolder,t),technicalTerm:this.buildTechnicalTerm(s,e.technicalTerm),servings:this.buildServings(s,e.servings),ratingLevelStart:this.buildRatingLevelStartEnd(s,e.ratingLevelStart),ratingLevelEnd:this.buildRatingLevelStartEnd(s,e.ratingLevelEnd),ratingLevelSelected:this.toAstProperty(r,ce.property_ratingLevelSelected,e.ratingLevelSelected,t),formula:this.toAstProperty(r,ce.property_formula,e.formula,t),markConfig:this.buildMarkConfigs(s,e.markConfig),imageSource:this.buildImageSource(s,e.imageSource),person:this.buildPerson(s,e.person),bot:this.toAstProperty(r,ce.property_bot,e.bot,t),referenceProperty:this.toAstProperty(r,ce.property_reference,e.referenceProperty,t),fullName:this.toAstProperty(r,ce.property_fullName,e.fullName,t),pseudonym:this.toAstProperty(r,ce.property_pseudonym,e.pseudonym,t),titleString:this.toAstProperty(r,ce.property_title,e.titleString,t),jobTitle:this.toAstProperty(r,ce.property_jobTitle,e.jobTitle,t),title:this.handleJsonText(s,Ue,e.title),subtitle:this.handleJsonText(s,Ue,e.subtitle),level:zt.asNumber(e.level),toc:this.toAstProperty(r,ce.property_toc,e.toc,t),progress:this.toAstProperty(r,ce.property_progress,e.progress,t),anchor:e.anchor,reference:e.reference,referenceEnd:e.referenceEnd,revealSolutions:this.toAstProperty(r,ce.property_revealSolutions,e.revealSolutions,t),item:this.handleJsonText(s,Ue,e.item),lead:this.handleJsonText(s,Ue,e.lead),pageNumber:this.handleJsonText(s,Ue,e.pageNumber),marginNumber:this.handleJsonText(s,Ue,e.marginNumber),hint:this.handleJsonText(s,Ue,e.hint),instruction:this.handleJsonText(s,Ue,e.instruction),partialAnswer:this.toAstProperty(r,ce.property_partialAnswer,e.partialAnswer,t),sampleSolution:this.toAstProperty(r,ce.property_sampleSolution,e.sampleSolution,t),additionalSolutions:this.toAstProperty(r,ce.property_additionalSolutions,e.additionalSolutions,t),...this.toExample(e.__isDefaultExample,e.example),previewImage:this.toImageResources(s,e.previewImage),previewVideo:this.toVideoResources(s,e.previewVideo),imagePlaceholder:this.toImageResource(s,e.imagePlaceholder),resources:ht.asArray(this.resourceBuilder.resourceFromResourceJson(s,e.resources)),body:this.buildBody(s,e.body),cardNode:n,footer:this.buildFooter(s,e.footer),extraProperties:this.parseExtraProperties(e.extraProperties),markup:e.markup,parser:e.parser,__isDefaultExample:e.__isDefaultExample??!1};return ve.isOfBitType(p.bitType,d.interview)&&this.pushDownTree(s,void 0,void 0,n,"questions","reasonableNumOfChars",e.reasonableNumOfChars),ve.isOfBitType(p.bitType,d.feedback)&&this.pushDownTree(s,void 0,void 0,n,["feedbacks","reason"],"reasonableNumOfChars",e.reasonableNumOfChars),this.pushDownTree(s,[p.body,...n?.cardBits?.map(e=>e.body)||[]],[De.gap],void 0,void 0,"isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(s,void 0,void 0,n,"pairs","isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(s,void 0,void 0,n,["matrix","cells"],"isCaseSensitive",e.isCaseSensitive??!0),this.pushExampleDownTree(s,p.body,n,p.__isDefaultExample,c.example),this.setDefaultBitValues(p),this.setIsExampleFlags(p),this.addVersionToParserInfo(p),he.removeUnwantedProperties(p,{ignoreAllFalse:!0,ignoreUndefined:["example"],ignoreEmptyArrays:["item","lead","pageNumber","marginNumber","hint","instruction"]}),Ht.validateBit(p)}buildBooks(e,t){if(se.isString(t))return t;if(!Array.isArray(t))return;const r=t.map(t=>this.buildBook(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildBook(e,t){if(!t)return;const r={book:t.book??"",reference:t.reference??"",referenceEnd:t.referenceEnd??void 0};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["book","reference"]}),r}buildGroupTags(e,t){if(!t)return;Array.isArray(t)||(t=[t]);let r=t.map(t=>this.buildGroupTag(e,t)).filter(e=>null!=e);const i={};for(const e of r)e&&(i[e.name]?i[e.name].tags=ht.removeDuplicates([...i[e.name].tags,...e.tags]):i[e.name]=e);return r=Object.values(i),r.length>0?r:void 0}buildGroupTag(e,t){if(!t)return;const r=Array.isArray(t.tags)?t.tags:[];return{name:t.name??"",tags:r.map(e=>e?.trim()??"")??[]}}buildFeedbackChoices(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFeedbackChoice(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFeedbackChoice(e,t){if(!t)return;const r={choice:t.choice??"",requireReason:!!t.requireReason,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildFeedbackReason(e,t){if(!t)return;const r=this.handleJsonText(e,Ue,"true"),i={text:t.text??"",reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,r),__textAst:t.__textAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example","reasonableNumOfChars"]}),i}buildChoices(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildChoice(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildChoice(e,t){if(!t)return;const r={choice:t.choice??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildResponses(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildResponse(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildResponse(e,t){if(!t)return;const r={response:t.response??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),r}buildBotResponses(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.botResponse(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}botResponse(e,t){if(!t)return;const r={response:t.response??"",reaction:t.reaction??"",feedback:t.feedback??"",item:t.item??"",lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint)};return he.removeUnwantedProperties(r,{ignoreEmptyString:["response","reaction","feedback","item"],ignoreAllFalse:!0,ignoreEmptyArrays:[],ignoreUndefined:["example"]}),r}buildFeedbacks(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFeedback(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFeedback(e,t){if(!t)return;let r,i;if(!t.choices)return;r=this.buildFeedbackChoices(e,t.choices),t.reason&&(i=this.buildFeedbackReason(e,t.reason));const o={item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),choices:r,reason:i};return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),o}buildQuizzes(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildQuiz(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildQuiz(e,t){if(!t)return;const r={...this.toExample(t.__isDefaultExample,t.__defaultExample)};let i,o;if(t.choices)i=this.buildChoices(e,t.choices),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,r.example,!0,i);else{if(!t.responses)return;o=this.buildResponses(e,t.responses),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,r.example,!1,o)}const a={item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),isExample:!!t.__defaultExample,choices:i,responses:o};return he.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),a}buildHeading(e,t){if(!t)return;if(null==t.forKeys)return;const r={forKeys:t.forKeys??"",forValues:t.forValues??t.__forValuesDefault??""};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["forKeys","forValues"],ignoreEmptyArrays:["forValues"]}),r}buildPairs(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildPair(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildPair(e,t){if(!t)return;const r=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,i=this.resourceBuilder.resourceFromResourceJson(e,t.keyAudio),o=this.resourceBuilder.resourceFromResourceJson(e,t.keyImage),a={key:t.key??"",keyAudio:i,keyImage:o,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),values:t.values||[],__valuesAst:t.__valuesAst};return he.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction","values"],ignoreUndefined:["example","isCaseSensitive"]}),a}buildMatricies(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildMatrix(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildMatrix(e,t){if(!t)return;let r=!1;for(const e of t.cells||[])t.__isDefaultExample&&!e.isExample&&(e.isExample=!0),r=!!e.isExample||r;const i={key:t.key??"",item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),isExample:r,cells:(t.cells||[]).map(t=>this.buildMatrixCell(e,t)).filter(e=>null!=e)};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["hint","item","cells"],ignoreUndefined:["isCaseSensitive"]}),i}buildMatrixCell(e,t){if(!t)return;const r=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,i={values:t.values||[],item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),__valuesAst:t.__valuesAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["instruction","item","values"],ignoreUndefined:["example","isCaseSensitive"]}),i}buildPronunciationTable(e,t){if(!t)return;return{data:(t.data||[]).map(t=>(t||[]).map(t=>{const r=this.resourceBuilder.resourceFromResourceJson(e,t.audio);return{title:this.handleJsonText(e,Ue,t.title),body:this.handleJsonText(e,Ue,t.body),audio:r}}))}}buildTable(e,t){if(!t)return;const r=mt(e.bitType,t),i=r,o=r;Array.isArray(i.columns)&&i.columns.length>0&&(i.columns=i.columns.map(t=>this.handleJsonText(e,Ue,t))),Array.isArray(i.data)&&i.data.length>0&&(i.data=i.data.map(t=>(t||[]).map(t=>this.handleJsonText(e,Ue,t))));const a=t=>{if(!t||!Array.isArray(t.rows))return;return{rows:t.rows.map(t=>({cells:(t.cells||[]).map(t=>{const r={content:this.handleJsonText(e,Ue,t.content)};return null!=t.title&&(r.title=t.title),null!=t.rowspan&&(r.rowspan=t.rowspan),null!=t.colspan&&(r.colspan=t.colspan),t.scope&&(r.scope=t.scope),r})}))}},s=a(o.header);s&&s.rows?.length>0&&(o.header=s);const n=a(o.body);n&&n.rows?.length>0&&(o.body=n);const l=a(o.footer);return l&&l.rows?.length>0&&(o.footer=l),r}buildQuestions(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildQuestion(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildQuestion(e,t){if(!t)return;const r=t.__sampleSolutionAst,i={question:this.handleJsonText(e,je,t.question),partialAnswer:t.partialAnswer??"",sampleSolution:t.sampleSolution??"",additionalSolutions:t.additionalSolutions??void 0,reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,r),__sampleSolutionAst:t.__sampleSolutionAst};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","item","hint","instruction"],ignoreUndefined:["example"],ignoreEmptyString:["partialAnswer","sampleSolution"]}),i}buildIngredients(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildIngredient(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildIngredient(e,t){if(!t)return;const r={title:this.handleJsonText(e,Ue,t.title),checked:t.checked??!1,ingredient:this.handleJsonText(e,Ue,t.ingredient),quantity:t.quantity??0,unit:t.unit??"",unitAbbr:t.unitAbbr??"",decimalPlaces:t.decimalPlaces??1,disableCalculation:t.disableCalculation??!1,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyString:["item","unit"]}),r}buildBody(e,t){if(!t)return;let r;const i=[],o=t.placeholders,a=t.bodyString,{textFormat:s}=e,n=()=>{let a,n=t.body;const l={};if(se.isString(t.body)?(a=(t.body??"").trim(),n=[]):Array.isArray(t.body)||(n=[]),o)for(const[e,t]of Object.entries(o))l[e]=t;if(a){a=dt.breakscape(a,{format:s,location:je,v2:!0});let e=0;const t=[];for(const[r,i]of Object.entries(l))if(a){const o=`[!${e}]`;a=a.replace(`${r}`,o),t.push(i),e++}n=this.textParser.toAst(a,{format:s,location:je});const r=e=>{for(let i=0,o=e.length;i<o;i++){const o=e[i];if("bit"===o.type){const r=o.index;null!=t[r]&&(e[i]=t[r])}else o.content&&r(o.content)}};r(n)}n=structuredClone(n),this.textParser.walkBodyBits(n,(t,r,o)=>{let a;switch(o.type){case De.gap:a=this.buildGap(e,o);break;case De.mark:a=this.buildMark(e,o);break;case De.select:a=this.buildSelect(e,o);break;case De.highlight:a=this.buildHighlight(e,o)}null!=a&&(t[r]=a,i.push(a))}),r=n,r.__tag="text"},l=s===x.bitmarkText;s===x.json?(()=>{if("string"==typeof t.body)try{r=JSON.parse(t.body)}catch(e){r=null}else r=t.body})():l?n():r=t.body;return{body:r,bodyBits:i,bodyString:a}}buildFooter(e,t){if(!t)return;return{footer:this.handleJsonText(e,je,t.footer)}}buildGap(e,t){if(!t)return;const r=Array.isArray(t.__solutionsAst)&&t.__solutionsAst.length>0?t.__solutionsAst[0]:null;t=this.bodyBitCopyFromAttrs(t);const i={type:De.gap,solutions:t.solutions||[],item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,r),__solutionsAst:t.__solutionsAst,attrs:{}};return he.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example","isCaseSensitive"]}),i}buildMarkConfigs(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildMarkConfig(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildMarkConfig(e,t){if(!t)return;const r={mark:t.mark??"unknown",color:t.color??"",emphasis:t.emphasis??""};return he.removeUnwantedProperties(r,{ignoreAllEmptyString:!0}),r}buildMark(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.mark,solution:t.solution??"",mark:t.mark??"",item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0),attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"],ignoreEmptyString:["solution","mark"]}),r}buildSelect(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.select,options:this.buildSelectOptions(e,t.options)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(!1,void 0,void 0),__hintString:t.__hintString,__instructionString:t.__instructionString,attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),r}buildSelectOptions(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildSelectOption(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildSelectOption(e,t){if(!t)return;const r={text:t.text??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),r}buildHighlight(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const r={type:De.highlight,texts:this.buildHighlightTexts(e,t.texts)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(!1,void 0,void 0),attrs:{}};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),r}buildHighlightTexts(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildHighlightText(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildHighlightText(e,t){if(!t)return;const r={text:t.text??"",isCorrect:!!t.isCorrect,isHighlighted:!!t.isHighlighted,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),r}buildFlashcards(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildFlashcard(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildFlashcard(e,t){if(!t)return;const r={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,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeAnswers","item","hint","instruction"],ignoreUndefined:["example"]}),r}buildDefinitionList(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildDefinitionListItem(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildDefinitionListItem(e,t){if(!t)return;const{bitType:r}=e,i=ve.isOfBitType(r,[d.metaSearchDefaultTerms]),o={term:this.buildTextAndIcon(e,t.term,i),definition:this.buildTextAndIcon(e,t.definition,i),alternativeDefinitions:(t.alternativeDefinitions||[]).map(t=>this.buildTextAndIcon(e,t,i)).filter(e=>null!=e),item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeDefinitions","item","hint","instruction"],ignoreUndefined:["example"]}),o}buildTextAndIcon(e,t,r=!1){const i=this.resourceBuilder.resourceFromResourceJson(e,t?.icon);let o=this.handleJsonText(e,Ue,t?.text||t);r&&(o=this.textGenerator.generateSync(o,x.plainText,je,{noBreakscaping:!0}).trim());const a={text:o,icon:i};return he.removeUnwantedProperties(a,{ignoreEmptyArrays:["text"],ignoreUndefined:["icon"]}),a}buildStatements(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildStatement(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildStatement(e,t){if(!t)return;const r={statement:this.handleJsonText(e,Ue,t.statement),isCorrect:!!t.isCorrect,item:this.handleJsonText(e,Ue,t.item),lead:this.handleJsonText(e,Ue,t.lead),hint:this.handleJsonText(e,Ue,t.hint),instruction:this.handleJsonText(e,Ue,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return he.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["statement"],ignoreUndefined:["example"]}),r}buildImageSource(e,t){if(!t)return;const{url:r,mockupId:i,size:o,format:a,trim:s}=t,n={url:r??"",mockupId:i??"",size:o??null,format:a??null,trim:qt.isBoolean(s)?s:null};return he.removeUnwantedProperties(n,{ignoreFalse:["trim"],ignoreEmptyString:["url","mockupId"],ignoreAllUndefined:!0}),n}buildPerson(e,t){if(!t)return;const{name:r,title:i,avatarImage:o}=t,a={name:r??"",title:i??void 0,avatarImage:this.resourceBuilder.resourceFromResourceJson(e,o)};return he.removeUnwantedProperties(a,{ignoreEmptyString:["name"],ignoreAllUndefined:!0}),a}buildTechnicalTerm(e,t){if(!t)return;const{technicalTerm:r,lang:i}=t,o={technicalTerm:r??"",lang:i??""};return he.removeUnwantedProperties(o,{ignoreEmptyString:["technicalTerm"]}),o}buildServings(e,t){if(!t)return;const{servings:r,unit:i,unitAbbr:o,decimalPlaces:a,disableCalculation:s,hint:n}=t,l={servings:r??0,unit:i??"",unitAbbr:o??"",decimalPlaces:a??1,disableCalculation:s??!1,hint:n??""};return he.removeUnwantedProperties(l,{ignoreEmptyString:["servings","unit"]}),l}buildRatingLevelStartEnd(e,t){if(!t)return;const{level:r,label:i}=t,o={level:r??0,label:this.handleJsonText(e,Ue,i)};return he.removeUnwantedProperties(o,{}),o}buildCardBits(e,t){if(!Array.isArray(t))return;const r=t.map(t=>this.buildCardBit(e,t)).filter(e=>null!=e);return r.length>0?r:void 0}buildCardBit(e,t){if(!t)return;const{bitType:r,textFormat:i}=e,o=this.buildBit({...t,bitType:r,textFormat:i},{cardSet:{sideNo:0,variantNo:0}});return he.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),Ht.validateCardBit(o)}toImageResource(e,t){return ht.asSingle(this.resourceBuilder.resourceFromResourceDataJson(e,ne.image,t?.image))}toImageResources(e,t){const r=ht.asArray(t),i=[];if(r&&r.length>0)for(const t of r){const r=this.resourceBuilder.resourceFromResourceDataJson(e,ne.image,t.image);i.push(r)}return i}toVideoResources(e,t){const r=ht.asArray(t),i=[];if(r&&r.length>0)for(const t of r){const r=this.resourceBuilder.resourceFromResourceDataJson(e,ne.video,t.video);i.push(r)}return i}buildCardNode(e,t){const r={heading:this.buildHeading(e,t.heading),questions:this.buildQuestions(e,t.questions),elements:this.handleJsonText(e,je,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 he.removeUnwantedProperties(r,{ignoreEmptyObjects:["table"]}),Object.keys(r).length>0?r:void 0}bodyBitCopyFromAttrs(e){const t={...e};if(e.attrs)for(const[r,i]of Object.entries(e.attrs))t[r]=i;return t}pushExampleDownTree(e,t,r,i,o){if(i||null!=o){if(r){if(this.pushExampleDownTreeString(e,i,o,r.pairs),this.pushExampleDownTreeBoolean(e,i,o,!1,r.flashcards),this.pushExampleDownTreeBoolean(e,i,o,!1,r.definitions),this.pushExampleDownTreeBoolean(e,i,o,!0,r.choices),this.pushExampleDownTreeBoolean(e,i,o,!1,r.responses,r.statements,r.statement),r.quizzes)for(const t of r.quizzes)this.pushExampleDownTreeBoolean(e,i,o,!0,t.choices),this.pushExampleDownTreeBoolean(e,i,o,!1,t.responses);if(r.matrix)for(const t of r.matrix)this.pushExampleDownTreeString(e,i,o,t.cells)}t&&this.pushExampleDownTreeBodyBits(e,i,o,t)}}pushExampleDownTreeBoolean(e,t,r,i,...o){if((t||null!=r)&&Array.isArray(o))for(const e of o)if(e){const o=Array.isArray(e)?e:[e];Ut.fillBooleanExample(o,t,r,i)}}pushExampleDownTreeString(e,t,r,...i){if((t||r)&&Array.isArray(i))for(const o of i)if(o){const i=Array.isArray(o)?o:[o];Ut.fillStringExample(e.textFormat,i,t,r,!1)}}pushExampleDownTreeBodyBits(e,t,r,i){if(!t&&!r)return;const o=this.textParser.extractBodyBits(i?.body);for(const i of o)if(i)switch(i.type){case De.gap:{const o=i;Ut.fillStringExample(e.textFormat,[o],t,r,!1);break}case De.mark:{const e=i;Ut.fillBooleanExample([e],t,r,!1);break}case De.select:{const e=i;Ut.fillBooleanExample(e.options,t,r,!0);break}case De.highlight:{const e=i;Ut.fillBooleanExample(e.texts,t,r,!0);break}}}pushDownTree(e,t,r,i,o,a,s){if(void 0!==s){if(i&&o){Array.isArray(o)||(o=[o]);const e=he.flatMapPath(i,o);for(const t of e)null==t[a]&&(t[a]=s)}if(t){const e=Array.isArray(t)?t:[t];for(const t of e)if(t&&t.body&&r){const e=this.textParser.extractBodyBits(t.body);if(r&&e&&e.length>0)for(const t of e)if(t&&-1!==r.indexOf(t.type)){const e=t;null==e[a]&&(e[a]=s)}}}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=ht.asArray(i)||[i];return r}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:r,cardNode:i}=e,o=this.textParser.extractBodyBits(r?.body);for(const e of o)switch(e.type){case De.gap:case De.mark:t(e);break;case De.select:{const r=e;let i=!1;for(const e of r.options)i=!!t(e)||i;r.isExample=i;break}case De.highlight:{const r=e;let i=!1;for(const e of r.texts)i=!!t(e)||i;r.isExample=i;break}}if(i){for(const e of i.flashcards||[])t(e);for(const e of i.definitions||[])t(e);for(const e of i.pairs||[])t(e);for(const e of i.matrix||[]){let r=!1;for(const i of e.cells||[])r=!!t(i)||r;e.isExample=r}for(const e of i.quizzes||[]){let r=!1;for(const i of e.responses||[])r=!!t(i)||r;for(const i of e.choices||[])r=!!t(i)||r;e.isExample=r}for(const e of i.responses||[])t(e);for(const e of i.choices||[])t(e);for(const e of i.statements||[])t(e);t(i.statement);for(const e of i.questions||[])t(e)}t(e.statement);for(const r of e.responses||[])t(r);for(const r of e.choices||[])t(r);t(e)}setDefaultBitValues(e){const{bitType:t}=e;switch(t){case d.articleAi:case d.noteAi:case d.summaryAi:e.aiGenerated=this.toAstProperty(t,ce.property_aiGenerated,!0,void 0)}}addVersionToParserInfo(e){const t=e.parser??{};t.version=Ee.appVersion.full,e.parser=t}},Yt=class{constructor(){l(this,"_buffer"),l(this,"_string",""),l(this,"endOfLineString","\n"),l(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){if(!this._buffer)return this;let t;return t=null!=e?e+this.endOfLineString:this.endOfLineString,this._buffer.push(t),this.lastWrite=t,this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;let r="";for(let i=0,o=e.length;i<o;i++){const a=e[i];this._buffer.push(a),r+=a,t&&i<o-1&&(this._buffer.push(t),r+=t),this._buffer.push(this.endOfLineString),r+=this.endOfLineString}return this.lastWrite=r,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}},Qt=r(722),Xt=r(722),Zt=(r(722),{v1:1,v2:2}),er={debugGenerationInline:!1},tr=class extends yt{constructor(e,t){super(),l(this,"ast",new $e),l(this,"textGenerator"),l(this,"bitmarkVersion"),l(this,"options"),l(this,"mainWriter"),l(this,"partWriter"),l(this,"writer"),l(this,"prettifySpace"),l(this,"spacesAroundValues"),l(this,"spacesAroundValuesStr"),l(this,"bitType",d._error),l(this,"textFormat",x.bitmarkText),l(this,"isBodyBitmarkText",!1),l(this,"isCardAllowed",!1),l(this,"firstBit",!0),l(this,"hasCardSet",!1),l(this,"hasFooter",!1),l(this,"inTag",!0),l(this,"skipTableTraversal",!1),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=(0,Xt.Enum)(ft).fromValue(t?.bitmarkVersion)??bt,this.options={...er,...t?.bitmarkOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion===ft.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=Zt.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=Zt.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 Lt(this.bitmarkVersion,{writeCallback:this.write,bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.mainWriter=e,this.partWriter=new Yt,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=d._error,this.textFormat=x.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,ze.bitmarkAst,this,void 0),this.writeLine()}enter_bitsValue(e,t){const r=e.value,i=ve.getBitConfig(r.bitType),o=ve.getBitResourcesConfig(r.bitType,r.resourceType);if(this.bitType=r.bitType,this.textFormat=r.textFormat??i.textFormatDefault,this.isBodyBitmarkText=this.textFormat===x.bitmarkText,this.isCardAllowed=this.calculateIsCardAllowed(),this.hasCardSet=this.haveValidCardSet(r),this.hasFooter=this.haveValidFooter(r),this.firstBit||(this.writeNL(),this.writeNL(),this.writeNL()),this.writeOPD(r.bitLevel),r.isCommented&&this.writeString("|"),this.writeTagKey(r.bitType),r.textFormat){this.isWriteTextFormat(r.textFormat,i.textFormatDefault)&&(this.writeColon(),this.writeTagKey(r.textFormat))}let a;if(i.resourceAttachmentAllowed&&r.resources&&r.resources.length>0){const e=o.comboResourceConfigKeysMap;if(o.comboResourceConfigKeysMap.size>0)for(const t of e.keys())a=ue(t);else a=r.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 r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;for(let e=0;e<r.length;e++){const i=r[e];this.writeNL(),this.writeProperty("internalComment",i,t,{format:b,array:!0})}return!1}enter_groupTag(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;for(const e of r){const{name:r,tags:i}=e;if(this.writeNL(),this.writeProperty("groupTag",r,t,{format:b,writeEmpty:!0}),i&&i.length>0)for(const e of i)this.writeProperty("tag",e,t,{format:b,writeEmpty:!0})}return!1}enter_labelTrue(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const o=i?.value;if(o){const e=""!=r,i=o.labelFalse&&""!=o.labelFalse;(e||i)&&this.writeNL(),e&&this.writeProperty("labelTrue",r,t,{format:b}),i&&this.writeProperty("labelFalse",o.labelFalse,t,{format:b})}return!1}enter_labelFalse(e,t){return!0}enter_imageSource(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{url:o,mockupId:a,size:s,format:n,trim:l}=r;return this.writeNL(),this.writeProperty("imageSource",o,t,{format:b}),o&&(a&&this.writeProperty("mockupId",a,t,{format:b}),s&&this.writeProperty("size",s,t,{format:b}),n&&this.writeProperty("format",n,t,{format:b}),qt.isBoolean(l)&&this.writeProperty("trim",l,t,{format:b})),!1}enter_technicalTerm(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{technicalTerm:o,lang:a}=r;return this.writeNL(),this.writeProperty("technicalTerm",o,t,{format:b}),null!=a&&this.writeProperty("lang",a,t,{format:b}),!1}enter_servings(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{servings:o,unit:a,unitAbbr:s,decimalPlaces:n,disableCalculation:l,hint:c}=r;return this.writeNL(),this.writeProperty("servings",o,t,{format:b}),null!=a&&this.writeProperty("unit",a,t,{format:b}),null!=s&&this.writeProperty("unitAbbr",s,t,{format:b}),null!=n&&this.writeProperty("decimalPlaces",n,t,{format:b}),null!=l&&this.writeProperty("disableCalculation",l,t,{format:b}),null!=c&&(this.writeOPQ(),this.writeTextOrValue(c,x.plainText,Ue),this.writeCL()),!1}enter_person(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{name:o,title:a,avatarImage:s}=r;return this.writeNL(),this.writeProperty("person",o,t,{format:b}),a&&this.writeProperty("title",a,t,{format:b}),s&&this.writeResource(ne.image,s.image.src),!1}enter_text(e,t){const r=this.getParentNode(t);return!r||r.key!==ze.term&&r.key!==ze.definition&&r.key!==ze.alternativeDefinitionsValue&&r.key!==ze.question&&r.key!==ze.answer&&r.key!==ze.alternativeAnswersValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1)}leaf_text(e,t){const r=this.getParentNode(t);return!r||r.key!==ze.term&&r.key!==ze.definition&&r.key!==ze.alternativeDefinitionsValue&&r.key!==ze.question&&r.key!==ze.answer&&r.key!==ze.alternativeAnswersValue&&r.key!==ze.reason||(se.isString(e.value)&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1)}enter_icon(e,t){const r=e.value,i=this.getParentNode(t);return!i||(i.key!==ze.term&&i.key!==ze.definition&&i.key!==ze.alternativeDefinitionsValue&&i.key!==ze.question&&i.key!==ze.answer&&i.key!==ze.alternativeAnswersValue||(this.writeNL(),this.writeResource(ne.icon,r.image.src)),!0)}leaf_iconValue(e,t){return this.writeNL(),this.writeProperty("icon",e.value,t,{format:b}),!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 r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;const{level:o,label:a}=r,s=e.key===ze.ratingLevelStart?"ratingLevelStart":"ratingLevelEnd";return this.writeNL(),this.writeProperty(s,o,t,{format:b}),a&&this.writeProperty("label",a,t,{format:y}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.markConfig)return!0;const{mark:o,color:a,emphasis:s}=r;return o&&(this.writeNL(),this.writeProperty("mark",o,t,{format:b}),a&&this.writeProperty("color",a,t,{format:b}),s&&this.writeProperty("emphasis",s,t,{format:b})),!1}enter_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:b})),!1}leaf_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:b})),!1}enter_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:b})),!1}leaf_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:b})),!1}leaf_reasonableNumOfChars(e,t){this.writeNL(),this.writeProperty("reasonableNumOfChars",e.value,t,{format:b})}leaf_additionalSolutionsValue(e,t){const r=this.getParentNode(t,2);r?.key===ze.questionsValue&&(this.writeNL(),this.writeProperty("additionalSolutions",e.value,t,{format:b,array:!0,writeEmpty:!0}))}enter_item(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.lead)||(!this.isEmptyText(i?.value?.pageNumber)||(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,Ue),this.writeCL(),!0))))}enter_lead(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.pageNumber)||(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,Ue),this.writeCL(),!0)))}enter_pageNumber(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(!this.isEmptyText(i?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.lead??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r??"",x.bitmarkText,Ue),this.writeCL(),!0))}enter_marginNumber(e,t){const r=e.value,i=this.getParentNode(t);return!this.isEmptyText(r)&&(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i?.value?.item??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.lead??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i?.value?.pageNumber??"",x.bitmarkText,Ue),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r,x.bitmarkText,Ue),this.writeCL(),!0)}enter_body(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue&&r?.key!==ze.cardBitsValue)return!0;this.inTag=!1;const i=e.value;if(this.textFormat===x.json){const e=i.body??null;if(Array.isArray(e)||he.isObject(e)){const t=JSON.stringify(e,null,this.prettifySpace);t&&(this.writePlainTextDivider(),this.writeNL(),this.writeTextOrValue(t,x.plainText,je))}}else if(this.isBodyBitmarkText){const e=!(this.hasCardSet||this.hasFooter);this.writeNL();const t=Array.isArray(i.body)?i.body:[];this.writeTextOrValue(t,this.textFormat,je,{plainTextDividerAllowed:e})}else{this.writePlainTextDivider(),this.writeNL();const e=se.isString(i.body)?i.body:"";this.writeTextOrValue(`${e}`,x.plainText,je)}return!1}exit_body(e,t){this.inTag=!0}bodyBitCallback(e,t,r){const i=(0,Xt.Enum)(ze).fromValue(e.type)??ze.bodyBit;return this.ast.walk(e,i,this,void 0),""}enter_gap(e,t){const r=e.value;if(r.solutions&&0===r.solutions.length)this.writeOPU(),this.writeCL();else for(const e of r.solutions)this.writeOPU(),this.writeTextOrValue(e,x.plainText,Ue),this.writeCL();return!0}enter_mark(e,t){const r=e.value;return this.writeOPE(),this.writeTextOrValue(r.solution,x.plainText,Ue),this.writeCL(),!0}enter_select(e,t){return!0}enter_highlight(e,t){return!0}enter_footer(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;return this.textFormat===x.json||i.footer&&i.footer.length>0&&this.isBodyBitmarkText&&(this.writeNL(),this.writeTextOrValue("==== footer ====",x.plainText,je),this.writeNL(),this.writeTextOrValue(i.footer,this.textFormat,je,{plainTextDividerAllowed:!0})),!1}enter_solutions(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;return i&&0===i.length&&(this.writeOPU(),this.writeCL()),!0}leaf_solution(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return;const i=e.value,o=this.getParentNode(t,2)?.value;o?.type===De.mark&&i&&(this.writeOPE(),this.writeTextOrValue(i,x.plainText,Ue),this.writeCL())}leaf_mark(e,t){const r=t[0];if(r?.key!==ze.mark)return;const i=e.value;i&&this.writeProperty("mark",i,t,{format:b})}enter_optionsValue(e,t){const r=e.value;return r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.text,x.plainText,Ue),this.writeCL(),!0}enter_textsValue(e,t){const r=e.value;return r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.text,x.plainText,Ue),this.writeCL(),!0}enter_cardNode(e,t){return!this.isCardAllowed||(this.writeCardSetStart(),!0)}between_cardNode(e,t,r,i){this.isCardAllowed&&this.writeCardSetCardDivider()}exit_cardNode(e,t){this.isCardAllowed&&(this.writeCardSetEnd(),this.options.cardSetVersion,Zt.v1)}enter_elements(e,t){}between_elements(e,t,r,i){this.writeCardSetSideDivider()}between_flashcards(e,t,r,i){this.writeCardSetCardDivider()}between_flashcardsValue(e,t,r,i){this.isCardAllowed&&(r.key===ze.answer?this.writeCardSetSideDivider():r.key===ze.alternativeAnswers&&0!==r.value?.length&&this.writeCardSetVariantDivider())}between_alternativeAnswers(e,t){this.writeCardSetVariantDivider()}between_alternativeDefinitions(e,t){this.writeCardSetVariantDivider()}enter_statements(e,t){}between_statements(e,t,r,i){this.isOfBitType(d.trueFalse1)||this.writeCardSetCardDivider()}enter_statementsValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.statement,x.plainText,Ue),this.writeCL(),!0}enter_choicesValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect||r.requireReason?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.choice,x.plainText,Ue),this.writeCL(),!0}enter_responsesValue(e,t){const r=e.value;return this.writeNL(),r.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(r.response,x.plainText,Ue),this.writeCL(),!0}between_feedbacks(e,t,r,i){this.writeCardSetCardDivider()}enter_reason(e,t){return this.writeCardSetSideDivider(),!0}enter_quizzes(e,t){}between_quizzes(e,t,r,i){this.writeCardSetCardDivider()}enter_heading(e,t){}between_heading(e,t,r,i){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_forValues(e,t){}between_forValues(e,t,r,i){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_pairs(e,t){}between_pairs(e,t,r,i){this.writeCardSetCardDivider()}enter_keyAudio(e,t){const r=e.value;return this.writeNL(),this.writeResource(ne.audio,r.audio.src),!1}enter_keyImage(e,t){const r=e.value;return this.writeNL(),this.writeResource(ne.image,r.image.src),!1}enter_matrix(e,t){}between_matrix(e,t,r,i){this.isCardAllowed&&this.writeCardSetCardDivider()}enter_values(e,t){this.isCardAllowed&&this.writeCardSetSideDivider()}between_values(e,t,r,i){this.isCardAllowed&&this.writeCardSetVariantDivider()}between_pronunciationTable(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}enter_table(e,t){const r=this.getParentNode(t);if(r?.key!==ze.cardNode)return!0;const i=e.value;return!i||!this.writeAdvancedTable(i)}between_table(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}writeAdvancedTable(e){const t=mt(d.tableExtended,e),r=[{key:"header",qualifier:"table-header",section:t.header},{key:"body",qualifier:void 0,section:t.body},{key:"footer",qualifier:"table-footer",section:t.footer}];let i=0;for(const{key:e,qualifier:t,section:o}of r){const r=o?.rows??[];if(0!==r.length)for(const o of r)this.writeCardSetCardDivider(t),this.writeTableRow(o,e),i++}return i>0}writeTableRow(e,t){const r=e?.cells??[];if(0!==r.length)for(let e=0;e<r.length;e++)e>0&&this.writeCardSetSideDivider(),this.writeNL(),this.writeTableCell(r[e],t)}writeTableCell(e,t){const r="body"===t?"td":"th",i=e.title?"th":"td";i!==r&&(this.writeTableCellProperty("tableCellType",i),this.writeNL()),e.rowspan&&e.rowspan>1&&(this.writeTableCellProperty("tableRowSpan",e.rowspan),this.writeNL()),e.colspan&&e.colspan>1&&(this.writeTableCellProperty("tableColSpan",e.colspan),this.writeNL()),e.scope&&(this.writeTableCellProperty("tableScope",e.scope),this.writeNL());const o=e.content??dt.EMPTY_STRING;this.writeTextOrValue(o,this.textFormat,je)}writeTableCellProperty(e,t){this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${t}`,x.plainText,Ue),this.writeCL()}between_data(e,t,r,i){const o=this.getParentNode(i);o?.key!==ze.table&&o?.key!==ze.pronunciationTable||this.writeCardSetCardDivider()}between_columns(e,t,r,i){const o=this.getParentNode(i),a=o?.key;a!==ze.table&&a!==ze.captionDefinitionList||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL()}enter_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.bitmarkText,Ue),this.writeCL()}between_dataValue(e,t,r,i){const o=this.getParentNode(i,2);o?.key!==ze.table&&o?.key!==ze.pronunciationTable||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_dataValueValue(e,t){const r=this.getParentNode(t,3);r?.key===ze.table&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je))}enter_dataValueValue(e,t){const r=this.getParentNode(t,3);if((r?.key===ze.table||r?.key===ze.pronunciationTable)&&e.value){if(r?.key===ze.pronunciationTable){const t=e.value;return t.title&&(this.writeNL(),this.writeOP(),this.writeHash(),this.writeTextOrValue(t.title,x.bitmarkText,Ue),this.writeCL()),t.audio&&(this.writeNL(),this.writeResource(ne.audio,t.audio.audio.src)),t.body&&(this.writeNL(),this.writeTextOrValue(t.body,this.textFormat,je)),!1}this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)}}between_captionDefinitionList(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.cardNode&&this.writeCardSetCardDivider()}leaf_term(e,t){const r=this.getParentNode(t);return r?.key!==ze.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1)}leaf_definition(e,t){const r=this.getParentNode(t);return r?.key!==ze.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1)}between_definitions(e,t,r,i){const o=this.getParentNode(i);o?.key!==ze.cardNode&&o?.key!==ze.captionDefinitionList||this.writeCardSetCardDivider()}between_definitionsValue(e,t,r,i){const o=this.getParentNode(i);o?.key===ze.definitions&&this.isCardAllowed&&(r.key===ze.definition?this.writeCardSetSideDivider():r.key===ze.alternativeDefinitions&&r.value?.length>0&&this.writeCardSetVariantDivider())}enter_questions(e,t){}between_questions(e,t,r,i){this.writeCardSetCardDivider()}enter_ingredients(e,t){}between_ingredients(e,t,r,i){this.writeCardSetCardDivider()}enter_ingredientsValue(e,t){const r=e.value;return null!=r.title&&(this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(r.title,x.bitmarkText,Ue),this.writeCL()),null!=r.ingredient&&(this.writeNL(),r.checked?this.writeOPP():this.writeOPM(),this.writeCL(),null!=r.quantity&&(this.writeOPB(),this.writeTextOrValue(`${r.quantity}`,x.plainText,Ue),this.writeCL()),null!=r.unit&&this.writeProperty("unit",r.unit,t,{format:b}),null!=r.unitAbbr&&this.writeProperty("unitAbbr",r.unitAbbr,t,{format:b}),null!=r.decimalPlaces&&this.writeProperty("decimalPlaces",r.decimalPlaces,t,{format:b}),r.disableCalculation&&this.writeProperty("disableCalculation",!0,t,{format:b}),this.writeNL(),this.writeTextOrValue(r.ingredient,this.textFormat,je)),!0}enter_botResponses(e,t){}between_botResponses(e,t,r,i){this.writeCardSetCardDivider()}enter_cardBits(e,t){}between_cardBits(e,t,r,i){this.writeCardSetCardDivider()}leaf_item(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeOPC(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_response(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeOPB(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_reaction(e,t){const r=this.getParentNode(t);r?.key===ze.botResponsesValue&&(this.writeNL(),this.writeProperty("reaction",e.value,t,{format:b}))}leaf_feedback(e,t){const r=this.getParentNode(t);if(r?.key!==ze.botResponsesValue)return;const i=e.value;i&&(this.writeNL(),this.writeTextOrValue(i,this.textFormat,je))}enter_backgroundWallpaper(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_imagePlaceholder(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_previewImageValue(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource("previewImage",r),!0}enter_previewVideoValue(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource("previewVideo",r),!0}enter_platformIcon(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_platformLogo(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_platformBackgroundImage(e,t){const r=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,r),!0}enter_coverImage(e,t){const r=e.value;if(r&&"object"==typeof r&&!Array.isArray(r)&&"type"in r){const t=r;return this.writeNL(),this.writePropertyStyleResource(e.key,t),!0}if(Array.isArray(r)){if(null==r)return!0;const e=this.getParentNode(t);if(e?.key!==ze.bitsValue)return!0;const i=this.getBitType(t);if(!i)return!0;const o=ve.getBitConfig(i),a=ve.getTagConfigForTag(o.tags,ce.property_coverImage);if(!a)return!0;this.writeNL_IfNotChain(t),this.writeProperty(a.tag,r,t,{format:a.format??b,array:a.array??!1,writeEmpty:!0,ignoreFalse:"false"===a.defaultValue,ignoreTrue:"true"===a.defaultValue})}return!0}leaf_coverImage(e,t){if(null==e.value)return;const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return;const i=this.getBitType(t);if(!i)return;const o=ve.getBitConfig(i),a=ve.getTagConfigForTag(o.tags,ce.property_coverImage);a&&(this.writeNL_IfNotChain(t),this.writeProperty(a.tag,e.value,t,{format:a.format??b,array:a.array??!1,writeEmpty:!0,ignoreFalse:"false"===a.defaultValue,ignoreTrue:"true"===a.defaultValue}))}exit_imagePlaceholder(e,t){}enter_posterImage(e,t){const r=this.getParentNode(t);if(r?.key===ze.bitsValue){const r=e.value;r&&this.writeProperty("posterImage",r,t,{format:b})}else{const r=e.value;r&&r.src&&this.writeProperty("posterImage",r.src,t,{format:b})}return!0}enter_thumbnails(e,t){const r=e.value;if(Array.isArray(r)){const e=["src1x","src2x","src3x","src4x"];for(let i=0;i<r.length&&i!==e.length;i++){const o=r[i],a=e[i];this.writeProperty(a,o.src,t,{format:b})}}return!1}leaf_level(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;if(!ve.isOfBitType(this.bitType,[d.chapter]))return!0;const i=e.value,o=r?.value;if(i>0&&null==o.title){this.writeNL(),this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeCL()}return!1}leaf_titleString(e,t){const r=this.getParentNode(t);return r?.key!==ze.bitsValue||(e.value&&(this.writeNL(),this.writeProperty("title",e.value,t,{format:b})),!1)}enter_title(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value,o=r?.value,a=o.level||1;if(a&&i){this.writeNL(),this.writeOP();for(let e=0;e<+a;e++)this.writeHash();this.writeTextOrValue(i,x.bitmarkText,Ue),this.writeCL()}return!1}enter_subtitle(e,t){const r=this.getParentNode(t);if(r?.key!==ze.bitsValue)return!0;const i=e.value;if(i){this.writeNL(),this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeTextOrValue(i,x.bitmarkText,Ue),this.writeCL()}return!1}enter_book(e,t){}enter_bookValue(e,t){const r=e.value;return r&&(this.writeNL(),this.writeProperty("book",r.book,t,{format:b,writeEmpty:!0}),r.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(r.reference,x.plainText,Ue),this.writeCL(),r.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(r.referenceEnd,x.plainText,Ue),this.writeCL()))),!1}leaf_book(e,t){const r=this.getParentNode(t),i=r?.value;i&&e.value&&(this.writeNL(),this.writeProperty("book",e.value,t,{format:b,writeEmpty:!0}),i.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(i.reference,x.plainText,Ue),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(i.referenceEnd,x.plainText,Ue),this.writeCL())))}leaf_anchor(e,t){e.value&&(this.writeNL(),this.writeOPDANGLE(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_reference(e,t){const r=this.getParentNode(t),i=r?.value;i&&e.value&&(i.book||(this.writeNL(),this.writeOPRANGLE(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL()))}enter_hint(e,t){const r=e.value;return this.isEmptyText(r)||(this.writeNL_IfNotChain(t),this.writeOPQ(),this.writeTextOrValue(r,x.bitmarkText,Ue),this.writeCL()),!1}enter_instruction(e,t){const r=e.value;return this.isEmptyText(r)||(this.writeNL_IfNotChain(t),this.writeOPB(),this.writeTextOrValue(r,x.bitmarkText,Ue),this.writeCL()),!1}leaf_lang(e,t){e.value&&(this.writeNL(),this.writeProperty("lang",e.value,t,{format:v}))}enter_refAuthor(e,t){e.value&&(this.writeNL(),this.writeProperty("refAuthor",e.value,t,{format:b,array:!0}))}leaf_refBookTitle(e,t){e.value&&(this.writeNL(),this.writeProperty("refBookTitle",e.value,t,{format:b,array:!0}))}enter_refPublisher(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublisher",e.value,t,{format:b,array:!0}))}leaf_refPublicationYear(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublicationYear",e.value,t,{format:b}))}leaf_citationStyle(e,t){e.value&&(this.writeNL(),this.writeProperty("citationStyle",e.value,t,{format:b}))}leaf_isExample(e,t){if(!e.value)return;const r=this.getParentNode(t),i=r?.value.example??null;null!=i&&""!==i&&(this.writeNL_IfNotChain(t),this.writeOPA(),this.writeString("example"),this.writeColon(),!0===i?this.writeString(" true "):!1===i?this.writeString(" false "):Array.isArray(i)?this.writeTextOrValue(i,x.bitmarkText,Ue):this.writeTextOrValue(i,x.plainText,Ue),this.writeCL())}enter_elementsValue(e,t){return e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1}leaf_solutionsValue(e,t){const r=this.getParentNode(t,2);r?.key===ze.bitsValue&&null!=e.value&&(this.writeOPU(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_prefix(e,t){e.value&&(this.writeOPPRE(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_postfix(e,t){e.value&&(this.writeOPPOST(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL())}leaf_isCaseSensitive(e,t){this.writeProperty("isCaseSensitive",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0})}leaf_forKeys(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL()}leaf_forValues(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL()}leaf_forValuesValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,x.plainText,Ue),this.writeCL()}leaf_key(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je))}leaf_valuesValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je))}enter_question(e,t){const r=this.getParentNode(t);return r?.key!==ze.questionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je)),!1)}leaf_question(e,t){const r=this.getParentNode(t);r?.key===ze.flashcardsValue&&e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,je))}leaf_srcAltValue(e,t){this.writeProperty("srcAlt",e.value,t,{format:b})}leaf_src1x(e,t){this.writeProperty("src1x",e.value,t,{format:b})}leaf_src2x(e,t){this.writeProperty("src2x",e.value,t,{format:b})}leaf_src3x(e,t){this.writeProperty("src3x",e.value,t,{format:b})}leaf_src4x(e,t){this.writeProperty("src4x",e.value,t,{format:b})}leaf_width(e,t){this.writeProperty("width",e.value,t,{format:b})}leaf_height(e,t){this.writeProperty("height",e.value,t,{format:b})}leaf_alt(e,t){this.writeProperty("alt",e.value,t,{format:b})}leaf_zoomDisabled(e,t){ve.isOfBitType(this.bitType,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages,d.extractorImage])?this.writeProperty("zoomDisabled",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0}):this.writeProperty("zoomDisabled",e.value,t,{format:v,writeEmpty:!0,ignoreFalse:!0,ignoreTrue:!1})}leaf_license(e,t){this.writeProperty("license",e.value,t,{format:b})}leaf_copyright(e,t){this.writeProperty("copyright",e.value,t,{format:b})}leaf_provider(e,t){}leaf_showInIndex(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("showInIndex",e.value,t,{format:v,ignoreFalse:!0}))}enter_caption(e,t){const r=e.value;return this.writeNL_IfNotChain(t),this.writeProperty("caption",r,t,{format:y}),!1}leaf_search(e,t){const r=e.value;r&&(this.writeNL_IfNotChain(t),this.writeProperty("search",r,t,{format:b}))}leaf_selected(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("selected",e.value,t,{format:v,ignoreFalse:!0}))}leaf_duration(e,t){const r=this.getParentNode(t);r?.key===ze.bitsValue&&this.writeNL(),this.writeProperty("duration",e.value,t,{format:b})}leaf_mute(e,t){this.writeProperty("mute",e.value,t,{format:v})}leaf_autoplay(e,t){this.writeProperty("autoplay",e.value,t,{format:v})}leaf_allowSubtitles(e,t){this.writeProperty("allowSubtitles",e.value,t,{format:v})}leaf_showSubtitles(e,t){this.writeProperty("showSubtitles",e.value,t,{format:v})}generateResourceHandlers(){for(const e of(0,Xt.Enum)(ne).keys()){if(e===(0,Xt.Enum)(ne).keyFromValue(ne.unknown))continue;const t=`enter_${e}`;"function"!=typeof this[t]&&(this[t]=(e,t)=>{const r=e.value;if(null==r)return!1;const i=this.getParentNode(t);if(i?.key!==ze.resourcesValue)return!0;const o=(0,Xt.Enum)(ne).fromValue(i?.value.__typeAlias)??(0,Xt.Enum)(ne).fromValue(i?.value.type);if(!o)return!1;const a=r.url||r.src||r.body||"";return this.writeNL(),this.writeResource(o,a),!0},this[t]=this[t].bind(this))}}generatePropertyHandlers(){for(const e of(0,Xt.Enum)(ae).values()){const t=de(e),r=[`enter_${t}`,`leaf_${t}`];for(const i of r)"function"!=typeof this[i]&&"example"!==t&&(this[i]=(t,r)=>{if(null==t.value)return;const i=this.getParentNode(r);if(i?.key!==ze.bitsValue)return;const o=this.getBitType(r);if(!o)return;const a=ve.getBitConfig(o),s=ve.getTagConfigForTag(a.tags,e);s&&(this.writeNL_IfNotChain(r),this.writeProperty(s.tag,t.value,r,{format:s.format??b,array:s.array??!1,writeEmpty:!0,ignoreFalse:"false"===s.defaultValue,ignoreTrue:"true"===s.defaultValue}))},this[i]=this[i].bind(this))}}getBitType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.bitType}}isChain(e){const t=this.getParentNode(e);return t?.key!==ze.bitsValue&&(t?.key!==ze.cardBitsValue&&(t?.key!==ze.feedbacksValue&&(t?.key!==ze.quizzesValue&&(t?.key!==ze.pairsValue&&(t?.key!==ze.matrixValue&&(t?.key!==ze.definitionsValue&&(t?.key!==ze.questionsValue&&t?.key!==ze.reason)))))))}haveValidCardSet(e){const t=ve.getBitConfig(e.bitType);return!!t&&!!t.cardSet}haveValidFooter(e){const t=e.footer;if(!t)return!1;return e.textFormat!==x.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(dt.breakscape(`${e}`,{format:x.plainText,location:Ue}))}writeTextOrValue(e,t,r,i){const o=r===Ue,a="string"==typeof e?e:void 0,s=Array.isArray(e)?e:void 0,n=o?this.spacesAroundValuesStr:"",l=t===x.bitmarkText?t:x.plainText,c=e=>o?`${n}${e}${n}`:e,p=e=>{const t=this.writer;this.writer=this.partWriter,this.partWriter.openSync(),e(),this.partWriter.closeSync();const r=this.partWriter.getString().trim();return this.writer=t,r};if(null!=a){const e=()=>this.write(dt.breakscape(a,{format:l,location:r}));if(o){const t=p(e);t&&this.write(c(t))}else e();return}if(null!=s){const e=()=>this.textGenerator.generateSync(s,t,r,i);if(o){const t=p(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===Zt.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.writeNL(),this.options.cardSetVersion===Zt.v1&&this.write("===")}writeCardSetCardDivider(e){this.writeNL();const t=this.getCardDividerMarker();this.write(t),e&&this.appendCardDividerQualifier(e)}writeCardSetSideDivider(){this.writeNL(),this.options.cardSetVersion===Zt.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.writeNL(),this.options.cardSetVersion===Zt.v1?this.write("--"):this.write("++")}getCardDividerMarker(){return this.options.cardSetVersion===Zt.v1?"===":"===="}appendCardDividerQualifier(e){const t=this.getCardDividerMarker(),r=dt.breakscape(e,{format:x.plainText,location:Ue});this.write(" "),this.write(r),this.write(" "),this.write(t)}writeNL_IfNotChain(e){this.isChain(e)||this.writeNL()}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writePropertyStyleResource(e,t,r=!1){if(e&&t){const i=t[(0,Xt.Enum)(ne).keyFromValue(t.type)??""],o=i&&(i.src||i.url||i.body)||"";r?this.writeOPA():this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(o,x.plainText,Ue),t.type,this.writeCL()}}writeResource(e,t){e&&(this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,x.plainText,Ue),this.writeCL())}writeProperty(e,t,r,i){let o;if(void 0!==t){const a=i.format===y;if(a){if(!i.writeEmpty&&a&&this.isEmptyText(t))return;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,x.bitmarkText,Ue),this.writeCL()}else if(o=Array.isArray(t)?t:[t],o.length>0){i.array||(o=o.slice(o.length-1));let t=0;for(const a of o)if(void 0!==a){if(i.ignoreFalse&&!1===a)continue;if(i.ignoreTrue&&!0===a)continue;if(!i.writeEmpty&&""===a)continue;t>0&&this.writeNL_IfNotChain(r),this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${a}`,x.plainText,Ue),this.writeCL(),t++}}}}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isEmptyText(e){return!e||(!Array.isArray(e)||0===e.length)}isWriteTextFormat(e,t){return!!(!((0,Xt.Enum)(x).fromValue(e)===t)||this.options.explicitTextFormat)}calculateIsCardAllowed(){return this.isBodyBitmarkText&&!this.isOfBitType1()&&!this.isTableBitType()}isTableBitType(){return this.isOfBitType([d.table])}isOfBitType1(){return this.isOfBitType([d.trueFalse1,d.multipleChoice1,d.multipleResponse1])}isOfBitType(e){return ve.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}},rr=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new tr(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()}},ir=r(722),or={},ar=class extends yt{constructor(e,t){super(),l(this,"ast",new $e),l(this,"textGenerator"),l(this,"bitmarkVersion"),l(this,"textParserVersion"),l(this,"textParser",new Mt),l(this,"options"),l(this,"jsonPrettifySpace"),l(this,"writer"),l(this,"json",[]),l(this,"bitWrapperJson",{}),l(this,"bitJson",{}),l(this,"textDefault",dt.EMPTY_STRING),l(this,"bodyDefault",dt.EMPTY_STRING),l(this,"bodyJson",this.bodyDefault),l(this,"listItem"),l(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=(0,ir.Enum)(ft).fromValue(t?.bitmarkVersion)??bt,this.textParserVersion=this.textParser.version(),this.options={...or,...t?.jsonOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===ft.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.textGenerator=new Lt(ft.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.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?dt.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?dt.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.listItem=void 0,this.placeholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,ze.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 r=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(r),this.bitWrapperJson.bit=this.bitJson;const i=ve.getBitConfig(r.bitType),o=this.getTextFormat(t),a=!!i.rootExampleType,s=i.rootExampleType===h;if(a){let e;s?(e=!0,ve.isOfBitType(r.bitType,d.trueFalse1)&&void 0!==r.cardNode?.statement?.isCorrect&&(e=r.cardNode.statement.isCorrect)):e="true";const t=this.toExample(r,{defaultExample:e,isBoolean:s,textFormat:o});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else r.isExample&&(this.bitJson.isExample=!0);this.placeholderIndex=0}exit_bitsValue(e,t){const r=this.bitJson.isExample,i=this.bitJson.example;delete this.bitJson.isExample,delete this.bitJson.example,this.bitJson.isExample=r,this.bitJson.example=i,this.cleanBitJson(this.bitJson)}enter_imageSource(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_person(e,t){const r=this.getBitType(t);let i="person";return ve.isOfBitType(r,d.conversationLeft1)&&(i="partner"),this.standardHandler(e,t,ze.bitsValue,{array:!1,keyOverride:i})}enter_ratingLevelStart(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_ratingLevelEnd(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_productId(e,t){const r=e.value,i=this.getParentNode(t);if(i?.key!==ze.bitsValue)return!0;return this.getBitType(t)===d.module?this.addProperty(this.bitJson,"productId",r,{array:!0}):r.length>0&&this.addProperty(this.bitJson,"productId",r[r.length-1],{array:!1}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const r=e.value,i=this.getParentNode(t);return i?.key!==ze.markConfig||(this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(r),!1)}enter_item(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_lead(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_pageNumber(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_marginNumber(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_hint(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_instruction(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}leaf_titleString(e,t){const r=this.getParentNode(t);return r?.key!==ze.bitsValue||this.standardHandler(e,t,[ze.bitsValue],{array:!1,keyOverride:"title"})}enter_title(e,t){return this.standardHandler(e,t,[ze.bitsValue,ze.cardNode],{array:!0})}enter_subtitle(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_caption(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_width(e,t){let r=e.value;const i=this.getBitType(t),o=this.getParentNode(t);return o?.key===ze.bitsValue&&ve.isOfBitType(i,d.extractorBlock)&&(r=zt.asNumber(r,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:r})}enter_height(e,t){let r=e.value;const i=this.getBitType(t),o=this.getParentNode(t);return o?.key===ze.bitsValue&&ve.isOfBitType(i,d.extractorBlock)&&(r=zt.asNumber(r,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:r})}enter_extraProperties(e,t){const r=e.value;if(!this.options.excludeUnknownProperties&&r)for(const[e,t]of Object.entries(r)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t,{array:!0})}}enter_cardBitsValue(e,t){const r=e.value,i=this.getBitType(t);if(!i)return;let o;if(i===d.bookReferenceList){this.bitJson.bookReferences||(this.bitJson.bookReferences=[]);const e={};this.addProperty(e,"lang",r.lang,{array:!1}),this.addProperty(e,"refAuthor",r.refAuthor??[],{array:!0}),this.addProperty(e,"refBookTitle",r.refBookTitle??[],{array:!1}),this.addProperty(e,"refPublisher",r.refPublisher??[],{array:!0}),this.addProperty(e,"refPublicationYear",r.refPublicationYear??[],{array:!1}),this.addProperty(e,"citationStyle",r.citationStyle??[],{array:!1}),this.bitJson.bookReferences.push(e)}else i===d.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),o=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),o=this.bitJson.listItems),this.listItem={item:r.item??[],lead:r.lead??[],hint:r.hint??[],instruction:r.instruction??[],body:this.bodyDefault},o.push(this.listItem)}exit_cardBitsValue(e,t){this.listItem=void 0}enter_body(e,t){const r=e.value,i=this.getParentNode(t);if(!i)return!1;const o=this.getTextFormat(t),a=o===x.bitmarkText;if(this.bodyJson=r.body,i.key===ze.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,je,{noBreakscaping:!0});this.bitJson.body=(e??"").trim()}else e&&(this.bitJson.body=this.moveBodyBitPropertiesToAttrs(this.bodyJson))}else i.key===ze.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson);return!1}bodyBitCallback(e,t,r){const i=`{${this.placeholderIndex}}`;return this.placeholderIndex++,this.bitJson.placeholders=this.bitJson.placeholders??{},this.bitJson.placeholders[i]=e,i}moveBodyBitPropertiesToAttrs(e,t=0){if(0===t)e=structuredClone(e);else if(t>5e3)throw new Error("Recursion limit exceeded");for(const r of e)if(r.type!==De.text&&(0,ir.Enum)(De).values().includes(r.type)){const e=r;e.attrs={};for(const[t,r]of Object.entries(e))"type"!==t&&"attrs"!==t&&(e.attrs[t]=r,delete e[t])}else Array.isArray(r.content)&&(t++,this.moveBodyBitPropertiesToAttrs(r.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,ze.cardNode,{array:!0,keyOverride:"cards"})}enter_definitions(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_statement(e,t){const r=e.value,i=this.getParentNode(t);i?.key===ze.cardNode&&r&&(this.bitJson.statement=r.statement??[],this.bitJson.isCorrect=r.isCorrect??!1,this.bitJson.example=r.example,this.bitJson.isExample=r.isExample)}enter_statements(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_choices(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_responses(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_feedbacks(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_quizzes(e,t){return this.standardHandler(e,t,ze.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,ze.cardNode,{array:!0})}enter_matrix(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_pronunciationTable(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_table(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_questions(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_botResponses(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0,keyOverride:"responses"})}enter_ingredients(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!0})}enter_captionDefinitionList(e,t){return this.standardHandler(e,t,ze.cardNode,{array:!1})}enter_backgroundWallpaper(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_imagePlaceholder(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_previewImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_previewVideo(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}enter_platformIcon(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_platformLogo(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_platformBackgroundImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_coverImage(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:Array.isArray(e.value)})}enter_resources(e,t){const r=e.value,i=this.getBitType(t),o=this.getResourceType(t);if(!r||!i)return!0;let a;const s=ve.getBitConfig(i),n=ve.getBitResourcesConfig(i,o).comboResourceConfigKeysMap;if(n.size>0)for(const[e,t]of n.entries()){const i=ue(e),o={type:i,__typeAlias:i,__configKey:e};for(const e of t){const t=r.find(t=>t.__configKey===e);if(t){const e=ve.getTagConfigForTag(s.tags,t.__configKey);if(e){const r=e.jsonKey??e.tag,i=e.configKey??t.__configKey,a=t.__configKey===i?t:void 0;if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(o[r]=t)}}}a=o}else if(ve.isOfBitType(i,[d.imagesLogoGrave,d.prototypeImages,d.extractorImage])){const e=[];for(const t of r)t.type===ne.image&&e.push(t);i===d.imagesLogoGrave?this.bitJson.logos=e:this.bitJson.images=e}else r.length>=1&&(a=r[0]);return this.bitJson.resource=a,!1}leaf_level(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}enter_book(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!0})}leaf_book(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_anchor(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_reference(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_referenceEnd(e,t){return this.standardHandler(e,t,ze.bitsValue,{array:!1})}leaf_markup(e,t){const r=e.value;return r&&(this.bitWrapperJson.bitmark=r),!1}enter_internalComment(e,t){return!1}enter_parser(e,t){const r=e.value,i=this.getBitType(t),o=this.getParentNode(t);if(r&&i){const{version:e,warnings:i,errors:a,...s}=r,n=`${this.bitmarkVersion}`,l=this.textParserVersion,c=this.getInternalComments(t);o?.key===ze.bitsValue&&(this.bitWrapperJson.parser={version:e,bitmarkVersion:n,textParserVersion:l,internalComments:c,...s,warnings:i,errors:a},this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){for(const e of(0,ir.Enum)(ae).values()){const t=de(e),r=[`enter_${t}`,`leaf_${t}`];for(const e of r)"function"!=typeof this[e]&&"example"!==t&&(this[e]=(e,r)=>{const i=e.value;if(null==i)return;const o=this.getParentNode(r);o?.key===ze.bitsValue&&(this.bitJson[t]=i)},this[e]=this[e].bind(this))}}standardHandler(e,t,r,i){if(r){const e=Array.isArray(r)?r:[r],i=this.getParentNode(t);if(!i?.key||!e.includes(i?.key))return!0}return this.addProperty(this.bitJson,i.keyOverride??e.key,i.valueOverride??e.value,i),!1}addProperty(e,t,r,i){if(void 0!==r){let o;Array.isArray(r)||(r=[r]);const a=r;o=!i.array&&a.length>=1?a[a.length-1]:a,(i.allowNull||null!=o)&&(e[t]=o)}}toExample(e,t){const{isExample:r,example:i,__isDefaultExample:o}=e,{defaultExample:a,isBoolean:s}=t;if(!r)return{isExample:!1,example:null};let n;return n=o?s?qt.toBoolean(a):this.convertBreakscapedStringToJsonText(a,t.textFormat,Ue):s?qt.toBoolean(i):this.convertBreakscapedStringToJsonText(i,t.textFormat,Ue),{isExample:!0,example:n}}getBitType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.bitType}}getTextFormat(e){const t=this.getBitType(e);if(t){const r=ve.getBitConfig(t);for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return(0,ir.Enum)(x).fromValue(e?.textFormat)??r.textFormatDefault}}return x.bitmarkText}getResourceType(e){for(const t of e)if(t.key===ze.bitsValue){const e=t.value;return e?.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===ze.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t,r){if(!e)return"";if(!(t===x.bitmarkText))return e||"";if(this.options.textAsPlainText)return e||"";return this.textParser.toAst(e,{format:t,location:r})}concatenatePlainTextWithJsonTexts(e,t,r){if(Array.isArray(e)){if(r=r.trim()){const i=r.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:qe.hardBreak});for(let e=0;e<i.length;e++){const t=i[e];t&&o.push({text:t,type:qe.text}),e<i.length-1&&o.push({type:qe.hardBreak})}const a=e[e.length-1];a&&a.type===qe.paragraph?a.content=[...a.content??[],...o]:e.push({type:qe.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${r??""}`}isBitmarkText(e){return null!=e&&(!!Array.isArray(e)&&"text"===e.__tag)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){const t=e.textFormat;return{type:e.isCommented?d._comment:e.bitType,originalType:e.isCommented?e.bitType:void 0,format:t,bitLevel:e.bitLevel}}cleanBitJson(e){const t=ve.getBitType(e.type);if(null==e.originalType&&(e.originalType=void 0),e.item||(e.item=void 0),ve.isOfBitType(t,[d._error,d._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,i=!1;ve.isOfBitType(t,[d.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),ve.isOfBitType(t,[d.article]),ve.isOfBitType(t,[d.example])&&(r=!0,i=!0),ve.isOfBitType(t,[d.multipleChoice1,d.multipleResponse1,d.multipleChoiceText,d.highlightText,d.gapText,d.gapTextInstructionGrouped,d.clozeAndMultipleChoiceText,d.sequence,d.mark,d.flashcard,d.definitionList])&&(r=!0,null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,[d.sequence])&&(r=!0,i=!0,null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.cloze)&&(r=!0,ve.isOfBitType(t,d.clozeSolutionGrouped)?(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!0)):ve.isOfBitType(t,d.clozeInstructionGrouped)&&(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!1))),ve.isOfBitType(t,[d.multipleChoice,d.multipleResponse])&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault)),ve.isOfBitType(t,d.essay)&&(r=!0,i=!0,null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="")),ve.isOfBitType(t,d.trueFalse1)&&(r=!0,i=!0,null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.trueFalse)&&(r=!0,null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault)),ve.isOfBitType(t,d.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)),ve.isOfBitType(t,d.interview)&&(r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[])),ve.isOfBitType(t,d.sequence)&&null==e.elements&&(e.elements=[]),t===d.matchMatrix&&(r=!0),ve.isOfBitType(t,d.match)&&(r=!0,null==e.heading&&(e.heading={})),ve.isOfBitType(t,d.learningPathBook)&&(null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1)),ve.isOfBitType(t,d.table)&&(null==e.tableFixedHeader&&(e.tableFixedHeader=!1),null==e.tableHeaderWhitespaceNoWrap&&(e.tableHeaderWhitespaceNoWrap=!1),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)),ve.isOfBitType(t,d.bookReference)&&(null==e.refAuthor&&(e.refAuthor=[]),null==e.refBookTitle&&(e.refBookTitle=""),null==e.refPublisher&&(e.refPublisher=[]),null==e.refPublicationYear&&(e.refPublicationYear="")),ve.isOfBitType(t,[d.pageBanner,d.pageBuyButton,d.pageBuyButtonAlt,d.pageBuyButtonPromotion,d.pageFooter,d.pageOpenBook,d.pagePerson,d.pageProduct,d.pageProductList,d.pageProductVideo,d.pageProductVideoList,d.pageSectionFolder,d.pageSubscribe,d.pageSubpage])&&(null==e.slug&&(e.slug=""),null==e.body&&(e.body=this.bodyDefault),ve.isOfBitType(t,d.pageBuyButton)&&null==e.content2Buy&&(e.content2Buy="")),ve.isOfBitType(t,d.tocResource)&&null==e.tocResource&&(e.tocResource=[]),ve.isOfBitType(t,d.tocContent)&&null==e.tocContent&&(e.tocContent=[]),ve.isOfBitType(t,d.book)&&(null==e.maxTocChapterLevel&&(e.maxTocChapterLevel=-1),null==e.hasPrintRestriction&&(e.hasPrintRestriction=!0),null==e.enforceUpdateOverUserInput&&(e.enforceUpdateOverUserInput=!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!==d.articleAi&&t!==d.noteAi&&t!==d.summaryAi||null==e.aiGenerated&&(e.aiGenerated=!0),ve.isOfBitType(t,[d.articleResponsive,d.pageArticleResponsive])&&null==e.imageFirst&&(e.imageFirst=!0),ve.isOfBitType(t,d.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy="")),ve.isOfBitType(t,[d.imagesLogoGrave,d.prototypeImages,d.extractorImage])&&(t===d.imagesLogoGrave?null==e.logos&&(e.logos=[]):null==e.images&&(e.images=[])),ve.isOfBitType(t,[d.stepImageScreenshotWithPointer,d.surveyMatrix])&&(null==e.pointerTop&&(e.pointerTop=""),null==e.pointerLeft&&(e.pointerLeft=""),ve.isOfBitType(t,[d.surveyMatrix])&&null==e.buttonCaption&&(e.buttonCaption="")),ve.isOfBitType(t,[d.listItem])&&null==e.listItemIndent&&(e.listItemIndent=0),ve.isOfBitType(t,d.surveyRating)&&(null==e.ratingLevelStart&&(e.ratingLevelStart={level:0}),null==e.ratingLevelEnd&&(e.ratingLevelEnd={level:0})),ve.isOfBitType(t,d.vendorStripePricingTable)&&(null==e.stripePricingTableId&&(e.stripePricingTableId=""),null==e.stripePublishableKey&&(e.stripePublishableKey="")),ve.isOfBitType(t,d.callToAction)&&(null==e.buttonCaption&&(e.buttonCaption=""),null==e.callToActionUrl&&(e.callToActionUrl="")),ve.isOfBitType(t,d.handInFile)&&null==e.handInAcceptFileType&&(e.handInAcceptFileType=[]),ve.isOfBitType(t,d.handInSubmit)&&(null==e.handInRequirement&&(e.handInRequirement=[]),null==e.handInInstruction&&(e.handInInstruction=""),null==e.buttonCaption&&(e.buttonCaption="")),ve.isOfBitType(t,d.module)&&null==e.hasBookNavigation&&(e.hasBookNavigation=!0),ve.isOfBitType(t,d.container)&&null==e.allowedBit&&(e.allowedBit=[]),ve.isOfBitType(t,d.platformPath)&&null==e.path&&(e.path=""),ve.isOfBitType(t,d.platformBrandTarget)&&null==e.platformBrandTarget&&(e.platformBrandTarget="none"),r?null==e.isExample&&(e.isExample=!1):(delete e.isExample,delete e.example),i?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 r=t[e];if(this.isBitmarkText(r)){const i=this.textGenerator.generateSync(r,x.bitmarkText,Ue,{noBreakscaping:!0});t[e]=(i??"").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}},sr=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new ar(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())}},nr=r(722),lr=class{getSupportedBits(e){const t=e?.includeNonDeprecated??!0,r=e?.includeDeprecated??!1,i=[];for(const e of(0,nr.Enum)(d).values()){if(e===d._error||e===d._comment)continue;const o=ve.getBitType(e),a=ve.getBitConfig(o),s=a.inheritedBitTypes.length>0?a.inheritedBitTypes:void 0;(t&&!a.deprecated||r&&a.deprecated)&&i.push({name:e,since:a.since,deprecated:a.deprecated,inheritedBitTypes:s})}return i}getSupportedBitConfigs(){const e=[];for(const t of(0,nr.Enum)(d).values()){if(t===d._error||t===d._comment)continue;const r=ve.getBitType(t),i=ve.getBitConfig(r);e.push(i)}return e}},cr=(r(722),{peggy:"peggy"}),pr=(r(722),{text:"text",json:"json",pojo:"pojo"}),dr=(r(722),{list:"list",deprecated:"deprecated",all:"all",bit:"bit"}),ur=r(722),mr=new Kt,hr=class{toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t,parser:i}=e,o=this.bitToAst(t,i?.internalComments);o&&r.push(o)}const i=r.length>0?{bits:r}:{};return mr.buildBitmark(i)}preprocessJson(e){const t=[];if(se.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return ve.getBitType(t.type)!==d._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){const{statement:r,reference:i,...o}=e,a=e.type===d._comment&&void 0!==e.originalType,s=ve.getBitType(a?e.originalType:e.type),n=ve.getBitConfig(s),l=(0,ur.Enum)(ut).fromValue(e.format);let c=(0,ur.Enum)(x).fromValue(e.format)??n.textFormatDefault;l===ut.bitmarkMinusMinus&&(c=x.bitmarkText);return mr.buildBit({...o,bitType:s,bitLevel:Math.max(Math.min(e.bitLevel??1,ve.bitLevelMax),ve.bitLevelMin),textFormat:e.format,resourceType:this.getResourceType(e.resource),isCommented:a,internalComment:t,...this.processTitle(s,e.title),...this.processReference(i),...this.parseExample(e.example),person:e.partner??e.person,markConfig:e.marks,resources:this.processResources(s,e.resource,e.images,e.logos),body:this.processBody(e.body,e.placeholders),flashcards:e.cards,statements:this.processStatements(r,e.isCorrect,e.statements,e.example),responses:this.processResponses(s,e.responses),botResponses:this.processBotResponse(s,e.responses),cardBits:this.processListItems(e.listItems??e.sections??e.bookReferences,e.placeholders),footer:this.processFooter(e.footer)})}processStatements(e,t,r,i){const o=[];if(e){const r={statement:e??"",isCorrect:t??!1,...this.parseExample(i)};r&&o.push(r)}if(Array.isArray(r))for(const e of r)o.push(e);if(0!==o.length)return o}processResponses(e,t){if(!ve.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processBotResponse(e,t){if(ve.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processListItems(e,t){const r=[];if(Array.isArray(e))for(const i of e){const e={...i};e.body&&(e.body={body:e.body,placeholders:t}),e&&r.push(e)}if(0!==r.length)return r}getResourceType(e){if(e){return(0,ur.Enum)(ne).fromValue(e.type)}}processResources(e,t,r,i){const o=[];if(t&&o.push(t),ve.isOfBitType(e,[d.prototypeImages,d.extractorImage])&&Array.isArray(r))for(const e of r)e&&o.push(e);if(ve.isOfBitType(e,[d.imagesLogoGrave])&&Array.isArray(i))for(const e of i)e&&o.push(e);return o}processBody(e,t){return{body:e,placeholders:t}}processFooter(e){if(e)return{footer:e}}processTitle(e,t){return ve.isOfBitType(e,d.author)?{titleString:t,title:void 0}:{titleString:void 0,title:t}}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=se.isString(e)||Array.isArray(e)?e:void 0;return t?{example:t}:{example:!!e}}},gr=(r(722),class{constructor(e,t){l(this,"source"),l(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}}),fr={TextFormat:"TextFormat",ResourceType:"ResourceType",Title:f.tag_title,Anchor:f.tag_anchor,Reference:f.tag_reference,ItemLead:f.tag_item,Instruction:f.tag_instruction,Hint:f.tag_hint,True:f.tag_true,False:f.tag_false,Gap:f.tag_gap,Mark:f.tag_mark,SampleSolution:f.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"},br="Bit",yr="Card",kr="Chain",vr=r(722),Tr=class{constructor(e){l(this,"cardIndex",0),l(this,"cardSideIndex",0),l(this,"cardVariantIndex",0),l(this,"currentCardQualifier"),l(this,"currentSideQualifier"),l(this,"currentVariantQualifier"),l(this,"parse"),l(this,"parserText"),l(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 r=this.parserLocation()?.start??{line:1,column:1,offset:0},i=this.parse(e,{startRule:"bit",grammarSource:new gr("bit",r)});return i.value&&(i.value.markup=t),i}handleTextFormat(e){return{type:fr.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:fr.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:(0,vr.Enum)(f).fromValue(e),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:fr.Property,key:`@${dt.unbreakscape(e,{format:x.plainText,location:Ue})}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){const r=dt.unbreakscape(e,{format:x.plainText,location:Ue}),i=se.kebabToCamel(r);return{type:fr.Resource,key:`&${i}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handlePlainTextDivider(e){return e=this.reduceToString(e),{type:fr.PlainTextDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleFooterDivider(e){return e=this.reduceToString(e),{type:fr.FooterDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSet(e){const t=e,r={cards:[]},i={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:i,parser:o}=e;if(!t||t!==fr.Card)continue;const{cardIndex:a,cardSideIndex:s,cardVariantIndex:n,value:l,cardQualifier:c,cardSideQualifier:p,cardVariantQualifier:d}=i;let u=r.cards[a];u?c&&!u.qualifier&&(u.qualifier=c):(u={sides:[],qualifier:c},r.cards[a]=u);let m=u.sides[s];m?p&&!m.qualifier&&(m.qualifier=p):(m={variants:[],qualifier:p},u.sides[s]=m);const h=m.variants[n];h?(m.variants[n].value+=l,d&&!h.qualifier&&(h.qualifier=d)):m.variants[n]={value:l,parser:o,qualifier:d}}r.cards=r.cards.filter(e=>e.sides.some(e=>e.variants.some(e=>0!==se.trimmedString(e.value).length)));for(const t of r.cards){const r={sides:[],qualifier:t.qualifier};i.cards.push(r);for(const i of t.sides){const t={variants:[],qualifier:i.qualifier};r.sides.push(t);for(const r of i.variants){let i={line:1,column:1,offset:0};if(r.parser.location){i=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,o=1;i.offset+=t,i.line+=o}let o=this.parse(r.value,{startRule:"cardContent",grammarSource:new gr("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o,qualifier:r.qualifier})}}}}return{type:fr.CardSet,value:i,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=void 0,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=void 0,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r,i=!1,o=!1,a=!1;if(Array.isArray(e)&&2===e.length){const[t,i]=e;"string"==typeof t?(e=t,"string"==typeof i&&i.trim()===i&&i.length>0&&(r=i)):e=t}else if(Array.isArray(e)&&1===e.length){const[t]=e;e=t}return t===Zt.v1?(i="==="===e,o="=="===e,a="--"===e):(i="===="===e,o="--"===e,a="++"===e),i?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0,this.currentCardQualifier=r,this.currentSideQualifier=void 0,this.currentVariantQualifier=void 0):o?(this.cardSideIndex++,this.cardVariantIndex=0,this.currentSideQualifier=r,this.currentVariantQualifier=void 0):a&&(this.cardVariantIndex++,this.currentVariantQualifier=r),this.isType(e,fr.Card)?e:{type:fr.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:"",cardQualifier:this.currentCardQualifier,cardSideQualifier:this.currentSideQualifier,cardVariantQualifier:this.currentVariantQualifier},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:fr.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e,cardQualifier:this.currentCardQualifier,cardSideQualifier:this.currentSideQualifier,cardVariantQualifier:this.currentVariantQualifier},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){const t=[];let r,i;for(const o of e)switch(o.type){case fr.BodyChar:if(r){const e=`${r.value??""}${o.value??""}`;r.value=e}else r={type:fr.BodyText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case fr.CardChar:if(i){const e=`${i.value??""}${o.value??""}`;i.value=e}else i={type:fr.CardText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:r&&(t.push(r),r=void 0),i&&(t.push(i),i=void 0),t.push(o)}return r&&t.push(r),i&&t.push(i),t}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!(0,vr.Enum)(fr).fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce((e,i,o)=>{if(null==i)return e;const{type:a,value:s}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(s)){const r=this.reduceToArrayOfTypes(s,t);e.push(...r)}else a&&e.push(i)}return e},[])}reduceToString(e){if(!Array.isArray(e))return"";return e.reduce((e,t,r)=>{if(null==t)return e;if(Array.isArray(t)){e+=this.reduceToString(t)}else e+=t;return e},[])}debugPrint(e,t){}},xr=r(722),_r=r(722),Cr=["----","\n==\n","\n---\n"],wr=["==\n","--\n"],Ar=["\n==","\n--"],Br=new class{validateBitTags(e,t){if(!t)return[];const{bitConfig:r,bitType:i,resourceType:o}=e,{tags:a,cardSet:s}=r,n={...a,...ve.getBitResourcesConfig(i,o).tags};return this.validateTagChainsRecursive(e,br,i,t,n,s).validated}checkBody(e,t,r,i,o){if(!o)return o;const{bitConfig:a}=e,{bodyAllowed:s}=a;return o.length>0&&!s&&e.addWarning(`Bit '${r}' should not have a body.`),o}checkBodyPart(e,t,r){return r?(this.checkBodyForCommonPotentialMistakes(e,t,r),r):r}checkFooter(e,t,r){if(!r)return r;const{bitConfig:i,bitType:o}=e,{footerAllowed:a}=i;return this.checkBodyForCommonPotentialMistakes(e,t,r),a||e.addWarning(`Bit '${o}' should not have a footer.`),r}checkCardBody(e,t,r,i,o,a,s){if(!i||!i.body)return i;const{bitConfig:n}=e;if(!n.cardSet)return i;const l=ve.getCardSetVariantConfig(r,a,s);if(!l)return i;const{bodyAllowed:c}=l;return i.bodyString.length>0&&!c&&e.addWarning(`Bit '${r}' should not have a card body at card:${o+1}, side:${a+1}, variant:${s+1}.`),i}validateTagChainsRecursive(e,t,r,i,o,a,s){if(!i)return{validated:[]};let n;const l=[...i],c=this.convertTagsToTypeKeyMap(e,t,r,o),p=(e,t,r)=>{c.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};t===br?(a&&p(fr.CardSet,1,0),p(fr.TextFormat,1,0),p(fr.BodyText,u,0),p(fr.BodyTextPlain,u,0),p(fr.PlainTextDivider,u,0),p(fr.FooterDivider,u,0)):t===yr&&p(fr.CardText,u,0);for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:p,key:d}=o;let u=(0,_r.Enum)(fr).fromValue(p);if(!u)continue;let m=u;u!==fr.Property&&u!==fr.Resource||(m=d);let h=c.get(m);if(!h&&u===fr.Property){const t=d.replace(/^@/,"&");if((t===ce.resource_backgroundWallpaper||t===ce.resource_imagePlaceholder||t===ce.resource_platformIcon||t===ce.resource_platformLogo||t===ce.resource_platformBackgroundImage||t===ce.resource_coverImage)&&(h=c.get(t),h)){u=fr.Resource,o.type=fr.Resource;const r=`Falling back to '[${t}]' from '[${d}]'. Replace '[${d}]' with '[&${d}]' to avoid this warning.`;e.addWarning(r)}}const{validated:g,warning:f}=this.validateSingleTag(e,t,r,o,u,h,a);u===fr.Resource&&(s=fr.Resource);let b=!0;if(!g)if(t===kr&&s!==fr.Resource){n=o;const e=l.slice(i+1);e.length>0&&(n.chain=e),l.splice(i),b=!1}else l.splice(i,1,null);if(f&&b&&e.addWarning(f.warning??"",f.content,f.previousContent),t===kr&&h&&h.chain&&g&&!g.chain){const e=l.slice(i+1);e.length>0&&(g.chain=e),l.splice(i+1)}if(g&&Array.isArray(g.chain)&&g.chain.length>0)if(h&&h.chain){const{validated:t,remaining:o}=this.validateTagChainsRecursive(e,kr,r,g.chain,h.chain,void 0,g.type);t&&t.length>0?g.chain=t:g.chain=void 0,o&&l.splice(i+1,0,o)}else if(g.type!==fr.Resource){const e=g.chain[0];g.chain.length>1&&(e.chain=g.chain.slice(1)),l.splice(i+1,0,e),g.chain=void 0}}for(const t of c.values()){const{minCount:r,_seenCount:i}=t;if(null!=r&&i<r){const i=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(i)}}return{validated:l.filter(e=>null!=e),remaining:n}}validateSingleTag(e,t,r,i,o,a,s){const{type:n,key:l}=i,c=a?this.getTagSignature(a):this.getUnknownTagSignature(n,l),p=" It will be ignored";let d,u,m="";if(a)switch(a._seenCount++,o){case fr.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i);d=o,u=s;break}case fr.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i);d=o,u=s;break}case fr.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,s);d=t,u=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i);d=o,u=s}}else switch(o){case fr.Property:u={extraProperty:!0},t!==kr&&(d=i);break;case fr.Resource:u={excessResource:!0},d=i;break;default:u={invalid:!0}}if(u){const e=a?._previous;u.invalid||u.excessResource?m=`${c} is not valid here (incorrectly chained?).${p}`:null!=u.tooMany?(m=`${c} is included more than the required ${u.tooMany} time(s).`,0===u.tooMany&&o===fr.Resource&&(m+=` Did you forget the '${l}' in the bit header?`),u.tooMany>0&&(m+=" The earlier ones will be ignored")):u.extraProperty?m=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:u.unexpectedCardSet?m=`${c} is not expected here.${p}`:u.unexpectedCardSideVariant&&(m=`${c} has a card / side / variant that is not expected here.${p}`),u.warning=m,u.content=d,u.previousContent=e}return a&&(a._previous=i),{validated:d,warning:u}}validateStandardTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateResourceTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==u&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:a}=i,s=a;let n,l=0,c=0;for(const r of s.cards){l=0;for(const i of r.sides){c=0;for(const r of i.variants){const o=r.content;let a;const s=ve.getCardSetVariantConfig(t,l,c);if(s){a=this.validateTagChainsRecursive(e,yr,t,o,s.tags).validated}else n={unexpectedCardSideVariant:!0};a&&a.length>0?i.variants[c]={parser:r.parser,content:a}:i.variants[c]={parser:r.parser,content:[]},c++}l++}}return{content:i,warning:n}}checkBodyForCommonPotentialMistakes(e,t,r){if(!r)return;const{bitType:i}=e;for(const t of Cr)r.includes(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`);for(const t of wr)r.startsWith(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`);for(const t of Ar)r.endsWith(t)&&e.addWarning(`Bit '${i}' might contain a mistake: ${t}`)}convertTagsToTypeKeyMap(e,t,r,i){const o=new Map;for(const e of Object.values(i)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===W,isProperty:e.type===H,isResource:e.type===G,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 r=(0,_r.Enum)(fr).fromValue(e.tag);r&&o.set(r,t)}}return o}getTagSignature(e){switch(e._type){case W:case H:case G:return`[${e._configKey}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case fr.Property:case fr.Resource:return`[${t}]`;default:return t?`'${e}' tag '${t}'`:`'${e}' tag`}}},Sr=new class{concatenatePlainTextWithAstTexts(e,t,r){if(Array.isArray(e)){if(r=r&&r.trim()){const i=r.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:qe.hardBreak});for(let e=0;e<i.length;e++){const t=i[e];t&&o.push({text:t,type:qe.text}),e<i.length-1&&o.push({type:qe.hardBreak})}const a=e[e.length-1];a&&a.type===qe.paragraph?a.content=[...a.content??[],...o]:e.push({type:qe.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${r??""}`}},Pr=new Mt,Ir=new class{process(e,t,r,i,o,a,s,n){const l=[];let c,p;const d=s.length>0?this.trimBodyParts(s):void 0,u=n?d:Br.checkBody(e,t,r,i,d);if(i===x.json&&u){c=u.reduce((e,t)=>{if(t.type===De.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="",r="",o=0;const a=e=>`[!${e}]`;if(u)for(let i=0;i<u.length;i++){const s=u[i];if(s.type===De.text){const i=s,o=i.data.bodyText;i.data.isPlain?t=dt.concatenate(t,o):e=dt.concatenate(e,o),r=dt.concatenate(r,o)}else{const t=a(o);e=dt.concatenate(e,t),l.push(s),o++}}const s=i===x.bitmarkText?Pr.toAst(e,{format:i,location:je}):dt.unbreakscape(e,{format:x.plainText,location:je}),n=dt.unbreakscape(t,{format:x.plainText,location:je}),d=se.countOccurrencesAtEnd(e,"\n")+se.countOccurrencesAtStart(t,"\n");c=Sr.concatenatePlainTextWithAstTexts(s,d,n),p=dt.unbreakscape(r,{format:i,location:je}).trim();const m=Array.isArray(c)?c:void 0;if(m&&u){o=0;for(let e=0;e<u.length;e++){const t=u[e];if(t.type===De.text)continue;const r=t;let i;switch(t.type){case De.gap:case De.mark:case De.select:case De.highlight:i=r}i&&this.replacePlaceholderWithBodyBit(m,i,o),o++}}}return{body:c,bodyBits:l.length>0?l:void 0,bodyString:p}}buildBodyText(e,t){return{type:De.text,data:{bodyText:e,isPlain:t}}}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,a)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[a]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}trimBodyParts(e){let t=!1,r=e.reduce((e,r)=>{const i=r;if(t||i.type!==De.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e},[]);return t=!1,r=r.reduceRight((e,r)=>{const i=r;if(t||i.type!==De.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e},[]),r}};function Lr(e,t,r,i,o,a,s,n){const{bitConfig:l}=e;e.DEBUG_CARD_SET&&e.debugPrint("card set",i);let c={};const p=function(e,t){const r={cards:[],internalComments:[]};if(!t)return r;const{bitType:i}=e;let o=0,a=0,s=0;for(const n of t.cards){const t={no:o++,sides:[],qualifier:n.qualifier};r.cards.push(t);for(const o of n.sides){const n={no:a++,variants:[],qualifier:o.qualifier};t.sides.push(n);for(const l of o.variants){const{parser:o,content:c}=l,p={parser:o,no:s++,qualifier:l.qualifier};n.variants.push(p);const d=ve.getTagsConfigForCardSet(i,a,s),u=e.bitContentProcessor(yr,d,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",u),u.cardBody=Br.checkCardBody(e,yr,i,u.cardBody,t.no,n.no,p.no),u.cardBodyStr=u.cardBody?.bodyString,p.data=u,u.internalComments&&r.internalComments.push(...u.internalComments)}s=0}a=0}return r}(e,i),u=l.cardSet?.configKey;switch(u){case _:case C:c=function(e,t,r){const i=[],o=[];let a,s,n,l="",c=[],p=0,u={};const m=t===d.flashcard1,h=Vr(r);for(let g=0;g<r.cards.length;g++){const f=r.cards[g];if(!h||0!==g){a=void 0,s=void 0,c=[],p=0,u={};for(const e of f.sides)for(const t of e.variants){const{cardBody:e,resources:r,...i}=t.data;u={...u,...i};const o=r&&r.length>0?r[0]:void 0,d=e?.body;0===p?(n=t,l=e?.bodyString??"",a={text:d,icon:o}):1===p?s={text:d,icon:o}:c.push({text:d,icon:o}),p++}if(0!==g&&m){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${l}'`,n);break}if(ve.isOfBitType(t,[d.flashcard])){const e={question:a,answer:s,alternativeAnswers:c,...u};e&&i.push(e)}else{const e={term:a,definition:s,alternativeDefinitions:c,...u};e&&o.push(e)}}}return{heading:h?.heading,flashcards:i.length>0?i:void 0,definitions:o.length>0?o:void 0}}(e,t,p);break;case w:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=t.cardBody?.body??t.cardBodyStr??dt.EMPTY_STRING;i.push(r)}return{elements:i.length>0?i:void 0}}(0,0,p);break;case A:c=function(e,t,r,i,o){const a=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{statements:t,statement:r,...i}=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,...i};t&&a.push(t)}}i&&a.push(i);Array.isArray(o)&&o.length>0&&a.push(...o);return{statements:a.length>0?a:void 0}}(0,0,p,o,a);break;case S:c=function(e,t,r){let i;const o=[],a=Vr(r);for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(!a||0!==e){i=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];for(const t of r.variants){const r=t.data,{cardBody:a,cardBodyStr:s,choices:n,...l}=r;if(0===e){const e=[];if(n&&n.length>0)for(const t of n){const{__isDefaultExample:r,example:i,...o}=t,a={choice:o.choice,requireReason:o.isCorrect,__isDefaultExample:r,example:i};e.push(a)}i={...r,choices:e},i&&o.push(i)}else if(1===e){const e={text:s??"",__textAst:a?.body,...l};i&&(i.reason=e)}}}}}return{heading:a?.heading,feedbacks:o.length>0?o:void 0}}(0,0,p);break;case B:c=function(e,t,r,i,o){const a=[],s=ve.isOfBitType(t,d.multipleChoice),n=ve.isOfBitType(t,d.multipleResponse);if(!s&&!n)return{};let l,c=!1;for(const e of r.cards){c=!1,l=void 0;for(const t of e.sides)for(const e of t.variants){const{__isDefaultExample:t,example:r,...i}=e.data;if(c=!0===t||c,l=r||l,i.trueFalse&&i.trueFalse.length>0){const e=[];for(const t of i.trueFalse){const{__isDefaultExample:r,example:i,...o}=t,a=r||c,s=i||l,p={isCorrect:o.isCorrect,__isDefaultExample:a,example:s};n?p.response=o.text:p.choice=o.text,p&&e.push(p)}n?i.responses=e:i.choices=e}const o={...i,choices:i.choices,responses:i.responses,__isDefaultExample:c,__defaultExample:l};o&&a.push(o)}}if(s&&Array.isArray(i)&&i.length>0){const e={choices:i};e&&a.push(e)}if(n&&Array.isArray(o)&&o.length>0){const e={responses:o};e&&a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,p,s,n);break;case P:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r={question:t.cardBody?.body??t.cardBodyStr??dt.EMPTY_STRING,...t};r&&i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,p);break;case I:c=function(e,t,r){const i=[];let o,a,s,n,l=[],c=[],p={},u=!1;const m=ve.isOfBitType(t,d.matchMatrix),h=Vr(r,m),g=h?.isDefaultExampleCardSet??!1;let f=h?.exampleCardSet;for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(h&&0===e)continue;o=void 0,l=[],c=[],a=void 0,s=void 0,p={},u=!1,n=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];for(const t of r.variants){const{cardBody:r,cardBodyStr:i,resources:d,__isDefaultExample:m,example:h,...f}=t.data;if(u=!0===m||u,n=h||n,0===e)if(Array.isArray(d)&&d.length>0){const e=d[0];e.type===ne.audio?a=e:e.type===ne.image&&(s=e)}else o=i;else{const e=i??"",t=r?.body;l.push(e),c.push(t),!g&&!u||n||(n=t),delete f.item,delete f.lead}p={...p,...f}}}u&&(f=void 0);const d=u||g,m=n||f,b={key:o??"",keyAudio:a,keyImage:s,values:l,__valuesAst:c,...p,__isDefaultExample:d,example:m};b&&i.push(b)}return{heading:h?.heading,pairs:i.length>0?i:void 0}}(0,t,p);break;case E:c=function(e,t,r){let i,o;const a=[];let s,n,l,c,p=[],d=[],u=[],m={},h=!1,g=!1;const f=Vr(r,!0),b=f?.isDefaultExampleCardSet??!1;let y=f?.exampleCardSet;for(let e=0;e<r.cards.length;e++){const t=r.cards[e];if(f&&0===e)continue;i=void 0,o=void 0,p=[],d=[],u=[],h=!1,s=void 0,l=void 0;for(let e=0;e<t.sides.length;e++){const r=t.sides[e];d=[],u=[],m={},g=!1,n=void 0,c=void 0;for(const t of r.variants){const r=t.data,{cardBody:a,cardBodyStr:p,__isDefaultExample:f,example:y,isCaseSensitive:k,...v}=r;if(g=!0===f||g,n=y||n,Object.assign(m,v),0===e)i=p,o=v,h=!0===f||h,s=y||s,l=null!=k?k:l;else{const e=p??dt.EMPTY_STRING,t=a?.body;d.push(e),u.push(t),!b&&!g||n||(n=t),c=null!=k?k:l}}if(e>0){g&&(s=y=void 0),h&&(y=void 0);const e=g||h||b,t=n||s||y,r={values:d,__valuesAst:u,...m,__isDefaultExample:e,example:t,isCaseSensitive:c};r&&p.push(r)}}const k={key:i??dt.EMPTY_STRING,cells:p,...o};k&&a.push(k)}return{heading:f?.heading,matrix:a.length>0?a:void 0}}(0,0,p);break;case F:c=function(e,t,r){const i=[];let o=[];for(const e of r.cards){o=[];for(const t of e.sides)for(const e of t.variants){const t=e.data,{title:r,cardBody:i,resources:a}=t,s=r&&r[1].titleAst,n=a&&a.length>0?a.find(e=>e.type===ne.audio):void 0,l={title:s??[],body:i?.body??[],audio:n};o.push(l)}i.push(o)}return{pronunciationTable:{data:i}}}(0,0,p);break;case N:case R:c=function(e,t,r){const i={header:[],body:[],footer:[]},o=t=>{if(!t)return;const r=t.trim().toLowerCase();return"table-header"===r?"header":"table-body"===r?"body":"table-footer"===r?"footer":void e.addWarning(`Unknown table section qualifier '${t}', defaulting to body.`)},a=(e,t)=>0===t&&e.sides.some(e=>e.variants.some(e=>{const t=e.data.title;return Array.isArray(t)&&t[1]?.titleAst})),s=(e,t)=>{if(!e)return;const r=e[t];return Array.isArray(r)?r[0]:r},n=(e,t)=>{const r=e.extraProperties;if(r){for(const e of t)Object.prototype.hasOwnProperty.call(r,e)&&delete r[e];0===Object.keys(r).length&&delete e.extraProperties}},l=(t,r)=>{if("string"==typeof t){const i=t.trim().toLowerCase();if("th"===i||"td"===i)return i;e.addWarning(`Invalid table cell type '${t}', using default for section '${r}'.`)}return"body"===r?"td":"th"},c=(t,r)=>{if(null==t)return 1;const i=zt.asNumber(t);return null==i||!Number.isInteger(i)||i<1?(e.addWarning(`Invalid table ${r} '${t}', defaulting to 1.`),1):i},p=t=>{if(null==t)return;if("string"!=typeof t)return void e.addWarning(`Invalid table scope '${t}', ignoring.`);const r=t.trim().toLowerCase();switch(r){case"row":case"col":case"rowgroup":case"colgroup":return r;default:return void e.addWarning(`Invalid table scope '${t}', ignoring.`)}},d=(e,t)=>{const r=e.data,i=r.title&&r.title[1]?.titleAst,o=r.cardBody?.body??r.cardBodyStr??dt.EMPTY_STRING,a=i??o,d=r.tableCellType??s(r.extraProperties,"tableCellType"),u=r.tableRowSpan??s(r.extraProperties,"tableRowSpan"),m=r.tableColSpan??s(r.extraProperties,"tableColSpan"),h=r.tableScope??s(r.extraProperties,"tableScope");n(r,["tableCellType","tableRowSpan","tableColSpan","tableScope"]);const g=l(d,t),f=c(u,"rowspan"),b=c(m,"colspan"),y=p(h),k={content:a};return"th"===g&&(k.title=!0),f>1&&(k.rowspan=f),b>1&&(k.colspan=b),y&&(k.scope=y),k},u=e=>{const t=o(e.qualifier);if(t)return t;for(const t of e.sides){const e=o(t.qualifier);if(e)return e;for(const e of t.variants){const t=o(e.qualifier);if(t)return t}}};for(let e=0;e<r.cards.length;e++){const t=r.cards[e],o=u(t),s=o||(a(t,e)?"header":"body"),n=[];for(const e of t.sides)for(const t of e.variants)n.push(d(t,s));i[s].push({cells:n})}const m={},h=i.header.length>0,g=i.body.length>0,f=i.footer.length>0;h&&(m.header={rows:i.header});g&&(m.body={rows:i.body});f&&(m.footer={rows:i.footer});h||g||f||(m.header={rows:[]},m.body={rows:[]},m.footer={rows:[]});return{table:m}}(e,0,p);break;case O:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{__instructionString:t,__itemString:r,reaction:o,cardBodyStr:a,...s}=e.data,n={response:t??dt.EMPTY_STRING,reaction:o??dt.EMPTY_STRING,feedback:a??dt.EMPTY_STRING,...s,item:r??dt.EMPTY_STRING};n&&i.push(n)}return{botResponses:i.length>0?i:void 0}}(0,0,p);break;case q:c=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{title:t,__instructionString:r,unit:o,unitAbbr:a,decimalPlaces:s,disableCalculation:n,cardBodyStr:l,cardBody:c,...p}=e.data,d=Array.isArray(t)&&t.length>0?t[t.length-1].titleString:void 0;let u=!1,m=zt.asNumber(r);if(c&&c.bodyBits){const e=c.bodyBits.find(e=>e.type===De.select);e&&(m=e.__instructionString?zt.asNumber(e.__instructionString):m,e.options&&e.options.length>0&&(u=e.options[0].isCorrect))}const h={title:d,checked:u,ingredient:l,quantity:m,unit:o??dt.EMPTY_STRING,unitAbbr:a??dt.EMPTY_STRING,decimalPlaces:s??1,disableCalculation:n,...p};h&&i.push(h)}return{ingredients:i.length>0?i:void 0}}(0,0,p);break;case M:case D:case z:c=function(e,t,r,i){const o=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{cardBody:t,...r}=e.data,i={body:t,...r};i&&o.push(i)}return{cardBits:o.length>0?o:void 0}}(0,0,0,p)}return c.internalComments=p.internalComments.length>0?p.internalComments:void 0,c}function Vr(e,t=!1){let r,i,o=!1;const a=[];let s,n=!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 r=t.variants[0].data,{title:c,__isDefaultExample:p,example:d}=r,u=c&&c[1].titleString;null!=u&&(o=!0),0===e?o&&(i=u,n=!0===p||n,s=d||s):o&&(a.push(u??""),n=!0===p||n,s=d||s)}if(o){let e=a;e=t?a:a.length>=1?a[a.length-1]:"",r={forKeys:i??"",forValues:e}}return r?{heading:r,isDefaultExampleCardSet:n,exampleCardSet:s}:void 0}function Er(e,t,r,i,o){const{type:a,value:s}=i,{textFormat:n}=e,l=new Mt,c=se.trimmedString(s);switch(a){case fr.Instruction:o.instruction=l.toAst(c,{format:n,location:Ue}),o.__instructionString=dt.unbreakscape(c,{format:x.bitmarkText,location:Ue});break;case fr.Hint:o.hint=l.toAst(c,{format:n,location:Ue}),o.__hintString=dt.unbreakscape(c,{format:x.bitmarkText,location:Ue});break;case fr.Anchor:o.anchor=dt.unbreakscape(c,{format:x.bitmarkText,location:Ue});break;case fr.Reference:o.reference=dt.unbreakscape(c,{format:x.bitmarkText,location:Ue});break;case fr.SampleSolution:o.sampleSolution=dt.unbreakscape(c,{format:x.bitmarkText,location:Ue}),o.__sampleSolutionAst=l.toAst(c,{format:n,location:Ue}),e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",i)}}var Nr=new Mt,Rr=new class{process(e,t,r,i,o,a){const{textFormat:s}=e;let n;o=o.trimStart(),a=a.trimEnd();const l=!!o.trim(),c=!!a.trim();let p=0;if(l&&c&&(p=se.countOccurrencesAtEnd(o,"\n")+se.countOccurrencesAtStart(a,"\n")),o||a){const r=s===x.bitmarkText;o&&(o=Br.checkFooter(e,t,o));const i=r?Nr.toAst(o,{format:s,location:je}):dt.unbreakscape(o,{format:x.plainText,location:je}),l=dt.unbreakscape(a,{format:x.plainText,location:je});n=Sr.concatenatePlainTextWithAstTexts(i,p,l)}return n?{footer:n}:void 0}},Fr=r(722),Or=new Mt;function Dr(e,t,r,i,o,a){if(t===kr)!function(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=o.solutions,l=o.__solutionsAst;if(n&&l&&se.isString(s)){const e=se.trimmedString(s);n.push(dt.unbreakscape(e,{format:x.bitmarkText,location:Ue}));const t=Or.toAst(e,{format:a,location:Ue});l.push(t)}}(e,0,0,i,o);else{const t=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",i);const o=ve.getTagConfigForTag(r,(0,Fr.Enum)(f).fromValue(i.type)),a=[i,...i.chain??[]],s=e.bitContentProcessor(kr,o?.chain,a);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",s);const n={type:De.gap,...s};return n}(e,0,r,i);t&&a.push(t)}}var Mr=r(722);function qr(e,t,r,i,o){t===kr?function(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=new Mt,l=se.trimmedString(s);o.itemLead||(o.itemLead=[]);const c=n.toAst(l,{format:a,location:Ue});o.itemLead.push(c),o.__itemLeadString||(o.__itemLeadString=[]),o.__itemLeadString.push(dt.unbreakscape(l,{format:x.bitmarkText,location:Ue}))}(e,0,0,i,o):function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("item lead content",i);const a=ve.getTagConfigForTag(r,(0,Mr.Enum)(f).fromValue(i.type)),s=[i,...i.chain??[]],n=e.bitContentProcessor(kr,a?.chain,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("item lead TAGS",n);o.itemLead=n.itemLead,o.__itemLeadString=n.__itemLeadString}(e,0,r,i,o)}var zr=r(722);function $r(e,t,r,i,o,a){if(t===kr)!function(e,t,r,i){const{value:o}=r;se.isString(o)&&(i.solution=se.trimmedString(o))}(0,0,i,o);else{const t=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",i);const o=ve.getTagConfigForTag(r,(0,zr.Enum)(f).fromValue(i.type)),a=e.bitContentProcessor(kr,r,[i]),s=e.bitContentProcessor(kr,o?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",s);const{solution:n}=a,{mark:l,...c}=s,p={type:De.mark,solution:n??"",mark:ht.asSingle(l)??"",...c};return p}(e,0,r,i);t&&a.push(t)}}var Jr=r(722);function Ur(e,t,r,i,o){t===kr||function(e,t,r,i,o){const{bitConfig:a}=e;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",i);const s=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:l}=s,c=dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:Ue}),p=a.tags[ce.property_book];if(p&&(p.maxCount===u||p.maxCount>1))return Array.isArray(o.book)||(o.book=[]),void o.book.push({book:c,reference:n??"",referenceEnd:l??void 0});o.book=c,o.reference=n,o.referenceEnd=l}(e,0,r,i,o)}var jr=new Mt;function Wr(e,t,r,i){const{bitType:o}=e,{value:a}=r,s=a;ve.isOfBitType(o,[d.cloze,d.clozeAndMultipleChoiceText,d.multipleChoiceText,d.highlightText,d.trueFalse,d.trueFalse1,d.multipleResponse,d.multipleResponse1,d.multipleChoice,d.multipleChoice1])?function(e,t,r,i){const{bitType:o,textFormat:a}=e;let s;Array.isArray(i.trueFalse)&&i.trueFalse.length>0&&(s=i.trueFalse[i.trueFalse.length-1]??void 0);s?!0===r?(s.__isDefaultExample=!0,s.example=!!s.isCorrect):qt.isBooleanString(r)?s.example=qt.toBoolean(r):(s.__isDefaultExample=!0,s.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t)):Array.isArray(i.__solutionsAst)&&i.__solutionsAst.length>0?i.example=!0===r?i.__solutionsAst[i.__solutionsAst.length-1]??void 0:r?jr.toAst(r,{format:a,location:Ue}):void 0:ve.isOfBitType(o,[d.multipleChoiceText,d.highlightText,d.trueFalse,d.trueFalse1,d.multipleResponse,d.multipleResponse1])?function(e,t,r,i){if(!0===r)i.__isDefaultExample=!0,i.example=void 0;else{const o=r?dt.unbreakscape(r,{format:x.bitmarkText,location:Ue}):void 0;qt.isBooleanString(o)?i.example=qt.toBoolean(o):(i.__isDefaultExample=!0,i.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t))}}(e,t,r,i):ve.isOfBitType(o,[d.clozeAndMultipleChoiceText,d.multipleChoice,d.multipleChoice1])?(i.__isDefaultExample=!0,i.example=void 0,!0!==r&&e.addWarning("At this level, only default [@example] is allowed, using default",t)):Hr(e,t,r,i)}(e,r,s,i):ve.isOfBitType(o,d.mark)?function(e,t,r,i){i.__isDefaultExample=!0,i.example=void 0,!0!==r&&e.addWarning("Only default [@example] is allowed, using default",t)}(e,r,s,i):Hr(e,r,s,i)}function Hr(e,t,r,i){const{textFormat:o}=e;!0===r||"true"===r?(i.__isDefaultExample=!0,i.example=void 0):i.example=r?jr.toAst(r,{format:o,location:Ue}):void 0}var Gr=r(722);function Kr(e,t,r,i,o){t===kr?function(e,t,r,i,o){const{value:a}=i,s=dt.unbreakscape(se.trimmedString(a),{format:x.bitmarkText,location:Ue});o.imageSourceUrl=s}(0,0,0,i,o):function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",i);const{key:a}=i,s=ve.getTagConfigForTag(r,(0,Gr.Enum)(ce).fromValue(a)),n=e.bitContentProcessor(kr,r,[i]),l=e.bitContentProcessor(kr,s?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",l);const{imageSourceUrl:c}=n,{mockupId:p,...d}=l;c||e.addWarning("[@imageSource] is missing the image url",i);p||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",i);const u={url:c??"",mockupId:p??"",...d};o.imageSource=u}(e,0,r,i,o)}var Yr=r(722);function Qr(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("person content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("person TAGS",a);const{propertyTitle:s,resources:n}=a,l=dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:Ue}),c=se.trimmedString(s),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||ne.image!==e.type?i.push(e):r=e;i.length>0&&e.addWarning(`${i.length} excess resource(s) present in the [@person] chain.`);return r}(e,n),d={name:l,title:c,avatarImage:p};o.person=d}var Xr=new Mt;var Zr=new Mt;function ei(e,t,r,i,o){const{value:a}=i,{key:s}=i,n=t===kr,l=ve.getTagConfigForTag(r,(0,Jr.Enum)(ae).fromValue(s)),c=l?l.configKey:void 0;let p=de(s);if(c===ce.property_internalComment)return void function(e,t,r,i){if(!i.internalComments)return;const{value:o}=r,a=se.isString(o)?se.trimmedString(o):void 0;a&&i.internalComments.push(a)}(0,0,i,o);if(l){if(c===ce.property_example)return void Wr(e,0,i,o);if(c===ce.property_groupTag)return void function(e,t,r,i,o){const{value:a}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("groupTag content",i);const s=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("groupTag TAGS",s);const{tag:n}=s,l={name:se.trimmedString(a)??"",tags:n??[]};Array.isArray(o.groupTag)||(o.groupTag=[]),o.groupTag.push(l)}(e,0,l.chain,i,o);if(c===ce.property_ratingLevelStart||c===ce.property_ratingLevelEnd)return void function(e,t,r,i,o){const{textFormat:a}=e,{key:s,value:n}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("ratingLevel content",i);const l=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("ratingLevel TAGS",l);const{label:c}=l,p={level:zt.asNumber(n)??0,label:c?Xr.toAst(c,{format:a,location:Ue}):void 0};switch(s){case ce.property_ratingLevelStart:o.ratingLevelStart=p;break;case ce.property_ratingLevelEnd:o.ratingLevelEnd=p}}(e,0,l.chain,i,o);if(c===ce.property_technicalTerm)return void function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("technicalTerm content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("technicalTerm TAGS",a);const{lang:s}=a,n={technicalTerm:dt.unbreakscape(se.trimmedString(i.value),{format:x.bitmarkText,location:Ue}),lang:s};o.technicalTerm=n}(e,0,l.chain,i,o);if(c===ce.property_servings)return void function(e,t,r,i,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("servings content",i);const a=e.bitContentProcessor(kr,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("servings TAGS",a);const{unit:s,unitAbbr:n,decimalPlaces:l,disableCalculation:c,__hintString:p}=a,d={servings:zt.asNumber(i.value)??1,unit:s,unitAbbr:n,decimalPlaces:l??1,disableCalculation:c,hint:p};o.servings=d}(e,0,l.chain,i,o);if(c===ce.property_person||c===ce.property_partner)return void Qr(e,0,l.chain,i,o);if(c===ce.property_imageSource)return void Kr(e,t,r,i,o);if(c===ce.property_book)return void Ur(e,t,l.chain,i,o);if(c===ce.property_mark&&!n)return void function(e,t,r,i,o){const{key:a}=i;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",i);const s=o.markConfig;if(!s)return;const n=ve.getTagConfigForTag(r,(0,Yr.Enum)(ce).fromValue(a)),{mark:l,...c}=e.bitContentProcessor(kr,n?.chain,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const p={mark:dt.unbreakscape(se.trimmedString(i.value)??"unknown",{format:x.bitmarkText,location:Ue}),emphasis:"underline",...c};p&&s.push(p)}(e,0,r,i,o);c===ce.property_title&&n&&(p="propertyTitle")}const d=(e,t,r,i)=>{if(r=(e=>{if(null!=e){if(i)switch(i.format){case b:return dt.unbreakscape(se.isString(e)?se.trimmedString(e):void 0,{format:x.plainText,location:Ue});case k:return zt.asNumber(dt.unbreakscape(e,{format:x.plainText,location:Ue}));case v:return qt.toBoolean(dt.unbreakscape(e,{format:x.plainText,location:Ue}),!0);case T:return!qt.toBoolean(dt.unbreakscape(e,{format:x.plainText,location:Ue}),!0);case y:return e=se.isString(e)?e:"",Zr.toAst(e,{format:x.bitmarkText,location:Ue})}return dt.unbreakscape(e,{format:x.plainText,location:Ue})}})(r),null==i||i.array)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r];else e[t]=r};d(l?o:o.extraProperties,p,a,l),c===ce.property_sampleSolution&&d(o,"__sampleSolutionAst",a,new X({configKey:ce.property_sampleSolution,tag:"sampleSolution",maxCount:1,minCount:1,chain:void 0,jsonKey:void 0,format:y,defaultValue:void 0,deprecated:void 0}))}function ti(e,t,r,i,o,a){const{value:s}=i,n=se.trimmedString(s);a?o.referenceEnd=dt.unbreakscape(n,{format:x.bitmarkText,location:Ue}):o.reference=dt.unbreakscape(n,{format:x.bitmarkText,location:Ue})}var ri=r(722),ii=new Gt;function oi(e,t,r,i,o){const{type:a,key:s,value:n,chain:l}=i,c=o.resources;if(!c)return;const p=(0,ri.Enum)(ce).fromValue(s);if(!p)return;const d=(0,ri.Enum)(ne).fromKey(p.replace(/^&/,""))??ne.unknown,u=ve.getTagConfigForTag(r,p),{posterImage:m,...h}=e.bitContentProcessor(kr,u?.chain,l);let g;if(m){const{subConfig:t,subChain:r}=function(e,t,r){let i;e&&(i=e[r]?.chain);const o=t?.reduce((e,t)=>{if(e)return e;const i=t;return i.key===r?i.chain:void 0},void 0);return{subConfig:i,subChain:o}}(u?.chain,l,ce.property_posterImage),{posterImage:i,...o}=e.bitContentProcessor(kr,t,r);g=ii.resource(e,{type:ne.image,value:m,...o}).image}const f=ii.resource(e,{type:d,value:dt.unbreakscape(n,{format:x.bitmarkText,location:Ue}),posterImage:g,...h});f&&(p===ce.resource_backgroundWallpaper||p===ce.resource_imagePlaceholder||p===ce.resource_platformIcon||p===ce.resource_platformLogo||p===ce.resource_platformBackgroundImage||p===ce.resource_previewImage||p===ce.resource_previewVideo||p===ce.resource_coverImage?o.propertyStyleResources&&(o.propertyStyleResources[d]?(Array.isArray(o.propertyStyleResources[d])||(o.propertyStyleResources[d]=[o.propertyStyleResources[d]]),o.propertyStyleResources[d].push(f)):o.propertyStyleResources[d]=f):c.push(f))}var ai=new Mt;function si(e,t,r,i,o){const{textFormat:a}=e,{value:s}=i,n=o.title;if(!n)return;const l=s,c=se.trimmedString(l.title);n[l.level.length]={titleAst:ai.toAst(c??"",{format:a,location:Ue}),titleString:c??""}}var ni=new Mt;function li(e,t,r,i,o,a){t===kr?function(e,t,r,i){const{textFormat:o}=e,{type:a,value:s}=r,n=i.trueFalse;if(!n)return;const l=dt.unbreakscape(se.trimmedString(s),{format:x.bitmarkText,location:Ue}),c=ni.toAst(l??"",{format:o,location:Ue});n.push({text:l,textAst:c,isCorrect:a===fr.True,__isDefaultExample:!1})}(e,0,i,o):function(e,t,r,i,o,a){const{bitType:s}=e,n=[i,...i.chain??[]],l=o.statements,c=o.choices,p=o.responses;if(!(l&&c&&p&&a))return;if(ve.isOfBitType(s,d.trueFalse1))o.statement=function(e,t,r){const{bitType:i}=e;if(!ve.isOfBitType(i,d.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const{trueFalse:o,...a}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",a);let s,n;o&&o.length>0&&(n=o[0]);if(n){const{statement:e,...t}=a;s={...n,statement:n.text,...t}}return s}(e,r,n);else if(ve.isOfBitType(s,[d.trueFalse,d.multipleChoice,d.multipleChoice1,d.multipleResponse,d.multipleResponse1,d.feedback])){const t=function(e,t,r){const{bitType:i}=e,o=ve.isOfBitType(i,d.trueFalse),a=ve.isOfBitType(i,[d.multipleChoice,d.multipleChoice1,d.feedback]),s=ve.isOfBitType(i,[d.multipleResponse,d.multipleResponse1]);if(!o&&!a&&!s)return{};const n=[],l=[],c=[],p=e.splitBitContent(r,[fr.True,fr.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",p);for(const r of p){const{trueFalse:i,...p}=e.bitContentProcessor(kr,t,r);let d;if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",p),i&&i.length>0&&(d=i[0]),d)if(o){const{statement:e,...t}=p,r={...d,statement:d.textAst??[],...t};r&&n.push(r)}else if(a){const e={...d,choice:d.text,...p};e&&l.push(e)}else if(s){const e={...d,response:d.text,...p};e&&c.push(e)}}const u={};o?u.statements=n:a?u.choices=l:s&&(u.responses=c);return u}(e,r,n);t.statements&&l.push(...t.statements),t.choices&&c.push(...t.choices),t.responses&&p.push(...t.responses)}else if(ve.isOfBitType(s,d.highlightText)){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const{trueFalse:i,...o}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",{trueFalse:i,...o});const a=[];if(i)for(const e of i){const t={...e,isHighlighted:!1};t&&a.push(t)}const s={type:De.highlight,texts:a,...o};return s}(e,r,n);t&&a.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const{trueFalse:i,...o}=e.bitContentProcessor(kr,t,r);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",{trueFalse:i,...o});const a=[];if(i)for(const e of i){const t=e;t&&a.push(t)}const s={type:De.select,options:a,...o};return s}(e,r,n);t&&a.push(t)}}(e,0,r,i,o,a)}var ci=!1,pi=!0,di=!0,ui=!0,mi=!0,hi=new Kt,gi=class{constructor(e){l(this,"context"),l(this,"nonFatalWarnings",[]),l(this,"nonFatalErrors",[]),l(this,"parser",{}),l(this,"parse"),l(this,"parserText"),l(this,"parserLocation"),this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={bitConfig:ve.getBitConfig(d._error),bitType:d._error,textFormat:x.bitmarkText,DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:ci,DEBUG_BIT_CONTENT:pi,DEBUG_BIT_TAGS:di,DEBUG_BODY:ui,DEBUG_FOOTER:mi,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 r=[];for(const i of e){if(!i)continue;const e=i.value;e?t.push(e):r=r.concat(i.errors??[])}return hi.buildBitmark({bits:t,errors:r.length>0?r:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:o,bitLevel:a,isCommented:s}=e;if(!r||ve.isOfBitType(r,d._error))return this.invalidBit();const n=ve.getBitConfig(r);this.context.bitConfig=n,this.context.bitType=r,this.context.textFormat=i,this.context.resourceType=o;const l=ve.isOfBitType(r,d.trueFalse1),c=ve.isOfBitType(r,d.multipleChoice1),p=ve.isOfBitType(r,d.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=this.squashUnwantedInlineBodyBits(t),t=Br.validateBitTags(this.context,t);const{body:m,footer:h,cardSet:g,title:f,statement:b,statements:y,choices:k,responses:v,propertyStyleResources:T,resources:x,posterImage:_,internalComments:C,...w}=this.bitContentProcessor(br,n.tags,t);this.debugPrint("BIT TAGS",w),this.debugPrint("BIT BODY",m),this.debugPrint("BIT FOOTER",h);const A=function(e,t,r){if(r=r??[],ve.isOfBitType(t,d.chapter)){let e;return r.length>0&&(e=r[r.length-1]),{title:e?.titleAst??[],titleString:e?.titleString??"",level:r.length>0?r.length-1:void 0}}return Array.isArray(r)?{title:r[1]?.titleAst??void 0,titleString:r[1]?.titleString??void 0,subtitle:r[2]?.titleAst??void 0,subtitleString:r[2]?.titleString??void 0}:{title:void 0,titleString:r??void 0,subtitle:void 0,subtitleString:void 0}}(this.context,r,f),B=Lr(this.context,r,0,g,b,y,k,v),S=function(e,t,r){const{bitType:i}=e,o=[],a=[],s=(0,ri.Enum)(ne).fromValue(t),n=ve.getBitResourcesConfig(i,s),l=n.resourceAttachmentAllowed,c=n.getCountsMin(),p=n.getCountsMax();if(r)for(const t of r.reverse()){const r=t.__configKey;let i=c.get(r)??0,s=p.get(r)??0;i=Math.max(0,i-1),s===u?o.unshift(t):s>0?(o.unshift(t),s--):a.unshift(t),c.set(r,i),p.set(r,s),t.__invalid&&e.addWarning(`Resource type [&${t.type}] is not valid`)}if(!l&&t){const r=`Resource type [&${t}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(r)}else 0===o.length&&t&&e.addWarning(`Resource type [&${t}] is specified in the bit header, but no such resource is present`);return a.forEach(e=>{e.__excessResource=!0,o.push(e)}),o}(this.context,o,x),P=[...C??[],...B.internalComments??[]],I=this.buildBitLevelWarnings(),L=this.buildBitLevelErrors();I&&(this.parser.warnings=I),L&&(this.parser.errors=L);return{value:hi.buildBit({bitType:r,bitLevel:a,isCommented:s,textFormat:i,resourceType:o,...A,posterImage:_,statement:l?b:void 0,choices:c?k:void 0,responses:p?v:void 0,...w,...T,resources:S,...B,body:m,footer:h,internalComment:P,parser:this.parser})}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:hi.buildBit({bitType:ve.getBitType(d._error),bitLevel:1,parser:this.parser})}}buildBitHeader(e,t,r){const i=dt.unbreakscape(e,{format:x.plainText,location:Ue}),o=ve.getBitType(i),a=ve.isBitTypeCommented(i);ve.isOfBitType(o,d._error)&&this.addError(`Invalid bit type: '${i}'`);const s=ve.getBitConfig(o);t>ve.bitLevelMax?(this.addWarning(`Bit level of ${t} too high, setting to max value of ${ve.bitLevelMax}`),t=ve.bitLevelMax):t<ve.bitLevelMin&&(this.addWarning(`Bit level of ${t} too low, setting to min value of ${ve.bitLevelMin}`),t=ve.bitLevelMin);let n=(0,xr.Enum)(x).fromValue(r.textFormat);r.textFormat&&!n&&this.addWarning(`Invalid text format '${r.textFormat}', defaulting to '${We.bitmarkPlusPlus}'`);const l=(0,xr.Enum)(ut).fromValue(r.textFormat);l&&(n=x.bitmarkText,this.addWarning(`${l} text format is deprecated. Bit will be parsed as '${We.bitmarkPlusPlus}'`)),n=n??s.textFormatDefault;const c=(0,xr.Enum)(ne).fromValue(r.resourceType);return r.resourceType&&!c&&this.addWarning(`Invalid resource type '${r.resourceType}', it will be ignored`),{bitType:o,bitLevel:t,textFormat:n??s.textFormatDefault,resourceType:c,isCommented:a}}buildTextAndResourceType(e,t){const r={},i=e=>{if(e){const t=dt.unbreakscape(se.string(e.value),{format:x.plainText,location:Ue});e.type===fr.TextFormat?r.textFormat=t:r.resourceType=t}};return i(e),i(t),r}resetParserState(){this.context.state={}}squashUnwantedInlineBodyBits(e){const t=[];if(!e)return t;const{textFormat:r}=this.context,i=r===x.bitmarkText,o=(e,t="")=>{const{chain:r,parser:i}=e;if(t+=i.text,r)for(const e of r)t=o(e,t);return t};let a=!1;for(const r of e){const{type:e,value:s}=r,n=s??"";let l=!1;if(a||(e===fr.BodyText&&!i&&n&&n.trim()&&(a=!0),e===fr.PlainTextDivider&&(a=!0,l=!0)),l)t.push({type:fr.BodyText,value:"\n"});else if(a)if(e===fr.BodyText)t.push({type:fr.BodyTextPlain,value:s});else{const e=o(r);t.push({type:fr.BodyTextPlain,value:e})}else t.push(r)}return t}bitContentProcessor(e,t,r){const i={};if(!r)return i;const{bitType:o,textFormat:a}=this.context;i.title=[],i.solutions=[],i.__solutionsAst=[],i.statements=[],i.choices=[],i.responses=[],i.propertyStyleResources={},i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.internalComments=[];let s=!1,n=!1;const l=[];let c=dt.EMPTY_STRING,p=dt.EMPTY_STRING,d=dt.EMPTY_STRING,u=dt.EMPTY_STRING;const m=e===br,h=e===yr,g=e===kr,f=()=>{if(c){c=Br.checkBodyPart(this.context,e,c);const t=Ir.buildBodyText(c,!1);l.push(t)}c=dt.EMPTY_STRING};for(const o of r){const{type:r,value:a}=o;switch(r){case fr.ItemLead:qr(this.context,e,t,o,i);break;case fr.Instruction:case fr.Hint:case fr.Anchor:case fr.SampleSolution:Er(this.context,0,0,o,i);break;case fr.Reference:ti(this.context,0,0,o,i,s),s=!0;break;case fr.Title:si(this.context,0,0,o,i);break;case fr.Property:ei(this.context,e,t,o,i);break;case fr.Gap:g||f(),Dr(this.context,e,t,o,i,l);break;case fr.Mark:g||f(),$r(this.context,e,t,o,i,l);break;case fr.True:case fr.False:g||f(),li(this.context,e,t,o,i,l);break;case fr.Resource:oi(this.context,0,t,o,i);break;case fr.CardSet:i.cardSet=a,n=!0;break;case fr.BodyText:case fr.CardText:n?p=dt.concatenate(p,a):c=dt.concatenate(c,a);break;case fr.BodyTextPlain:n?u=dt.concatenate(u,a):d=dt.concatenate(d,a);break;case fr.FooterDivider:n&&(p=dt.concatenate(p,a)),n=!0}}f();const b=d?Ir.buildBodyText(d,!0):void 0;if(b&&l.push(b),i.itemLead){const e=i.itemLead.length;e>0&&(i.item=i.itemLead[0]),e>1&&(i.lead=i.itemLead[1]),e>2&&(i.pageNumber=i.itemLead[2]),e>3&&(i.marginNumber=i.itemLead[e-1])}if(i.__itemLeadString){const e=i.__itemLeadString.length;e>0&&(i.__itemString=i.__itemLeadString[0]),e>1&&(i.__leadString=i.__itemLeadString[1]),e>2&&(i.__pageNumberString=i.__itemLeadString[2]),e>3&&(i.__marginNumberString=i.__itemLeadString[e-1])}return m?i.body=Ir.process(this.context,e,o,a,t,i,l,!1):h&&(i.cardBody=Ir.process(this.context,e,o,a,t,i,l,!0)),i.footer=Rr.process(this.context,e,t,i,p,u),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===Object.keys(i.propertyStyleResources).length&&delete i.propertyStyleResources,0===i.resources.length&&delete i.resources,0===i.internalComments.length&&delete i.internalComments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}addWarning(e,t,r){const i={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:r?.parser??void 0};i.original||delete i.original,this.nonFatalWarnings.push(i)}addError(e,t,r){const i={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:r?.parser??void 0};i.original||delete i.original,this.nonFatalErrors.push(i)}debugPrint(e,t){}},fi=class extends SyntaxError{constructor(e,t,r,i){super(e),this.expected=t,this.found=r,this.location=i,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null;const i=e.find(e=>e.source===this.location.source);i&&(r=i.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,s=this.location.source+":"+a.line+":"+a.column;if(r){const e=this.location.end,i="".padEnd(a.line.toString().length," "),n=r[o.line-1],l=(o.line===e.line?e.column:n.length+1)-o.column||1;t+="\n --\x3e "+s+"\n"+i+" |\n"+a.line+" | "+n+"\n"+i+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+s}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}const i=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return i?e.replace(i,e=>"\\u{"+r(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function s(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"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}const n={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return n[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],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 bi=function e(t,r){const i={},o=(r=void 0!==r?r:{}).grammarSource,a={bitmark:nt,bit:function(){let e,t,r,o,a;e=We,t=[],r=Et();for(;r!==i;)t.push(r),r=Et();if(r=pt(),r!==i){for(o=[],a=Et();a!==i;)o.push(a),a=Et();He=e,e=r}else We=e,e=i;return e},cardContent:function(){let e,t,r;e=We,t=[],r=ht(),r===i&&(r=wt());for(;r!==i;)t.push(r),r=ht(),r===i&&(r=wt());return He=e,t=je(t),e=t,e}};let s=nt;const n="[.",l="]",c="[",p=":",d="&",u="$$$$",m="====",h="text",g="~~~~",f="footer",b=" ",y="--",k="++",v="===",T="==",x="[@id",_="#",C="[▼",w="[►",A="[@",B="[%",S="[!",P="[?",I="[+",L="[-",V="[$",E="[_",N="[=",R="[&",F="^]",O="id:",D=".",M="\n",q="\r\n",z=/^[^\]]/,$=/^[a-z]/,J=/^[a-z0-9\-]/,U=/^[^:\]]/,j=/^[^&:\]]/,W=/^[^\n\r\u2028\u2029]/,H=/^[ \t]/,G=/^[\r\u2028-\u2029]/,K=/^[ \t\n\r\u2028\u2029]/,Y=et("[.",!1),Q=tt(["]"],!0,!1,!1),X=et("]",!1),Z=et("[",!1),ee=et(":",!1),te=et("&",!1),re={type:"any"},ie=et("$$$$",!1),oe=et("====",!1),ae=et("text",!1),se=et("~~~~",!1),ne=et("footer",!1),le=et(" ",!1),ce=et("--",!1),pe=et("++",!1),de=et("===",!1),ue=et("==",!1),me=tt([["a","z"]],!1,!1,!1),he=tt([["a","z"],["0","9"],"-"],!1,!1,!1),ge=et("[@id",!1),fe=et("#",!1),be=et("[▼",!1),ye=et("[►",!1),ke=et("[@",!1),ve=et("[%",!1),Te=et("[!",!1),xe=et("[?",!1),_e=et("[+",!1),Ce=et("[-",!1),we=et("[$",!1),Ae=et("[_",!1),Be=et("[=",!1),Se=et("[&",!1),Pe=et("^]",!1),Ie=et("id:",!1),Le=tt([":","]"],!0,!1,!1),Ve=et(".",!1),Ee=tt(["&",":","]"],!0,!1,!1),Ne=rt("Character"),Re=tt(["\n","\r","\u2028","\u2029"],!0,!1,!1),Fe=rt("Blank Line"),Oe=tt([" ","\t"],!1,!1,!1),De=rt("Line Terminator"),Me=et("\n",!1),qe=et("\r\n",!1),ze=tt(["\r",["\u2028","\u2029"]],!1,!1,!1),$e=rt("Whitespace, then Line Terminator"),Je=rt("whitespace"),Ue=tt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1,!1);function je(e){return Mt.handleCardContent(e)}let We=0|r.peg$currPos,He=We;const Ge=[{line:1,column:1}];let Ke,Ye=We,Qe=r.peg$maxFailExpected||[],Xe=0|r.peg$silentFails;if(r.startRule){if(!(r.startRule in a))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=a[r.startRule]}function Ze(){return t.substring(He,We)}function et(e,t){return{type:"literal",text:e,ignoreCase:t}}function tt(e,t,r,i){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:i}}function rt(e){return{type:"other",description:e}}function it(e){let r,i=Ge[e];if(i)return i;if(e>=Ge.length)r=Ge.length-1;else for(r=e;!Ge[--r];);for(i=Ge[r],i={line:i.line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Ge[e]=i,i}function ot(e,t,r){const i=it(e),a=it(t),s={source:o,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:a.line,column:a.column}};return r&&o&&"function"==typeof o.offset&&(s.start=o.offset(s.start),s.end=o.offset(s.end)),s}function at(e){We<Ye||(We>Ye&&(Ye=We,Qe=[]),Qe.push(e))}function st(e,t,r){return new fi(fi.buildMessage(e,t),e,t,r)}function nt(){let e;return e=function(){let e,r,o,a;e=We,r=[],o=Ft();for(;o!==i;)r.push(o),o=Ft();return o=function(){let e,r,o,a;e=We,r=We,o=[],a=ct();for(;a!==i;)o.push(a),a=ct();return r=t.substring(r,We),He=e,r=function(e){return Mt.handleRawBit(e)}(r),e=r,e}(),a=function(){let e,t;e=[],t=lt();for(;t!==i;)e.push(t),t=lt();return e}(),He=e,e=function(e,t){return qt.buildBits([e,...t])}(o,a),e}(),e}function lt(){let e,r,o,a;for(e=We,r=[],o=Et();o!==i;)r.push(o),o=Et();return o=Nt(),o===i&&(o=null),a=function(){let e,r,o,a,s,c;if(e=We,r=We,o=We,a=function(){let e,r,o,a;e=We,t.substr(We,2)===n?(r=n,We+=2):(r=i,0===Xe&&at(Y));if(r!==i){for(o=[],a=t.charAt(We),z.test(a)?We++:(a=i,0===Xe&&at(Q));a!==i;)o.push(a),a=t.charAt(We),z.test(a)?We++:(a=i,0===Xe&&at(Q));93===t.charCodeAt(We)?(a=l,We++):(a=i,0===Xe&&at(X)),a!==i?(He=e,e=r):(We=e,e=i)}else We=e,e=i;return e}(),a!==i){for(s=[],c=ct();c!==i;)s.push(c),c=ct();a=[a,s],o=a}else We=o,o=i;r=o!==i?t.substring(r,We):o;r!==i&&(He=e,p=r,r=Mt.handleRawBit(p));var p;return e=r,e}(),a!==i?(He=e,e=a):(We=e,e=i),e}function ct(){let e,t,r,o;if(e=We,t=Nt(),t!==i?(r=We,Xe++,o=dt(),Xe--,o===i?r=void 0:(We=r,r=i),r!==i?(t=[t,r],e=t):(We=e,e=i)):(We=e,e=i),e===i)if(e=[],t=Lt(),t!==i)for(;t!==i;)e.push(t),t=Lt();else e=i;return e}function pt(){let e,r,o;var a,s,n;return e=We,r=dt(),r!==i?(o=function(){let e,t,r;e=We,t=[],r=yt(),r===i&&(r=vt(),r===i&&(r=xt(),r===i&&(r=ht(),r===i&&(r=bt()))));for(;r!==i;)t.push(r),r=yt(),r===i&&(r=vt(),r===i&&(r=xt(),r===i&&(r=ht(),r===i&&(r=bt()))));return He=e,t=function(e){return Mt.handleBitContent(e)}(t),e=t,e}(),He=e,a=r,s=o,e=qt.buildBit(a,s)):(We=e,e=i),e===i&&(e=We,r=We,o=function(){let e,r;Xe++,e=[],t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re));for(;r!==i;)e.push(r),t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re));return Xe--,e}(),r=t.substring(r,We),He=e,n=r,r=qt.invalidBit(n),e=r),e}function dt(){let e,r,o,a,s,n;var p,d,u;return e=We,91===t.charCodeAt(We)?(r=c,We++):(r=i,0===Xe&&at(Z)),r!==i?(o=function(){let e,r,o;e=We,r=[],46===t.charCodeAt(We)?(o=D,We++):(o=i,0===Xe&&at(Ve));if(o!==i)for(;o!==i;)r.push(o),46===t.charCodeAt(We)?(o=D,We++):(o=i,0===Xe&&at(Ve));else r=i;r!==i&&(He=e,r=r.length);return e=r,e}(),o!==i?(a=Pt(),s=function(){let e,t,r;e=We,t=ut(),t===i&&(t=mt());t===i&&(t=null);r=ut(),r===i&&(r=mt());r===i&&(r=null);return He=e,e=function(e,t){return qt.buildTextAndResourceType(e,t)}(t,r),e}(),93===t.charCodeAt(We)?(n=l,We++):(n=i,0===Xe&&at(X)),n!==i?(He=e,p=o,d=a,u=s,e=qt.buildBitHeader(d,p,u)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i),e}function ut(){let e,r,o;var a;return e=We,58===t.charCodeAt(We)?(r=p,We++):(r=i,0===Xe&&at(ee)),r!==i?(o=Pt(),He=e,a=o,e=Mt.handleTextFormat(a)):(We=e,e=i),e}function mt(){let e,r,o;var a;return e=We,38===t.charCodeAt(We)?(r=d,We++):(r=i,0===Xe&&at(te)),r!==i?(o=Pt(),He=e,a=o,e=Mt.handleResourceType(a)):(We=e,e=i),e}function ht(){let e,t,r,o,a;if(e=We,t=We,r=ft(),r!==i){for(o=[],a=gt();a!==i;)o.push(a),a=gt();r=[r,o],t=r}else We=t,t=i;var s;return t!==i&&(He=e,s=t,t=Mt.handleTagChain(s)),e=t,e}function gt(){let e,t;return e=We,t=ft(),t!==i&&(He=e),e=t,e}function ft(){let e,r;var o;return e=We,r=function(){let e,r,o,a;e=We,t.substr(We,4)===x?(r=x,We+=4):(r=i,0===Xe&&at(ge));r!==i?(o=It(),o!==i?(a=function(){let e;93===t.charCodeAt(We)?(e=l,We++):(e=i,0===Xe&&at(X));return e}(),a!==i?(He=e,s=o,e=Mt.handlePropertyTag("id",s)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=We,t.substr(We,2)===A?(r=A,We+=2):(r=i,0===Xe&&at(ke));r!==i?(o=Bt(),o!==i?(a=It(),a!==i?(s=St(),s!==i?(He=e,n=o,l=a,e=Mt.handlePropertyTag(n,l)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);var n,l;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=We,91===t.charCodeAt(We)?(r=c,We++):(r=i,0===Xe&&at(Z));if(r!==i){if(o=[],35===t.charCodeAt(We)?(a=_,We++):(a=i,0===Xe&&at(fe)),a!==i)for(;a!==i;)o.push(a),35===t.charCodeAt(We)?(a=_,We++):(a=i,0===Xe&&at(fe));else o=i;o!==i?(a=At(),s=St(),s!==i?(He=e,n=o,l=a,e=Mt.handleTag(fr.Title,{level:n,title:l})):(We=e,e=i)):(We=e,e=i)}else We=e,e=i;var n,l;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===C?(r=C,We+=2):(r=i,0===Xe&&at(be));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Anchor,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===w?(r=w,We+=2):(r=i,0===Xe&&at(ye));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Reference,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===B?(r=B,We+=2):(r=i,0===Xe&&at(ve));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.ItemLead,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===S?(r=S,We+=2):(r=i,0===Xe&&at(Te));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Instruction,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===P?(r=P,We+=2):(r=i,0===Xe&&at(xe));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Hint,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===E?(r=E,We+=2):(r=i,0===Xe&&at(Ae));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Gap,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===N?(r=N,We+=2):(r=i,0===Xe&&at(Be));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.Mark,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===V?(r=V,We+=2):(r=i,0===Xe&&at(we));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.SampleSolution,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===I?(r=I,We+=2):(r=i,0===Xe&&at(_e));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.True,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a;e=We,t.substr(We,2)===L?(r=L,We+=2):(r=i,0===Xe&&at(Ce));r!==i?(o=At(),a=St(),a!==i?(He=e,s=o,e=Mt.handleTag(fr.False,s)):(We=e,e=i)):(We=e,e=i);var s;return e}(),r===i&&(r=function(){let e,r,o,a,s;e=We,t.substr(We,2)===R?(r=R,We+=2):(r=i,0===Xe&&at(Se));r!==i?(o=Bt(),o!==i?(a=It(),a!==i?(s=St(),s!==i?(He=e,n=o,l=a,e=Mt.handleResourceTag(n,l)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);var n,l;return e}()))))))))))))),r!==i&&(He=e,o=r,r=Mt.handleBitTag(o)),e=r,e}function bt(){let e,r;return e=We,t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re)),r!==i&&(He=e,r={type:fr.BodyChar,value:r}),e=r,e}function yt(){let e;return e=function(){let e,t,r,o,a;e=We,t=We,r=Nt(),r!==i?(o=kt(),o!==i?(a=Rt(),a!==i?(r=[r,o,a],t=r):(We=t,t=i)):(We=t,t=i)):(We=t,t=i);t!==i&&(He=e,s=t,t=Mt.handleFooterDivider(s));var s;return e=t,e}(),e===i&&(e=function(){let e,r,o,a,s;e=We,r=We,o=Nt(),o!==i?(a=function(){let e,r,o,a,s,n;t.substr(We,4)===u?(e=u,We+=4):(e=i,0===Xe&&at(ie));if(e===i)if(e=We,t.substr(We,4)===m?(r=m,We+=4):(r=i,0===Xe&&at(oe)),r!==i){if(o=[],a=Ft(),a!==i)for(;a!==i;)o.push(a),a=Ft();else o=i;if(o!==i)if(t.substr(We,4)===h?(a=h,We+=4):(a=i,0===Xe&&at(ae)),a!==i){if(s=[],n=Ft(),n!==i)for(;n!==i;)s.push(n),n=Ft();else s=i;s!==i?(t.substr(We,4)===m?(n=m,We+=4):(n=i,0===Xe&&at(oe)),n!==i?(r=[r,o,a,s,n],e=r):(We=e,e=i)):(We=e,e=i)}else We=e,e=i;else We=e,e=i}else We=e,e=i;return e}(),a!==i?(s=Rt(),s!==i?(o=[o,a,s],r=o):(We=r,r=i)):(We=r,r=i)):(We=r,r=i);r!==i&&(He=e,n=r,r=Mt.handlePlainTextDivider(n));var n;return e=r,e}()),e}function kt(){let e,r,o,a,s,n;if(t.substr(We,4)===g?(e=g,We+=4):(e=i,0===Xe&&at(se)),e===i)if(e=We,t.substr(We,4)===m?(r=m,We+=4):(r=i,0===Xe&&at(oe)),r!==i){if(o=[],a=Ft(),a!==i)for(;a!==i;)o.push(a),a=Ft();else o=i;if(o!==i)if(t.substr(We,6)===f?(a=f,We+=6):(a=i,0===Xe&&at(ne)),a!==i){if(s=[],n=Ft(),n!==i)for(;n!==i;)s.push(n),n=Ft();else s=i;s!==i?(t.substr(We,4)===m?(n=m,We+=4):(n=i,0===Xe&&at(oe)),n!==i?(r=[r,o,a,s,n],e=r):(We=e,e=i)):(We=e,e=i)}else We=e,e=i;else We=e,e=i}else We=e,e=i;return e}function vt(){let e,r,o,a,s;if(e=We,r=We,o=function(){let e,r,o,a;e=We,r=[],o=Rt(),o===i&&(o=Nt());if(o!==i)for(;o!==i;)r.push(o),o=Rt(),o===i&&(o=Nt());else r=i;r!==i?(o=We,Xe++,a=function(){let e,r,o,a,s,n,l;e=We,t.substr(We,4)===m?(r=m,We+=4):(r=i,0===Xe&&at(oe));r!==i?(o=We,32===t.charCodeAt(We)?(a=b,We++):(a=i,0===Xe&&at(le)),a!==i?(s=Ct(),s!==i?(32===t.charCodeAt(We)?(n=b,We++):(n=i,0===Xe&&at(le)),n!==i?(t.substr(We,4)===m?(l=m,We+=4):(l=i,0===Xe&&at(oe)),l!==i?(a=[a,s,n,l],o=a):(We=o,o=i)):(We=o,o=i)):(We=o,o=i)):(We=o,o=i),o===i&&(o=null),a=Rt(),a===i&&(a=Dt()),a!==i?(r=[r,o,a],e=r):(We=e,e=i)):(We=e,e=i);return e}(),Xe--,a!==i?(We=o,o=void 0):o=i,o!==i?(He=e,e=void Mt.handleCardSetStart()):(We=e,e=i)):(We=e,e=i);return e}(),o!==i){for(a=[],s=Tt();s!==i;)a.push(s),s=Tt();s=function(){let e,t,r,o,a;e=We,t=We,r=kt(),r===i&&(r=null);o=We,Xe++,a=Dt(),Xe--,a!==i?(We=o,o=void 0):o=i;o!==i?(r=[r,o],t=r):(We=t,t=i);t!==i&&(He=e,t=void Mt.handleCardSetEnd());return e=t,e}(),s!==i?(o=[o,a,s],r=o):(We=r,r=i)}else We=r,r=i;var n;return r!==i&&(He=e,n=r,r=Mt.handleCardSet(n[1].flat())),e=r,e}function Tt(){let e,r;var o;return e=We,r=function(){let e,r;e=We,r=function(){let e,r,o,a,s,n,l;e=We,t.substr(We,4)===m?(r=m,We+=4):(r=i,0===Xe&&at(oe));r!==i?(32===t.charCodeAt(We)?(o=b,We++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(We)?(s=b,We++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(We,4)===m?(n=m,We+=4):(n=i,0===Xe&&at(oe)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(He=e,e=["====",a]):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);e===i&&(e=We,t.substr(We,4)===m?(r=m,We+=4):(r=i,0===Xe&&at(oe)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(He=e,e=["===="]):(We=e,e=i)):(We=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n,l;e=We,t.substr(We,2)===y?(r=y,We+=2):(r=i,0===Xe&&at(ce));r!==i?(32===t.charCodeAt(We)?(o=b,We++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(We)?(s=b,We++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(We,2)===y?(n=y,We+=2):(n=i,0===Xe&&at(ce)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(He=e,e=["--",a]):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);e===i&&(e=We,t.substr(We,2)===y?(r=y,We+=2):(r=i,0===Xe&&at(ce)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(He=e,e=["--"]):(We=e,e=i)):(We=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n,l;e=We,t.substr(We,2)===k?(r=k,We+=2):(r=i,0===Xe&&at(pe));r!==i?(32===t.charCodeAt(We)?(o=b,We++):(o=i,0===Xe&&at(le)),o!==i?(a=Ct(),a!==i?(32===t.charCodeAt(We)?(s=b,We++):(s=i,0===Xe&&at(le)),s!==i?(t.substr(We,2)===k?(n=k,We+=2):(n=i,0===Xe&&at(pe)),n!==i?(l=Rt(),l===i&&(l=Dt()),l!==i?(He=e,e=["++",a]):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i)):(We=e,e=i);e===i&&(e=We,t.substr(We,2)===k?(r=k,We+=2):(r=i,0===Xe&&at(pe)),r!==i?(o=Rt(),o===i&&(o=Dt()),o!==i?(He=e,e=["++"]):(We=e,e=i)):(We=e,e=i));return e}(),r===i&&(r=function(){let e,r,o,a,s,n;e=We,r=We,Xe++,o=We,a=kt(),a!==i?(s=Dt(),s!==i?(a=[a,s],o=a):(We=o,o=i)):(We=o,o=i);Xe--,o===i?r=void 0:(We=r,r=i);if(r!==i){if(o=We,a=We,s=Vt(),n=Nt(),n!==i?(s=[s,n],a=s):(We=a,a=i),a===i){if(a=We,s=[],n=Lt(),n!==i)for(;n!==i;)s.push(n),n=Lt();else s=i;s!==i?(n=Ot(),n!==i?(s=[s,n],a=s):(We=a,a=i)):(We=a,a=i)}o=a!==i?t.substring(o,We):a,o!==i?(He=e,l=o,e=Mt.handleCardLine(l)):(We=e,e=i)}else We=e,e=i;var l;return e}())));r!==i&&(He=e,o=r,r=Mt.handleCardLineOrDivider(o,2));var o;return e=r,e}(),r!==i&&(He=e,o=r,r=Mt.handleCards(o)),e=r,e}function xt(){let e,r,o,a,s;if(e=We,r=We,o=function(){let e,r,o,a,s,n;e=We,r=[],o=Rt(),o===i&&(o=Nt());if(o!==i)for(;o!==i;)r.push(o),o=Rt(),o===i&&(o=Nt());else r=i;r!==i?(o=We,Xe++,a=We,t.substr(We,3)===v?(s=v,We+=3):(s=i,0===Xe&&at(de)),s!==i?(n=Rt(),n!==i?(s=[s,n],a=s):(We=a,a=i)):(We=a,a=i),Xe--,a!==i?(We=o,o=void 0):o=i,o!==i?(He=e,e=void Mt.handleCardSetStart()):(We=e,e=i)):(We=e,e=i);return e}(),o!==i){for(a=[],s=_t();s!==i;)a.push(s),s=_t();s=function(){let e,t,r,o,a;e=We,t=We,r=kt(),r===i&&(r=null);o=We,Xe++,a=Dt(),Xe--,a!==i?(We=o,o=void 0):o=i;o!==i?(r=[r,o],t=r):(We=t,t=i);t!==i&&(He=e,t=void Mt.handleCardSetEnd());return e=t,e}(),s!==i?(o=[o,a,s],r=o):(We=r,r=i)}else We=r,r=i;var n;return r!==i&&(He=e,n=r,r=Mt.handleCardSet(n[1].flat())),e=r,e}function _t(){let e,r;var o;return e=We,r=function(){let e,r,o,a;e=We,r=We,t.substr(We,3)===v?(o=v,We+=3):(o=i,0===Xe&&at(de));o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(We=r,r=i)):(We=r,r=i);r===i&&(r=We,t.substr(We,2)===T?(o=T,We+=2):(o=i,0===Xe&&at(ue)),o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(We=r,r=i)):(We=r,r=i),r===i&&(r=We,t.substr(We,2)===y?(o=y,We+=2):(o=i,0===Xe&&at(ce)),o!==i?(a=Rt(),a===i&&(a=Dt()),a!==i?(o=[o,a],r=o):(We=r,r=i)):(We=r,r=i),r===i&&(r=function(){let e,r,o,a,s,n;e=We,r=We,Xe++,o=We,a=kt(),a!==i?(s=Dt(),s!==i?(a=[a,s],o=a):(We=o,o=i)):(We=o,o=i);Xe--,o===i?r=void 0:(We=r,r=i);if(r!==i){if(o=We,a=We,s=Vt(),n=Nt(),n!==i?(s=[s,n],a=s):(We=a,a=i),a===i){if(a=We,s=[],n=Lt(),n!==i)for(;n!==i;)s.push(n),n=Lt();else s=i;s!==i?(n=Ot(),n!==i?(s=[s,n],a=s):(We=a,a=i)):(We=a,a=i)}o=a!==i?t.substring(o,We):a,o!==i?(He=e,l=o,e=Mt.handleCardLine(l)):(We=e,e=i)}else We=e,e=i;var l;return e}())));r!==i&&(He=e,s=r,r=Mt.handleCardLineOrDivider(s,1));var s;return e=r,e}(),r!==i&&(He=e,o=r,r=Mt.handleCards(o)),e=r,e}function Ct(){let e,r,o;return e=We,r=We,Xe++,t.substr(We,6)===f?(o=f,We+=6):(o=i,0===Xe&&at(ne)),o===i&&(t.substr(We,4)===h?(o=h,We+=4):(o=i,0===Xe&&at(ae))),Xe--,o===i?r=void 0:(We=r,r=i),r!==i?(o=function(){let e,r,o,a,s;e=We,r=We,o=t.charAt(We),$.test(o)?We++:(o=i,0===Xe&&at(me));if(o!==i){for(a=[],s=t.charAt(We),J.test(s)?We++:(s=i,0===Xe&&at(he));s!==i;)a.push(s),s=t.charAt(We),J.test(s)?We++:(s=i,0===Xe&&at(he));o=[o,a],r=o}else We=r,r=i;e=r!==i?t.substring(e,We):r;return e}(),o!==i?(He=e,e=o):(We=e,e=i)):(We=e,e=i),e}function wt(){let e,r;return e=We,t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re)),r!==i&&(He=e,r={type:fr.CardChar,value:r}),e=r,e}function At(){let e,r,o,a;for(e=We,r=We,o=[],t.substr(We,2)===F?(a=F,We+=2):(a=i,0===Xe&&at(Pe)),a===i&&(a=t.charAt(We),z.test(a)?We++:(a=i,0===Xe&&at(Q)));a!==i;)o.push(a),t.substr(We,2)===F?(a=F,We+=2):(a=i,0===Xe&&at(Pe)),a===i&&(a=t.charAt(We),z.test(a)?We++:(a=i,0===Xe&&at(Q)));return r=t.substring(r,We),He=e,e=r,e}function Bt(){let e,r,o,a,s;if(e=We,r=We,Xe++,t.substr(We,3)===O?(o=O,We+=3):(o=i,0===Xe&&at(Ie)),Xe--,o===i?r=void 0:(We=r,r=i),r!==i){for(o=We,a=[],s=t.charAt(We),U.test(s)?We++:(s=i,0===Xe&&at(Le));s!==i;)a.push(s),s=t.charAt(We),U.test(s)?We++:(s=i,0===Xe&&at(Le));o=t.substring(o,We),He=e,e=(n=o)?n.trim():""}else We=e,e=i;var n;return e}function St(){let e,r,o;if(93===t.charCodeAt(We)?(e=l,We++):(e=i,0===Xe&&at(X)),e===i){for(e=We,r=[],o=Ft();o!==i;)r.push(o),o=Ft();o=function(){let e,r;e=We,Xe++,t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re));Xe--,r===i?e=void 0:(We=e,e=i);return e}(),o!==i?(r=[r,o],e=r):(We=e,e=i)}return e}function Pt(){let e,r,o,a;for(e=We,r=We,o=[],a=t.charAt(We),j.test(a)?We++:(a=i,0===Xe&&at(Ee));a!==i;)o.push(a),a=t.charAt(We),j.test(a)?We++:(a=i,0===Xe&&at(Ee));var s;return r=t.substring(r,We),He=e,r=(s=r)?s.trim():null,e=r,e}function It(){let e,r,o;var a;return e=We,58===t.charCodeAt(We)?(r=p,We++):(r=i,0===Xe&&at(ee)),r!==i?(o=At(),He=e,e=(a=o)?a.trim():""):(We=e,e=i),e===i&&(e=We,r="",He=e,r=!0,e=r),e}function Lt(){let e,r;return Xe++,e=t.charAt(We),W.test(e)?We++:(e=i,0===Xe&&at(Re)),Xe--,e===i&&(r=i,0===Xe&&at(Ne)),e}function Vt(){let e,t;for(Xe++,e=[],t=Lt();t!==i;)e.push(t),t=Lt();return Xe--,e}function Et(){let e,r,o;for(Xe++,e=We,r=[],o=t.charAt(We),H.test(o)?We++:(o=i,0===Xe&&at(Oe));o!==i;)r.push(o),o=t.charAt(We),H.test(o)?We++:(o=i,0===Xe&&at(Oe));return o=Nt(),o!==i?(r=[r,o],e=r):(We=e,e=i),Xe--,e===i&&(r=i,0===Xe&&at(Fe)),e}function Nt(){let e,r;return Xe++,10===t.charCodeAt(We)?(e=M,We++):(e=i,0===Xe&&at(Me)),e===i&&(t.substr(We,2)===q?(e=q,We+=2):(e=i,0===Xe&&at(qe)),e===i&&(e=t.charAt(We),G.test(e)?We++:(e=i,0===Xe&&at(ze)))),Xe--,e===i&&(r=i,0===Xe&&at(De)),e}function Rt(){let e,r,o;for(Xe++,e=We,r=[],o=t.charAt(We),H.test(o)?We++:(o=i,0===Xe&&at(Oe));o!==i;)r.push(o),o=t.charAt(We),H.test(o)?We++:(o=i,0===Xe&&at(Oe));return o=Nt(),o!==i?(r=[r,o],e=r):(We=e,e=i),Xe--,e===i&&(r=i,0===Xe&&at($e)),e}function Ft(){let e,r;return Xe++,e=t.charAt(We),K.test(e)?We++:(e=i,0===Xe&&at(Ue)),Xe--,e===i&&(r=i,0===Xe&&at(Je)),e}function Ot(){let e,r;return e=Nt(),e===i&&(e=We,Xe++,t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re)),Xe--,r===i?e=void 0:(We=e,e=i)),e}function Dt(){let e,r;return e=Rt(),e===i&&(e=We,Xe++,t.length>We?(r=t.charAt(We),We++):(r=i,0===Xe&&at(re)),Xe--,r===i?e=void 0:(We=e,e=i)),e}const Mt=new Tr({parse:e,parserText:Ze,parserLocation:zt}),qt=new gi({parse:e,parserText:Ze,parserLocation:zt});function zt(){const e=ot(He,We);return e?(delete e.source,e):e}function ot(e,t,r){var i=it(e),a=it(t),s={source:o,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:a.line,column:a.column}};return o&&"function"==typeof o.offset&&(s.start=o.offset(s.start),s.end=o.offset(s.end)),s}Ke=s();const $t=Ke!==i&&We===t.length;function Jt(){throw Ke!==i&&We<t.length&&at({type:"end"}),st(Qe,Ye<t.length?function(e=We){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(Ye):null,Ye<t.length?ot(Ye,Ye+1):ot(Ye,Ye))}return r.peg$library?{peg$result:Ke,peg$currPos:We,peg$FAILED:i,peg$maxFailExpected:Qe,peg$maxFailPos:Ye,peg$success:$t,peg$throw:$t?void 0:Jt}:$t?Ke:void Jt()},yi=class{constructor(){l(this,"jsonParser",new hr)}toAst(e,t){return bi(e)}},ki={string:"string",file:"file"},vi={bitmark:"bitmark",json:"json",ast:"ast"},Ti=class{constructor(){l(this,"ast",new $e),l(this,"jsonParser",new hr),l(this,"bitmarkParser",new yi),l(this,"textParser",new Mt),l(this,"textGenerator",new Lt),l(this,"jsonStringifyPrettify",(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e})}version(){return Ee.appVersion.full}info(e){const t=Object.assign({},e),r=new lr;let i;const o=!t.outputFormat||t.outputFormat===pr.text,a=t.outputFormat===pr.json,s=t.type===dr.all,n=t.type===dr.deprecated,l=s||!n,c=s||n;if(t.type===dr.bit){const e=r.getSupportedBitConfigs().filter(e=>{if(!t.bit)return!0;return ve.getBitType(t.bit)===e.bitType});i=o?e.map(e=>e.toString({includeChains:!0,includeConfigs:!0})).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:c}).filter(e=>{if(!t.bit)return!0;const r=ve.getBitType(t.bit);return e.name===r||void 0});i=o?this.supportedBitsAsString(e):e}if(a){const e=!0===t.prettify?2:t.prettify||void 0;i=JSON.stringify(i,null,e)}return i}generateConfig(e){const t=Object.assign({},e);(new ConfigBuilder).build(t)}convert(e,t){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.outputFormat,s=a===vi.bitmark,n=a===vi.json,l=a===vi.ast,c=cr.peggy;let p=e;const d="string"==typeof e;if(Ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==ki.file||Ee.isNode&&d&&fs.existsSync(p)&&(p=fs.readFileSync(p,{encoding:"utf8"}));let u=this.ast.preprocessAst(p);const m=!!u;m||(u=this.jsonParser.toAst(p));const h=!!u?.bits,g=e=>{r=this.bitmarkParser.toAst(e,{parserType:c})},f=e=>{if(c===cr.peggy)if(u=this.bitmarkParser.toAst(e,{parserType:c}),i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(u)}else{const e=new sr(i).generateSync(u);r=this.jsonStringifyPrettify(e,o)}},b=e=>{if(i.outputFile){new BitmarkFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new rr(i);r=t.generateSync(e)}},y=e=>{r=this.jsonStringifyPrettify(e,o)},k=e=>{if(i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new sr(i).generateSync(e);r=this.jsonStringifyPrettify(t,o)}},v=e=>{r=this.jsonStringifyPrettify(e,o)};return d&&!h&&!m?s?(g(p),b(r)):l?g(p):f(p):m?l?y(u):n?k(u):b(u):h?n?k(u):l?v(u):(e=>{if(i.outputFile)new BitmarkFileGenerator(i.outputFile,i).generateSync(e);else{const t=new rr(i);r=t.generateSync(e)}})(u):r="",r}upgrade(e,t){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.bitmarkParserType;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let l=this.jsonParser.toAst(s);const c=!!l?.bits,p=e=>{if(i.outputFile){new JsonFileGenerator(i.outputFile,i).generateSync(e)}else{const t=new sr(i).generateSync(e);r=this.jsonStringifyPrettify(t,o)}};if(n&&!c)(e=>{const t=this.bitmarkParser.toAst(e,{parserType:a});if(i.outputFile){new BitmarkFileGenerator(i.outputFile,i).generateSync(t)}else{const e=new rr(i);r=e.generateSync(t)}})(s);else{if(!c)return;p(l)}return r}createAst(e,t){let r,i=e;const o="string"==typeof e,a=Object.assign({},t);a.inputFormat&&a.inputFormat!==ki.file||Ee.isNode&&o&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));let s=this.ast.preprocessAst(i);const n=!!s;n||(s=this.jsonParser.toAst(i));const l=!!s?.bits;return r=o&&!l&&!n?this.bitmarkParser.toAst(i):l?s:{},r}convertText(e,t){let r,i;const o=Object.assign({},t),a=Object.assign({},o.fileOptions),s=Object.assign({},o.jsonOptions),n=(0,Qt.Enum)(TextFormat).fromValue(o.textFormat)??TextFormat.bitmarkText,l=o.textLocation??TextLocation.body;let c=e;const p="string"==typeof e;if(Ee.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");o.inputFormat&&o.inputFormat!==ki.file||Ee.isNode&&p&&fs.existsSync(c)&&(c=fs.readFileSync(c,{encoding:"utf8"}));const d=this.textParser.preprocessAst(c),u=!!d;if(i=u?this.textGenerator.generateSync(d,n,l):this.textParser.toAst(c,{format:n,location:TextLocation.body}),o.outputFile){const e=o.outputFile.toString();let t=i;u||(t=this.jsonStringifyPrettify(i,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else r=u?i:this.jsonStringifyPrettify(i,s);return r}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions),o=(0,Qt.Enum)(TextFormat).fromValue(r.textFormat)??TextFormat.bitmarkText,a=r.textLocation??TextLocation.body;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));const l=Breakscape.breakscape(s,{format:o,location:a});if(!r.outputFile)return l;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions),o=(0,Qt.Enum)(TextFormat).fromValue(r.textFormat)??TextFormat.bitmarkText,a=r.textLocation??TextLocation.body;let s=e;const n="string"==typeof e;if(Ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==ki.file||Ee.isNode&&n&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));const l=Breakscape.unbreakscape(s,{format:o,location:a});if(!r.outputFile)return l;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n";return t}},xi=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new Yt,this.generator=new ar(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()}};Fe()}},t={};var r=function r(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}(922);return r})());