@gmb/bitmark-parser-generator
Version:
A bitmark parser and generator using Peggy.js
1 lines • 499 kB
JavaScript
!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={718:(e,t,i)=>{function r(e,t){var i;const r=Object.freeze,o=Object.defineProperty,a=Object.assign,n={enumerable:!1},s=new Map,l=new Map,c=new Map,d=new Map,p=new Map,u=(null!==(i=null==t?void 0:t.iterationKeys)&&void 0!==i?i:Object.keys(e)).map(e=>`${e}`);for(const[t,i]of Object.entries(e))s.set(t,i),c.set(t.toLowerCase(),i);for(const[e,t]of s){const i="string"==typeof t?t.toLowerCase():t;l.set(t,e),d.set(i,e)}const h=u.map(e=>s.get(e)),m=u.map(e=>[e,s.get(e)]);return(t=>{let i=e;function g(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(d.get(e.toLowerCase())):l.has(e)?e:void 0}Object.isExtensible(e)||(i=a({},e)),o(i,"fromKey",a({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):s.get(`${e}`)}},n)),o(i,"fromValue",a({value:g},n)),o(i,"keyFromValue",a({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?d.get(e.toLowerCase()):l.get(e)}},n)),o(i,"setMetadata",a({value:function(e,t,i){const r=g(e);null!=r&&p.set(r,t)}},n)),o(i,"getMetadata",a({value:function(e,t){return p.get(e)}},n)),o(i,Symbol.iterator,a({value:function(){let e=0;return{next:()=>e<u.length?{value:s.get(`${u[e++]}`),done:!1}:{done:!0}}}},n)),o(i,"values",a({value:()=>h},n)),o(i,"keys",a({value:()=>u},n)),o(i,"entries",a({value:()=>m},n));let b=i;return(null==t?void 0:t.noFreeze)||(b=r(i),r(u),r(h),r(m)),b})(t)}i.r(t),i.d(t,{superenum:()=>o});const o=r;o.fromObject=r,o.fromArray=function(e,t){Array.isArray(e)||(e=[]);const i=e.reduce((e,t)=>(e[`${t}`]=t,e),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),r(i,t)}},922:(e,t,i)=>{var r,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,l=(e,t,i)=>((e,t,i)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),c={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(c,{Ast:()=>le,BitType:()=>d,BitmarkGenerator:()=>gt,BitmarkParser:()=>fi,BitmarkParserGenerator:()=>Ti,BitmarkParserType:()=>vt,BitmarkStringGenerator:()=>bt,BitmarkVersion:()=>Ee,BodyTextFormat:()=>de,Builder:()=>dt,CardSetVersion:()=>ht,InfoFormat:()=>xt,InfoType:()=>_t,Input:()=>yi,JsonGenerator:()=>yt,JsonParser:()=>Ct,JsonStringGenerator:()=>vi,NodeType:()=>se,Output:()=>ki,ResourceBuilder:()=>ct,StringWriter:()=>pt,bitmarkTextParse:()=>et}),e.exports=(r=c,((e,t,i,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of n(t))s.call(e,l)||l===i||o(e,l,{get:()=>t[l],enumerable:!(r=a(t,l))||r.enumerable});return e})(o({},"__esModule",{value:!0}),r));var d=(0,i(718).superenum)({_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",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",browserImage:"browser-image",bug:"bug",bugAlt:"bug-alt",bugCollapsible:"bug-collapsible",buttonCopyText:"button-copy-text",callToAction:"call-to-action",callToActionBookNow:"call-to-action-book-now",callToActionContact:"call-to-action-contact",callToActionCreateAccount:"call-to-action-create-account",callToActionDownload:"call-to-action-download",callToActionGetNow:"call-to-action-get-now",callToActionGetOffer:"call-to-action-get-offer",callToActionJoin:"call-to-action-join",callToActionLearnMore:"call-to-action-learn-more",callToActionMail:"call-to-action-mail",callToActionSeeMore:"call-to-action-see-more",callToActionShopNow:"call-to-action-shop-now",callToActionStartNow:"call-to-action-start-now",callToActionSubscribe:"call-to-action-subscribe",callToActionWatch:"call-to-action-watch",card1:"card-1",chapter:"chapter",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",clozeInstructionGrouped:"cloze-instruction-grouped",clozeList:"cloze-list",clozeSeveral:"cloze-several",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",code:"code",codeRuntime:"code-runtime",collapsible:"collapsible",conclusion:"conclusion",conclusionAlt:"conclusion-alt",consoleLog:"console-log",container:"container",containerAccordionTabs:"container-accordion-tabs",containerBits2:"container-bits-2",containerCards:"container-cards",containerCarousel:"container-carousel",containerCookRecipe:"container-cook-recipe",containerFolder:"container-folder",containerFolderAll:"container-folder-all",containerGallery:"container-gallery",containerGrid:"container-grid",containerGroup:"container-group",containerNewsArticle:"container-news-article",containerNowrap:"container-nowrap",containerNowrapStretch:"container-nowrap-stretch",containerPreview:"container-preview",containerScroller:"container-scroller",containerSlides:"container-slides",containerStack:"container-stack",containerTabs:"container-tabs",containerWrap:"container-wrap",conversationLeft1:"conversation-left-1",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",clozeAndMultipleChoiceTextConversationLeft1:"cloze-and-multiple-choice-text-conversation-left-1",clozeAndMultipleChoiceTextConversationLeft1Scream:"cloze-and-multiple-choice-text-conversation-left-1-scream",clozeAndMultipleChoiceTextConversationLeft1Thought:"cloze-and-multiple-choice-text-conversation-left-1-thought",clozeAndMultipleChoiceTextConversationRight1:"cloze-and-multiple-choice-text-conversation-right-1",clozeAndMultipleChoiceTextConversationRight1Scream:"cloze-and-multiple-choice-text-conversation-right-1-scream",clozeAndMultipleChoiceTextConversationRight1Thought:"cloze-and-multiple-choice-text-conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookNoteOnQuantity:"cook-note-on-quantity",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",dangerAlt:"danger-alt",dangerCollapsible:"danger-collapsible",definitionList:"definition-list",definitionTerm:"definition-term",deleted:"deleted",details:"details",details1:"details-1",detailsImage:"details-image",diff:"diff",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",essay:"essay",example:"example",exampleAlt:"example-alt",exampleCollapsible:"example-collapsible",exampleList:"example-list",extractorAiChat:"extractor-ai-chat",extractorBlock:"extractor-block",extractorConfiguration:"extractor-configuration",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",note:"note",noteAi:"note-ai",noteAlt:"note-alt",notebookArticle:"notebook-article",noteCollapsible:"note-collapsible",output:"output",page:"page",pageAcademy:"page-academy",pageArticle:"page-article",pageArticleAlt:"page-article-alt",pageArticleResponsive:"page-article-responsive",pageBanner:"page-banner",pageBuyButton:"page-buy-button",pageBuyButtonAlt:"page-buy-button-alt",pageBuyButtonPromotion:"page-buy-button-promotion",pageCategory:"page-category",pageCollapsible:"page-collapsible",pageContainer:"page-container",pageContainerFolder:"page-container-folder",pageContainerGroup:"page-container-group",pageContainerNowrap:"page-container-nowrap",pageContainerNowrapStretch:"page-container-nowrap-stretch",pageContainerWrap:"page-container-wrap",pageCoverImage:"page-cover-image",pageFooter:"page-footer",pageHero:"page-hero",pageOpenBook:"page-open-book",pageOpenBookList:"page-open-book-list",pagePerson:"page-person",pageProduct:"page-product",pageProductList:"page-product-list",pageProductVideo:"page-product-video",pageProductVideoList:"page-product-video-list",pagePromotion:"page-promotion",pageSectionFolder:"page-section-folder",pageShopInShop:"page-shop-in-shop",pageSpecial:"page-special",pageSubpage:"page-subpage",pageSubscribe:"page-subscribe",parameters:"parameters",photo:"photo",platformPath:"platform-path",preparationNote:"preparation-note",pronunciationTable:"pronunciation-table",prototypeImages:"prototype-images",qAndA:"q-and-a",qAndACard:"q-and-a-card",question1:"question-1",quote:"quote",rating:"rating",recipe:"recipe",recordAudio:"record-audio",recordVideo:"record-video",releaseNote:"release-note",releaseNotesSummary:"release-notes-summary",remark:"remark",remarkAlt:"remark-alt",remarkCollapsible:"remark-collapsible",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewCustomerNote:"review-customer-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",sampleSolution:"sample-solution",scorm:"scorm",screenshot:"screenshot",selfAssessment:"self-assessment",separator:"separator",separatorAlt:"separator-alt",sequence:"sequence",sideNote:"side-note",sideNoteCollapsible:"side-note-collapsible",smartStandardArticleNonNormative:"smart-standard-article-non-normative",smartStandardArticleNonNormativeCollapsible:"smart-standard-article-non-normative-collapsible",smartStandardArticleNormative:"smart-standard-article-normative",smartStandardArticleNormativeCollapsible:"smart-standard-article-normative-collapsible",smartStandardExampleNonNormative:"smart-standard-example-non-normative",smartStandardExampleNonNormativeCollapsible:"smart-standard-example-non-normative-collapsible",smartStandardExampleNormative:"smart-standard-example-normative",smartStandardExampleNormativeCollapsible:"smart-standard-example-normative-collapsible",smartStandardFormula:"smart-standard-formula",smartStandardFormulaNonNormative:"smart-standard-formula-non-normative",smartStandardFormulaNormative:"smart-standard-formula-normative",smartStandardImageFigureNonNormative:"smart-standard-image-figure-non-normative",smartStandardImageFigureNonNormativeCollapsible:"smart-standard-image-figure-non-normative-collapsible",smartStandardImageFigureNormative:"smart-standard-image-figure-normative",smartStandardImageFigureNormativeCollapsible:"smart-standard-image-figure-normative-collapsible",smartStandardLegend:"smart-standard-legend",smartStandardLegendNonNormative:"smart-standard-legend-non-normative",smartStandardLegendNormative:"smart-standard-legend-normative",smartStandardList:"smart-standard-list",smartStandardListCollapsible:"smart-standard-list-collapsible",smartStandardListItem:"smart-standard-list-item",smartStandardListItemCollapsible:"smart-standard-list-item-collapsible",smartStandardNoteNonNormative:"smart-standard-note-non-normative",smartStandardNoteNonNormativeCollapsible:"smart-standard-note-non-normative-collapsible",smartStandardNoteNormative:"smart-standard-note-normative",smartStandardNoteNormativeCollapsible:"smart-standard-note-normative-collapsible",smartStandardRemarkLegend:"smart-standard-remark-legend",smartStandardRemarkLegendNonNormative:"smart-standard-remark-legend-non-normative",smartStandardRemarkLegendNormative:"smart-standard-remark-legend-normative",smartStandardRemarkFormula:"smart-standard-remark-formula",smartStandardRemarkFormulaNonNormative:"smart-standard-remark-formula-non-normative",smartStandardRemarkFormulaNormative:"smart-standard-remark-formula-normative",smartStandardRemarkNonNormative:"smart-standard-remark-non-normative",smartStandardRemarkNonNormativeCollapsible:"smart-standard-remark-non-normative-collapsible",smartStandardRemarkNormative:"smart-standard-remark-normative",smartStandardRemarkNormativeCollapsible:"smart-standard-remark-normative-collapsible",smartStandardRemarkTableImageNonNormative:"smart-standard-remark-table-image-non-normative",smartStandardRemarkTableImageNonNormativeCollapsible:"smart-standard-remark-table-image-non-normative-collapsible",smartStandardRemarkTableImageNormative:"smart-standard-remark-table-image-normative",smartStandardRemarkTableImageNormativeCollapsible:"smart-standard-remark-table-image-normative-collapsible",smartStandardRemarkTableNonNormative:"smart-standard-remark-table-non-normative",smartStandardRemarkTableNonNormativeCollapsible:"smart-standard-remark-table-non-normative-collapsible",smartStandardRemarkTableNormative:"smart-standard-remark-table-normative",smartStandardRemarkTableNormativeCollapsible:"smart-standard-remark-table-normative-collapsible",smartStandardTableImageNonNormative:"smart-standard-table-image-non-normative",smartStandardTableImageNonNormativeCollapsible:"smart-standard-table-image-non-normative-collapsible",smartStandardTableImageNormative:"smart-standard-table-image-normative",smartStandardTableImageNormativeCollapsible:"smart-standard-table-image-normative-collapsible",smartStandardTableNonNormative:"smart-standard-table-non-normative",smartStandardTableNonNormativeCollapsible:"smart-standard-table-non-normative-collapsible",smartStandardTableNormative:"smart-standard-table-normative",smartStandardTableNormativeCollapsible:"smart-standard-table-normative-collapsible",standardArticleNonNormative:"standard-article-non-normative",standardArticleNormative:"standard-article-normative",standardExampleNonNormative:"standard-example-non-normative",standardExampleNormative:"standard-example-normative",standardImageFigureNonNormative:"standard-image-figure-non-normative",standardImageFigureNormative:"standard-image-figure-normative",standardList:"standard-list",standardListItem:"standard-list-item",standardNoteNonNormative:"standard-note-non-normative",standardNoteNormative:"standard-note-normative",standardRemarkNonNormative:"standard-remark-non-normative",standardRemarkNormative:"standard-remark-normative",standardRemarkTableImageNonNormative:"standard-remark-table-image-non-normative",standardRemarkTableImageNormative:"standard-remark-table-image-normative",standardRemarkTableNonNormative:"standard-remark-table-non-normative",standardRemarkTableNormative:"standard-remark-table-normative",standardTableImageNonNormative:"standard-table-image-non-normative",standardTableImageNormative:"standard-table-image-normative",standardTableNonNormative:"standard-table-non-normative",standardTableNormative:"standard-table-normative",statement:"statement",stdout:"stdout",step:"step",stepImageScreenshot:"step-image-screenshot",stepImageScreenshotWithPointer:"step-image-screenshot-with-pointer",sticker:"sticker",stickyNote:"sticky-note",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",summary:"summary",summaryAi:"summary-ai",survey:"survey",survey1:"survey-1",surveyAnonymous:"survey-anonymous",surveyAnonymous1:"survey-anonymous-1",surveyMatrix:"survey-matrix",surveyMatrixMe:"survey-matrix-me",surveyRating:"survey-rating",surveyRatingDisplay:"survey-rating-display",surveyRatingOnce:"survey-rating-once",table:"table",tableAlt:"table-alt",tableImage:"table-image",tableImageAlt:"table-image-alt",takePicture:"take-picture",toc:"toc",tocChapter:"toc-chapter",tocInline:"toc-inline",tocResource:"toc-resource",tocContent:"toc-content",trueFalse:"true-false",trueFalse1:"true-false-1",vendorAmcharts5Chart:"vendor-amcharts-5-chart",vendorDatadogDashboardEmbed:"vendor-datadog-dashboard-embed",vendorFormbricksEmbed:"vendor-formbricks-embed",vendorFormbricksLink:"vendor-formbricks-link",vendorFormbricksEmbedAnonymous:"vendor-formbricks-embed-anonymous",vendorFormbricksLinkAnonymous:"vendor-formbricks-link-anonymous",vendorHighchartsChart:"vendor-highcharts-chart",vendorIframelyCard:"vendor-iframely-card",vendorIframelyEmbed:"vendor-iframely-embed",vendorIframelyPreview:"vendor-iframely-preview",vendorIframelyPreviewMini:"vendor-iframely-preview-mini",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",vendorJupyterOutput:"vendor-jupyter-output",vendorPadletEmbed:"vendor-padlet-embed",vendorStripePricingTable:"vendor-stripe-pricing-table",vendorStripePricingTableExternal:"vendor-stripe-pricing-table-external",video:"video",videoEmbed:"video-embed",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLandscape:"video-landscape",videoLink:"video-link",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",warningAlt:"warning-alt",warningCollapsible:"warning-collapsible",websiteLink:"website-link",workbookArticle:"workbook-article"}),p=(0,i(718).superenum)({infinity:"infinity"}),u=(0,i(718).superenum)({none:"none",string:"string",boolean:"boolean"}),h={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:"&"},m=(0,i(718).superenum)(h),g=(0,i(718).superenum)({none:"none",plainText:"plainText",bitmarkText:"bitmarkText",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"}),b=(0,i(718).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkText:"bitmark++"}),f=(0,i(718).superenum)({flashcard:"flashcard",definitionList:"definitionList",elements:"elements",statements:"statements",quiz:"quiz",feedback:"feedback",questions:"questions",matchPairs:"matchPairs",matchAudioPairs:"matchAudioPairs",matchImagePairs:"matchImagePairs",matchMatrix:"matchMatrix",table:"table",pronunciationTable:"pronunciationTable",botActionResponses:"botActionResponses",exampleBitList:"exampleBitList",clozeList:"clozeList",ingredients:"ingredients",bookReferenceList:"bookReferenceList"}),y=(0,i(718).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"}),k=(0,i(718).superenum)({unknown:"unknown",tag:"tag",property:"property",resource:"resource",group:"group"}),T=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}},v=class extends T{constructor(e){super({type:k.tag,jsonKey:void 0,...e}),l(this,"type",k.tag)}toString(e){const t=Object.assign({},e);let i=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},x=class extends T{constructor(e){super({type:k.property,...e}),l(this,"type",k.property),l(this,"array"),l(this,"format"),l(this,"defaultValue"),this.array=e.maxCount===p.infinity||e.maxCount>1,this.format=e.format,this.defaultValue=e.defaultValue}toString(e){const t=Object.assign({},e);let i=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.array&&(i+=`, arr=${this.array}`),null!=this.format&&(i+=`, fmt=${this.format}`),null!=this.defaultValue&&(i+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},_=class extends T{constructor(e){super({type:k.resource,...e}),l(this,"type",k.resource)}toString(e){const t=Object.assign({},e);let i=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(i+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(i+=`, max=${this.maxCount}`),null!=this.minCount&&(i+=`, min=${this.minCount}`),null!=this.jsonKey&&(i+=`, json=${this.jsonKey}`)),i+="]",this.chain&&t.includeChains){i+="\n|__";let e=!0;for(const r of Object.values(this.chain))e||(i+=" "),i+=`${r.toString(t)}`,e=!1}return i}},w=class{constructor(e,t,i,r){l(this,"tags"),l(this,"bodyAllowed"),l(this,"bodyRequired"),l(this,"repeatCount"),this.tags=e,this.bodyAllowed=t??!0,this.bodyRequired=i,this.repeatCount=r}toString(e){const t=Object.assign({},e);let i="";const r=[];this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),null!=this.repeatCount&&r.push(`repeatCount=${this.repeatCount}`),i+=`[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))i+=`\n${e.toString(t)}`;return i}},C=class{constructor(e,t){l(this,"configKey"),l(this,"variants"),this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let i="",r=0,o=0;for(const e of this.variants){for(const a of e)i+=`[Card - Side ${r}, Variant ${o}]`,i+=`\n${a.toString(t)}`,o++;r++}return i}},A=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:i,inheritedBitTypes:r,textFormatDefault:o,tags:a,cardSet:n,quizBit:s,deprecated:c,bodyAllowed:d,bodyRequired:p,footerAllowed:u,footerRequired:h,resourceAttachmentAllowed:m,rootExampleType:g,comboResourceConfigKey:b}=e;this.since=t,this.bitType=i,this.inheritedBitTypes=r,this.inheritedBitTypesSet=new Set(r),this.textFormatDefault=o,this.tags=a,this.cardSet=n,this.quizBit=s,this.deprecated=c,this.bodyAllowed=d??!0,this.bodyRequired=p,this.footerAllowed=u??!0,this.footerRequired=h,this.resourceAttachmentAllowed=m??!0,this.rootExampleType=g,this.comboResourceConfigKey=b}toString(e){const t=Object.assign({},e);let i=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(i+="\n\n[Inheritance]",i+=`\n${this.inheritedBitTypes.join(" => ")}`),i+=`\n\n[Default text format]\n${this.textFormatDefault}`;const r=[];null!=this.since&&r.push(`since=${this.since}`),null!=this.deprecated&&r.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&r.push("bodyAllowed"),this.bodyRequired&&r.push("bodyRequired"),this.footerAllowed&&r.push("footerAllowed"),this.footerRequired&&r.push("footerRequired"),this.resourceAttachmentAllowed&&r.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&r.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceConfigKey&&r.push(`comboResourceConfigKey=${this.comboResourceConfigKey}`),i+=`\n\n[Flags]\n${r.join(", ")}`,i+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===p.infinity||e.maxCount>0)&&(i+=`\n${e.toString(t)}`);return this.cardSet&&(i+=`\n\n${this.cardSet.toString(t)}`),i}},B=i(718),S={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_technicalTerm:"group_technicalTerm",group_person:"group_person",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_quizCommon:"group_quizCommon",group_resourceBitTags:"group_resourceBitTags",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceIcon:"group_resourceIcon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"},P=((0,i(718).superenum)(S),{property_action:"@action",property_activityType:"@activityType",property_additionalSolutions:"@additionalSolutions",property_ageRange:"@ageRange",property_aiGenerated:"@aiGenerated",property_allowedBit:"@allowedBit",property_allowSubtitles:"@allowSubtitles",property_alt:"@alt",property_altLangTag:"@altLangTag",property_analyticsTag:"@analyticsTag",property_author:"@author",property_autoplay:"@autoplay",property_availableClassifications:"@availableClassifications",property_blockId:"@blockId",property_book:"@book",property_bookAlias:"@bookAlias",property_bookDiff:"@bookDiff",property_bot:"@bot",property_bubbleTag:"@bubbleTag",property_buttonCaption:"@buttonCaption",property_callToActionUrl:"@callToActionUrl",property_caption:"@caption",property_categoryTag:"@categoryTag",property_chatWithBook:"@chatWithBook",property_chatWithBookBrainKey:"@chatWithBookBrainKey",property_citationStyle:"@citationStyle",property_classification:"@classification",property_codeLineNumbers:"@codeLineNumbers",property_codeMinimap:"@codeMinimap",property_color:"@color",property_colorTag:"@colorTag",property_computerLanguage:"@computerLanguage",property_content2Buy:"@content2Buy",property_copyright:"@copyright",property_coverColor:"@coverColor",property_coverImage:"@coverImage",property_customerExternalId:"@customerExternalId",property_customerId:"@customerId",property_date:"@date",property_dateEnd:"@dateEnd",property_decimalPlaces:"@decimalPlaces",property_deeplink:"@deeplink",property_diffContext:"@diffContext",property_diffOp:"@diffOp",property_diffRef:"@diffRef",property_diffTime:"@diffTime",property_diffTo:"@diffTo",property_disableCalculation:"@disableCalculation",property_disableFeedback:"@disableFeedback",property_duration:"@duration",property_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_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_imageFirst:"@imageFirst",property_imageSource:"@imageSource",property_index:"@index",property_internalComment:"@internalComment",property_isCaseSensitive:"@isCaseSensitive",property_isInfoOnly:"@isInfoOnly",property_isPublic:"@isPublic",property_isTemplate:"@isTemplate",property_isTemplateStripTheme:"@isTemplateStripTheme",property_isTracked:"@isTracked",property_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_mailingList:"@mailingList",property_mark:"@mark",property_maxCreatedBits:"@maxCreatedBits",property_maxDisplayLevel:"@maxDisplayLevel",property_maxTocChapterLevel:"@maxTocChapterLevel",property_mockupId:"@mockupId",property_mute:"@mute",property_padletId:"@padletId",property_page:"@page",property_pageNo:"@pageNo",property_partialAnswer:"@partialAnswer",property_partner:"@partner",property_path:"@path",property_person:"@person",property_pointerLeft:"@pointerLeft",property_pointerTop:"@pointerTop",property_posterImage:"@posterImage",property_processHandIn:"@processHandIn",property_processHandInLocation:"@processHandInLocation",property_product:"@product",property_productFolder:"@productFolder",property_productId:"@productId",property_productVideo:"@productVideo",property_progress:"@progress",property_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_releaseDate:"@releaseDate",property_releaseKind:"@releaseKind",property_releaseVersion:"@releaseVersion",property_reportTag:"@reportTag",property_resolved:"@resolved",property_resolvedBy:"@resolvedBy",property_resolvedDate:"@resolvedDate",property_revealSolutions:"@revealSolutions",property_sampleSolution:"@sampleSolution",property_scormSource:"@scormSource",property_search:"@search",property_searchIndex:"@searchIndex",property_servings:"@servings",property_showInIndex:"@showInIndex",property_showSubtitles:"@showSubtitles",property_siteName:"@siteName",property_size:"@size",property_slug:"@slug",property_spaceId:"@spaceId",property_src1x:"@src1x",property_src2x:"@src2x",property_src3x:"@src3x",property_src4x:"@src4x",property_stripePricingTableId:"@stripePricingTableId",property_stripePublishableKey:"@stripePublishableKey",property_subject:"@subject",property_subtype:"@subtype",property_tableAutoWidth:"@tableAutoWidth",property_tableColumnMinWidth:"@tableColumnMinWidth",property_tableFixedHeader:"@tableFixedHeader",property_tableHeaderWhitespaceNoWrap:"@tableHeaderWhitespaceNoWrap",property_tableHeight:"@tableHeight",property_tablePagination:"@tablePagination",property_tablePaginationLimit:"@tablePaginationLimit",property_tableResizableColumns:"@tableResizableColumns",property_tableSearch:"@tableSearch",property_tableSort:"@tableSort",property_tableWhitespaceNoWrap:"@tableWhitespaceNoWrap",property_tag:"@tag",property_target:"@target",property_technicalTerm:"@technicalTerm",property_textReference:"@textReference",property_theme:"@theme",property_thumbImage:"@thumbImage",property_title:"@title",property_toc:"@toc",property_tocContent:"@tocContent",property_tocResource:"@tocResource",property_topicTag:"@topicTag",property_trim:"@trim",property_unit:"@unit",property_unitAbbr:"@unitAbbr",property_vendorDashboardId:"@vendorDashboardId",property_vendorSurveyId:"@vendorSurveyId",property_vendorUrl:"@vendorUrl",property_videoCallLink:"@videoCallLink",property_width:"@width",property_x:"@x",property_y:"@y",property_zoomDisabled:"@zoomDisabled"}),I=(0,i(718).superenum)(P),L={resource_image:"&image",resource_imageResponsive:"&imageResponsive",resource_imagePortrait:"&imagePortrait",resource_imageLandscape:"&imageLandscape",resource_imageEmbed:"&imageEmbed",resource_imageLink:"&imageLink",resource_audio:"&audio",resource_audioEmbed:"&audioEmbed",resource_audioLink:"&audioLink",resource_video:"&video",resource_videoEmbed:"&videoEmbed",resource_videoLink:"&videoLink",resource_stillImageFilm:"&stillImageFilm",resource_stillImageFilmEmbed:"&stillImageFilmEmbed",resource_stillImageFilmLink:"&stillImageFilmLink",resource_article:"&article",resource_articleEmbed:"&articleEmbed",resource_articleLink:"&articleLink",resource_document:"&document",resource_documentEmbed:"&documentEmbed",resource_documentLink:"&documentLink",resource_documentDownload:"&documentDownload",resource_appLink:"&appLink",resource_websiteLink:"&websiteLink",resource_icon:"&icon",resource_backgroundWallpaper:"&backgroundWallpaper",resource_imagePlaceholder:"&imagePlaceholder"},E=((0,i(718).superenum)(L),i(718)),V=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}countOccurrences(e,t){return e.split(t).length-1}countOccurrencesAtStart(e,t){let i=0;for(;e.startsWith(t);)i++,e=e.substring(t.length);return i}countOccurrencesAtEnd(e,t){let i=0;for(;e.endsWith(t);)i++,e=e.substring(0,e.length-t.length);return i}splitPlaceholders(e,t){let i=[e];const r=(e,t)=>{const i=[];for(const r of e){const e=r.split(t);for(let r=0,o=e.length;r<o;r++){const a=e[r],n=r===o-1;i.push(a),n||i.push(t)}}return i};for(const e of t)i=r(i,e);return i}firstLine(e,t){const i=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return i;const r=e.split("\n");return r.length>0?r[0].substring(0,t):i}wordWrap(e,t){const i=[];if(t<1||null==e||e.length<=t)return i;const r=e.length,o=r-t;let a,n=0;for(;n<o;){let r;const o=n+t,s=e.indexOf("\n",n);if(s>-1&&s>n&&s<o){r=s-n,a=e.substr(n,r),n=n+r+1,i.push(a);continue}const l=e.lastIndexOf(" ",o);let c=0;l>-1&&l!=n-1?(r=l-n,r>0&&(c=n+r+1)):(r=t,c=n+t),a=e.slice(n,n+r),n=c,i.push(a.trim())}return n<r&&(a=e.slice(n),i.push(a)),i}kebabToCamel(e){return e?e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()):e}},N=(0,E.superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link",icon:"icon",backgroundWallpaper:"backgroundWallpaper",imagePlaceholder:"imagePlaceholder"});function R(e){return`&${V.kebabToCamel(e)}`}var F=(0,B.superenum)({_unknown:"_unknown",...h,...L,...P,...S});function O(e){return e?e.startsWith("@")?k.property:e.startsWith("&")?k.resource:e.startsWith("group_")?k.group:k.tag:k.unknown}function D(e){return e.replace(/^@/,"")}function z(e){return N.fromKey(e.replace(/^&/,""))}var q=class{constructor(e,t,i,r){l(this,"tags"),l(this,"resourceAttachmentAllowed"),l(this,"resourceAttachmentConfigKey"),l(this,"comboResourceConfigKeysMap"),this.tags=e,this.resourceAttachmentAllowed=t??!1,this.resourceAttachmentConfigKey=i,this.comboResourceConfigKeysMap=r}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.configKey,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.configKey,t.maxCount);return e}},M=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}getViaPath(e,t){if(!e)return;if(!t)return;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let i=e;for(const e of t){if(null==i)return;i=i[e]}return i}setViaPath(e,t,i,r){if(!e)return!1;if(!t)return!1;Array.isArray(t)||(t=[t]),t=t.flatMap(e=>e.split("."));let o=e;for(let e=0;e<t.length-1;e++){const i=t[e];if(null==o[i]){if(!r)return!1;o[i]={}}o=o[i]}return o[t[t.length-1]]=i,!0}flatMapPath(e,t){if(!e)return[];if(!t)return[];Array.isArray(t)||(t=[t]);const i=e,r=t.shift();if(null==r)return i;const o=i[r];return o?Array.isArray(o)?o.flatMap(e=>this.flatMapPath(e,t.slice())):[this.flatMapPath(o,t)].flat():[]}orderProperties(e,t){const i=e,r=Object.assign({},i);for(const e of Object.keys(i))delete i[e];for(const e of t)Object.prototype.hasOwnProperty.call(r,e)&&(i[e]=r[e])}removeUndefinedProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||null==r&&delete i[e]}removeFalseProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||!1===r&&delete i[e]}removeEmptyStringProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||""===r&&delete i[e]}removeEmptyArrayProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||Array.isArray(r)&&0===r.length&&delete i[e]}removeEmptyObjectProperties(e,t){const i=e;for(const[e,r]of Object.entries(i))t&&t.indexOf(e)>=0||this.isObject(r)&&0===Object.keys(r).length&&delete i[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const i=e;if(null==i[t])return;let r=i[t];if(Array.isArray(r)){if(0===r.length)return;r=r[r.length-1]}return r}deepMerge(...e){return function e(...t){function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function r(t,r){for(const[o,a]of Object.entries(r)){const r=i(a);void 0!==t[o]&&i(t[o])===r&&["array","object"].includes(r)?t[o]=e(t[o],a):t[o]=structuredClone(a)}}let o=structuredClone(t.shift());for(const e of t){const t=i(e);i(o)===t?"array"===t?o=[...o,...structuredClone(e)]:"object"===t?r(o,e):o=e:o=structuredClone(e)}return o}(...e)}},$={[f.definitionList]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the definition.",format:g.plainText},{key:F.tag_title,description:"Title of the definition."},{key:F.group_resourceIcon,description:"Icon resource for the definition."}],repeatCount:p.infinity}]]},[f.flashcard]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the flashcard.",format:g.plainText},{key:F.tag_title,description:"Title of the flashcard."},{key:F.group_resourceIcon,description:"Icon resource for the flashcard."}],repeatCount:p.infinity}]]},[f.elements]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the element.",format:g.plainText}],repeatCount:p.infinity}]]},[f.statements]:{variants:[[{tags:[{key:F.tag_true,description:"Tag for true statements.",maxCount:1},{key:F.tag_false,description:"Tag for false statements.",maxCount:1},{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the statement.",format:g.plainText}],bodyAllowed:!1}]]},[f.quiz]:{variants:[[{tags:[{key:F.group_trueFalse,description:"Group for true/false questions."},{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the quiz question.",format:g.plainText}],bodyAllowed:!1}]]},[f.feedback]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.group_trueFalse,description:"Group for true/false feedback."},{key:F.tag_title,description:"Title of the feedback."}],bodyAllowed:!1}],[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:g.number},{key:F.property_example,description:"Example text for the feedback.",format:g.plainText},{key:F.tag_title,description:"Title of the feedback."}],bodyAllowed:!0}]]},[f.questions]:{variants:[[{tags:[{key:F.property_reasonableNumOfChars,description:"Property for reasonable number of characters.",format:g.number},{key:F.tag_sampleSolution,description:"Sample solution for the question."},{key:F.property_sampleSolution,description:"Property for sample solution text.",format:g.plainText},{key:F.property_additionalSolutions,description:"Property for additional solutions.",format:g.plainText,maxCount:p.infinity},{key:F.property_partialAnswer,description:"Property for partial answer text.",format:g.plainText},{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the question.",format:g.plainText}],repeatCount:p.infinity}]]},[f.matchPairs]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the match pair.",format:g.plainText},{key:F.tag_title,description:"Title of the match pair."},{key:F.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:g.boolean}],repeatCount:p.infinity}]]},[f.matchAudioPairs]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the audio match pair.",format:g.plainText},{key:F.tag_title,description:"Title of the audio match pair."},{key:F.resource_audio,description:"Audio resource for the match pair."}],repeatCount:p.infinity}]]},[f.matchImagePairs]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the image match pair.",format:g.plainText},{key:F.tag_title,description:"Title of the image match pair."},{key:F.resource_image,description:"Image resource for the match pair."}],repeatCount:p.infinity}]]},[f.matchMatrix]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the match matrix.",format:g.plainText},{key:F.tag_title,description:"Title of the match matrix."},{key:F.property_isCaseSensitive,description:"Property to indicate if the match is case sensitive.",format:g.boolean}],repeatCount:p.infinity}]]},[f.table]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.tag_title,description:"Title of the table."}],repeatCount:p.infinity}]]},[f.pronunciationTable]:{variants:[[{tags:[{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.tag_title,description:"Title of the pronunciation table."},{key:F.resource_audio,description:"Audio resource for the pronunciation table."}],repeatCount:p.infinity}]]},[f.botActionResponses]:{variants:[[{tags:[{key:F.property_reaction,description:"Reaction to the bot action.",format:g.plainText},{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_example,description:"Example text for the bot action response.",format:g.plainText}]}]]},[f.clozeList]:{variants:[[{tags:[{key:F.group_standardTags,description:"Standard tags for cloze items."},{key:F.group_gap,description:"Group for gap tags in cloze items."}]}]]},[f.exampleBitList]:{variants:[[{tags:[{key:F.group_standardTags,description:"Standard tags for example bits."},{key:F.tag_title,description:"Title of the example bit."}],repeatCount:p.infinity}]]},[f.ingredients]:{variants:[[{tags:[{key:F.tag_title,description:"Title of the ingredient."},{key:F.group_trueFalse,description:"Group for true/false properties of the ingredient."},{key:F.group_standardItemLeadInstructionHint,description:"Standard tags for lead, instruction, and hint."},{key:F.property_unit,description:"Unit of measurement for the ingredient.",format:g.plainText},{key:F.property_unitAbbr,description:"Abbreviation for the unit of measurement.",format:g.plainText},{key:F.property_decimalPlaces,description:"Number of decimal places for the ingredient quantity.",format:g.number,defaultValue:"1"},{key:F.property_disableCalculation,description:"Disable calculation for the ingredient.",format:g.boolean}],repeatCount:p.infinity}]]},[f.bookReferenceList]:{variants:[[{tags:[{key:F.group_standardTags,description:"Standard tags for book references."},{key:F.property_refAuthor,description:"Author of the book.",format:g.plainText,maxCount:p.infinity},{key:F.property_refBookTitle,description:"Title of the book.",format:g.plainText},{key:F.property_refPublisher,description:"Publisher of the book.",format:g.plainText,maxCount:p.infinity},{key:F.property_refPublicationYear,description:"Year of publication of the book.",format:g.plainText},{key:F.property_citationStyle,description:"Citation style for the book reference.",format:g.plainText}],repeatCount:p.infinity}]]}},j={[F.group_standardAllBits]:{name:"Standard",description:"Standard tags which apply to all bits",type:y.standard,tags:[{key:F.property_id,description:"The unique identifier(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_customerId,description:"The customer-specific identifier for the bit",format:g.plainText},{key:F.property_externalId,description:"The external identifier for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_isTemplate,description:"If true, the bit is a template",format:g.boolean,defaultValue:"false"},{key:F.property_isTemplateStripTheme,description:"If true, the bit is a template strip theme",format:g.boolean,defaultValue:"false"},{key:F.property_aiGenerated,description:"If true, the bit is AI-generated",format:g.boolean},{key:F.property_machineTranslated,description:"If true, the bit is machine-translated",format:g.plainText},{key:F.property_searchIndex,description:"The search index(es) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_analyticsTag,description:"The analytics tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_categoryTag,description:"The category tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_topicTag,description:"The topic tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_reportTag,description:"The report tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_altLangTag,description:"The alternative language tag for the bit",format:g.plainText},{key:F.property_feedbackEngine,description:"The feedback engine for the bit",format:g.plainText},{key:F.property_feedbackType,description:"The feedback type for the bit",format:g.plainText},{key:F.property_disableFeedback,description:"If true, feedback is disabled for the bit",format:g.boolean},{key:F.property_diffTo,description:"The diff to version for the bit",format:g.plainText},{key:F.property_diffOp,description:"The diff operation for the bit",format:g.plainText},{key:F.property_diffRef,description:"The diff reference for the bit",format:g.plainText},{key:F.property_diffContext,description:"The diff context for the bit",format:g.plainText},{key:F.property_diffTime,description:"The diff time for the bit",format:g.number},{key:F.property_ageRange,description:"The age range for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_lang,description:"The language for the bit",format:g.plainText},{key:F.property_publisher,description:"The publisher(s) of the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_publisherName,description:"The name of the publisher of the bit",format:g.plainText},{key:F.property_theme,description:"The theme(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_target,description:"The target(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_tag,description:"The tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_groupTag,description:"The group tag(s) for the bit",format:g.plainText,maxCount:p.infinity,chain:[{key:F.property_tag,description:"The tag(s) for the group",format:g.plainText,maxCount:p.infinity}]},{key:F.property_reductionTag,description:"The reduction tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_bubbleTag,description:"The bubble tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_levelCEFRp,description:"The CEFRp level for the bit",format:g.plainText},{key:F.property_levelCEFR,description:"The CEFR level for the bit",format:g.plainText},{key:F.property_levelILR,description:"The ILR level for the bit",format:g.plainText},{key:F.property_levelACTFL,description:"The ACTFL level for the bit",format:g.plainText},{key:F.property_icon,description:"The icon for the bit",format:g.plainText},{key:F.property_iconTag,description:"The icon tag for the bit",format:g.plainText},{key:F.property_colorTag,description:"The color tag(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.tag_anchor,name:"Anchor",description:"The anchor for the bit"},{key:F.property_search,description:"The search text for the bit",format:g.plainText},{key:F.property_showInIndex,description:"If true, the bit is shown in the index",format:g.boolean,defaultValue:"false"},{key:F.property_layer,description:"The layer(s) for the bit",format:g.plainText,maxCount:p.infinity},{key:F.property_layerRole,description:"The layer role(s) for the bit",format:g.plainText,maxCount:p.infinity}]},[F.group_standardItemLeadInstructionHint]:{type:y.standard,description:"Standard group for item, lead, page number, margin number, instruction and hint tags",tags:[{key:F.tag_item,description:"The item for the bit",chain:[{key:F.tag_item,description:"The lead, page number, and margin number for the bit",maxCount:3}]},{key:F.tag_instruction,name:"Instruction",description:"The instruction for the bit"},{key:F.tag_hint,name:"Hint",description:"The hint for the bit"}]},[F.group_standardTags]:{type:y.standard,description:"Standard tags which apply to MOST (but not all) bits",tags:[{key:F.group_standardAllBits,description:"All standard tags which apply to all bits"},{key:F.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:F.property_example,description:"The example(s) for the bit",format:g.plainText}]},[F.group_imageSource]:{type:y.standard,description:"Image source chain",tags:[{key:F.property_imageSource,description:"The source of an image",format:g.plainText,chain:[{key:F.property_mockupId,description:"The mockup ID for the image",format:g.plainText},{key:F.property_size,description:"The size of the image",format:g.number},{key:F.property_format,description:"The format of the image",format:g.plainText},{key:F.property_trim,description:"If true, the image is trimmed",format:g.boolean}]}]},[F.group_technicalTerm]:{type:y.standard,description:"Technical term chain",tags:[{key:F.property_technicalTerm,description:"The technical term",format:g.plainText,chain:[{key:F.property_lang,description:"The language of the technical term",format:g.plainText}]}]},[F.group_person]:{type:y.standard,description:"Person chain",tags:[{key:F.property_person,description:"A person",format:g.plainText,chain:[{key:F.property_title,description:"The person's title",format:g.plainText},{key:F.group_resourceImage,description:"The image of the person"}]},{key:F.property_partner,description:"A partner",format:g.plainText,chain:[{key:F.property_title,description:"The partner's title",format:g.plainText},{key:F.group_resourceImage,description:"The image of the partner"}]}]},[F.group_gap]:{type:y.standard,description:"Gap chain",tags:[{key:F.tag_gap,description:"The value of a gap in the content",maxCount:p.infinity,chain:[{key:F.tag_gap,description:"Alternative values for the gaps in the content",maxCount:p.infinity},{key:F.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:F.property_example,description:"An example for the gap",format:g.plainText},{key:F.property_isCaseSensitive,description:"If true, the gap text is case sensitive",format:g.boolean}]}]},[F.group_trueFalse]:{type:y.standard,description:"True/False chain",tags:[{key:F.tag_true,description:"True value for a true/false statement/question",maxCount:p.infinity,chain:[{key:F.tag_true,description:"True values for a true/false statement/question",maxCount:p.infinity},{key:F.tag_false,description:"False values for a true/false statement/question",maxCount:p.infinity},{key:F.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:F.property_example,description:"An example for the true/false statement/question",format:g.plainText}]},{key:F.tag_false,description:"False value for a true/false statement/question",maxCount:p.infinity,chain:[{key:F.tag_true,description:"True values for a true/false statement/question",maxCount:p.infinity},{key:F.tag_false,description:"False values for a true/false statement/question",maxCount:p.infinity},{key:F.group_standardItemLeadInstructionHint,description:"Item, lead, page number, margin number, instruction and hint tags"},{key:F.property_example,description:"An example for the true/false statement/question",format:g.plainText}]}]},[F.group_markConfig]:{type:y.standard,description:"Mark configuration chain",tags:[{key:F.property_mark,description:"The mark configuration",format:g.plainText,maxCount:p.infinity,chain:[{key:F.property_color,description:"The color of the mark",format:g.plainText},{key:F.property_emphasis,description:"The emphasis of the mark",format:g.plainText}]}]},[F.group_mark]:{type:y.standard,description:"Mark chain",tags:[{key:F.tag_mark,description:"The marked content",maxCount:p.infinity,chain:[{key:F.property_mark,description:"The mark configuration",format:g.plainText},{key:F.property_example,description:"An example for the marked content",format:g.plainText}]}]},[F.group_bookCommon]:{type:y.standard,description:"Common book tags",tags:[{key:F.property_language,description:"The language of the book",format:g.plainText,maxCount:p.infinity},{key:F.property_customerExternalId,description:"The customer-specific external identifier for the book",format:g.plainText},{key:F.property_spaceId,description:"The space ID for the book",format:g.plainText,maxCount:p.infinity},{key:F.property_kind,description:"The kind of the book",format:g.plainText},{key:F.property_hasMarkAsDone,description:'If true, the book has a "Mark as done" feature',format:g.boolean,defaultValue:"false"},{key:F.property_processHandIn,description:"If true, the book will be processed when upon hand-in",format:g.boolean,defaultValue:"false"},{key:F.property_processHandInLocation,description:"The location where the book was handed-in",format:g.plainText},{key:F.property_isPublic,description:"If true, the book is public",format:g.boolean,defaultValue:"false"},{key:F.property_isTemplate,description:"If true, the book is a template",format:g.boolean,defaultValue:"false"},{key:F.property_isTemplateStripTheme,description:"If true, the book is a template strip theme",format:g.boolean,defaultValue:"false"},{key:F.property_isEditable,description:"If true, the book is editable",format:g.boolean,defaultValue:"false"},{key:F.property_chatWithBook,description:"If true, the user can chat about the book with an AI assistant",format:g.boolean,defaultValue:"false"},{key:F.property_chatWithBookBrainKey,description:"The BookBrain key for the book chat",format:g.plainText},{key:F.tag_title,name:"Title",description:"The title of the book",maxCount:2},{key:F.property_subtype,description:"The subtype of the book",format:g.plainText},{key:F.property_coverImage,description:"The cover image(s) of the book",format:g.plainText,maxCount:p.infinity},{key:F.property_coverColor,description:"The cover color of the book",format:g.plainText},{key:F.property_subject,description:"The subject(s) of the book",format:g.plainText,maxCount:p.infinity},{key:F.property_author,description:"The author(s) of the book",format:g.plainText,maxCount:p.infinity},{key:F.property_publications,description:"The publication(s) of the book",format:g.plainText,maxCount:p.infinity},{key:F.property_duration,description:"The duration of the book",format:g.plainText},{key:F.property_maxTocChapterLevel,description:"The maximum table of contents chapter level",format:g.number}]},[F.group_learningPathCommon]:{type:y.standard,description:"Common learning path tags",tags:[{key:F.property_action,description:"The action for the learning path",format:g.plainText},{key:F.property_duration,description:"The duration of the learning path",format:g.plainText},{key:F.property_date,description:"The date of the learning path",format:g.plainText},{key:F.property_dateEnd,description:"The end date of the learning path",format:g.plainText},{key:F.property_location,description:"The location of the learning path",format:g.plainText},{key:F.property_list,description:"The list of items in the learning path",format:g.plainText,maxCount:p.infinity},{key:F.property_textReference,description:"The text reference for the learning path",format:g.plainText},{key:F.property_isTracked,description:"If true, the learning path is tracked",format:g.boolean},{key:F.property_isInfoOnly,description:"If true, the learning path is info only",format:g.boolean},{key:F.property_deeplink,description:"The deeplink(s) for the learning path",format:g.plainText,maxCount:p.infinity},{key:F.property_buttonCaption,description:"The caption for the button of the learning path",format:g.plainText},{key:F.property_book,description:"The book(s) associated with the learning path",format:g.plainText,chain:[{key:F.tag_reference,description:"The reference(s) for the book(s) in the learning path",maxCount:2}]}]},[F.group_quizCommon]:{type:y.standard,description:"Common quiz tags",tags:[{key:F.property_revealSolutions,description:"If true, the quiz solutions are revealed",format:g.boolean}]},[F.group_resourceBitTags]:{type:y.standard,description:"Resource bit tags",tags:[{key:F.resource_imagePlaceholder,description:"Placeholder image for the resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the placeholder image"}],maxCount:1}]},[F.group_resourceCommon]:{type:y.standard,description:"Common resource properties",tags:[{key:F.property_license,description:"The license for the resource",format:g.plainText},{key:F.property_copyright,description:"The copyright information for the resource",format:g.plainText},{key:F.property_caption,description:"The caption for the resource",format:g.bitmarkText},{key:F.property_showInIndex,description:"If true, the resource is shown in the index",format:g.boolean,defaultValue:"false"},{key:F.property_search,description:"The search text for the resource",format:g.plainText}]},[F.group_resourceImageCommon]:{type:y.standard,description:"Common properties for image resources",tags:[{key:F.group_resourceCommon,description:"Common resource properties"},{key:F.property_src1x,description:"The source URL for the image at 1x resolution",format:g.plainText},{key:F.property_src2x,description:"The source URL for the image at 2x resolution",format:g.plainText},{key:F.property_src3x,description:"The source URL for the image at 3x resolution",format:g.plainText},{key:F.property_src4x,description:"The source URL for the image at 4x resolution",format:g.plainText},{key:F.property_width,description:"The width of the image",format:g.number},{key:F.property_height,description:"The height of the image",format:g.number},{key:F.property_alt,description:"The alternative text for the image",format:g.plainText},{key:F.property_zoomDisabled,description:"If true, zooming is disabled for the image",format:g.boolean}]},[F.group_resourceAudioCommon]:{type:y.standard,description:"Common properties for audio resources",tags:[{key:F.group_resourceCommon,description:"Common resource properties"},{key:F.property_duration,description:"The duration of the audio resource",format:g.plainText},{key:F.property_mute,description:"If true, the audio is muted",format:g.boolean},{key:F.property_autoplay,description:"If true, the audio plays automatically",format:g.boolean}]},[F.group_resourceVideoCommon]:{type:y.standard,description:"Common properties for video resources",tags:[{key:F.group_resourceCommon,description:"Common resource properties"},{key:F.property_width,description:"The width of the video",format:g.number},{key:F.property_height,description:"The height of the video",format:g.number},{key:F.property_duration,description:"The duration of the video",format:g.plainText},{key:F.property_mute,description:"If true, the video is muted",format:g.boolean},{key:F.property_autoplay,description:"If true, the video plays automatically",format:g.boolean},{key:F.property_allowSubtitles,description:"If true, subtitles are allowed for the video",format:g.boolean},{key:F.property_showSubtitles,description:"If true, subtitles are shown in the video",format:g.boolean},{key:F.property_alt,description:"The alternative text for the video",format:g.plainText},{key:F.property_posterImage,description:"The poster image for the video",format:g.plainText,chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the poster image"}]},{key:F.property_src1x,description:"The source URL for the video at 1x resolution",format:g.plainText},{key:F.property_src2x,description:"The source URL for the video at 2x resolution",format:g.plainText},{key:F.property_src3x,description:"The source URL for the video at 3x resolution",format:g.plainText},{key:F.property_src4x,description:"The source URL for the video at 4x resolution",format:g.plainText}]},[F.group_resourceIcon]:{type:y.standard,description:"Common properties for icon resources",tags:[{key:F.resource_icon,description:"The icon resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the icon resource"}]}]},[F.group_resourceImage]:{type:y.resource,description:"Common properties for image resources",tags:[{key:F.resource_image,description:"The image resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the image resource"}]}]},[F.group_resourceImagePortrait]:{type:y.resource,description:"Portrait image resource",tags:[{key:F.resource_imagePortrait,description:"The portrait image resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the portrait image resource"}]}]},[F.group_resourceImageLandscape]:{type:y.resource,description:"Landscape image resource",tags:[{key:F.resource_imageLandscape,description:"The landscape image resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the landscape image resource"}]}]},[F.group_resourceImageEmbed]:{type:y.resource,description:"Embedded image resource",tags:[{key:F.resource_imageEmbed,description:"The embedded image resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the embedded image resource"}]}]},[F.group_resourceImageLink]:{type:y.resource,description:"Link to an image resource",tags:[{key:F.resource_imageLink,description:"The link to the image resource",chain:[{key:F.group_resourceImageCommon,description:"Common image properties for the linked image resource"}]}]},[F.group_resourceAudio]:{type:y.resource,description:"Audio resource",tags:[{key:F.resource_audio,description:"The audio resource",chain:[{key:F.group_resourceAudioCommon,description:"Common audio properties for the audio resource"}]}]},[F.group_resourceAudioEmbed]:{type:y.resource,description:"Embedded audio resource",tags:[{key:F.resource_audioEmbed,description:"The embedded audio resource",chain:[{key:F.group_resourceAudioCommon,description:"Common audio properties for the embedded audio resource"}]}]},[F.group_resourceAudioLink]:{type:y.resource,description:"Link to an audio resource",tags:[{key:F.resource_audioLink,description:"The link to the audio resource",chain:[{key:F.group_resourceAudioCommon,description:"Common audio properties for the linked audio resource"}]}]},[F.group_resourceVideo]:{type:y.resource,description:"Video resource",tags:[{key:F.resource_video,description:"The video resource",chain:[{key:F.group_resourceVideoCommon,description:"Common video properties for the video resource"}]}]},[F.group_resourceVideoEmbed]:{type:y.resource,description:"Embedded video resource",tags:[{key:F.resource_videoEmbed,description:"The embedded video resource",chain:[{key:F.group_resourceVideoCommon,description:"Common video properties for the embedded video resource"}]}]},[F.group_resourceVideoLink]:{type:y.resource,description:"Link to a video resource",tags:[{key:F.resource_videoLink,description:"The link to the video resource",chain:[{key:F.group_resourceVideoCommon,description:"Common video properties for the linked video resource"}]}]},[F.group_resourceStillImageFilmEmbed]:{type:y.resource,description:"Embedded still image film resource",tags:[{key:F.resource_stillImageFilmEmbed,description:"The embedded still image film resource",chain:[{key:F.group_resourceVideoCommon,description:"Common video properties for the embedded still image film resource"}]}]},[F.group_resourceStillImageFilmLink]:{type:y.resource,description:"Link to a still image film resource",tags:[{key:F.resource_stillImageFilmLink,description:"The link to the still image film resource",chain:[{key:F.group_resourceVideoCommon,description:"Common video properties for the linked still image film resource"}]}]},[F.group_resourceArticle]:{type:y.resource,description:"Article resource",tags:[{key:F.resource_article,description:"The article resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the article resource"}]}]},[F.group_resourceArticleEmbed]:{type:y.resource,description:"Embedded article resource",tags:[{key:F.resource_articleEmbed,description:"The embedded article resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the embedded article resource"}]}]},[F.group_resourceArticleLink]:{type:y.resource,description:"Link to an article resource",tags:[{key:F.resource_articleLink,description:"The link to the article resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the linked article resource"}]}]},[F.group_resourceDocument]:{type:y.resource,description:"Document resource",tags:[{key:F.resource_document,description:"The document resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the document resource"}]}]},[F.group_resourceDocumentEmbed]:{type:y.resource,description:"Embedded document resource",tags:[{key:F.resource_documentEmbed,description:"The embedded document resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the embedded document resource"}]}]},[F.group_resourceDocumentLink]:{type:y.resource,description:"Link to a document resource",tags:[{key:F.resource_documentLink,description:"The link to the document resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the linked document resource"}]}]},[F.group_resourceDocumentDownload]:{type:y.resource,description:"Downloadable document resource",tags:[{key:F.resource_documentDownload,description:"The downloadable document resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the downloadable document resource"}]}]},[F.group_resourceAppLink]:{type:y.resource,description:"Link to an app resource",tags:[{key:F.resource_appLink,description:"The link to the app resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the linked app resource"}]}]},[F.group_resourceWebsiteLink]:{type:y.resource,description:"Link to a website resource",tags:[{key:F.resource_websiteLink,description:"The link to the website resource",chain:[{key:F.group_resourceCommon,description:"Common resource properties for the linked website resource"}]}]},[F.group_resourceStillImageFilm]:{type:y.comboResource,description:"Resource for still image film",comboResourceConfigKey:F.resource_stillImageFilm,tags:[{key:F.group_resourceImage,description:"The image resource for the still image film",maxCount:1,minCount:1},{key:F.group_resourceAudio,description:"The audio resource for the still image film",maxCount:1,minCount:1}]},[F.group_resourceImageResponsive]:{type:y.comboResource,description:"Responsive image resource",comboResourceConfigKey:F.resource_imageResponsive,tags:[{key:F.group_resourceImagePortrait,description:"The portrait image resource",maxCount:1,minCount:1},{key:F.group_resourceImageLandscape,description:"The landscape image resource",maxCount:1,minCount:1}]}},W=new class{hydrateTagsConfig(e){const t={tags:{}};for(const i of e){let e;switch(O(i.key)){case k.tag:e=this.hydrateTagConfig(i);break;case k.property:e=this.hydratePropertyTagConfig(i);break;case k.resource:e=this.hydrateResourceTagConfig(i);break;case k.group:e=this.hydrateTagGroupConfig(i);break;default:throw new Error(`Unknown tag type for config key '${i.key}'`)}e&&(t.tags={...t.tags,...e.tags},t.info=Object.assign(t.info??{},e.info))}return t}hydrateCardSetConfig(e){if(!e)return;const t=$[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const i=[];for(const e of t.variants){const t=[];for(const i of e){const e=this.hydrateCardVariantConfig(i);t.push(e)}i.push(t)}return new C(e,i)}hydrateTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a}=e,n=F.fromValue(t)||F._unknown;if(!n)throw new Error(`No tag key found for config key '${n}'`);const s=m.fromValue(n);if(!s)throw new Error(`No tag found for tag config key '${n}'`);let l;o&&(l=this.hydrateTagsConfig(o).tags);const c=new v({configKey:n,tag:s,maxCount:i??1,minCount:r??0,chain:l,deprecated:a});return{tags:{[n]:c}}}hydratePropertyTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a,format:n,defaultValue:s,jsonKey:l}=e,c=F.fromValue(t)||F._unknown;if(!c)throw new Error(`No property key found for config key '${c}'`);const d=t.substring(1);let p;o&&(p=this.hydrateTagsConfig(o).tags);const u=new x({configKey:c,tag:d,maxCount:i??1,minCount:r??0,chain:p,jsonKey:l,format:n,defaultValue:s,deprecated:a});return{tags:{[c]:u}}}hydrateResourceTagConfig(e){const{key:t,maxCount:i,minCount:r,chain:o,deprecated:a,jsonKey:n}=e,s=F.fromValue(t)||F._unknown;if(!s)throw new Error(`No resource key found for config key '${s}'`);const l=t.substring(1);let c;o&&(c=this.hydrateTagsConfig(o).tags);const d=new _({configKey:s,tag:l,maxCount:i??1,minCount:r??0,chain:c,jsonKey:n,deprecated:a});return{tags:{[s]:d}}}hydrateTagGroupConfig(e){const{key:t}=e,i=F.fromValue(t)||F._unknown;if(!i)throw new Error(`No group key found for config key '${i}'`);const r=j[i];if(!r)throw new Error(`No config found for group config key '${t}'`);const{tags:o}=r,a=this.hydrateTagsConfig(o).tags,n=Object.values(a);if(n.length>0){const t=n[0],i=t;i.maxCount=e.maxCount??t.maxCount,i.minCount=e.minCount??t.minCount}return{tags:a,info:{comboResourceConfigKey:r.comboResourceConfigKey}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:i,bodyRequired:r,repeatCount:o}=e,a=this.hydrateTagsConfig(t);return new w(a.tags,i,r,o)}},J={[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:F.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:F.group_quizCommon,description:"Common tags for quiz bits"},{key:F.tag_title,description:"The title of the flashcard quiz"},{key:F.property_flashcardSet,description:"The flashcard set to use for the app flashcards",format:g.plainText,maxCount:p.infinity}],rootExampleType:u.string},[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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.property_fullName,description:"Full name of the author"},{key:F.property_pseudonym,description:"A pseudonym of the author, if any"},{key:F.property_title,description:'The title of the author, e.g. "Dr.", "Prof.", etc.',jsonKey:"title"},{key:F.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:F.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:F.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:g.boolean,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:F.property_imageFirst,description:"If the image should be displayed first in the responsive article",format:g.boolean,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:F.property_buttonCaption,description:"The caption of the button",format:g.plainText}]},[d.callToAction]:{since:"1.15.0",baseBitType:d._standard,description:"Call to action bit, used to create a call to action button",tags:[{key:F.property_buttonCaption,description:"The caption of the call to action button",format:g.plainText},{key:F.property_callToActionUrl,description:"The URL to navigate to when the call to action button is clicked",format:g.plainText,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:F.property_maxCreatedBits,description:"The maximum number of bits that can be created from this bit",format:g.number}],textFormatDefault:b.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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.group_resourceBitTags,description:"Tags for the resource bit"},{key:F.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:F.tag_reference,description:"The reference to the bit that this alias points to"},{key:F.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:F.property_diffTo,description:"The reference to the bit that this diff compares to",format:g.plainText}]},[d.book]:{since:"1.3.0",baseBitType:d._standard,description:"Book bit, used to represent a book",tags:[{key:F.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:f.bookReferenceList},[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:F.tag_title,description:"The title of the book cover",maxCount:2},{key:F.property_coverColor,description:"The color of the book cover",format:g.plainText}]},[d.bookAlias]:{since:"1.4.3",baseBitType:d.book,description:"Book alias, used to create an alias for a book",tags:[{key:F.property_bookAlias,description:"The alias for the book",format:g.plainText,maxCount:p.infinity}]},[d.bookDiff]:{since:"3.10.0",baseBitType:d.book,description:"Book diff, used to show differences between two book versions",tags:[{key:F.property_bookDiff,description:"The reference to the book that this diff compares to",format:g.plainText}]},[d.bookClose]:{since:"1.18.0",baseBitType:d.article,description:"Close section of a book, used to close the book",tags:[{key:F.property_buttonCaption,description:"The caption of the close button",format:g.plainText}]},[d.bookReference]:{since:"2.2.0",baseBitType:d.article,description:"Book reference, used to reference a book in another book",tags:[{key:F.property_refAuthor,description:"The author of the referenced book",format:g.plainText,maxCount:p.infinity},{key:F.property_refBookTitle,description:"The title of the referenced book",format:g.plainText},{key:F.property_refPublisher,description:"The publisher of the referenced book",format:g.plainText,maxCount:p.infinity},{key:F.property_refPublicationYear,description:"The publication year of the referenced book",format:g.plainText},{key:F.property_citationStyle,description:"The citation style to use for the book reference",format:g.plainText}]},[d.botActionResponse]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action response bit, used to define responses for bot actions",cardSet:f.botActionResponses},[d.botActionSend]:{since:"1.3.0",baseBitType:d._standard,description:"Bot action send bit, used to define actions for sending messages",tags:[{key:F.property_date,description:"The date when the message should be sent",format:g.plainText}]},[d.browserImage]:{since:"1.3.0",baseBitType:d.image,description:"Browser image bit, used to display images in the browser",tags:[{key:F.property_focusX,description:"The X coordinate for focusing the image in the browser",format:g.number},{key:F.property_focusY,description:"The Y coordinate for focusing the image in the browser",format:g.number}]},[d.card1]:{since:"1.3.0",baseBitType:d._standard,description:"Card bit, used for cards in quizzes",quizBit:!0,tags:[{key:F.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:F.tag_anchor,description:"The anchor for the chapter, used for linking"},{key:F.tag_title,description:"The title of the chapter"},{key:F.property_toc,description:"If the chapter should be included in the table of contents",format:g.boolean,defaultValue:"true"},{key:F.property_progress,description:"The progress of the chapter, used for tracking reading progress",format:g.boolean,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:F.group_quizCommon,description:"Common tags for quiz bits"},{key:F.group_gap,description:"Tags for gaps in cloze and multiple choice text bits"},{key:F.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:F.group_quizCommon,description:"Common tags for quiz bits"},{key:F.property_isCaseSensitive,description:"If the cloze answers are case sensitive",format:g.boolean},{key:F.property_quizCountItems,description:"The number of items in the cloze quiz",format:g.boolean},{key:F.property_quizStrikethroughSolutions,description:"If the cloze solutions should be strikethrough",format:g.boolean},{key:F.property_additionalSolutions,description:"Additional solutions for the cloze quiz",format:g.plainText,maxCount:p.infinity},{key:F.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:F.group_quizCommon,description:"Common tags for quiz bits"}],cardSet:f.clozeList},[d.code]:{since:"1.3.0",baseBitType:d._standard,description:"Code bit, used for code snippets in articles or documents",tags:[{key:F.property_computerLanguage,description:"The programming language of the code snippet",format:g.plainText},{key:F.property_codeLineNumbers,description:"If line numbers should be displayed for the code snippet",format:g.boolean},{key:F.property_codeMinimap,description:"If a minimap should be displayed for the code snippet",format:g.boolean}],textFormatDefault:b.plainText},[d.formula]:{since:"1.35.0",baseBitType:d._standard,description:"Formula bit, used for mathematical formulas in articles or documents",textFormatDefault:b.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.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:F.property_pointerTop,description:"The top position of the pointer in the screenshot",format:g.plainText,minCount:1,maxCount:1},{key:F.property_pointerLeft,description:"The left position of the pointer in the screenshot",format:g.plainText,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:F.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"},[d.advertisingAdvertorial]:{since:"4.2.0",baseBitType:d.article,description:"Advertorial content bit (sponsored article)"},[d.advertisingCallToAction]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for advertising"},[d.advertisingCallToActionMeeting]:{since:"4.2.0",baseBitType:d.callToAction,description:"Call-to-action for meeting or appointment"},[d.advertisingBanner]:{since:"4.2.0",baseBitType:d.image,description:"Banner advertisement bit"},[d.advertisingSkyscraper]:{since:"4.2.0",baseBitType:d.image,description:"Skyscraper (vertical) advertisement bit"},[d.advertisingRectangle]:{since:"4.2.0",baseBitType:d.image,description:"Rectangle advertisement bit"},[d.advertisingFullPage]:{since:"4.2.0",baseBitType:d.image,description:"Full-page advertisement bit"},[d.advertisingHalfPage]:{since:"4.2.0",baseBitType:d.image,description:"Half-page advertisement bit"},[d.advertisingQuarterPage]:{since:"4.2.0",baseBitType:d.image,description:"Quarter-page advertisement bit"},[d.advertisingClassifiedPage]:{since:"4.2.0",baseBitType:d.image,description:"Classifieds advertisement page bit"},[d.advertisingLandscape]:{since:"4.2.0",baseBitType:d.image,description:"Landscape format advertisement bit"},[d.advertisingPortrait]:{since:"4.2.0",baseBitType:d.image,description:"Portrait format advertisement bit"},[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:F.group_technicalTerm,description:"Tags for technical terms related to ingredients"},{key:F.property_servings,description:"The number of servings for the ingredients",format:g.number,chain:[{key:F.property_unit,description:"The unit of measurement for the ingredients",format:g.plainText},{key:F.property_unitAbbr,description:"The abbreviation for the unit of measurement",format:g.plainText},{key:F.property_decimalPlaces,description:"The number of decimal places for the ingredient quantity",format:g.number,defaultValue:"1"},{key:F.property_disableCalculation,description:"If the ingredient quantity calculation should be disabled",format:g.boolean},{key:F.tag_hint,description:"Hint for the ingredient, used to provide additional information"}]}],cardSet:f.ingredients},[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:F.group_resourceBitTags,description:"Tags for resource bits, used to categorize documents"},{key:F.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:F.group_resourceBitTags,description:"Tags for resource bits, used to categorize downloadable documents"},{key:F.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:F.group_resourceBitTags,description:"Tags for resource bits, used to categorize embedded documents"},{key:F.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:F.group_resourceBitTags,description:"Tags for resource bits, used to categorize document links"},{key:F.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:F.group_quizCommon,description:"Common tags for quiz bits"},{key:F.property_reasonableNumOfChars,description:"The reasonable number of characters for the essay",format:g.number},{key:F.property_sampleSolution,description:"Sample solution for the essay, used as a reference answer",format:g.plainText},{key:F.property_additionalSolutions,description:"Additional solutions for the essay, used for alternative answers",format:g.plainText,maxCount:p.infinity},{key:F.property_partialAnswer,description:"Partial answer for the essay, used to indicate incomplete answers",format:g.plainText},{key:F.property_reference,description:"Reference for the essay, used to link to external resources",format:g.plainText,maxCount:p.infinity}],rootExampleType:u.string},[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:F.tag_title,description:"The title of the example"}],rootExampleType:u.string},[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:F.property_classification,description:"Classification for the created bits",format:g.plainText,maxCount:p.infinity}]},[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:F.property_path,description:"The path for the platform, used to define navigation paths",format:g.plainText}]},[d.container]:{since:"1.9.0",baseBitType:d.article,description:"Container bit, used to group bits together in articles or books",tags:[{key:F.property_allowedBit,description:"Allowed bits in the container, used to define which bits can be placed inside",format:g.plainText,maxCount:p.infinity}]},[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:F.property_hasBookNavigation,description:"Indicates if the module has book navigation",format:g.boolean,defaultValue:"true"},{key:F.property_productId,description:"Product ID for the module, used to link to a specific product",format:g.plainText,minCount:1,maxCount:p.infinity},{key:F.property_duration,description:"Duration of the module, used to indicate how long it takes to complete",format:g.plainText}]},[d.moduleProduct]:{since:"1.9.0",baseBitType:d.module,description:"Module product bit, used to define products in modules",tags:[{key:F.property_productId,description:"Product ID for the module product, used to link to a specific product",format:g.plainText,minCount:1,maxCount:p.infinity}]},[d.exampleList]:{since:"1.4.13",baseBitType:d.example,description:"Example list bit, used to create lists of examples in articles or books",cardSet:f.exampleBitList,rootExampleType:u.string},[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:b.plainText},[d.extractorImage]:{since:"4.3.0",baseBitType:d.image,description:"Extractor embedded image bit, used for embedded images extracted from PDFs",textFormatDefault:b.plainText},[d.extractorImageCollapsible]:{since:"4.3.0",baseBitType:d.extractorImage,description:"Collapsible extractor embedded image bit, used for embedded images extracted from PDFs",textFormatDefault:b.plainText},[d.extractorInformation]:{since:"3.8.0",baseBitType:d._standard,description:"Extractor information bit, used to provide information about extractors in articles or books",textFormatDefault:b.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:F.property_blockId,description:"Unique identifier for the block, used to reference the block in extractor pages",format:g.plainText},{key:F.property_pageNo,description:"Page number for the block, used to indicate the page on which the block appears",format:g.number},{key:F.property_x,description:"X-coordinate for the block, used to position the block on the page",format:g.number},{key:F.property_y,description:"Y-coordinate for the block, used to position the block on the page",format:g.number},{key:F.property_width,description:"Width of the block, used to define the size of the block on the page",format:g.number},{key:F.property_height,description:"Height of the block, used to define the size of the block on the page",format:g.number},{key:F.property_index,description:"Index of the block, used to order blocks within the extractor page",format:g.number},{key:F.property_classification,description:"Classification for the block, used to categorize the block within the extractor",format:g.plainText},{key:F.property_availableClassifications,description:"Available classifications for the block, used to define possible classifications",format:g.plainText,maxCount:p.infinity},{key:F.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:F.property_slug,description:"Slug for the book, used to identify the book in the system",format:g.plainText},{key:F.property_book,description:"Book reference for the page, used to link to a specific book",format:g.plainText,chain:[{key:F.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:F.tag_reference,description:"Reference tag for the book, used to link to the book in the system"},{key:F.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button"}]},[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:F.property_book,description:"Book reference for the page, used to link to a specific book",maxCount:p.infinity,chain:[{key:F.tag_reference,description:"Reference tag for the book, used to link to the book in the system",maxCount:2}]},{key:F.property_buttonCaption,description:"Caption for the button, used to define the text displayed on the button",format:g.plainText}]},[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:F.property_slug,description:"Slug for the subscription page, used to identify the page in the system",format:g.plainText},{key:F.property_buttonCaption,description:"Caption for the subscription button, used to define the text displayed on the button",format:g.plainText},{key:F.property_mailingList,description:"Mailing list for the subscription, used to link to a specific mailing list",format:g.plainText}]},[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:F.property_slug,description:"Slug for the footer, used to identify the footer in the system",format:g.plainText}],cardSet:f.exampleBitList},[d.legend]:{since:"3.12.0",baseBitType:d._standard,description:"Legend bit, used to provide legends in articles or books",cardSet:f.definitionList},[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:f.definitionList},[d.metaSearchDefaultTerms]:{since:"3.12.0",baseBitType:d._standard,description:"Meta search default terms bit, used to define default search terms in articles",cardSet:f.definitionList},[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:F.group_quizCommon,description:"Common quiz tags for flashcards"}],cardSet:f.flashcard},[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:F.property_focusX,description:"X-coordinate for the focus point, used to define the focus area in the image",format:g.number},{key:F.property_focusY,description:"Y-coordinate for the focus point, used to define the focus area in the image",format:g.number}]},[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:F.group_quizCommon,description:"Common quiz tags for highlighted text"},{key:F.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:F.resource_backgroundWallpaper,description:"Background wallpaper for the image, used to set a background for the image",chain:[{key:F.group_resourceImageCommon,description:"Common resource image tags for images"}]},{key:F.group_resourceBitTags,description:"Resource bit tags for images, used to define additional properties for images"},{key:F.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:f.definitionList},[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:f.definitionList},[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:F.property_slug,description:"Slug for the page banner, used to identify the banner in the system",format:g.plainText}]},[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:F.property_caption,description:"Caption for the table image, used to provide a description for the image",format:g.bitmarkText}]},[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:F.group_resourceBitTags,description:"Resource bit tags for image links, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for images on device, used to define additional properties"},{key:F.group_resourceImage,description:"Resource image tags for images on device, used to attach images"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for responsive images, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for logo grave images, used to define additional properties"},{key:F.group_resourceImage,description:"Resource image tags for logo grave images, used to attach images",minCount:1,maxCount:p.infinity}],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:F.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:F.group_quizCommon,description:"Common quiz tags for interviews"},{key:F.property_reasonableNumOfChars,description:"Reasonable number of characters for the interview, used to limit input size",format:g.number}],cardSet:f.questions},[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.learningPathBook]:{since:"1.3.0",baseBitType:d._standard,description:"Learning path book bit, used to create learning paths in articles or books",tags:[{key:F.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:F.property_bot,description:"Bot reference for the training, used to link to a specific bot",format:g.plainText}]},[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:F.property_externalLink,description:"External link for the learning path, used to link to external resources",format:g.plainText},{key:F.property_externalLinkText,description:"Text for the external link, used to define the link text displayed",format:g.plainText}]},[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:F.property_videoCallLink,description:"Video call link for the learning path, used to link to video calls",format:g.plainText}]},[d.leLearningObjectives]:{since:"1.25.0",baseBitType:d.learningPathLearningGoal,description:"Learning objectives bit, used to define learning objectives in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the learning objectives, used to categorize the activity",format:g.plainText}]},[d.leVideoCall]:{since:"1.25.0",baseBitType:d.learningPathVideoCall,description:"Video call bit, used to create video calls in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the video call, used to categorize the activity",format:g.plainText}]},[d.leClassroomEvent]:{since:"1.25.0",baseBitType:d.learningPathClassroomEvent,description:"Classroom event bit, used to create classroom events in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the classroom event, used to categorize the activity",format:g.plainText}]},[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:F.property_activityType,description:"Activity type for the completion, used to categorize the activity",format:g.plainText}]},[d.leExternalLink]:{since:"1.25.0",baseBitType:d.learningPathExternalLink,description:"External link bit, used to create external links in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the external link, used to categorize the activity",format:g.plainText}]},[d.leReadBook]:{since:"1.25.0",baseBitType:d.learningPathBook,description:"Read book bit, used to create reading tasks in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the reading task, used to categorize the activity",format:g.plainText}]},[d.leLearningStep]:{since:"1.25.0",baseBitType:d.learningPathStep,description:"Learning step bit, used to create steps in learning paths",tags:[{key:F.property_activityType,description:"Activity type for the learning step, used to categorize the activity",format:g.plainText}]},[d.lePreparationTask]:{since:"1.26.0",baseBitType:d.learningPathBook,description:"Preparation task bit, used to create preparation tasks in learning paths",tags:[{key:F.property_activityType,format:g.plainText,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:F.property_activityType,description:"Activity type for the video embed, used to categorize the activity",format:g.plainText},{key:F.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:F.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:F.property_activityType,description:"Activity type for the audio embed, used to categorize the activity",format:g.plainText},{key:F.group_resourceBitTags,description:"Resource bit tags for audio embeds, used to define additional properties"},{key:F.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:F.property_listItemIndent,description:"Indentation level for the list item, used to define the hierarchy of the list",format:g.number,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:F.group_quizCommon,description:"Common quiz tags for marks"},{key:F.group_markConfig,description:"Configuration tags for marks, used to define properties of marks"},{key:F.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:F.group_quizCommon,description:"Common quiz tags for matching pairs"},{key:F.property_isCaseSensitive,description:"Case sensitivity for matching pairs, used to define if matches are case-sensitive",format:g.boolean}],cardSet:f.matchPairs},[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:f.matchMatrix},[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:f.matchAudioPairs},[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:f.matchImagePairs},[d.feedback]:{since:"3.13.0",baseBitType:d._standard,description:"Feedback bit, used to provide feedback in articles or books",tags:[{key:F.property_reasonableNumOfChars,description:"Reasonable number of characters for feedback, used to limit input size",format:g.number}],cardSet:f.feedback},[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:F.group_quizCommon,description:"Common quiz tags for multiple choice 1 questions"},{key:F.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:F.group_quizCommon,description:"Common quiz tags for multiple choice questions"},{key:F.group_trueFalse,description:"True/False tags for multiple choice questions"}],cardSet:f.quiz},[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:F.group_quizCommon,description:"Common quiz tags for multiple choice text questions"},{key:F.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:F.group_quizCommon,description:"Common quiz tags for multiple response 1 questions"},{key:F.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:F.group_quizCommon,description:"Common quiz tags for multiple response questions"},{key:F.group_trueFalse,description:"True/False tags for multiple response questions"}],cardSet:f.quiz},[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:F.tag_title,description:"Title of the page, used to display the page title"},{key:F.property_thumbImage,description:"Thumbnail image for the page, used to display a small image representation",format:g.plainText}]},[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:F.property_slug,description:"Slug for the page, used to identify the page in URLs",format:g.plainText},{key:F.property_content2Buy,description:"Content to buy for the page, used to define what is being sold",format:g.plainText},{key:F.property_buttonCaption,description:"Caption for the buy button, used to define the text displayed on the button",format:g.plainText}]},[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:F.property_slug,description:"Slug for the subpage, used to identify the subpage in URLs",format:g.plainText},{key:F.property_page,description:"Page reference for the subpage, used to link to the parent page",format:g.plainText}]},[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:F.property_slug,description:"Slug for the person page, used to identify the person in URLs",format:g.plainText},{key:F.group_person,description:"Person tags, used to define properties of the person"},{key:F.property_buttonCaption,description:"Caption for the button on the person page, used to define the text displayed",format:g.plainText}]},[d.pageProduct]:{since:"1.4.17",baseBitType:d._standard,description:"Page product bit, used to create product pages in articles or books",tags:[{key:F.property_slug,description:"Slug for the product page, used to identify the product in URLs",format:g.plainText},{key:F.property_product,description:"Product reference for the product page, used to link to the product",format:g.plainText}]},[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:F.property_slug,description:"Slug for the product list page, used to identify the product list in URLs",format:g.plainText},{key:F.property_product,description:"Product reference for the product list, used to link to the product",format:g.plainText,maxCount:p.infinity}]},[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:F.property_slug,description:"Slug for the product video page, used to identify the product video in URLs",format:g.plainText},{key:F.property_productVideo,description:"Product video reference for the product video page, used to link to the video",format:g.plainText}]},[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:F.property_slug,description:"Slug for the product video list page, used to identify the product video list in URLs",format:g.plainText},{key:F.property_productVideo,description:"Product video reference for the product video list, used to link to the video",format:g.plainText,maxCount:p.infinity}]},[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:F.property_slug,description:"Slug for the section folder page, used to identify the section in URLs",format:g.plainText},{key:F.property_productFolder,description:"Product folder reference for the section folder page, used to link to the folder",format:g.plainText}]},[d.photo]:{since:"1.3.0",baseBitType:d.image,description:"Photo bit, used to create photo bits in articles or books"},[d.quote]:{since:"1.3.0",baseBitType:d._standard,description:"Quote bit, used to create quotes in articles or books",tags:[{key:F.property_quotedPerson,description:"Quoted person for the quote, used to define who is being quoted",format:g.plainText}]},[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:F.property_releaseVersion,description:"Release version for the release note, used to define the version of the release",format:g.plainText},{key:F.property_releaseKind,description:"Release kind for the release note, used to define the type of release",format:g.plainText},{key:F.property_releaseDate,description:"Release date for the release note, used to define when the release was made",format:g.plainText}]},[d.reviewNote]:{since:"1.3.0",baseBitType:d._standard,description:"Review note bit, used to create review notes in articles or books",tags:[{key:F.tag_title,description:"Title of the review note, used to display the note title"},{key:F.property_resolved,description:"Resolved status for the review note, used to indicate if the note is resolved",format:g.boolean},{key:F.property_resolvedDate,description:"Resolved date for the review note, used to define when the note was resolved",format:g.plainText},{key:F.property_resolvedBy,description:"Resolved by for the review note, used to define who resolved the note",format:g.plainText}],rootExampleType:u.string},[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:F.tag_anchor,description:"Anchor for the sample solution, used to link to the solution"},{key:F.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:F.group_quizCommon,description:"Common quiz tags for sequences"}],cardSet:f.elements,rootExampleType:u.boolean},[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:F.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for still image films, used to define additional properties"},{key:F.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:F.property_pointerTop,description:"Pointer for the top of the survey matrix, used to define the top label",format:g.plainText,minCount:1,maxCount:1},{key:F.property_pointerLeft,description:"Pointer for the left of the survey matrix, used to define the left label",format:g.plainText,minCount:1,maxCount:1},{key:F.property_buttonCaption,description:"Caption for the button in the survey matrix, used to define the button text",format:g.plainText,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:F.property_ratingLevelStart,description:"Start level for the rating survey, used to define the lowest rating",format:g.number,chain:[{key:F.property_label,description:"Label for the start level of the rating survey, used to define the text displayed",format:g.bitmarkText}]},{key:F.property_ratingLevelEnd,description:"End level for the rating survey, used to define the highest rating",format:g.number,chain:[{key:F.property_label,description:"Label for the end level of the rating survey, used to define the text displayed",format:g.bitmarkText}]},{key:F.property_ratingLevelSelected,description:"Selected level for the rating survey, used to define the default rating",format:g.number},{key:F.property_buttonCaption,description:"Caption for the button in the rating survey, used to define the button text",format:g.plainText}]},[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:F.property_scormSource,description:"Source for the SCORM content, used to define the SCORM package URL",format:g.plainText},{key:F.property_posterImage,description:"Poster image for the SCORM content, used to display a preview image",format:g.plainText}]},[d.pronunciationTable]:{since:"3.1.0",baseBitType:d._standard,description:"Pronunciation table bit, used to create pronunciation tables in articles or books",cardSet:f.pronunciationTable},[d.table]:{since:"1.5.19",baseBitType:d._standard,description:"Table bit, used to create tables in articles or books",tags:[{key:F.property_caption,description:"Caption for the table, used to define the title of the table",format:g.bitmarkText},{key:F.property_tableFixedHeader,description:"Fixed header for the table, used to keep the header visible while scrolling",format:g.boolean},{key:F.property_tableHeaderWhitespaceNoWrap,description:"No wrap for table header whitespace, used to prevent header text wrapping",format:g.boolean},{key:F.property_tableSearch,description:"Search functionality for the table, used to enable searching within the table",format:g.boolean},{key:F.property_tableSort,description:"Sorting functionality for the table, used to enable sorting of table columns",format:g.boolean},{key:F.property_tablePagination,description:"Pagination for the table, used to limit the number of rows displayed at once",format:g.boolean},{key:F.property_tablePaginationLimit,description:"Pagination limit for the table, used to define the number of rows per page",format:g.number,defaultValue:"0"},{key:F.property_tableHeight,description:"Height for the table, used to define the height of the table in pixels",format:g.number,defaultValue:"0"},{key:F.property_tableWhitespaceNoWrap,description:"No wrap for table whitespace, used to prevent text wrapping in table cells",format:g.boolean},{key:F.property_tableAutoWidth,description:"Auto width for table columns, used to automatically adjust column widths",format:g.boolean},{key:F.property_tableResizableColumns,description:"Resizable columns for the table, used to allow users to resize table columns",format:g.boolean},{key:F.property_tableColumnMinWidth,description:"Minimum width for table columns, used to define the minimum width of columns",format:g.number}],cardSet:f.table},[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:F.property_maxDisplayLevel,description:"Maximum display level for the chapter in the table of contents",format:g.number}]},[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:F.property_maxTocChapterLevel,description:"Maximum chapter level for the inline table of contents",format:g.number}]},[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:F.property_tocResource,description:"Resource content for the table of contents, used to define the resource",format:g.plainText,maxCount:p.infinity},{key:F.property_buttonCaption,description:"Caption for the button in the table of contents resource, used to define the text displayed on the button",format:g.plainText}]},[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:F.property_tocContent,description:"Content for the table of contents, used to define the content section",format:g.plainText,maxCount:p.infinity},{key:F.property_buttonCaption,description:"Caption for the button in the table of contents content, used to define the text displayed on the button",format:g.plainText}]},[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:F.property_handInAcceptFileType,description:"Accepted file types for the hand-in file, used to define allowed file formats",format:g.plainText,maxCount:p.infinity}]},[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:F.property_handInRequirement,description:"Requirement for the hand-in submission, used to define what is needed",format:g.plainText,maxCount:p.infinity},{key:F.property_handInInstruction,description:"Instruction for the hand-in submission, used to guide the user",format:g.plainText},{key:F.property_buttonCaption,description:"Caption for the button in the hand-in submission, used to define the button text",format:g.plainText}]},[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:F.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:F.property_labelTrue,description:"Label for the true option in the true/false question",format:g.plainText},{key:F.property_labelFalse,description:"Label for the false option in the true/false question",format:g.plainText},{key:F.tag_true,description:"Tag for the true option in the true/false question"},{key:F.tag_false,description:"Tag for the false option in the true/false question"}],rootExampleType:u.boolean},[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:F.group_quizCommon,description:"Common quiz tags for true/false questions"},{key:F.property_labelTrue,description:"Label for the true option in the true/false question",format:g.plainText},{key:F.property_labelFalse,description:"Label for the false option in the true/false question",format:g.plainText}],cardSet:f.statements},[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:b.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:F.property_vendorDashboardId,description:"Dashboard ID for the Datadog dashboard, used to define which dashboard to embed",format:g.plainText}],textFormatDefault:b.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:F.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to embed",format:g.plainText}],textFormatDefault:b.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:F.property_vendorSurveyId,description:"Survey ID for the Formbricks survey, used to define which survey to link to",format:g.plainText}],textFormatDefault:b.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:F.property_width,description:"Width for the embedded content, used to define the width in pixels",format:g.number},{key:F.property_height,description:"Height for the embedded content, used to define the height in pixels",format:g.number},{key:F.property_vendorUrl,description:"URL for the content to be embedded, used to define the source URL",format:g.plainText}],textFormatDefault:b.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:F.property_jupyterId,description:"Jupyter ID for the notebook, used to define which notebook to embed",format:g.plainText},{key:F.property_jupyterExecutionCount,description:"Execution count for the Jupyter output, used to define the execution order",format:g.number}],textFormatDefault:b.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:F.property_padletId,description:"Padlet ID for the board, used to define which Padlet to embed",format:g.plainText}],textFormatDefault:b.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:F.property_stripePricingTableId,description:"Stripe pricing table ID, used to define which pricing table to embed",format:g.plainText,minCount:1},{key:F.property_stripePublishableKey,description:"Stripe publishable key, used to authenticate the Stripe pricing table",format:g.plainText,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:F.group_resourceBitTags,description:"Resource bit tags for videos, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for video embeds, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for video links, used to define additional properties"},{key:F.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:F.group_resourceBitTags,description:"Resource bit tags for website links, used to define additional properties"},{key:F.group_resourceWebsiteLink,description:"Resource website link tags, used to attach website links to the bit",minCount:1}],resourceAttachmentAllowed:!1}},H=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)),d.fromValue(e)??d._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const i=this.getBitConfig(e);if(!i)return!1;if(Array.isArray(t)){for(const e of t)if(i.inheritedBitTypesSet.has(e))return!0;return!1}return i.inheritedBitTypesSet.has(t)}isBitTypeCommented(e){return!!e?.startsWith("|")}getBitConfig(e){let t=this.bitCache.get(e);if(!t){const i=()=>{throw new Error(`No config found for bit: ${e}`)},r=[],o=[];let a=e;for(;a;){const e=J[a];e||i(),r.push(a),o.push(e),a=e.baseBitType}o.reverse();const n=o.reduce((e,t)=>e=M.deepMerge(e,t),{}),{since:s,textFormatDefault:l,quizBit:c,tags:d,cardSet:u,deprecated:h,bodyAllowed:m,bodyRequired:f,footerAllowed:y,footerRequired:k,resourceAttachmentAllowed:T,rootExampleType:v}=n;d?.push({key:F.property_internalComment,description:"Internal comment for the bit.",format:g.plainText,maxCount:p.infinity,minCount:0});const x=this.getAllResourcesTagsWithZeroCounts(),_=W.hydrateTagsConfig(d??[]),w=W.hydrateCardSetConfig(u),C=_.info?.comboResourceConfigKey,B={..._.tags};for(const[e,t]of Object.entries(x))B[e]||(B[e]=t);t=new A({since:s,bitType:e,inheritedBitTypes:r,textFormatDefault:l??b.bitmarkText,tags:B,cardSet:w,quizBit:c,deprecated:h,bodyAllowed:m,bodyRequired:f,footerAllowed:y,footerRequired:k,resourceAttachmentAllowed:T,rootExampleType:v,comboResourceConfigKey:C}),this.bitCache.set(e,t)}return t}getTagConfigForTag(e,t){if(e)return e[t]}getTagsConfigForCardSet(e,t,i){const r=this.getCardSetVariantConfig(e,t,i);if(r)return r.tags}getCardSetVariantConfig(e,t,i){let r;const o=this.getBitConfig(e);if(!o)return;const a=o.cardSet?.variants;if(!a)return;const n=a[Math.min(t,a.length-1)],s=n.length-1;return r=i>s?n[s]:n[i],r}getBitResourcesConfig(e,t){let i={};const r=new Map,o=t?R(t):void 0,a=this.getBitConfig(e),n={};for(const[e,t]of Object.entries(a.tags))t.type===k.resource&&(n[e]=t);const s=a.comboResourceConfigKey??(a.resourceAttachmentAllowed?o:void 0);if(s){const e=new Map,o=this.getComboResource(s);if(o){const t=Object.values(o).filter(e=>e.type===k.resource);t.map(e=>e.configKey).forEach(i=>{const r=t.find(e=>e.configKey===i);r&&e.set(i,r)});const i=this.getComboResourceConfigKeys(s);i&&i.length>0&&r.set(s,i)}if(t)for(const[t,r]of Object.entries(n)){const o=s===r.configKey,a=!!e&&e.has(r.configKey);if(o){const e=new _({configKey:r.configKey,tag:r.tag,minCount:1,maxCount:1,chain:r.chain,jsonKey:r.jsonKey,deprecated:r.deprecated});i[t]=e}else if(a){if(e){const o=e.get(r.configKey);o&&(i[t]=o)}}else i[t]=r}else i=n}else i=n;return new q(i,a.resourceAttachmentAllowed,o,r)}getComboResourceConfigKeys(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter(e=>e.type===k.resource).map(e=>e.configKey)}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(j).filter(t=>t.type===y.comboResource&&t.comboResourceConfigKey===e).forEach(e=>{t={...t,...W.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(j).filter(e=>e.type===y.resource).forEach(t=>{e={...e,...W.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}},G="@gmb/bitmark-parser-generator",U="4.5.0",K="ISC",Y=(0,i(718).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"}),Q=(0,i(718).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});function X(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:Y.unknown,os:Q.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce((e,t)=>(t&&e.push(t),e),[]),i={keys:new Set,versions:{}};let r="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let a=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){a=!0;break}a?i.versions[r]=o.replace("_","."):i.keys.add(o),r=o}return i}(window.navigator.userAgent),i=t.keys.has("firefox"),r=t.keys.has("chrome"),o=t.keys.has("chromium"),a=t.keys.has("safari"),n=r,s=i,l=t.keys.has("macintosh");return a&&!r&&!o?(e.browser=Y.safari,e.browserVersion=t.versions.version):n?(e.browser=Y.chrome,e.browserVersion=t.versions.chrome):s&&(e.browser=Y.firefox,e.browserVersion=t.versions.firefox),l&&(e.os=Q.macos,e.osVersion=t.versions.x),e}var Z={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:X(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=Z,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===Y.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?Y.node:Y.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):Z}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,Q.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):Z}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 Z;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let i="",r="",o="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?i=n:1===e?r=n:2===e?a=n:3===e&&(o=n)}return{full:e,major:i,minor:r,patch:a,build:o}}},te=ee.init.bind(ee),ie=!1;function re(){ie||(te(G,U),ie=!0)}var oe=(0,i(718).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"}),ae=(0,i(718).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",subscript:"subscript",superscript:"superscript",ins:"ins",del:"del",underline:"underline",doubleUnderline:"doubleUnderline",circle:"circle",languageEmRed:"languageEmRed",languageEmOrange:"languageEmOrange",languageEmYellow:"languageEmYellow",languageEmGreen:"languageEmGreen",languageEmBlue:"languageEmBlue",languageEmPurple:"languageEmPurple",languageEmPink:"languageEmPink",languageEmBrown:"languageEmBrown",languageEmBlack:"languageEmBlack",languageEmWhite:"languageEmWhite",languageEmGray:"languageEmGray",languageEm:"languageEm",userUnderline:"userUnderline",userDoubleUnderline:"userDoubleUnderline",userStrike:"userStrike",userCircle:"userCircle",userHighlight:"userHighlight",notranslate:"notranslate",link:"link",ref:"ref",xref:"xref",extref:"extref",footnote:"footnote",footnoteStar:"footnote*",symbol:"symbol",var:"var",code:"code",timer:"timer",duration:"duration",color:"color",comment:"comment"}),ne=(0,i(718).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",noBulletList:"noBulletList",bulletList:"bulletList",orderedList:"orderedList",orderedListRoman:"orderedListRoman",orderedListRomanLower:"orderedListRomanLower",letteredList:"letteredList",letteredListLower:"letteredListLower",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",imageInline:"imageInline",codeBlock:"codeBlock",latex:"latex",gap:"gap",select:"select",highlight:"highlight",mark:"mark"}),se=(0,i(718).superenum)({unknown:"unknown",__isDefaultExample:"__isDefaultExample",__typeAlias:"__typeAlias",action:"action",actionValue:"actionValue",activityType:"activityType",activityTypeValue:"activityTypeValue",additionalSolutions:"additionalSolutions",additionalSolutionsValue:"additionalSolutionsValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",alias:"alias",alignment:"alignment",allowedBit:"allowedBit",allowedBitValue:"allowedBitValue",alt:"alt",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",alternativeDefinitions:"alternativeDefinitions",alternativeDefinitionsValue:"alternativeDefinitionsValue",altLangTag:"altLangTag",altLangTagValue:"altLangTagValue",analyticsTag:"analyticsTag",analyticsTagValue:"analyticsTagValue",anchor:"anchor",answer:"answer",appLink:"appLink",attrs:"attrs",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",author:"author",authorValue:"authorValue",availableClassifications:"availableClassifications",availableClassificationsValue:"availableClassificationsValue",avatarImage:"avatarImage",backgroundWallpaper:"backgroundWallpaper",backgroundWallpaperValue:"backgroundWallpaperValue",bitLevel:"bitLevel",bitmarkAst:"bitmarkAst",bitmarkVersion:"bitmarkVersion",bits:"bits",bitsValue:"bitsValue",bitType:"bitType",blockId:"blockId",blockIdValue:"blockIdValue",body:"body",bodyBit:"bodyBit",bodyBits:"bodyBits",bodyJson:"bodyJson",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",bodyText:"bodyText",bodyValue:"bodyValue",book:"book",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",bookDiff:"bookDiff",bookDiffValue:"bookDiffValue",bookValue:"bookValue",bot:"bot",botResponses:"botResponses",botResponsesValue:"botResponsesValue",botValue:"botValue",bubbleTag:"bubbleTag",bubbleTagValue:"bubbleTagValue",buttonCaption:"buttonCaption",buttonCaptionValue:"buttonCaptionValue",callToActionUrl:"callToActionUrl",callToActionUrlValue:"callToActionUrlValue",caption:"caption",captionDefinitionList:"captionDefinitionList",captionValue:"captionValue",cardBits:"cardBits",cardBitsValue:"cardBitsValue",cardNode:"cardNode",categoryTag:"categoryTag",categoryTagValue:"categoryTagValue",cells:"cells",cellsValue:"cellsValue",chatWithBook:"chatWithBook",chatWithBookBrainKey:"chatWithBookBrainKey",chatWithBookBrainKeyValue:"chatWithBookBrainKeyValue",chatWithBookValue:"chatWithBookValue",checked:"checked",choice:"choice",choices:"choices",choicesValue:"choicesValue",citationStyle:"citationStyle",citationStyleValue:"citationStyleValue",class:"class",classification:"classification",classificationValue:"classificationValue",codeLineNumbers:"codeLineNumbers",codeLineNumbersValue:"codeLineNumbersValue",codeMinimap:"codeMinimap",codeMinimapValue:"codeMinimapValue",color:"color",colorTag:"colorTag",colorTagValue:"colorTagValue",column:"column",columns:"columns",columnsValue:"columnsValue",comment:"comment",commentedBitType:"commentedBitType",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",content:"contentValue",content2Buy:"content2Buy",contentValue:"contentValue",contentValueValue:"contentValueValue",copyright:"copyright",coverColor:"coverColor",coverColorValue:"coverColorValue",coverImage:"coverImage",coverImageValue:"coverImageValue",customerExternalId:"customerExternalId",customerId:"customerId",customerIdValue:"customerIdValue",data:"data",dataValue:"dataValue",dataValueValue:"dataValueValue",date:"date",dateEnd:"dateEnd",dateEndValue:"dateEndValue",dateValue:"dateValue",decimalPlaces:"decimalPlaces",deeplink:"deeplink",deeplinkValue:"deeplinkValue",definition:"definition",definitions:"definitions",definitionsValue:"definitionsValue",diffContext:"diffContext",diffContextValue:"diffContextValue",diffOp:"diffOp",diffOpValue:"diffOpValue",diffRef:"diffRef",diffRefValue:"diffRefValue",diffTime:"diffTime",diffTimeValue:"diffTimeValue",diffTo:"diffTo",diffToValue:"diffToValue",disableCalculation:"disableCalculation",disableFeedback:"disableFeedback",disableFeedbackValue:"disableFeedbackValue",document:"document",documentDownload:"documentDownload",documentEmbed:"documentEmbed",documentLink:"documentLink",duration:"duration",durationValue:"durationValue",elements:"elements",elementsValue:"elementsValue",emphasis:"emphasis",end:"end",errors:"errors",errorsValue:"errorsValue",example:"example",exampleValue:"exampleValue",externalId:"externalId",externalIdValue:"externalIdValue",externalLink:"externalLink",externalLinkText:"externalLinkText",extraProperties:"extraProperties",feedback:"feedback",feedbackEngine:"feedbackEngine",feedbackEngineValue:"feedbackEngineValue",feedbacks:"feedbacks",feedbacksValue:"feedbacksValue",feedbackType:"feedbackType",flashcards:"flashcards",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",flashcardsValue:"flashcardsValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",footer:"footer",footerText:"footerText",forKeys:"forKeys",format:"format",forValues:"forValues",forValuesValue:"forValuesValue",fullName:"fullName",fullNameValue:"fullNameValue",gap:"gap",groupTag:"groupTag",groupTagValue:"groupTagValue",handInAcceptFileType:"handInAcceptFileType",handInAcceptFileTypeValue:"handInAcceptFileTypeValue",handInInstruction:"handInInstruction",handInInstructionValue:"handInInstructionValue",handInRequirement:"handInRequirement",handInRequirementValue:"handInRequirementValue",hasBookNavigation:"hasBookNavigation",hasBookNavigationValue:"hasBookNavigationValue",hasMarkAsDone:"hasMarkAsDone",hasMarkAsDoneValue:"hasMarkAsDoneValue",heading:"heading",height:"height",heightValue:"heightValue",highlight:"highlight",hint:"hint",href:"href",icon:"icon",iconTag:"iconTag",iconTagValue:"iconTagValue",iconValue:"iconValue",id:"id",idValue:"idValue",image:"image",imageFirst:"imageFirst",imageFirstValue:"imageFirstValue",imageLandscape:"imageLandscape",imageLink:"imageLink",imagePlaceholder:"imagePlaceholder",imagePlaceholderValue:"imagePlaceholderValue",imagePortrait:"imagePortrait",imageSource:"imageSource",index:"index",indexValue:"indexValue",ingredients:"ingredients",ingredientsValue:"ingredientsValue",instruction:"instruction",internalComment:"internalComment",internalCommentValue:"internalCommentValue",isCaseSensitive:"isCaseSensitive",isCommented:"isCommented",isCorrect:"isCorrect",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",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",level:"level",levelACTFL:"levelACTFL",levelACTFLValue:"levelACTFLValue",levelCEFR:"levelCEFR",levelCEFRp:"levelCEFRp",levelCEFRpValue:"levelCEFRpValue",levelCEFRValue:"levelCEFRValue",levelILR:"levelILR",levelILRValue:"levelILRValue",license:"license",line:"line",list:"list",listItemIndent:"listItemIndent",listItemIndentValue:"listItemIndentValue",listValue:"listValue",location:"location",locationValue:"locationValue",machineTranslated:"machineTranslated",machineTranslatedValue:"machineTranslatedValue",mailingList:"mailingList",marginNumber:"marginNumber",mark:"mark",markConfig:"markConfig",markConfigValue:"markConfigValue",marks:"marks",marksValue:"marksValue",markup:"markup",matrix:"matrix",matrixValue:"matrixValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",maxDisplayLevel:"maxDisplayLevel",maxDisplayLevelValue:"maxDisplayLevelValue",maxTocChapterLevel:"maxTocChapterLevel",maxTocChapterLevelValue:"maxTocChapterLevelValue",message:"message",mockupId:"mockupId",name:"name",offset:"offset",options:"options",optionsValue:"optionsValue",original:"original",padletId:"padletId",padletIdValue:"padletIdValue",page:"page",pageNo:"pageNo",pageNoValue:"pageNoValue",pageNumber:"pageNumber",pageValue:"pageValue",pairs:"pairs",pairsValue:"pairsValue",parent:"parent",parser:"parser",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",path:"path",pathValue:"pathValue",person:"person",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",posterImage:"posterImage",posterImageValue:"posterImageValue",postfix:"postfix",prefix:"prefix",processHandIn:"processHandIn",processHandInLocation:"processHandInLocation",processHandInLocationValue:"processHandInLocationValue",processHandInValue:"processHandInValue",product:"product",productFolder:"productFolder",productFolderValue:"productFolderValue",productId:"productId",productIdValue:"productIdValue",productList:"productList",productListValue:"productListValue",productValue:"productValue",productVideo:"productVideo",productVideoList:"productVideoList",productVideoListValue:"productVideoListValue",productVideoValue:"productVideoValue",progress:"progress",progressValue:"progressValue",pronunciationTable:"pronunciationTable",properties:"properties",property:"property",propertyKey:"propertyKey",propertyValue:"propertyValue",propertyValues:"propertyValues",provider:"provider",pseudonym:"pseudonym",pseudonymValue:"pseudonymValue",publications:"publications",publicationsValue:"publicationsValue",publisher:"publisher",publisherName:"publisherName",publisherNameValue:"publisherNameValue",publisherValue:"publisherValue",quantity:"quantity",question:"question",questions:"questions",questionsValue:"questionsValue",quizCountItems:"quizCountItems",quizCountItemsValue:"quizCountItemsValue",quizStrikethroughSolutions:"quizStrikethroughSolutions",quizStrikethroughSolutionsValue:"quizStrikethroughSolutionsValue",quizzes:"quizzes",quizzesValue:"quizzesValue",quotedPerson:"quotedPerson",ratingLevelEnd:"ratingLevelEnd",ratingLevelSelected:"ratingLevelSelected",ratingLevelSelectedValue:"ratingLevelSelectedValue",ratingLevelStart:"ratingLevelStart",reaction:"reaction",reason:"reason",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",reductionTag:"reductionTag",reductionTagValue:"reductionTagValue",refAuthor:"refAuthor",refBookTitle:"refBookTitle",reference:"reference",referenceEnd:"referenceEnd",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",refPublicationYear:"refPublicationYear",refPublisher:"refPublisher",releaseDate:"releaseDate",releaseDateValue:"releaseDateValue",releaseKind:"releaseKind",releaseKindValue:"releaseKindValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",reportTag:"reportTag",reportTagValue:"reportTagValue",resolved:"resolved",resolvedBy:"resolvedBy",resolvedByValue:"resolvedByValue",resolvedDate:"resolvedDate",resolvedDateValue:"resolvedDateValue",resolvedValue:"resolvedValue",resources:"resources",resourcesValue:"resourcesValue",resourceType:"resourceType",response:"response",responses:"responses",responsesValue:"responsesValue",revealSolutions:"revealSolutions",root:"root",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",scormSource:"scormSource",scormSourceValue:"scormSourceValue",search:"search",searchIndex:"searchIndex",searchIndexValue:"searchIndexValue",searchValue:"searchValue",section:"section",select:"select",servings:"servings",servingsValue:"servingsValue",showInIndex:"showInIndex",showInIndexValue:"showInIndexValue",size:"size",slug:"slug",slugValue:"slugValue",solution:"solution",solutions:"solutions",solutionsValue:"solutionsValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",start:"start",statement:"statement",statements:"statements",statementsValue:"statementsValue",statementText:"statementText",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",stripePricingTableId:"stripePricingTableId",stripePricingTableIdValue:"stripePricingTableIdValue",stripePublishableKey:"stripePublishableKey",stripePublishableKeyValue:"stripePublishableKeyValue",subject:"subject",subjectValue:"subjectValue",subtitle:"subtitle",subtype:"subtype",subtypeValue:"subtypeValue",table:"table",tableAutoWidth:"tableAutoWidth",tableAutoWidthValue:"tableAutoWidthValue",tableColumnMinWidth:"tableColumnMinWidth",tableColumnMinWidthValue:"tableColumnMinWidthValue",tableFixedHeader:"tableFixedHeader",tableFixedHeaderValue:"tableFixedHeaderValue",tableHeaderWhitespaceNoWrap:"tableHeaderWhitespaceNoWrap",tableHeaderWhitespaceNoWrapValue:"tableHeaderWhitespaceNoWrapValue",tableHeight:"tableHeight",tableHeightValue:"tableHeightValue",tablePagination:"tablePagination",tablePaginationLimit:"tablePaginationLimit",tablePaginationLimitValue:"tablePaginationLimitValue",tablePaginationValue:"tablePaginationValue",tableResizableColumns:"tableResizableColumns",tableResizableColumnsValue:"tableResizableColumnsValue",tableSearch:"tableSearch",tableSearchValue:"tableSearchValue",tableSort:"tableSort",tableSortValue:"tableSortValue",tableWhitespaceNoWrap:"tableWhitespaceNoWrap",tableWhitespaceNoWrapValue:"tableWhitespaceNoWrapValue",tag:"tag",tagValue:"tagValue",target:"target",targetValue:"targetValue",technicalTerm:"technicalTerm",technicalTermValue:"technicalTermValue",term:"term",text:"text",textAlign:"textAlign",textAst:"textAst",textAstValue:"textAstValue",textFormat:"textFormat",textReference:"textReference",textReferenceValue:"textReferenceValue",texts:"texts",textsValue:"textsValue",theme:"theme",themeValue:"themeValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",title:"title",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"}),le=class{constructor(){re()}walk(e,t,i,r){this.walkRecursive(e,[{index:0,key:t,value:e}],i,r)}getRouteKey(e){return e.reduce((t,i,r)=>(+i.key!==i.index&&(t+=`${i.key}`,r<e.length-1&&(t+="_")),t),"")}printTree(e,t=se.bitmarkAst){this.walkRecursive(e,[{index:0,key:t,value:e}],{enter:(e,t)=>(console.log("Enter: "+this.getRouteKey(t)),t[t.length-1].key!==se.bodyJson),between:(e,t,i,r)=>{console.log("Between: "+this.getRouteKey(r))},exit:(e,t)=>{console.log("Exit: "+this.getRouteKey(t))},leaf:(e,t)=>{console.log("Leaf: "+this.getRouteKey(t))}},void 0)}preprocessAst(e){if(V.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,i,r){const{enter:o,between:a,exit:n,leaf:s}=i,l=t[t.length-1].key,c=!this.isValue(e),d=t[t.length-1];if(c){if(o){if(!1===o(d,t,r))return}}else s&&s(d,t,r);if(c){const o=this.isArray(e),n=Object.keys(e);for(let s=0,c=n.length;s<c;s++){const p=n[s],u=s===c-1,h=e,m=h[p];if(null!=m){const e={key:this.getAstKey(p,l,o),index:s,value:m},c=t.slice();if(c.push(e),this.walkRecursive(m,c,i,r),!u){const i=n[s+1],c=h[i],p={key:this.getAstKey(i,l,o),index:s+1,value:c};if(a){if(!1===a(d,e,p,t,r))break}}}}}c&&n&&n(d,t,r)}getAstKey(e,t,i){let r=e;return i&&t&&(r=`${t}Value`),se.fromKey(r)||`unknown(${r})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}},ce=(0,i(718).superenum)({tag:"tag",body:"body"}),de=(0,i(718).superenum)({plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"}),pe=/([*`_!=])(?=\1)/,ue=/(\^*])/,he=/(\^+)/,me=`${ue.source}|${he.source}`,ge=`${pe.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}|${he.source}`,be=`${/^(\[)(\^*)(\.)/.source}`,fe=new RegExp(`${pe.source}|${ue.source}|${he.source}`,"gm"),ye=new RegExp(me,"gm"),ke=new RegExp(ge,"gm"),Te=new RegExp(be,"gm"),ve=new RegExp("^(?:(\\[)(\\^*)(\\.))|(\\^+)","gm"),xe=new RegExp("\\^([\\^]*)","gm"),_e=new RegExp("^(\\[)\\^(\\^*)(\\.)","gm"),we=new RegExp("^(\\||•|#)","gm"),Ce={format:de.bitmarkPlusPlus,location:ce.body,v2:!1};function Ae(e){return"string"==typeof e||e instanceof String}var Be={format:b.bitmarkText,location:ce.body,inPlaceArray:!1,v2:!1},Se=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t={}){if(null==e)return;const i=Object.assign({},Ce,t);if(Array.isArray(e))return e.map(e=>this.breakscape(e,i));if(!Ae(e))return e;const{regex:r,replacer:o}=function(e,t,i=!1){return t===ce.tag?i||e!==de.bitmarkPlusPlus?{regex:ye,replacer:"$2^$1"}:{regex:fe,replacer:"$1$3^$2"}:e===de.bitmarkPlusPlus?i?{regex:ve,replacer:"$1$4^$2$3"}:{regex:ke,replacer:"$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14"}:{regex:Te,replacer:"$1^$2$3"}}(i.format,i.location,i.v2);let a=e;return a=a.replace(r,o),a}unbreakscape(e,t={}){if(null==e)return;const i=Object.assign({},Ce,t);if(Array.isArray(e))return e.map(e=>this.unbreakscape(e,i));if(!Ae(e))return e;const{regex:r,replacer:o}=function(e,t){const i=e!==de.bitmarkPlusPlus;return t===ce.body&&i?{regex:_e,replacer:"$1$2$3"}:{regex:xe,replacer:"$1"}}(i.format,i.location);let a=e;return a=a.replace(r,o),a}breakscapeCode(e,t){if(null==e)return e;const i=Object.assign({},Ce,t),r=e=>e?e.replace(we,"$1^"):e;if(Array.isArray(e)){const t=i.inPlaceArray?e:[e.length];for(let t=0,i=e.length;t<i;t++){const i=e[t];Ae(i)&&(e[t]=r(i))}e=t}else Ae(e)&&(e=r(e));return e}version(){return U}license(){return K}},Pe=new class{constructor(){l(this,"EMPTY_STRING","")}breakscape(e,t){const i=Object.assign({},Be,t);return Se.breakscape(e,{format:i.format,location:i.location,inPlaceArray:i.inPlaceArray,v2:i.v2})}unbreakscape(e,t){const i=Object.assign({},Be,t);return Se.unbreakscape(e,i)}breakscapeCode(e,t){const i=Object.assign({},Be,t);return Se.breakscapeCode(e,i)}concatenate(e,t){return e+t}},Ie=(0,i(718).superenum)({bitmarkMinusMinus:"bitmark--"}),Le=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}removeDuplicates(e,t){const i=new Set;let r=0;for(let o=0;o<e.length;o++){const a=e[o],n=t?t(a):a;i.has(n)||(i.add(n),r!==o&&(e[r]=a),r++)}return r<e.length&&(e.length=r),e}},Ee=(i(718),(0,i(718).superenum)({v2:2,v3:3})),Ve=Ee.v3,Ne=class{constructor(){l(this,"ast",new le),l(this,"debugGenerationInline",!1),l(this,"printed",!1)}enter(e,t,i){let r;const o=this,a=`enter_${e.key}`;return this.printed||(this.printed=!0),this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[a]&&(r=o[a](e,t,i)),r}between(e,t,i,r,o){let a;const n=this,s=`between_${e.key}`;return this.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[s]&&(a=n[s](e,t,i,r,o)),a}exit(e,t,i){const r=this,o=`exit_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof r[o]&&r[o](e,t,i)}leaf(e,t,i){const r=this,o=`leaf_${e.key}`;this.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof r[o]&&r[o](e,t,i),this.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}getParentNode(e,t=1){if(e.length>t)return e[e.length-t-1]}},Re={bodyBitCallback:void 0,debugGenerationInline:!1},Fe="==",Oe=["*","`","_","!","="],De={[ae.bold]:"**",[ae.light]:"``",[ae.italic]:"__",[ae.highlight]:"!!"},ze=[ae.bold,ae.light,ae.italic,ae.highlight],qe=[ae.strike,ae.subscript,ae.superscript,ae.ins,ae.del,ae.underline,ae.doubleUnderline,ae.circle,ae.languageEmRed,ae.languageEmOrange,ae.languageEmYellow,ae.languageEmGreen,ae.languageEmBlue,ae.languageEmPurple,ae.languageEmPink,ae.languageEmBrown,ae.languageEmBlack,ae.languageEmWhite,ae.languageEmGray,ae.languageEm,ae.userUnderline,ae.userDoubleUnderline,ae.userStrike,ae.userCircle,ae.userHighlight,ae.notranslate,ae.link,ae.ref,ae.xref,ae.extref,ae.footnote,ae.footnoteStar,ae.symbol,ae.var,ae.code,ae.timer,ae.duration,ae.color,ae.comment],Me=new RegExp(/(\n|\r\n)/,"g"),$e=new RegExp(/https?:\/\/|mailto:(.*)/,"g"),je=new RegExp(/\]/,"g"),We="enter",Je="between",He="exit",Ge=class extends Ne{constructor(e,t){super(),l(this,"ast",new le),l(this,"bitmarkVersion"),l(this,"options"),l(this,"generateOptions",{}),l(this,"textFormat",b.bitmarkText),l(this,"textLocation",ce.body),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",ne.text),l(this,"inPreText",!1),l(this,"thisNodeIsPreText",!1),l(this,"preTextIndexTemp",-1),l(this,"havePreText",!1),l(this,"preTextIndex",-1),this.bitmarkVersion=Ee.fromValue(e)??Ve,this.options={...Re,...t},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion,Ee.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}async generate(e,t,i,r){return this.generateSync(e,t,i,r)}generateSync(e,t,i,r){if(this.generateOptions=Object.assign({},r),this.validateGenerateOptions(e),this.generateOptions.plainTextDividerAllowed){const r=this.options.writeCallback,o=this.options.bodyBitCallback;this.options.writeCallback=void 0,this.options.bodyBitCallback=void 0,this.resetState(t,i),this.walkAndWrite(e),this.options.writeCallback=r,this.options.bodyBitCallback=o;const a=this.havePreText,n=this.preTextIndex;this.resetState(t,i),this.havePreText=a,this.preTextIndex=n,this.walkAndWrite(e)}else this.resetState(t,i),this.walkAndWrite(e);return this.writerText}getPlaceholders(){return this.placeholders}resetState(e,t){this.printed=!1,this.textFormat=e??b.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=ne.hardBreak,this.inPreText=!1,this.thisNodeIsPreText=!1,this.preTextIndexTemp=-1,this.havePreText=!1,this.preTextIndex=-1}walkAndWrite(e){this.ast.walk(e,se.textAst,this,void 0)}enter_textAstValue(e,t){return this.handleEnterNode(e.value,t)}between_textAstValue(e,t,i,r){return this.handleBetweenNode(e.value,t,i,r)}exit_textAstValue(e,t){return this.handleExitNode(e.value,t)}enter_contentValue(e,t){return this.handleEnterContentValueNode(e,t)}between_contentValue(e,t,i,r){this.handleBetweenContentValueNode(e,t,i,r)}exit_contentValue(e,t){this.handleExitContentValueNode(e,t)}enter_contentValueValue(e,t){return this.handleEnterNode(e.value,t)}between_contentValueValue(e,t,i,r){this.handleBetweenNode(e.value,t,i,r)}exit_contentValueValue(e,t){return this.handleExitNode(e.value,t)}handleEnterNode(e,t){switch(this.handleEnterNodePreTextCheck(e,t),this.handleIndent(e),e.type){case ne.paragraph:this.inParagraph=!0,this.writeParagraph(e);break;case ne.hardBreak:this.writeHardBreak(e);break;case ne.text:this.writeMarks(e,We),this.writeText(e),this.writeMarks(e,Je),0===this.textDepth&&(this.inInline=!0),this.textDepth++;break;case ne.heading:this.writeHeading(e),this.inHeading=!0;break;case ne.section:this.writeSection(e);break;case ne.listItem:case ne.taskItem:this.writeBullet(e,t);break;case ne.image:case ne.imageInline:this.writeImage(e);break;case ne.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case ne.latex:this.writeLatex(e);break;case ne.noBulletList:case ne.bulletList:case ne.orderedList:case ne.orderedListRoman:case ne.orderedListRomanLower:case ne.letteredList:case ne.letteredListLower:case ne.taskList:this.inBulletList=!0;break;case ne.gap:case ne.select:case ne.highlight:case ne.mark:return this.writeBodyBit(e,t),!1}this.exitedCodeBlock=!1}handleBetweenNode(e,t,i,r){e.type}handleExitNode(e,t){switch(e.type){case ne.text:this.textDepth--,0===this.textDepth&&(this.inInline=!1),this.writeMarks(e,He);break;case ne.paragraph:this.writeNL(),this.inParagraph=!1;break;case ne.heading:this.inHeading=!1;case ne.section:case ne.image:this.inParagraph||(this.writeNL(),this.writeNL());break;case ne.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case ne.noBulletList:case ne.bulletList:case ne.orderedList:case ne.orderedListRoman:case ne.orderedListRomanLower:case ne.letteredList:case ne.letteredListLower:case ne.taskList:this.currentIndent<=1&&(this.writeNL(),this.inBulletList=!1)}this.handleDedent(e),this.nodeIndex++}handleIndent(e){switch(e.type){case ne.noBulletList:case ne.bulletList:case ne.orderedList:case ne.orderedListRoman:case ne.orderedListRomanLower:case ne.letteredList:case ne.letteredListLower:case ne.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case ne.noBulletList:case ne.bulletList:case ne.orderedList:case ne.orderedListRoman:case ne.orderedListRomanLower:case ne.letteredList:case ne.letteredListLower:case ne.taskList:this.currentIndent--}}handleEnterContentValueNode(e,t){3===t.length&&(this.thisNodeIsPreText=!0,this.inPreText=!1,this.previousRootParagraphContextType=ne.hardBreak)}handleBetweenContentValueNode(e,t,i,r){if(3===r.length){const e=t.value;this.updatePreTextState(),this.thisNodeIsPreText=!0,this.previousRootParagraphContextType=e.type,this.rootParagraphNodeContentIndex++}}handleExitContentValueNode(e,t){3===t.length&&(this.updatePreTextState(),this.thisNodeIsPreText=!1,this.generateOptions.plainTextDividerAllowed&&this.inPreText&&(this.havePreText=!0,this.preTextIndex=this.preTextIndexTemp),this.inPreText=!1)}updatePreTextState(){!this.inPreText&&this.thisNodeIsPreText&&this.previousRootParagraphContextType===ne.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===ne.hardBreak)return;if(e.type===ne.text)return}this.thisNodeIsPreText=!1}getLinkHref(e){if(e.type===ne.text&&e.marks){const t=e.marks.reduce((e,t)=>{if(t.type===ae.link){const e=t,i=e.attrs?.href;if(i)return i}return e},"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e,t){const i=`[!${this.placeholderIndex}]`;if(this.placeholders[i]=e,this.options.bodyBitCallback){const i=this.options.bodyBitCallback(e,this.placeholderIndex,t);this.write(i)}else this.write(i);this.placeholderIndex++}writeText(e){if(null==e.text)return;const t=this.inCodeBlock;let i=e.text;const r=this.getLinkText(e);if(r&&(i=r),i=r||this.breakscape(i,{format:this.textFormat,location:this.textLocation}),this.currentIndent>1){const e=this.getIndentationString();i=i.replace(Me,`$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:b.plainText,location:this.textLocation});this.write(t)}else this.write(i);(this.currentIndent>1||t)&&(this.thisNodeIsPreText=!1),this.inPreText||e.text!==i||(this.thisNodeIsPreText=!1)}isSimpleLink(e){if(null==e.text)return!1;if(1!==e.marks?.length)return!1;const t=this.getLinkHref(e);if(t){return t.replace($e,"$1")===e.text}return!1}getLinkText(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let i;return i=t.replace($e,"$1")===e.text?t:e.text,i=(i??"").replace(je,"^]"),i}return!1}getInterTextBreakscape(e){if(this.bitmarkVersion===Ee.v2)return"";if(this.textFormat===b.plainText)return"";const t=this.writerText.slice(-1),i=e.slice(0,1);return t===i&&-1!==Oe.indexOf(t)||this.textLocation===ce.body&&"["===t&&-1!=="@#▼►%!?+-$_=&".indexOf(i)?"^":""}validateGenerateOptions(e){this.generateOptions.plainTextDividerAllowed&&(1!==e.length||1===e.length&&e[0].type!==ne.paragraph)&&(this.generateOptions.plainTextDividerAllowed=!1)}writeMarks(e,t){if(e.marks){const i=!(!this.inInline&&!this.inHeading);this.thisNodeIsPreText=!1;if(0===e.marks.length)return void this.writeMarkTextWrapper(Fe);const r=1===e.marks.length&&i,o=e.marks.reduce((e,t)=>e||(-1!==ze.indexOf(t.type)?r?De[t.type]:Fe:-1!==qe.indexOf(t.type)?Fe:e),void 0),a=this.isSimpleLink(e);if(null!=o&&!a){if(t!=We&&t!=Je||this.writeMarkTextWrapper(o),t==Je)for(const t of e.marks)-1!==ze.indexOf(t.type)?r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(t)):ae.comment===t.type?(this.writeInlineMarkStartEnd(),this.writeCommentMark(t)):ae.link===t.type?(this.writeInlineMarkStartEnd(),this.writeLinkMark(t)):ae.ref===t.type?(this.writeInlineMarkStartEnd(),this.writeRefMark(t)):ae.xref===t.type?(this.writeInlineMarkStartEnd(),this.writeXRefMark(t)):ae.extref===t.type?(this.writeInlineMarkStartEnd(),this.writeExtRefMark(t)):ae.footnote===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteMark(t)):ae.footnoteStar===t.type?(this.writeInlineMarkStartEnd(),this.writeFootnoteStarMark(t)):ae.symbol===t.type?(this.writeInlineMarkStartEnd(),this.writeSymbolMark(t)):-1!==qe.indexOf(t.type)&&(this.writeInlineMarkStartEnd(),this.writeInlineMark(t));if(t==He){let t=!1;for(const i of e.marks)-1!==ze.indexOf(i.type)?r||(t=!0):ae.comment!==i.type&&ae.link!==i.type&&ae.ref!==i.type&&ae.xref!==i.type&&ae.footnote!==i.type&&ae.footnoteStar!==i.type&&-1===qe.indexOf(i.type)||(t=!0);t&&this.writeInlineMarkStartEnd()}}}}writeParagraph(e){if(this.textFormat===b.bitmarkText){if(this.inBulletList)return;const t=e.content?.length??0;if(0===this.nodeIndex){if(1===t){const t=e.content?.[0].type===ne.text,i=e.content?.[0].text??"";if(!t||""!==i)return}if(t>1)return}this.write("|"),this.writeNL(),this.exitedCodeBlock&&this.writeNL()}}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){let t="";const i=e.attrs?.level??1;for(let e=0;e<+i;e++)t+="#";t+=" ",this.write(t)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e,t){let i=this.getIndentationString();const r=this.getParentNode(t,2),o=r?.value,a=o?.type,n=o?.attrs?.start??1;if(a===ne.bulletList)i+="• ";else if(a===ne.noBulletList)i+="•_ ";else if(a===ne.orderedList)i+=`•${n} `;else if(a===ne.orderedListRoman)i+=`•${n}I `;else if(a===ne.orderedListRomanLower)i+=`•${n}i `;else if(a===ne.letteredList)i+="•A ";else if(a===ne.letteredListLower)i+="•a ";else if(a===ne.taskList){const t=e;i+=t.attrs?.checked??!1?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs,i=e.type===ne.imageInline,r=this.getMediaAttrs(i?"imageInline":"image",t,{ignoreAttributes:i?new Set(["alt","zoomDisabled","title"]):void 0});let o="";i&&(o=`==${t.alt??""}==`),o+=r?`|${r}|`:"",this.write(o)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeLatex(e){if(null==e.attrs||!e.attrs.formula)return;const t=e.attrs,i=`==${this.breakscape(t.formula,{format:this.textFormat,location:this.textLocation})}==|latex|`;this.write(i)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[i,r]of Object.entries(e.attrs))("language"===i&&"plain text"!==r||"color"===i||"name"===i||"duration"===i)&&(t=`${t}:${r}`);this.write(t)}writeCommentMark(e){const t=`#${e.comment||""}`;this.write(t)}writeLinkMark(e){const t=`link:${((e.attrs?.href||"")??"").replace(je,"^]")}`;this.write(t)}writeRefMark(e){const t=`►${e.attrs?.reference??""}`;this.write(t)}writeXRefMark(e){const t=e.attrs?.xref??"",i=e.attrs?.reference??"";let r=`xref:${t}`;i&&(r+=`|►${i}`),this.write(r)}writeExtRefMark(e){const t=e.attrs?.extref??"",i=e.attrs?.references??[],r=e.attrs?.provider??"";let o=`extref:${t}`;for(const e of i)o+=`|►${e??""}`;o+=`|provider:${r}`,this.write(o)}writeFootnoteMark(e){this.write("footnote:")}writeFootnoteStarMark(e){this.write("footnote*:")}writeSymbolMark(e){if(null==e.attrs)return;const t=e.attrs,i=this.getMediaAttrs("symbol",t)??"";this.write(i)}writeInlineMarkStartEnd(){this.write("|")}writePlainTextDivider(){this.write("==== text ====")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}getMediaAttrs(e,t,i){if(!e)return;const r=Object.assign({},i).ignoreAttributes??new Set;let o=`${e}:${t?.src??""}`;const a=Object.entries(t).filter(([e,t])=>"src"!==e);for(let e=0;e<a.length;e++){const[t,i]=a[e];if(!r.has(t))switch(t){case"textAlign":"left"!==i&&(o+=`|captionAlign:${i}`);break;case"alignment":"center"!==i&&i&&(o+=`|alignment:${i}`);break;case"title":i&&(o+=`|caption:${i}`);break;case"class":"center"!==i&&i&&(o+=`|align:${i}`);break;case"comment":i&&(o+=`|#${i}`);break;case"":V.isString(i)?o+=`|:${i}`:o+="|";break;case"zoomDisabled":i||(o+="|zoomDisabled:false");break;default:t&&i&&(o+=`|${t}:${i}`)}}return o}breakscape(e,t){return this.generateOptions.noBreakscaping?e:Pe.breakscape(e,t)}getBitType(e){for(const t of e)if(t.key===se.bitsValue){const e=t.value;return e?.bitType}}write(e){return e=this.getInterTextBreakscape(e)+e,this.options.writeCallback&&this.options.writeCallback(e),this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const i of e)this.write(`${i}${t??""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}};function Ue(e){return"string"!=typeof e?null:Pe.unbreakscape(e)}function Ke(e){e&&"object"==typeof e&&(delete e._tempParsingParent,delete e._tempListStart,Object.keys(e).forEach(t=>{Ke(e[t])}))}function Ye(e){const t=e=>e&&"text"===e.type&&!e.text;function i(e){for(let r=e.length-1;r>=0;r--){const o=e[r];t(o)?e.splice(r,1):o&&Array.isArray(o.content)&&i(o.content)}}return Array.isArray(e)?i(e):e&&Array.isArray(e.content)&&i(e.content),e}function Qe(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):Ze(e,{startRule:"bitmarkPlusString"})}var Xe=class extends SyntaxError{constructor(e,t,i,r){super(e),this.expected=t,this.found=i,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let i=null;const r=e.find(e=>e.source===this.location.source);r&&(i=r.text.split(/\r\n|\n|\r/g));const o=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+a.line+":"+a.column;if(i){const e=this.location.end,r="".padEnd(a.line.toString().length," "),s=i[o.line-1],l=(o.line===e.line?e.column:s.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+r+" |\n"+a.line+" | "+s+"\n"+r+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+n}return t}static buildMessage(e,t){function i(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return r?e.replace(r,e=>"\\u{"+i(e)+"}"):e}function a(e){return o(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}function n(e){return o(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}const s={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let i=1;i<t.length;i++)t[i-1]!==t[i]&&(t[e]=t[i],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+(((c=t)?'"'+a(c)+'"':"end of input")+" found.");var c}};function Ze(e,t){const i={},r=(t=void 0!==t?t:{}).grammarSource,o={version:Fo,bitmarkPlusPlus:function(){let e,t;if(So++,e=[],t=Oo(),t!==i)for(;t!==i;)e.push(t),t=Oo();else e=i;e===i&&(e=function(){let e,t;return e=xo,t="",_o=e,t=[],e=t,e}());So--,e===i&&(t=i,0===So&&No(Mt));return e},bitmarkPlus:function(){let e,t;return So++,e=xo,t=pa(),_o=e,t=To(t),e=t,So--,e},bitmarkMinusMinus:function(){let e,t;return So++,e=xo,t=Ta(),_o=e,t=vo(t),e=t,So--,e},bitmarkPlusString:function(){let e;return So++,e=pa(),So--,e},bitmarkMinusMinusString:Ta};let a=Fo;const n="|",s="### ",l="## ",c="# ",d="code",p=":",u="bitmark++",h="bitmark--",m="JavaScript",g="• ",b="•_ ",f="•",y=" ",k="I ",T="i ",v="•A ",x="•a ",_="•+ ",w="•- ",C="\t",A="image",B="#",S="@",P="width",I="height",L="alignment",E="captionAlign",V="left",N="center",R="right",F="alt",O="caption",D="zoomDisabled",z="true",q="false",M="=",$="|latex|",j="|imageInline:",W="alignmentVertical",J="size",H="top",G="middle",U="bottom",K="baseline",Y="sub",Q="super",X="text-bottom",Z="text-top",ee="line-height",te="font-height",ie="explicit",re="link:",oe="extref:",ae="provider:",ne="xref:",se="►",le="symbol:",ce="footnote:",de="footnote*:",pe="var:",ue="code:",he="timer",me="timer:",ge="duration:",be="P",fe="color:",ye="|►",ke="bold",Te="italic",ve="light",xe="highlight",_e="strike",we="subscript",Ce="superscript",Ae="ins",Be="del",Se="underline",Pe="doubleUnderline",Ie="circle",Le="languageEmRed",Ee="languageEmOrange",Ve="languageEmYellow",Ne="languageEmGreen",Re="languageEmBlue",Fe="languageEmPurple",Oe="languageEmPink",De="languageEmBrown",ze="languageEmBlack",qe="languageEmWhite",Me="languageEmGray",$e="languageEm",je="userUnderline",We="userDoubleUnderline",Je="userStrike",He="userCircle",Ge="userHighlight",Ze="notranslate",et="aqua",tt="black",it="blue",rt="brown",ot="fuchsia",at="lightgrey",nt="gray",st="darkgray",lt="green",ct="lime",dt="magenta",pt="maroon",ut="navy",ht="olive",mt="orange",gt="pink",bt="purple",ft="red",yt="silver",kt="teal",Tt="violet",vt="white",xt="yellow",_t="*",wt="_",Ct="`",At="!",Bt="[!",St="]",Pt="\n",It="\r\n",Lt="http",Et="s",Vt="://",Nt="mailto:",Rt=/^[ \t]/,Ft=/^[0-9]/,Ot=/^[\r\u2028-\u2029]/,Dt=/^[^\n\r\u2028\u2029]/,zt=/^[!#-;=?-[\]-_a-{}-~]/,qt={type:"any"},Mt=Lo("StyledText"),$t=Po("|",!1),jt=Po("### ",!1),Wt=Po("## ",!1),Jt=Po("# ",!1),Ht=Po("code",!1),Gt=Io([" ","\t"],!1,!1,!1),Ut=Po(":",!1),Kt=Po("bitmark++",!1),Yt=Po("bitmark--",!1),Qt=Po("JavaScript",!1),Xt=Po("• ",!1),Zt=Po("•_ ",!1),ei=Po("•",!1),ti=Io([["0","9"]],!1,!1,!1),ii=Po(" ",!1),ri=Po("I ",!1),oi=Po("i ",!1),ai=Po("•A ",!1),ni=Po("•a ",!1),si=Po("•+ ",!1),li=Po("•- ",!1),ci=Po("\t",!1),di=Po("image",!1),pi=Po("#",!1),ui=Po("@",!1),hi=Po("width",!1),mi=Po("height",!1),gi=Po("alignment",!1),bi=Po("captionAlign",!1),fi=Po("left",!1),yi=Po("center",!1),ki=Po("right",!1),Ti=Po("alt",!1),vi=Po("caption",!1),xi=Po("zoomDisabled",!1),_i=Po("true",!1),wi=Po("false",!1),Ci=Po("=",!1),Ai=Po("|latex|",!1),Bi=Po("|imageInline:",!1),Si=Po("alignmentVertical",!1),Pi=Po("size",!1),Ii=Po("top",!1),Li=Po("middle",!1),Ei=Po("bottom",!1),Vi=Po("baseline",!1),Ni=Po("sub",!1),Ri=Po("super",!1),Fi=Po("text-bottom",!1),Oi=Po("text-top",!1),Di=Po("line-height",!1),zi=Po("font-height",!1),qi=Po("explicit",!1),Mi=Po("link:",!1),$i=Po("extref:",!1),ji=Po("provider:",!1),Wi=Po("xref:",!1),Ji=Po("►",!1),Hi=Po("symbol:",!1),Gi=Po("footnote:",!1),Ui=Po("footnote*:",!1),Ki=Po("var:",!1),Yi=Po("code:",!1),Qi=Po("timer",!1),Xi=Po("timer:",!1),Zi=Po("duration:",!1),er=Po("P",!1),tr=Po("color:",!1),ir=Po("|►",!1),rr=Po("bold",!1),or=Po("italic",!1),ar=Po("light",!1),nr=Po("highlight",!1),sr=Po("strike",!1),lr=Po("subscript",!1),cr=Po("superscript",!1),dr=Po("ins",!1),pr=Po("del",!1),ur=Po("underline",!1),hr=Po("doubleUnderline",!1),mr=Po("circle",!1),gr=Po("languageEmRed",!1),br=Po("languageEmOrange",!1),fr=Po("languageEmYellow",!1),yr=Po("languageEmGreen",!1),kr=Po("languageEmBlue",!1),Tr=Po("languageEmPurple",!1),vr=Po("languageEmPink",!1),xr=Po("languageEmBrown",!1),_r=Po("languageEmBlack",!1),wr=Po("languageEmWhite",!1),Cr=Po("languageEmGray",!1),Ar=Po("languageEm",!1),Br=Po("userUnderline",!1),Sr=Po("userDoubleUnderline",!1),Pr=Po("userStrike",!1),Ir=Po("userCircle",!1),Lr=Po("userHighlight",!1),Er=Po("notranslate",!1),Vr=Po("aqua",!1),Nr=Po("black",!1),Rr=Po("blue",!1),Fr=Po("brown",!1),Or=Po("fuchsia",!1),Dr=Po("lightgrey",!1),zr=Po("gray",!1),qr=Po("darkgray",!1),Mr=Po("green",!1),$r=Po("lime",!1),jr=Po("magenta",!1),Wr=Po("maroon",!1),Jr=Po("navy",!1),Hr=Po("olive",!1),Gr=Po("orange",!1),Ur=Po("pink",!1),Kr=Po("purple",!1),Yr=Po("red",!1),Qr=Po("silver",!1),Xr=Po("teal",!1),Zr=Po("violet",!1),eo=Po("white",!1),to=Po("yellow",!1),io=Po("*",!1),ro=Po("_",!1),oo=Po("`",!1),ao=Po("!",!1),no=Po("[!",!1),so=Po("]",!1),lo=Lo("Line Terminator"),co=Po("\n",!1),po=Po("\r\n",!1),uo=Io(["\r",["\u2028","\u2029"]],!1,!1,!1),ho=Io(["\n","\r","\u2028","\u2029"],!0,!1,!1),mo=Po("http",!1),go=Po("s",!1),bo=Po("://",!1),fo=Po("mailto:",!1),yo=Io(["!",["#",";"],"=",["?","["],["]","_"],["a","{"],["}","~"]],!1,!1,!1);function ko(e){let t={...e};Ke(t);return Ye(t)}function To(e){return[{type:"paragraph",content:e,attrs:{}}]}function vo(e){return[{type:"paragraph",content:e,attrs:{}}]}let xo=0|t.peg$currPos,_o=xo;const wo=[{line:1,column:1}];let Co,Ao=xo,Bo=t.peg$maxFailExpected||[],So=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=o[t.startRule]}function Po(e,t){return{type:"literal",text:e,ignoreCase:t}}function Io(e,t,i,r){return{type:"class",parts:e,inverted:t,ignoreCase:i,unicode:r}}function Lo(e){return{type:"other",description:e}}function Eo(t){let i,r=wo[t];if(r)return r;if(t>=wo.length)i=wo.length-1;else for(i=t;!wo[--i];);for(r=wo[i],r={line:r.line,column:r.column};i<t;)10===e.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return wo[t]=r,r}function Vo(e,t,i){const o=Eo(e),a=Eo(t),n={source:r,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:a.line,column:a.column}};return i&&r&&"function"==typeof r.offset&&(n.start=r.offset(n.start),n.end=r.offset(n.end)),n}function No(e){xo<Ao||(xo>Ao&&(Ao=xo,Bo=[]),Bo.push(e))}function Ro(e,t,i){return new Xe(Xe.buildMessage(e,t),e,t,i)}function Fo(){let t,r,o;for(t=xo,r=[],e.length>xo?(o=e.charAt(xo),xo++):(o=i,0===So&&No(qt));o!==i;)r.push(o),e.length>xo?(o=e.charAt(xo),xo++):(o=i,0===So&&No(qt));return _o=t,r="8.34.3",t=r,t}function Oo(){let t,r;var o;return t=xo,r=function(){let t,r,o,a,n;if(t=xo,r=qo(),r!==i){for(o=xo,a=[],n=Ra();n!==i;)a.push(n),n=Ra();o=e.substring(o,xo),a=Fa(),a!==i?(n=Na(),n===i&&(n=null),_o=t,s=r,t={type:"heading",content:Qe(o),attrs:{level:s.length-1}}):(xo=t,t=i)}else xo=t,t=i;var s;return t}(),r!==i&&(_o=t,o=r,r=Ye({...o})),t=r,t===i&&(t=xo,r=function(){let e,t,r,o;if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Wo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"bulletList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,a=t,n=r,e={...a,content:n,attrs:{}}):(xo=e,e=i)}else xo=e,e=i;var a,n;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Jo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"noBulletList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Ho(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Go(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedListRoman"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Uo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"orderedListRomanLower"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,attrs:{start:t[0]._tempListStart},content:t}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Ko(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"letteredList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i){if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Yo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"letteredListLower"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i;if(e===i)if(e=xo,t=function(){let e,t,r;e=xo,t=xo,So++,r=Qo(),So--,r!==i?(xo=t,t=void 0):t=i;t!==i&&(_o=e,t={type:"taskList"});return e=t,e}(),t!==i){if(r=[],o=Zo(),o!==i)for(;o!==i;)r.push(o),o=Zo();else r=i;r!==i?(o=Na(),o===i&&(o=null),_o=e,e=function(e,t){return{...e,content:t,attrs:{}}}(t,r)):(xo=e,e=i)}else xo=e,e=i}}}}}}return e}(),r!==i&&(_o=t,r=ko(r)),t=r,t===i&&(t=xo,r=na(),r!==i&&(_o=t,r=function(e){return{...e}}(r)),t=r,t===i&&(t=xo,r=function(){let t,r,o;t=xo,r=$o(),r!==i?(o=function(){let t,r,o,a;t=xo,r=xo,o=[],a=jo();for(;a!==i;)o.push(a),a=jo();return r=e.substring(r,xo),_o=t,r=function(e){return[{type:"text",text:Ue(e.trim())}]}(r),t=r,t}(),_o=t,t=function(e,t){return{...e,content:t}}(r,o)):(xo=t,t=i);return t}(),r!==i&&(_o=t,r=function(e){return{...e}}(r)),t=r,t===i&&(t=xo,r=function(){let e,t,r;e=xo,t=xo,So++,r=Do(),So--,r===i?t=void 0:(xo=t,t=i);t!==i?(r=ia(),r!==i?(_o=e,e={type:"paragraph",content:Qe(r.trim()),attrs:{}}):(xo=e,e=i)):(xo=e,e=i);e===i&&(e=xo,t=oa(),t!==i?(r=ia(),r!==i?(_o=e,e=function(e){return{type:"paragraph",content:Qe(e.trim()),attrs:{}}}(r)):(xo=e,e=i)):(xo=e,e=i),e===i&&(e=xo,t=oa(),t!==i?(r="",_o=e,e=function(e){return{type:"paragraph",content:Qe(e.trim()),attrs:{}}}(r)):(xo=e,e=i)));return e}(),r!==i&&(_o=t,r=function(e){return Ye({...e})}(r)),t=r)))),t}function Do(){let e;return e=qo(),e===i&&(e=Xo(),e===i&&(e=na(),e===i&&(e=$o(),e===i&&(e=oa())))),e}function zo(){let t;return 124===e.charCodeAt(xo)?(t=n,xo++):(t=i,0===So&&No($t)),t}function qo(){let t;return e.substr(xo,4)===s?(t=s,xo+=4):(t=i,0===So&&No(jt)),t===i&&(e.substr(xo,3)===l?(t=l,xo+=3):(t=i,0===So&&No(Wt)),t===i&&(e.substr(xo,2)===c?(t=c,xo+=2):(t=i,0===So&&No(Jt)))),t}function Mo(){let t,r,o;return t=xo,r=zo(),r!==i?(o=function(){let t;return e.substr(xo,4)===d?(t=d,xo+=4):(t=i,0===So&&No(Ht)),t}(),o!==i?(_o=t,t=o):(xo=t,t=i)):(xo=t,t=i),t}function $o(){let t,r,o,a,n,s,l,c;if(t=xo,r=Mo(),r!==i){for(o=xo,a=xo,n=[],s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Gt));s!==i;)n.push(s),s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Gt));s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(_o=t,t={type:"codeBlock",language:""}):(xo=t,t=i)}else xo=t,t=i;if(t===i)if(t=xo,r=Mo(),r!==i)if(58===e.charCodeAt(xo)?(o=p,xo++):(o=i,0===So&&No(Ut)),o!==i)if(a=function(){let t,r,o;e.substr(xo,9)===u?(t=u,xo+=9):(t=i,0===So&&No(Kt));if(t===i&&(e.substr(xo,9)===h?(t=h,xo+=9):(t=i,0===So&&No(Yt)),t===i&&(e.substr(xo,10)===m?(t=m,xo+=10):(t=i,0===So&&No(Qt)),t===i))){if(t=xo,r=[],o=Ra(),o!==i)for(;o!==i;)r.push(o),o=Ra();else r=i;t=r!==i?e.substring(t,xo):r,t===i&&(t="")}return t}(),a!==i){for(n=xo,s=xo,l=[],c=e.charAt(xo),Rt.test(c)?xo++:(c=i,0===So&&No(Gt));c!==i;)l.push(c),c=e.charAt(xo),Rt.test(c)?xo++:(c=i,0===So&&No(Gt));c=Fa(),c!==i?(l=[l,c],s=l):(xo=s,s=i),n=s!==i?e.substring(n,xo):s,n!==i?(_o=t,t={type:"codeBlock",attrs:{language:a.trim().toLowerCase()}}):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function jo(){let t,r,o,a,n,s;if(t=xo,r=xo,So++,o=Do(),So--,o===i?r=void 0:(xo=r,r=i),r!==i){if(o=xo,a=xo,n=[],s=Ra(),s!==i)for(;s!==i;)n.push(s),s=Ra();else n=i;n!==i?(s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(_o=t,t=o):(xo=t,t=i)}else xo=t,t=i;return t===i&&(t=Na()),t}function Wo(){let t;return e.substr(xo,2)===g?(t=g,xo+=2):(t=i,0===So&&No(Xt)),t}function Jo(){let t;return e.substr(xo,3)===b?(t=b,xo+=3):(t=i,0===So&&No(Zt)),t}function Ho(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Go(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(e.substr(xo,2)===k?(n=k,xo+=2):(n=i,0===So&&No(ri)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Uo(){let t,r,o,a,n;if(t=xo,r=xo,8226===e.charCodeAt(xo)?(o=f,xo++):(o=i,0===So&&No(ei)),o!==i){if(a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;a!==i?(e.substr(xo,2)===T?(n=T,xo+=2):(n=i,0===So&&No(oi)),n!==i?(o=[o,a,n],r=o):(xo=r,r=i)):(xo=r,r=i)}else xo=r,r=i;return t=r!==i?e.substring(t,xo):r,t}function Ko(){let t;return e.substr(xo,3)===v?(t=v,xo+=3):(t=i,0===So&&No(ai)),t}function Yo(){let t;return e.substr(xo,3)===x?(t=x,xo+=3):(t=i,0===So&&No(ni)),t}function Qo(){let t;return e.substr(xo,3)===_?(t=_,xo+=3):(t=i,0===So&&No(si)),t===i&&(e.substr(xo,3)===w?(t=w,xo+=3):(t=i,0===So&&No(li))),t}function Xo(){let e;return e=Wo(),e===i&&(e=Jo(),e===i&&(e=Ho(),e===i&&(e=Go(),e===i&&(e=Uo(),e===i&&(e=Ko(),e===i&&(e=Yo(),e===i&&(e=Qo()))))))),e}function Zo(){let t,r,o,a,n,s,l,c,d;if(t=xo,r=ta(),r!==i)if(o=Xo(),o!==i){for(a=xo,n=xo,s=[],l=xo,c=xo,So++,d=Na(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(e.length>xo?(d=e.charAt(xo),xo++):(d=i,0===So&&No(qt)),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);l!==i;)s.push(l),l=xo,c=xo,So++,d=Na(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(e.length>xo?(d=e.charAt(xo),xo++):(d=i,0===So&&No(qt)),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);for(l=Na(),l===i&&(l=null),s=[s,l],n=s,a=e.substring(a,xo),n=[],s=ea();s!==i;)n.push(s),s=ea();if(s=xo,l=function(){let t,r,o,a;t=xo,So++,r=xo,o=[],9===e.charCodeAt(xo)?(a=C,xo++):(a=i,0===So&&No(ci));if(a!==i)for(;a!==i;)o.push(a),9===e.charCodeAt(xo)?(a=C,xo++):(a=i,0===So&&No(ci));else o=i;o!==i?(_o=xo,a=o.length>qa.length,a=a?void 0:i,a!==i?(_o=r,r=function(e){za.push(qa),qa=e.join("")}(o)):(xo=r,r=i)):(xo=r,r=i);So--,r!==i?(xo=t,t=void 0):t=i;return t}(),l!==i){for(c=[],d=Zo();d!==i;)c.push(d),d=Zo();d=function(){let e;_o=xo,e=function(){return qa=za.pop(),!0}(),e=e?void 0:i;return e}(),d!==i?(_o=s,s=c):(xo=s,s=i)}else xo=s,s=i;s===i&&(s=null),_o=t,t=function(e,t,i,r){let o="bulletList";const a=e.match(/•([0-9]+)([Ii]?) /);let n=1;if(a&&(o="orderedList",a.length>1&&(n=Number(a[1])),a.length>2)){let e=a[2];"I"==e&&(o="orderedListRoman"),"i"==e&&(o="orderedListRomanLower")}"•_ "==e&&(o="noBulletList"),"•A "==e&&(o="letteredList"),"•a "==e&&(o="letteredListLower"),"•+ "!=e&&"•- "!=e||(o="taskList");let s=[{type:"paragraph",attrs:{},content:Qe((t+i.join("")).trim())}];if(r&&r[0]&&r[0]._tempParsingParent){let e={type:r[0]._tempParsingParent,attrs:{start:n},content:r};if((e.type.startsWith("orderedList")||e.type.startsWith("letteredList"))&&r[0]._tempListStart){const t=r[0]._tempListStart;t>1&&(e.attrs.start=t)}s.push(e)}let l="listItem",c=null;if("taskList"==o){l="taskItem";let t=!1;"•+ "==e&&(t=!0),c={checked:t}}return c?{type:l,attrs:c,content:s,_tempParsingParent:o,_tempListStart:n}:{type:l,content:s,_tempParsingParent:o,_tempListStart:n}}(o,a,n,s)}else xo=t,t=i;else xo=t,t=i;return t}function ea(){let t,r,o,a,n,s,l,c,d,p;if(t=xo,r=xo,So++,o=function(){let t,r,o;t=xo,r=[],o=e.charAt(xo),Rt.test(o)?xo++:(o=i,0===So&&No(Gt));for(;o!==i;)r.push(o),o=e.charAt(xo),Rt.test(o)?xo++:(o=i,0===So&&No(Gt));o=Na(),o!==i?(r=[r,o],t=r):(xo=t,t=i);return t}(),So--,o===i?r=void 0:(xo=r,r=i),r!==i)if(o=ta(),o!==i)if(a=xo,So++,n=Xo(),So--,n===i?a=void 0:(xo=a,a=i),a!==i){if(n=xo,s=xo,l=[],c=xo,d=xo,So++,p=Na(),So--,p===i?d=void 0:(xo=d,d=i),d!==i?(e.length>xo?(p=e.charAt(xo),xo++):(p=i,0===So&&No(qt)),p!==i?(d=[d,p],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,p=Na(),So--,p===i?d=void 0:(xo=d,d=i),d!==i?(e.length>xo?(p=e.charAt(xo),xo++):(p=i,0===So&&No(qt)),p!==i?(d=[d,p],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;l!==i?(c=Fa(),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i),n=s!==i?e.substring(n,xo):s,n!==i?(_o=t,t=n):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function ta(){let t,r,o;for(t=xo,r=[],9===e.charCodeAt(xo)?(o=C,xo++):(o=i,0===So&&No(ci));o!==i;)r.push(o),9===e.charCodeAt(xo)?(o=C,xo++):(o=i,0===So&&No(ci));return _o=xo,o=r.join("")===qa,o=o?void 0:i,o!==i?(r=[r,o],t=r):(xo=t,t=i),t}function ia(){let t,r,o;if(t=xo,r=[],o=ra(),o!==i)for(;o!==i;)r.push(o),o=ra();else r=i;return t=r!==i?e.substring(t,xo):r,t}function ra(){let t,r,o,a,n,s;if(t=xo,r=xo,So++,o=Do(),So--,o===i?r=void 0:(xo=r,r=i),r!==i){if(o=xo,a=xo,n=[],s=Ra(),s!==i)for(;s!==i;)n.push(s),s=Ra();else n=i;n!==i?(s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(r=[r,o],t=r):(xo=t,t=i)}else xo=t,t=i;return t===i&&(t=Na()),t}function oa(){let t,r,o,a,n,s;if(t=xo,r=zo(),r!==i){for(o=xo,a=xo,n=[],s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Gt));s!==i;)n.push(s),s=e.charAt(xo),Rt.test(s)?xo++:(s=i,0===So&&No(Gt));s=Fa(),s!==i?(n=[n,s],a=n):(xo=a,a=i),o=a!==i?e.substring(o,xo):a,o!==i?(a=Na(),a===i&&(a=null),r=[r,o,a],t=r):(xo=t,t=i)}else xo=t,t=i;return t}function aa(){let t,r,o;return t=xo,r=zo(),r!==i?(o=function(){let t;return e.substr(xo,5)===A?(t=A,xo+=5):(t=i,0===So&&No(di)),t}(),o!==i?(_o=t,t=o):(xo=t,t=i)):(xo=t,t=i),t}function na(){let t,r,o,a,n,s,l,c,d,u,h,m;if(t=xo,r=aa(),r!==i)if(58===e.charCodeAt(xo)?(o=p,xo++):(o=i,0===So&&No(Ut)),o!==i)if(32===e.charCodeAt(xo)?(a=y,xo++):(a=i,0===So&&No(ii)),a===i&&(a=null),n=function(){let t,r,o,a,n,s,l,c,d;t=xo,r=xo,e.substr(xo,4)===Lt?(o=Lt,xo+=4):(o=i,0===So&&No(mo));if(o!==i)if(115===e.charCodeAt(xo)?(a=Et,xo++):(a=i,0===So&&No(go)),a===i&&(a=null),e.substr(xo,3)===Vt?(n=Vt,xo+=3):(n=i,0===So&&No(bo)),n!==i){for(s=[],l=xo,c=xo,So++,d=zo(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(d=Da(),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);l!==i;)s.push(l),l=xo,c=xo,So++,d=zo(),So--,d===i?c=void 0:(xo=c,c=i),c!==i?(d=Da(),d!==i?(c=[c,d],l=c):(xo=l,l=i)):(xo=l,l=i);o=[o,a,n,s],r=o}else xo=r,r=i;else xo=r,r=i;t=r!==i?e.substring(t,xo):r;return t}(),n!==i){for(s=[],32===e.charCodeAt(xo)?(l=y,xo++):(l=i,0===So&&No(ii));l!==i;)s.push(l),32===e.charCodeAt(xo)?(l=y,xo++):(l=i,0===So&&No(ii));if(l=zo(),l!==i){for(c=sa(),d=xo,u=xo,h=[],m=e.charAt(xo),Rt.test(m)?xo++:(m=i,0===So&&No(Gt));m!==i;)h.push(m),m=e.charAt(xo),Rt.test(m)?xo++:(m=i,0===So&&No(Gt));m=Fa(),m!==i?(h=[h,m],u=h):(xo=u,u=i),d=u!==i?e.substring(d,xo):u,d!==i?(u=Na(),u===i&&(u=null),_o=t,t=function(e,t,i){const r=Object.assign({},...i);let o=r.alignment||"center";delete r.alignment;let a=r.captionAlign||"left";delete r.captionAlign;let n=r.alt||null;delete r.alt;let s=r.caption||null;delete r.caption;let l=r.align||"center";delete r.align;let c=void 0===r.zoomDisabled||("boolean"==typeof r.zoomDisabled?r.zoomDisabled:"true"===String(r.zoomDisabled).toLowerCase());return delete r.zoomDisabled,{type:e,attrs:{alignment:o,textAlign:a,src:t,alt:Ue(n),title:Ue(s),class:l,zoomDisabled:c,...r}}}(r,n,c)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;else xo=t,t=i;return t}function sa(){let e,t,r;for(e=xo,t=[],r=la();r!==i;)t.push(r),r=la();return _o=e,e=t,e}function la(){let t,r,o,a,n,s,l,c,d,u;if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={comment:o.trim()}):(xo=t,t=i)}else xo=t,t=i;var h,m;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;if(s=l!==i?e.substring(s,xo):l,s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,h=o,m=s,t={[h]:parseInt(m)}):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=function(){let t;e.substr(xo,3)===F?(t=F,xo+=3):(t=i,0===So&&No(Ti));t===i&&(e.substr(xo,7)===O?(t=O,xo+=7):(t=i,0===So&&No(vi)));return t}(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));for(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t.trim()}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=function(){let t;e.substr(xo,9)===L?(t=L,xo+=9):(t=i,0===So&&No(gi));t===i&&(e.substr(xo,12)===E?(t=E,xo+=12):(t=i,0===So&&No(bi)));return t}(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=function(){let t;e.substr(xo,4)===V?(t=V,xo+=4):(t=i,0===So&&No(fi));t===i&&(e.substr(xo,6)===N?(t=N,xo+=6):(t=i,0===So&&No(yi)),t===i&&(e.substr(xo,5)===R?(t=R,xo+=5):(t=i,0===So&&No(ki))));return t}(),s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=da(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=function(){let t;e.substr(xo,4)===z?(t=z,xo+=4):(t=i,0===So&&No(_i));t===i&&(e.substr(xo,5)===q?(t=q,xo+=5):(t=i,0===So&&No(wi)));return t}(),s!==i){for(l=[],32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c!==i;)l.push(c),32===e.charCodeAt(xo)?(c=y,xo++):(c=i,0===So&&No(ii));c=zo(),c!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=da(),o!==i){for(a=[],32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii));n!==i;)a.push(n),32===e.charCodeAt(xo)?(n=y,xo++):(n=i,0===So&&No(ii));n=zo(),n!==i?(_o=t,t=function(e){return{[e]:!0}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=zo(),o!==i?(_o=t,t=void 0):(xo=t,t=i),t===i)){for(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{error:"Found unknown property or invalid value: "+e}}(o)):(xo=t,t=i)}}}}}}return t}function ca(){let t;return e.substr(xo,5)===P?(t=P,xo+=5):(t=i,0===So&&No(hi)),t===i&&(e.substr(xo,6)===I?(t=I,xo+=6):(t=i,0===So&&No(mi))),t}function da(){let t;return e.substr(xo,12)===D?(t=D,xo+=12):(t=i,0===So&&No(xi)),t}function pa(){let e,t,r,o;for(e=xo,t=ua(),t===i&&(t=null),r=[],o=ga(),o===i&&(o=ua());o!==i;)r.push(o),o=ga(),o===i&&(o=ua());var a,n;return _o=e,n=r,e=Ye((a=t)?[a,...n.flat()]:n.flat()),e}function ua(){let t,r,o,a,n,s,l;if(t=xo,r=Na(),r!==i&&(_o=t,r={type:"hardBreak"}),t=r,t===i){if(t=xo,r=xo,o=[],a=xo,n=ba(),n===i&&(n=null),s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=ba(),n!==i?(s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i)),a!==i)for(;a!==i;)o.push(a),a=xo,n=ba(),n===i&&(n=null),s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=ba(),n!==i?(s=xo,So++,l=ga(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i));else o=i;r=o!==i?e.substring(r,xo):o,r!==i&&(_o=t,r={text:Ue(r),type:"text"}),t=r}return t}function ha(){let t;return 61===e.charCodeAt(xo)?(t=M,xo++):(t=i,0===So&&No(Ci)),t}function ma(){let e,t,r;return e=xo,t=ha(),t!==i?(r=ha(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function ga(){let t,r,o,a,s,l,c,d;if(t=xo,r=Ia(),r!==i){if(o=xo,a=[],s=e.charAt(xo),Ft.test(s)?xo++:(s=i,0===So&&No(ti)),s!==i)for(;s!==i;)a.push(s),s=e.charAt(xo),Ft.test(s)?xo++:(s=i,0===So&&No(ti));else a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=La(),a!==i?(_o=t,t={index:+o,type:"bit"}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;var p,u;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(e.substr(xo,7)===$?(s=$,xo+=7):(s=i,0===So&&No(Ai)),s!==i?(_o=t,t=function(e){return{attrs:{formula:Ue(e)},type:"latex"}}(o)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(e.substr(xo,13)===j?(s=j,xo+=13):(s=i,0===So&&No(Bi)),s!==i?(l=Oa(),l!==i?(124===e.charCodeAt(xo)?(c=n,xo++):(c=i,0===So&&No($t)),c!==i?(d=function(){let e,t,r;e=xo,t=[],r=fa();for(;r!==i;)t.push(r),r=fa();return _o=e,e=t,e}(),_o=t,u=d,t={attrs:{alt:o,src:((p=l).pr+p.t).trim(),...Object.assign({},...u),zoomDisabled:!0},type:"imageInline"}):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=ma(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=ma(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=ma(),a!==i?(s=function(){let t,r,o,a;t=xo,124===e.charCodeAt(xo)?(r=n,xo++):(r=i,0===So&&No($t));if(r!==i){if(o=[],a=ya(),a!==i)for(;a!==i;)o.push(a),a=ya();else o=i;o!==i?(_o=t,t=o):(xo=t,t=i)}else xo=t,t=i;return t}(),s!==i?(_o=t,t=function(e,t){return t||(t=[]),{marks:t,text:Ue(e),type:"text"}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Aa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Aa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Aa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Aa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"bold"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Ba(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Ba(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Ba(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Ba(),a!==i?(_o=t,t=function(e){return{marks:[{type:"italic"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Sa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Sa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Sa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Sa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"light"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Pa(),r!==i){for(o=xo,a=[],s=xo,l=xo,So++,c=Pa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);s!==i;)a.push(s),s=xo,l=xo,So++,c=Pa(),So--,c===i?l=void 0:(xo=l,l=i),l!==i?(e.length>xo?(c=e.charAt(xo),xo++):(c=i,0===So&&No(qt)),c!==i?(l=[l,c],s=l):(xo=s,s=i)):(xo=s,s=i);o=e.substring(o,xo),a=Pa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"highlight"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;t===i&&(t=xo,r=Oa(),r!==i&&(_o=t,r=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}}(r)),t=r)}}}}}}}return t}function ba(){let t,r,o,a,n;if(t=xo,r=xo,o=ma(),o!==i){if(a=[],n=ha(),n!==i)for(;n!==i;)a.push(n),n=ha();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Sa(),o!==i){if(a=[],n=wa(),n!==i)for(;n!==i;)a.push(n),n=wa();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Pa(),o!==i){if(a=[],n=Ca(),n!==i)for(;n!==i;)a.push(n),n=Ca();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;t=r!==i?e.substring(t,xo):r}}return t}function fa(){let t,r,o,a,n,s,l,c,d,u;if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={comment:o}):(xo=t,t=i)}else xo=t,t=i;var h,m;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));if(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i),c!==i)for(;c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=e.charAt(xo),Ft.test(u)?xo++:(u=i,0===So&&No(ti)),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);else l=i;s=l!==i?e.substring(s,xo):l,s!==i?(l=zo(),l!==i?(_o=t,h=o,m=s,t={[h]:parseInt(m)}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),o=ca(),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));for(s=xo,l=[],c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,d=xo,So++,u=zo(),So--,u===i?d=void 0:(xo=d,d=i),d!==i?(u=Ra(),u!==i?(d=[d,u],c=d):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{type:"error",msg:e+" must be a positive integer.",found:t}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i){if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),e.substr(xo,17)===W?(o=W,xo+=17):(o=i,0===So&&No(Si)),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s=function(){let t;e.substr(xo,3)===H?(t=H,xo+=3):(t=i,0===So&&No(Ii));t===i&&(e.substr(xo,6)===G?(t=G,xo+=6):(t=i,0===So&&No(Li)),t===i&&(e.substr(xo,6)===U?(t=U,xo+=6):(t=i,0===So&&No(Ei)),t===i&&(e.substr(xo,8)===K?(t=K,xo+=8):(t=i,0===So&&No(Vi)),t===i&&(e.substr(xo,3)===Y?(t=Y,xo+=3):(t=i,0===So&&No(Ni)),t===i&&(e.substr(xo,5)===Q?(t=Q,xo+=5):(t=i,0===So&&No(Ri)),t===i&&(e.substr(xo,11)===X?(t=X,xo+=11):(t=i,0===So&&No(Fi)),t===i&&(e.substr(xo,8)===Z?(t=Z,xo+=8):(t=i,0===So&&No(Oi)))))))));return t}(),s!==i?(l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i;if(t===i)if(t=xo,64===e.charCodeAt(xo)?(r=S,xo++):(r=i,0===So&&No(ui)),r===i&&(r=null),e.substr(xo,4)===J?(o=J,xo+=4):(o=i,0===So&&No(Pi)),o!==i)if(58===e.charCodeAt(xo)?(a=p,xo++):(a=i,0===So&&No(Ut)),a!==i){for(n=[],32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s!==i;)n.push(s),32===e.charCodeAt(xo)?(s=y,xo++):(s=i,0===So&&No(ii));s=function(){let t;e.substr(xo,11)===ee?(t=ee,xo+=11):(t=i,0===So&&No(Di));t===i&&(e.substr(xo,11)===te?(t=te,xo+=11):(t=i,0===So&&No(zi)),t===i&&(e.substr(xo,5)===Q?(t=Q,xo+=5):(t=i,0===So&&No(Ri)),t===i&&(e.substr(xo,3)===Y?(t=Y,xo+=3):(t=i,0===So&&No(Ni)),t===i&&(e.substr(xo,8)===ie?(t=ie,xo+=8):(t=i,0===So&&No(qi))))));return t}(),s!==i?(l=zo(),l!==i?(_o=t,t=function(e,t){return{[e]:t}}(o,s)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}}}return t}function ya(){let t,r,o,a,n,s,l,c,p,u,h;if(t=xo,e.substr(xo,5)===re?(r=re,xo+=5):(r=i,0===So&&No(Mi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={type:"link",attrs:{href:o.trim(),target:"_blank"}}):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,7)===oe?(r=oe,xo+=7):(r=i,0===So&&No($i)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);if(o=e.substring(o,xo),a=function(){let e,t;e=[],t=ka();for(;t!==i;)e.push(t),t=ka();return e}(),n=zo(),n!==i)if(e.substr(xo,9)===ae?(s=ae,xo+=9):(s=i,0===So&&No(ji)),s!==i){for(l=xo,c=[],p=xo,u=xo,So++,h=zo(),So--,h===i?u=void 0:(xo=u,u=i),u!==i?(h=Ra(),h!==i?(u=[u,h],p=u):(xo=p,p=i)):(xo=p,p=i);p!==i;)c.push(p),p=xo,u=xo,So++,h=zo(),So--,h===i?u=void 0:(xo=u,u=i),u!==i?(h=Ra(),h!==i?(u=[u,h],p=u):(xo=p,p=i)):(xo=p,p=i);l=e.substring(l,xo),c=zo(),c!==i?(_o=t,t=function(e,t,i){return{type:"extref",attrs:{extref:e.trim(),references:t,provider:i.trim()}}}(o,a,l)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,5)===ne?(r=ne,xo+=5):(r=i,0===So&&No(Wi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);if(o=e.substring(o,xo),a=zo(),a!==i)if(9658===e.charCodeAt(xo)?(n=se,xo++):(n=i,0===So&&No(Ji)),n!==i){for(s=xo,l=[],c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),l=zo(),l!==i?(_o=t,t=function(e,t){return{type:"xref",attrs:{xref:e.trim(),reference:t.trim()}}}(o,s)):(xo=t,t=i)}else xo=t,t=i;else xo=t,t=i}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,5)===ne?(r=ne,xo+=5):(r=i,0===So&&No(Wi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"xref",attrs:{xref:e.trim(),reference:""}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,9658===e.charCodeAt(xo)?(r=se,xo++):(r=i,0===So&&No(Ji)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"ref",attrs:{reference:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,7)===le?(r=le,xo+=7):(r=i,0===So&&No(Hi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(n=sa(),_o=t,t=function(e,t){const i=Object.assign({},...t);return{type:"symbol",attrs:{src:e.trim(),...i}}}(o,n)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,9)===ce?(r=ce,xo+=9):(r=i,0===So&&No(Gi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"footnote",attrs:{content:Qe(e.trim())}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,10)===de?(r=de,xo+=10):(r=i,0===So&&No(Ui)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"footnote*",attrs:{content:Qe(e.trim())}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,4)===pe?(r=pe,xo+=4):(r=i,0===So&&No(Ki)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"var",attrs:{name:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,4)===d?(r=d,xo+=4):(r=i,0===So&&No(Ht)),r!==i?(o=zo(),o!==i?(_o=t,t={type:"code",attrs:{language:"plain text"}}):(xo=t,t=i)):(xo=t,t=i),t===i)){if(t=xo,e.substr(xo,5)===ue?(r=ue,xo+=5):(r=i,0===So&&No(Yi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t={type:"code",attrs:{language:o.trim().toLowerCase()}}):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,5)===he?(r=he,xo+=5):(r=i,0===So&&No(Qi)),r!==i?(o=zo(),o!==i?(_o=t,t={type:"timer",attrs:{name:""}}):(xo=t,t=i)):(xo=t,t=i),t===i)){if(t=xo,e.substr(xo,6)===me?(r=me,xo+=6):(r=i,0===So&&No(Xi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"timer",attrs:{name:e.trim()}}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,e.substr(xo,9)===ge?(r=ge,xo+=9):(r=i,0===So&&No(Zi)),r!==i){if(o=xo,a=xo,80===e.charCodeAt(xo)?(n=be,xo++):(n=i,0===So&&No(er)),n!==i){for(s=xo,l=[],c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);c!==i;)l.push(c),c=xo,p=xo,So++,u=zo(),So--,u===i?p=void 0:(xo=p,p=i),p!==i?(u=Ra(),u!==i?(p=[p,u],c=p):(xo=c,c=i)):(xo=c,c=i);s=e.substring(s,xo),n=[n,s],a=n}else xo=a,a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=zo(),a!==i?(_o=t,t=function(e){return{type:"duration",attrs:{duration:e}}}(o)):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i&&(t=xo,e.substr(xo,6)===fe?(r=fe,xo+=6):(r=i,0===So&&No(tr)),r!==i?(o=function(){let t;e.substr(xo,4)===et?(t=et,xo+=4):(t=i,0===So&&No(Vr));t===i&&(e.substr(xo,5)===tt?(t=tt,xo+=5):(t=i,0===So&&No(Nr)),t===i&&(e.substr(xo,4)===it?(t=it,xo+=4):(t=i,0===So&&No(Rr)),t===i&&(e.substr(xo,5)===rt?(t=rt,xo+=5):(t=i,0===So&&No(Fr)),t===i&&(e.substr(xo,7)===ot?(t=ot,xo+=7):(t=i,0===So&&No(Or)),t===i&&(e.substr(xo,9)===at?(t=at,xo+=9):(t=i,0===So&&No(Dr)),t===i&&(e.substr(xo,4)===nt?(t=nt,xo+=4):(t=i,0===So&&No(zr)),t===i&&(e.substr(xo,8)===st?(t=st,xo+=8):(t=i,0===So&&No(qr)),t===i&&(e.substr(xo,5)===lt?(t=lt,xo+=5):(t=i,0===So&&No(Mr)),t===i&&(e.substr(xo,4)===ct?(t=ct,xo+=4):(t=i,0===So&&No($r)),t===i&&(e.substr(xo,7)===dt?(t=dt,xo+=7):(t=i,0===So&&No(jr)),t===i&&(e.substr(xo,6)===pt?(t=pt,xo+=6):(t=i,0===So&&No(Wr)),t===i&&(e.substr(xo,4)===ut?(t=ut,xo+=4):(t=i,0===So&&No(Jr)),t===i&&(e.substr(xo,5)===ht?(t=ht,xo+=5):(t=i,0===So&&No(Hr)),t===i&&(e.substr(xo,6)===mt?(t=mt,xo+=6):(t=i,0===So&&No(Gr)),t===i&&(e.substr(xo,4)===gt?(t=gt,xo+=4):(t=i,0===So&&No(Ur)),t===i&&(e.substr(xo,6)===bt?(t=bt,xo+=6):(t=i,0===So&&No(Kr)),t===i&&(e.substr(xo,3)===ft?(t=ft,xo+=3):(t=i,0===So&&No(Yr)),t===i&&(e.substr(xo,6)===yt?(t=yt,xo+=6):(t=i,0===So&&No(Qr)),t===i&&(e.substr(xo,4)===kt?(t=kt,xo+=4):(t=i,0===So&&No(Xr)),t===i&&(e.substr(xo,6)===Tt?(t=Tt,xo+=6):(t=i,0===So&&No(Zr)),t===i&&(e.substr(xo,5)===vt?(t=vt,xo+=5):(t=i,0===So&&No(eo)),t===i&&(e.substr(xo,6)===xt?(t=xt,xo+=6):(t=i,0===So&&No(to))))))))))))))))))))))));return t}(),o!==i?(a=zo(),a!==i?(_o=t,t={type:"color",attrs:{color:o}}):(xo=t,t=i)):(xo=t,t=i)):(xo=t,t=i),t===i&&(t=xo,r=function(){let t;e.substr(xo,4)===ke?(t=ke,xo+=4):(t=i,0===So&&No(rr));t===i&&(e.substr(xo,6)===Te?(t=Te,xo+=6):(t=i,0===So&&No(or)),t===i&&(e.substr(xo,5)===ve?(t=ve,xo+=5):(t=i,0===So&&No(ar)),t===i&&(e.substr(xo,9)===xe?(t=xe,xo+=9):(t=i,0===So&&No(nr)),t===i&&(e.substr(xo,6)===_e?(t=_e,xo+=6):(t=i,0===So&&No(sr)),t===i&&(e.substr(xo,9)===we?(t=we,xo+=9):(t=i,0===So&&No(lr)),t===i&&(e.substr(xo,11)===Ce?(t=Ce,xo+=11):(t=i,0===So&&No(cr)),t===i&&(e.substr(xo,3)===Ae?(t=Ae,xo+=3):(t=i,0===So&&No(dr)),t===i&&(e.substr(xo,3)===Be?(t=Be,xo+=3):(t=i,0===So&&No(pr)),t===i&&(e.substr(xo,9)===Se?(t=Se,xo+=9):(t=i,0===So&&No(ur)),t===i&&(e.substr(xo,15)===Pe?(t=Pe,xo+=15):(t=i,0===So&&No(hr)),t===i&&(e.substr(xo,6)===Ie?(t=Ie,xo+=6):(t=i,0===So&&No(mr)),t===i&&(e.substr(xo,13)===Le?(t=Le,xo+=13):(t=i,0===So&&No(gr)),t===i&&(e.substr(xo,16)===Ee?(t=Ee,xo+=16):(t=i,0===So&&No(br)),t===i&&(e.substr(xo,16)===Ve?(t=Ve,xo+=16):(t=i,0===So&&No(fr)),t===i&&(e.substr(xo,15)===Ne?(t=Ne,xo+=15):(t=i,0===So&&No(yr)),t===i&&(e.substr(xo,14)===Re?(t=Re,xo+=14):(t=i,0===So&&No(kr)),t===i&&(e.substr(xo,16)===Fe?(t=Fe,xo+=16):(t=i,0===So&&No(Tr)),t===i&&(e.substr(xo,14)===Oe?(t=Oe,xo+=14):(t=i,0===So&&No(vr)),t===i&&(e.substr(xo,15)===De?(t=De,xo+=15):(t=i,0===So&&No(xr)),t===i&&(e.substr(xo,15)===ze?(t=ze,xo+=15):(t=i,0===So&&No(_r)),t===i&&(e.substr(xo,15)===qe?(t=qe,xo+=15):(t=i,0===So&&No(wr)),t===i&&(e.substr(xo,14)===Me?(t=Me,xo+=14):(t=i,0===So&&No(Cr)),t===i&&(e.substr(xo,10)===$e?(t=$e,xo+=10):(t=i,0===So&&No(Ar)),t===i&&(e.substr(xo,13)===je?(t=je,xo+=13):(t=i,0===So&&No(Br)),t===i&&(e.substr(xo,19)===We?(t=We,xo+=19):(t=i,0===So&&No(Sr)),t===i&&(e.substr(xo,10)===Je?(t=Je,xo+=10):(t=i,0===So&&No(Pr)),t===i&&(e.substr(xo,10)===He?(t=He,xo+=10):(t=i,0===So&&No(Ir)),t===i&&(e.substr(xo,13)===Ge?(t=Ge,xo+=13):(t=i,0===So&&No(Lr)),t===i&&(e.substr(xo,11)===Ze?(t=Ze,xo+=11):(t=i,0===So&&No(Er)))))))))))))))))))))))))))))));return t}(),r!==i?(o=zo(),o!==i?(_o=t,t={type:r}):(xo=t,t=i)):(xo=t,t=i),t===i)))if(t=xo,35===e.charCodeAt(xo)?(r=B,xo++):(r=i,0===So&&No(pi)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=zo(),a!==i?(_o=t,t=function(e){return{type:"comment",comment:e}}(o)):(xo=t,t=i)}else xo=t,t=i}}}}}}}}}}}return t}function ka(){let t,r,o,a,n,s,l;if(t=xo,e.substr(xo,2)===ye?(r=ye,xo+=2):(r=i,0===So&&No(ir)),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),_o=t,t=o.trim()}else xo=t,t=i;return t}function Ta(){let e,t,r,o;for(So++,e=xo,t=va(),t===i&&(t=null),r=[],o=Ea(),o===i&&(o=va());o!==i;)r.push(o),o=Ea(),o===i&&(o=va());var a,n;return _o=e,n=r,e=Ye((a=t)?[a,...n.flat()]:n.flat()),So--,e}function va(){let t,r,o,a,n,s,l;if(t=xo,r=Na(),r!==i&&(_o=t,r={type:"hardBreak"}),t=r,t===i){if(t=xo,r=xo,o=[],a=xo,n=Va(),n===i&&(n=null),s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=Va(),n!==i?(s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i)),a!==i)for(;a!==i;)o.push(a),a=xo,n=Va(),n===i&&(n=null),s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Ra(),l!==i?(n=[n,s,l],a=n):(xo=a,a=i)):(xo=a,a=i),a===i&&(a=xo,n=Va(),n!==i?(s=xo,So++,l=Ea(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(n=[n,s],a=n):(xo=a,a=i)):(xo=a,a=i));else o=i;r=o!==i?e.substring(r,xo):o,r!==i&&(_o=t,r={text:Ue(r),type:"text"}),t=r}return t}function xa(){let t;return 42===e.charCodeAt(xo)?(t=_t,xo++):(t=i,0===So&&No(io)),t}function _a(){let t;return 95===e.charCodeAt(xo)?(t=wt,xo++):(t=i,0===So&&No(ro)),t}function wa(){let t;return 96===e.charCodeAt(xo)?(t=Ct,xo++):(t=i,0===So&&No(oo)),t}function Ca(){let t;return 33===e.charCodeAt(xo)?(t=At,xo++):(t=i,0===So&&No(ao)),t}function Aa(){let e,t,r;return e=xo,t=xa(),t!==i?(r=xa(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Ba(){let e,t,r;return e=xo,t=_a(),t!==i?(r=_a(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Sa(){let e,t,r;return e=xo,t=wa(),t!==i?(r=wa(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Pa(){let e,t,r;return e=xo,t=Ca(),t!==i?(r=Ca(),r!==i?(t=[t,r],e=t):(xo=e,e=i)):(xo=e,e=i),e}function Ia(){let t;return e.substr(xo,2)===Bt?(t=Bt,xo+=2):(t=i,0===So&&No(no)),t}function La(){let t;return 93===e.charCodeAt(xo)?(t=St,xo++):(t=i,0===So&&No(so)),t}function Ea(){let t,r,o,a,n,s,l;if(t=xo,r=Ia(),r!==i){if(o=xo,a=[],n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti)),n!==i)for(;n!==i;)a.push(n),n=e.charAt(xo),Ft.test(n)?xo++:(n=i,0===So&&No(ti));else a=i;o=a!==i?e.substring(o,xo):a,o!==i?(a=La(),a!==i?(_o=t,t={index:+o,type:"bit"}):(xo=t,t=i)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Aa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Aa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Aa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Aa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"bold"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Ba(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Ba(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Ba(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Ba(),a!==i?(_o=t,t=function(e){return{marks:[{type:"italic"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i){if(t=xo,r=Sa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Sa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Sa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Sa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"light"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i;if(t===i)if(t=xo,r=Pa(),r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=Pa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=Pa(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(e.length>xo?(l=e.charAt(xo),xo++):(l=i,0===So&&No(qt)),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),a=Pa(),a!==i?(_o=t,t=function(e){return{marks:[{type:"highlight"}],text:Ue(e),type:"text"}}(o)):(xo=t,t=i)}else xo=t,t=i}}}return t}function Va(){let t,r,o,a,n;if(t=xo,r=xo,o=Sa(),o!==i){if(a=[],n=wa(),n!==i)for(;n!==i;)a.push(n),n=wa();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;if(t=r!==i?e.substring(t,xo):r,t===i){if(t=xo,r=xo,o=Pa(),o!==i){if(a=[],n=Ca(),n!==i)for(;n!==i;)a.push(n),n=Ca();else a=i;a!==i?(o=[o,a],r=o):(xo=r,r=i)}else xo=r,r=i;t=r!==i?e.substring(t,xo):r}return t}function Na(){let t,r;return So++,10===e.charCodeAt(xo)?(t=Pt,xo++):(t=i,0===So&&No(co)),t===i&&(e.substr(xo,2)===It?(t=It,xo+=2):(t=i,0===So&&No(po)),t===i&&(t=e.charAt(xo),Ot.test(t)?xo++:(t=i,0===So&&No(uo)))),So--,t===i&&(r=i,0===So&&No(lo)),t}function Ra(){let t;return t=e.charAt(xo),Dt.test(t)?xo++:(t=i,0===So&&No(ho)),t}function Fa(){let t,r;return t=Na(),t===i&&(t=xo,So++,e.length>xo?(r=e.charAt(xo),xo++):(r=i,0===So&&No(qt)),So--,r===i?t=void 0:(xo=t,t=i)),t}function Oa(){let t,r,o,a,n,s,l;if(t=xo,r=xo,o=xo,e.substr(xo,4)===Lt?(a=Lt,xo+=4):(a=i,0===So&&No(mo)),a!==i?(115===e.charCodeAt(xo)?(n=Et,xo++):(n=i,0===So&&No(go)),n===i&&(n=null),e.substr(xo,3)===Vt?(s=Vt,xo+=3):(s=i,0===So&&No(bo)),s!==i?(a=[a,n,s],o=a):(xo=o,o=i)):(xo=o,o=i),o===i&&(e.substr(xo,7)===Nt?(o=Nt,xo+=7):(o=i,0===So&&No(fo))),r=o!==i?e.substring(r,xo):o,r!==i){for(o=xo,a=[],n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Da(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);n!==i;)a.push(n),n=xo,s=xo,So++,l=zo(),So--,l===i?s=void 0:(xo=s,s=i),s!==i?(l=Da(),l!==i?(s=[s,l],n=s):(xo=n,n=i)):(xo=n,n=i);o=e.substring(o,xo),_o=t,t={pr:r,t:o}}else xo=t,t=i;return t}function Da(){let t;return t=e.charAt(xo),zt.test(t)?xo++:(t=i,0===So&&No(yo)),t}var za=[],qa="";e=e.trimStart(),Co=a();const Ma=Co!==i&&xo===e.length;function $a(){throw Co!==i&&xo<e.length&&No({type:"end"}),Ro(Bo,Ao<e.length?function(t=xo){const i=e.codePointAt(t);return void 0===i?"":String.fromCodePoint(i)}(Ao):null,Ao<e.length?Vo(Ao,Ao+1):Vo(Ao,Ao))}return t.peg$library?{peg$result:Co,peg$currPos:xo,peg$FAILED:i,peg$maxFailExpected:Bo,peg$maxFailPos:Ao,peg$success:Ma,peg$throw:Ma?void 0:$a}:Ma?Co:void $a()}var et=Ze,tt=class{version(){return et("",{startRule:"version"})}preprocessAst(e){if(V.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){if(Array.isArray(e))return e;let i=e??"";if(!i)return[];let r="bitmarkPlusPlus";return Object.assign({},t).location===ce.tag&&(r="bitmarkPlus"),i=i.trim(),et(i,{startRule:r})}extractBodyBits(e){if(!Array.isArray(e))return[];const t=[],i=e;for(const e of i)switch(e.type){case ne.gap:case ne.select:case ne.highlight:case ne.mark:t.push(e);break;default:{const i=this.extractBodyBits(e.content);for(const e of i)t.push(e)}}return t}walkBodyBits(e,t){if(!Array.isArray(e))return;const i=e;for(let e=0;e<i.length;e++){const r=i[e];switch(r.type){case ne.gap:case ne.select:case ne.highlight:case ne.mark:t(i,e,r);break;default:this.walkBodyBits(r.content,t)}}}},it=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}},rt=new class{asNumber(e,t){if(null==e)return t??void 0;const i=+e;return Number.isNaN(i)||!isFinite(i)?t??void 0:i}isNumeric(e){if(null==e)return!1;const t=+e;return!Number.isNaN(t)&&isFinite(t)}},ot=class{constructor(){l(this,"textParser"),l(this,"textGenerator"),this.textParser=new tt,this.textGenerator=new Ge}toExample(e,t,i){if(null!=t){let e;return e=it.isBoolean(i)?it.toBoolean(t):t,{isExample:!0,example:e,__defaultExample:i??null}}return e?{isExample:!0,example:i??null,__defaultExample:i??null}:{isExample:!1,example:null,__defaultExample:i??null}}toAstProperty(e,t,i,r){if(null==i)return;let o=H.getBitConfig(e).tags;if(r?.cardSet){const{sideNo:t,variantNo:i}=r.cardSet;o=H.getTagsConfigForCardSet(e,t,i)??o}const a=H.getTagConfigForTag(o,t);a?.array&&!Array.isArray(i)?i=[i]:!a?.array&&Array.isArray(i)&&(i=i[i.length-1]);const n=e=>{if(null==e)return;switch(a?.format??g.plainText){case g.plainText:return null!=rt.asNumber(e)&&(e=`${e}`),V.isString(e)?V.trimmedString(e):void 0;case g.number:return rt.asNumber(e);case g.boolean:return it.toBoolean(e,!0);case g.invertedBoolean:return!it.toBoolean(e,!0)}return e};if(Array.isArray(i)){const e=i;for(let t=0,i=e.length;t<i;t++)e[t]=n(e[t])}else i=n(i);return i}getEmptyTextAst(e){return this.handleJsonText(e,ce.tag," ")}handleJsonText(e,t,i){let r;const{textFormat:o}=e;if(null==i)r=[];else if(this.textParser.isAst(i))r=i;else{if(Array.isArray(i)){const e=[];for(let r=0,a=i.length;r<a;r++){const a=i[r];this.textParser.isAst(a)?e[r]=a:V.isString(a)?(e[r]=this.textParser.toAst(Pe.breakscape(a,{format:o,location:t}),{format:o,location:t}),e[r].__tag="text"):e[r]=[]}return e}r=V.isString(i)?this.textParser.toAst(Pe.breakscape(i,{format:o,location:t,v2:!0}),{format:o,location:t}):[]}return r.__tag="text",r}},at=new tt,nt=new class{fillStringExample(e,t,i,r,o){if(t){Array.isArray(t)||(t=[t]);for(const a of t)if(!a.isExample&&(i?(a.example=a.__defaultExample,a.isExample=!0):a.example=r?at.toAst(r,{format:e,location:ce.tag}):void 0,o))break}}fillBooleanExample(e,t,i,r){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!r||o.isCorrect)&&(t?(o.example=o.__defaultExample,o.isExample=!0):o.example=it.toBoolean(i),r))break}}},st=new class{fileExtensionFromUrl(e){let t;if(e)try{const i=new URL(e).pathname.split(".");i.length>1&&(t=i[i.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}},lt=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 i=!0;switch(e.type){case N.image:{const t=e.image;V.isString(t.src)||(t.src="");break}case N.imageLink:{const t=e.imageLink;V.isString(t.url)||(t.url="");break}case N.audio:{const t=e.audio;V.isString(t.src)||(t.src="");break}case N.audioEmbed:{const t=e.audioEmbed;V.isString(t.src)||(t.src="");break}case N.audioLink:{const t=e.audioLink;V.isString(t.url)||(t.url="");break}case N.video:{const t=e.video;V.isString(t.src)||(t.src="");break}case N.videoEmbed:{const t=e.videoEmbed;V.isString(t.url)||(t.url="");break}case N.videoLink:{const t=e.videoLink;V.isString(t.url)||(t.url="");break}case N.stillImageFilm:{const t=e;V.isString(t.image.src)||(t.image.src=""),V.isString(t.audio.src)||(t.audio.src="");break}case N.stillImageFilmEmbed:{const t=e.stillImageFilmEmbed;V.isString(t.url)||(t.url="");break}case N.stillImageFilmLink:{const t=e.stillImageFilmLink;V.isString(t.url)||(t.url="");break}case N.article:{const t=e.article;V.isString(t.body)||(t.body="");break}case N.document:{const t=e.document;V.isString(t.url)||(t.url="");break}case N.documentEmbed:{const t=e.documentEmbed;V.isString(t.url)||(t.url="");break}case N.documentLink:{const t=e.documentLink;V.isString(t.url)||(t.url="");break}case N.documentDownload:{const t=e.documentDownload;V.isString(t.url)||(t.url="");break}case N.appLink:{const t=e.appLink;V.isString(t.url)||(t.url="");break}case N.websiteLink:{const t=e.websiteLink;V.isString(t.url)||(t.url="");break}default:i=!1}return i||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(!V.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!V.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!V.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!V.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(!V.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`)}},ct=class extends ot{resourceFromResourceJson(e,t){if(!t)return;const i=[];Array.isArray(t)||(t=[t]);for(const r of t){let t=N.fromValue(r.type);if(!t)return;const o=N.keyFromValue(t);if(!o)return;let a;if(t=N.fromValue(r.__typeAlias)??t,t===N.imageResponsive){const t=r,o=this.resourceFromResourceDataJson(e,N.imagePortrait,t.imagePortrait),a=this.resourceFromResourceDataJson(e,N.imageLandscape,t.imageLandscape);o&&i.push(o),a&&i.push(a)}else if(t===N.stillImageFilm){const t=r,o=this.resourceFromResourceDataJson(e,N.image,t.image),a=this.resourceFromResourceDataJson(e,N.audio,t.audio);o&&i.push(o),a&&i.push(a)}else{if(a=r[o],!a)return;const n=this.resourceFromResourceDataJson(e,t,a);n&&i.push(n)}}return 0!==i.length?1===i.length?i[0]:i:void 0}resourceFromResourceDataJson(e,t,i){if(!i)return;if(!(t=N.fromValue(t)))return;const r=V.isString(i)?i:void 0,o=i.url||i.src||i.body||r,a=i.posterImage?this.resourceFromResourceDataJson(e,N.image,i.posterImage)?.image:void 0,n=i.thumbnails?i.thumbnails.map(t=>this.resourceFromResourceDataJson(e,N.image,t)?.image):void 0;return this.resource(e,{type:t,value:o,format:i.format,src1x:i.src1x,src2x:i.src2x,src3x:i.src3x,src4x:i.src4x,caption:this.handleJsonText(e,ce.tag,i.caption),width:i.width??void 0,height:i.height??void 0,alt:i.alt,zoomDisabled:i.zoomDisabled,duration:i.duration,mute:i.mute,autoplay:i.autoplay,allowSubtitles:i.allowSubtitles,showSubtitles:i.showSubtitles,posterImage:a,thumbnails:n,siteName:void 0,license:i.license,copyright:i.copyright,showInIndex:i.showInIndex,search:i.search})}resource(e,t){let i;const{type:r,value:o,format:a,...n}=t,s={type:r,value:o??Pe.EMPTY_STRING,format:a??Pe.EMPTY_STRING,...n};switch(r){case N.video:case N.videoEmbed:case N.videoLink:case N.stillImageFilmEmbed:case N.stillImageFilmLink:{const i=["src1x","src2x","src3x","src4x"],r=[];for(const o of i){const i=t[o];if(i){const t=this.resource(e,{type:N.image,value:i});t&&r.push(t.image)}}s.thumbnails=[...s.thumbnails||[],...r]}}switch(r){case N.image:case N.imagePortrait:case N.imageLandscape:case N.backgroundWallpaper:case N.imagePlaceholder:case N.icon:i=this.imageResource(e,s,r);break;case N.imageLink:i=this.imageLinkResource(e,s);break;case N.audio:i=this.audioResource(e,s);break;case N.audioEmbed:i=this.audioEmbedResource(e,s);break;case N.audioLink:i=this.audioLinkResource(e,s);break;case N.video:i=this.videoResource(e,s);break;case N.videoEmbed:i=this.videoEmbedResource(e,s);break;case N.videoLink:i=this.videoLinkResource(e,s);break;case N.stillImageFilmEmbed:i=this.stillImageFilmEmbedResource(e,s);break;case N.stillImageFilmLink:i=this.stillImageFilmLinkResource(e,s);break;case N.article:i=this.articleResource(e,s);break;case N.document:i=this.documentResource(e,s);break;case N.documentEmbed:i=this.documentEmbedResource(e,s);break;case N.documentLink:i=this.documentLinkResource(e,s);break;case N.documentDownload:i=this.documentDownloadResource(e,s);break;case N.appLink:i=this.appLinkResource(e,s);break;case N.websiteLink:i=this.websiteLinkResource(e,s)}return i}imageResource(e,t,i){const{value:r,src1x:o,src2x:a,src3x:n,src4x:s,width:l,height:c,alt:p,zoomDisabled:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,{bitType:y}=e;let k=!1;H.isOfBitType(y,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages])&&(k=!0);const T={type:N.image,__typeAlias:i??N.image,__configKey:R(i??N.image),image:{format:st.fileExtensionFromUrl(r)??void 0,provider:st.domainFromUrl(r)??void 0,src:r??"",src1x:o??void 0,src2x:a??void 0,src3x:n??void 0,src4x:s??void 0,width:l??null,height:c??null,alt:p??"",zoomDisabled:u??k,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0}};return M.removeUnwantedProperties(T.image,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","alt","license","copyright"]}),lt.validateResource(T)}imageLinkResource(e,t){const{value:i,src1x:r,src2x:o,src3x:a,src4x:n,width:s,height:l,alt:c,zoomDisabled:d,license:p,copyright:u,showInIndex:h,caption:m,search:g}=t,b={type:N.imageLink,__typeAlias:N.imageLink,__configKey:R(N.imageLink),imageLink:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",src1x:r??void 0,src2x:o??void 0,src3x:a??void 0,src4x:n??void 0,width:s??null,height:l??null,alt:c??"",zoomDisabled:d??!1,license:p??"",copyright:u??"",showInIndex:h??!1,caption:this.handleJsonText(e,ce.tag,m),search:g??void 0}};return M.removeUnwantedProperties(b.imageLink,{ignoreFalse:["zoomDisabled","showInIndex"],ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","alt","license","copyright"]}),lt.validateResource(b)}audioResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:N.audio,__typeAlias:N.audio,__configKey:R(N.audio),audio:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ce.tag,c),search:d??void 0}};return M.removeUnwantedProperties(p.audio,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(p)}audioEmbedResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:N.audioEmbed,__typeAlias:N.audioEmbed,__configKey:R(N.audioEmbed),audioEmbed:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,src:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ce.tag,c),search:d??void 0}};return M.removeUnwantedProperties(p.audioEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(p)}audioLinkResource(e,t){const{value:i,duration:r,mute:o,autoplay:a,license:n,copyright:s,showInIndex:l,caption:c,search:d}=t,p={type:N.audioLink,__typeAlias:N.audioLink,__configKey:R(N.audioLink),audioLink:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",duration:r??void 0,mute:o??void 0,autoplay:a??void 0,license:n??"",copyright:s??"",showInIndex:l??!1,caption:this.handleJsonText(e,ce.tag,c),search:d??void 0}};return M.removeUnwantedProperties(p.audioLink,{ignoreEmptyString:["url"]}),lt.validateResource(p)}videoResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:N.video,__typeAlias:N.video,__configKey:R(N.video),video:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,src:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0,posterImage:p??void 0,thumbnails:u??void 0}};return M.removeUnwantedProperties(y.video,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["src","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(y)}videoEmbedResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:N.videoEmbed,__typeAlias:N.videoEmbed,__configKey:R(N.videoEmbed),videoEmbed:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0}};return M.removeUnwantedProperties(y.videoEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(y)}videoLinkResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:N.videoLink,__typeAlias:N.videoLink,__configKey:R(N.videoLink),videoLink:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0}};return M.removeUnwantedProperties(y.videoLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(y)}stillImageFilmEmbedResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:N.stillImageFilmEmbed,__typeAlias:N.stillImageFilmEmbed,__configKey:R(N.stillImageFilmEmbed),stillImageFilmEmbed:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0}};return M.removeUnwantedProperties(y.stillImageFilmEmbed,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(y)}stillImageFilmLinkResource(e,t){const{value:i,width:r,height:o,duration:a,mute:n,autoplay:s,allowSubtitles:l,showSubtitles:c,alt:d,posterImage:p,thumbnails:u,license:h,copyright:m,showInIndex:g,caption:b,search:f}=t,y={type:N.stillImageFilmLink,__typeAlias:N.stillImageFilmLink,__configKey:R(N.stillImageFilmLink),stillImageFilmLink:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",width:r??null,height:o??null,duration:a??void 0,mute:n??void 0,autoplay:s??void 0,allowSubtitles:l??void 0,showSubtitles:c??void 0,alt:d??"",posterImage:p??void 0,thumbnails:u??void 0,license:h??"",copyright:m??"",showInIndex:g??!1,caption:this.handleJsonText(e,ce.tag,b),search:f??void 0}};return M.removeUnwantedProperties(y.stillImageFilmLink,{ignoreEmptyArrays:["caption"],ignoreUndefined:["width","height"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(y)}articleResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.article,__typeAlias:N.article,__configKey:R(N.article),article:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,body:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.article,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["body","alt","license","copyright"]}),lt.validateResource(l)}documentResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.document,__typeAlias:N.document,__configKey:R(N.document),document:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.document,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}documentEmbedResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.documentEmbed,__typeAlias:N.documentEmbed,__configKey:R(N.documentEmbed),documentEmbed:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.documentEmbed,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}documentLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.documentLink,__typeAlias:N.documentLink,__configKey:R(N.documentLink),documentLink:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.documentLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}documentDownloadResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.documentDownload,__typeAlias:N.documentDownload,__configKey:R(N.documentDownload),documentDownload:{format:st.fileExtensionFromUrl(i)??void 0,provider:st.domainFromUrl(i)??void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.documentDownload,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}appLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.appLink,__typeAlias:N.appLink,__configKey:R(N.appLink),appLink:{provider:void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.appLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}websiteLinkResource(e,t){const{value:i,license:r,copyright:o,showInIndex:a,caption:n,search:s}=t,l={type:N.websiteLink,__typeAlias:N.websiteLink,__configKey:R(N.websiteLink),websiteLink:{provider:void 0,url:i??"",license:r??"",copyright:o??"",showInIndex:a??!1,caption:this.handleJsonText(e,ce.tag,n),search:s??void 0}};return M.removeUnwantedProperties(l.websiteLink,{ignoreEmptyArrays:["caption"],ignoreEmptyString:["url","alt","license","copyright"],ignoreFalse:["showInIndex"]}),lt.validateResource(l)}},dt=class extends ot{constructor(){super(...arguments),l(this,"resourceBuilder",new ct)}buildBitmark(e){const{bits:t,errors:i}=e,r={bits:t,errors:i};return M.removeUnwantedProperties(r),r}buildBit(e,t){const i=e.bitType,r=H.getBitConfig(i),o=Ie.fromValue(e.textFormat);let a=b.fromValue(e.textFormat)??r.textFormatDefault;o===Ie.bitmarkMinusMinus&&(a=b.bitmarkText);const n={bitConfig:r,bitType:i,textFormat:a},s=this.buildCardNode(n,e),l=H.isOfBitType(e.bitType,d.essay)?this.toAstProperty(i,F.property_reasonableNumOfChars,e.reasonableNumOfChars,t):void 0,c={...this.toExample(e.__isDefaultExample,e.example)},p={bitType:i,bitLevel:e.bitLevel,textFormat:a,resourceType:N.fromValue(e.resourceType),isCommented:e.isCommented,id:this.toAstProperty(i,F.property_id,e.id,t),internalComment:this.toAstProperty(i,F.property_internalComment,e.internalComment,t),customerId:this.toAstProperty(i,F.property_customerId,e.customerId,t),customerExternalId:this.toAstProperty(i,F.property_customerExternalId,e.customerExternalId,t),externalId:this.toAstProperty(i,F.property_externalId,e.externalId,t),spaceId:this.toAstProperty(i,F.property_spaceId,e.spaceId,t),padletId:this.toAstProperty(i,F.property_padletId,e.padletId,t),jupyterId:this.toAstProperty(i,F.property_jupyterId,e.jupyterId,t),jupyterExecutionCount:this.toAstProperty(i,F.property_jupyterExecutionCount,e.jupyterExecutionCount,t),isPublic:this.toAstProperty(i,F.property_isPublic,e.isPublic,t),isTemplate:this.toAstProperty(i,F.property_isTemplate,e.isTemplate,t),isTemplateStripTheme:this.toAstProperty(i,F.property_isTemplateStripTheme,e.isTemplateStripTheme,t),isEditable:this.toAstProperty(i,F.property_isEditable,e.isEditable,t),aiGenerated:this.toAstProperty(i,F.property_aiGenerated,e.aiGenerated,t),machineTranslated:this.toAstProperty(i,F.property_machineTranslated,e.machineTranslated,t),searchIndex:this.toAstProperty(i,F.property_searchIndex,e.searchIndex,t),analyticsTag:this.toAstProperty(i,F.property_analyticsTag,e.analyticsTag,t),categoryTag:this.toAstProperty(i,F.property_categoryTag,e.categoryTag,t),topicTag:this.toAstProperty(i,F.property_topicTag,e.topicTag,t),reportTag:this.toAstProperty(i,F.property_reportTag,e.reportTag,t),altLangTag:this.toAstProperty(i,F.property_altLangTag,e.altLangTag,t),feedbackEngine:this.toAstProperty(i,F.property_feedbackEngine,e.feedbackEngine,t),feedbackType:this.toAstProperty(i,F.property_feedbackType,e.feedbackType,t),disableFeedback:this.toAstProperty(i,F.property_disableFeedback,e.disableFeedback,t),diffTo:this.toAstProperty(i,F.property_diffTo,e.diffTo,t),diffOp:this.toAstProperty(i,F.property_diffOp,e.diffOp,t),diffRef:this.toAstProperty(i,F.property_diffRef,e.diffRef,t),diffContext:this.toAstProperty(i,F.property_diffContext,e.diffContext,t),diffTime:this.toAstProperty(i,F.property_diffTime,e.diffTime,t),path:this.toAstProperty(i,F.property_path,e.path,t),releaseVersion:this.toAstProperty(i,F.property_releaseVersion,e.releaseVersion,t),releaseKind:this.toAstProperty(i,F.property_releaseKind,e.releaseKind,t),releaseDate:this.toAstProperty(i,F.property_releaseDate,e.releaseDate,t),book:this.buildBooks(n,e.book),ageRange:this.toAstProperty(i,F.property_ageRange,e.ageRange,t),lang:this.toAstProperty(i,F.property_lang,e.lang,t),language:this.toAstProperty(i,F.property_language,e.language,t),publisher:this.toAstProperty(i,F.property_publisher,e.publisher,t),publisherName:this.toAstProperty(i,F.property_publisherName,e.publisherName,t),theme:this.toAstProperty(i,F.property_theme,e.theme,t),computerLanguage:this.toAstProperty(i,F.property_computerLanguage,e.computerLanguage,t),target:this.toAstProperty(i,F.property_target,e.target,t),slug:this.toAstProperty(i,F.property_slug,e.slug,t),tag:this.toAstProperty(i,F.property_tag,e.tag,t),groupTag:this.buildGroupTags(n,e.groupTag),reductionTag:this.toAstProperty(i,F.property_reductionTag,e.reductionTag,t),bubbleTag:this.toAstProperty(i,F.property_bubbleTag,e.bubbleTag,t),levelCEFRp:this.toAstProperty(i,F.property_levelCEFRp,e.levelCEFRp,t),levelCEFR:this.toAstProperty(i,F.property_levelCEFR,e.levelCEFR,t),levelILR:this.toAstProperty(i,F.property_levelILR,e.levelILR,t),levelACTFL:this.toAstProperty(i,F.property_levelACTFL,e.levelACTFL,t),icon:this.toAstProperty(i,F.property_icon,e.icon,t),iconTag:this.toAstProperty(i,F.property_iconTag,e.iconTag,t),colorTag:this.toAstProperty(i,F.property_colorTag,e.colorTag,t),flashcardSet:this.toAstProperty(i,F.property_flashcardSet,e.flashcardSet,t),subtype:this.toAstProperty(i,F.property_subtype,e.subtype,t),bookAlias:this.toAstProperty(i,F.property_bookAlias,e.bookAlias,t),bookDiff:this.toAstProperty(i,F.property_bookDiff,e.bookDiff,t),coverImage:this.toAstProperty(i,F.property_coverImage,e.coverImage,t),coverColor:this.toAstProperty(i,F.property_coverColor,e.coverColor,t),publications:this.toAstProperty(i,F.property_publications,e.publications,t),author:this.toAstProperty(i,F.property_author,e.author,t),subject:this.toAstProperty(i,F.property_subject,e.subject,t),date:this.toAstProperty(i,F.property_date,e.date,t),dateEnd:this.toAstProperty(i,F.property_dateEnd,e.dateEnd,t),location:this.toAstProperty(i,F.property_location,e.location,t),kind:this.toAstProperty(i,F.property_kind,e.kind,t),hasMarkAsDone:this.toAstProperty(i,F.property_hasMarkAsDone,e.hasMarkAsDone,t),processHandIn:this.toAstProperty(i,F.property_processHandIn,e.processHandIn,t),processHandInLocation:this.toAstProperty(i,F.property_processHandInLocation,e.processHandInLocation,t),chatWithBook:this.toAstProperty(i,F.property_chatWithBook,e.chatWithBook,t),chatWithBookBrainKey:this.toAstProperty(i,F.property_chatWithBookBrainKey,e.chatWithBookBrainKey,t),action:this.toAstProperty(i,F.property_action,e.action,t),showInIndex:this.toAstProperty(i,F.property_showInIndex,e.showInIndex,t),refAuthor:this.toAstProperty(i,F.property_refAuthor,e.refAuthor,t),refBookTitle:this.toAstProperty(i,F.property_refBookTitle,e.refBookTitle,t),refPublisher:this.toAstProperty(i,F.property_refPublisher,e.refPublisher,t),refPublicationYear:this.toAstProperty(i,F.property_refPublicationYear,e.refPublicationYear,t),citationStyle:this.toAstProperty(i,F.property_citationStyle,e.citationStyle,t),blockId:this.toAstProperty(i,F.property_blockId,e.blockId,t),pageNo:this.toAstProperty(i,F.property_pageNo,e.pageNo,t),x:this.toAstProperty(i,F.property_x,e.x,t),y:this.toAstProperty(i,F.property_y,e.y,t),width:this.toAstProperty(i,F.property_width,e.width,t),height:this.toAstProperty(i,F.property_height,e.height,t),index:this.toAstProperty(i,F.property_index,e.index,t),classification:this.toAstProperty(i,F.property_classification,e.classification,t),availableClassifications:this.toAstProperty(i,F.property_availableClassifications,e.availableClassifications,t),allowedBit:this.toAstProperty(i,F.property_allowedBit,e.allowedBit,t),tableFixedHeader:this.toAstProperty(i,F.property_tableFixedHeader,e.tableFixedHeader,t),tableHeaderWhitespaceNoWrap:this.toAstProperty(i,F.property_tableHeaderWhitespaceNoWrap,e.tableHeaderWhitespaceNoWrap,t),tableSearch:this.toAstProperty(i,F.property_tableSearch,e.tableSearch,t),tableSort:this.toAstProperty(i,F.property_tableSort,e.tableSort,t),tablePagination:this.toAstProperty(i,F.property_tablePagination,e.tablePagination,t),tablePaginationLimit:this.toAstProperty(i,F.property_tablePaginationLimit,e.tablePaginationLimit,t),tableHeight:this.toAstProperty(i,F.property_tableHeight,e.tableHeight,t),tableWhitespaceNoWrap:this.toAstProperty(i,F.property_tableWhitespaceNoWrap,e.tableWhitespaceNoWrap,t),tableAutoWidth:this.toAstProperty(i,F.property_tableAutoWidth,e.tableAutoWidth,t),tableResizableColumns:this.toAstProperty(i,F.property_tableResizableColumns,e.tableResizableColumns,t),tableColumnMinWidth:this.toAstProperty(i,F.property_tableColumnMinWidth,e.tableColumnMinWidth,t),quizCountItems:this.toAstProperty(i,F.property_quizCountItems,e.quizCountItems,t),quizStrikethroughSolutions:this.toAstProperty(i,F.property_quizStrikethroughSolutions,e.quizStrikethroughSolutions,t),codeLineNumbers:this.toAstProperty(i,F.property_codeLineNumbers,e.codeLineNumbers,t),codeMinimap:this.toAstProperty(i,F.property_codeMinimap,e.codeMinimap,t),stripePricingTableId:this.toAstProperty(i,F.property_stripePricingTableId,e.stripePricingTableId,t),stripePublishableKey:this.toAstProperty(i,F.property_stripePublishableKey,e.stripePublishableKey,t),thumbImage:this.toAstProperty(i,F.property_thumbImage,e.thumbImage,t),scormSource:this.toAstProperty(i,F.property_scormSource,e.scormSource,t),posterImage:this.toAstProperty(i,F.property_posterImage,e.posterImage,t),focusX:this.toAstProperty(i,F.property_focusX,e.focusX,t),focusY:this.toAstProperty(i,F.property_focusY,e.focusY,t),pointerLeft:this.toAstProperty(i,F.property_pointerLeft,e.pointerLeft,t),pointerTop:this.toAstProperty(i,F.property_pointerTop,e.pointerTop,t),listItemIndent:this.toAstProperty(i,F.property_listItemIndent,e.listItemIndent,t),backgroundWallpaper:this.toImageResource(n,e.backgroundWallpaper),hasBookNavigation:this.toAstProperty(i,F.property_hasBookNavigation,e.hasBookNavigation,t),duration:this.toAstProperty(i,F.property_duration,e.duration,t),deeplink:this.toAstProperty(i,F.property_deeplink,e.deeplink,t),externalLink:this.toAstProperty(i,F.property_externalLink,e.externalLink,t),externalLinkText:this.toAstProperty(i,F.property_externalLinkText,e.externalLinkText,t),videoCallLink:this.toAstProperty(i,F.property_videoCallLink,e.videoCallLink,t),vendorDashboardId:this.toAstProperty(i,F.property_vendorDashboardId,e.vendorDashboardId,t),vendorSurveyId:this.toAstProperty(i,F.property_vendorSurveyId,e.vendorSurveyId,t),vendorUrl:this.toAstProperty(i,F.property_vendorUrl,e.vendorUrl,t),search:this.toAstProperty(i,F.property_search,e.search,t),list:this.toAstProperty(i,F.property_list,e.list,t),layer:this.toAstProperty(i,F.property_layer,e.layer,t),layerRole:this.toAstProperty(i,F.property_layerRole,e.layerRole,t),textReference:this.toAstProperty(i,F.property_textReference,e.textReference,t),isTracked:this.toAstProperty(i,F.property_isTracked,e.isTracked,t),isInfoOnly:this.toAstProperty(i,F.property_isInfoOnly,e.isInfoOnly,t),imageFirst:this.toAstProperty(i,F.property_imageFirst,e.imageFirst,t),activityType:this.toAstProperty(i,F.property_activityType,e.activityType,t),labelTrue:this.toAstProperty(i,F.property_labelTrue,e.labelTrue,t),labelFalse:this.toAstProperty(i,F.property_labelFalse,e.labelFalse,t),content2Buy:this.toAstProperty(i,F.property_content2Buy,e.content2Buy,t),mailingList:this.toAstProperty(i,F.property_mailingList,e.mailingList,t),buttonCaption:this.toAstProperty(i,F.property_buttonCaption,e.buttonCaption,t),callToActionUrl:this.toAstProperty(i,F.property_callToActionUrl,e.callToActionUrl,t),caption:this.handleJsonText(n,ce.tag,e.caption),quotedPerson:this.toAstProperty(i,F.property_quotedPerson,e.quotedPerson,t),reasonableNumOfChars:l,resolved:this.toAstProperty(i,F.property_resolved,e.resolved,t),resolvedDate:this.toAstProperty(i,F.property_resolvedDate,e.resolvedDate,t),resolvedBy:this.toAstProperty(i,F.property_resolvedBy,e.resolvedBy,t),handInAcceptFileType:this.toAstProperty(i,F.property_handInAcceptFileType,e.handInAcceptFileType,t),handInRequirement:this.toAstProperty(i,F.property_handInRequirement,e.handInRequirement,t),handInInstruction:this.toAstProperty(i,F.property_handInInstruction,e.handInInstruction,t),maxCreatedBits:this.toAstProperty(i,F.property_maxCreatedBits,e.maxCreatedBits,t),maxDisplayLevel:this.toAstProperty(i,F.property_maxDisplayLevel,e.maxDisplayLevel,t),maxTocChapterLevel:this.toAstProperty(i,F.property_maxTocChapterLevel,e.maxTocChapterLevel,t),tocResource:this.toAstProperty(i,F.property_tocResource,e.tocResource,t),tocContent:this.toAstProperty(i,F.property_tocContent,e.tocContent,t),page:this.toAstProperty(i,F.property_page,e.page,t),productId:this.toAstProperty(i,F.property_productId,e.productId,t),product:this.toAstProperty(i,F.property_product,e.product,t),productVideo:this.toAstProperty(i,F.property_productVideo,e.productVideo,t),productFolder:this.toAstProperty(i,F.property_productFolder,e.productFolder,t),technicalTerm:this.buildTechnicalTerm(n,e.technicalTerm),servings:this.buildServings(n,e.servings),ratingLevelStart:this.buildRatingLevelStartEnd(n,e.ratingLevelStart),ratingLevelEnd:this.buildRatingLevelStartEnd(n,e.ratingLevelEnd),ratingLevelSelected:this.toAstProperty(i,F.property_ratingLevelSelected,e.ratingLevelSelected,t),markConfig:this.buildMarkConfigs(n,e.markConfig),imageSource:this.buildImageSource(n,e.imageSource),person:this.buildPerson(n,e.person),bot:this.toAstProperty(i,F.property_bot,e.bot,t),referenceProperty:this.toAstProperty(i,F.property_reference,e.referenceProperty,t),fullName:this.toAstProperty(i,F.property_fullName,e.fullName,t),pseudonym:this.toAstProperty(i,F.property_pseudonym,e.pseudonym,t),titleString:this.toAstProperty(i,F.property_title,e.titleString,t),jobTitle:this.toAstProperty(i,F.property_jobTitle,e.jobTitle,t),title:this.handleJsonText(n,ce.tag,e.title),subtitle:this.handleJsonText(n,ce.tag,e.subtitle),level:rt.asNumber(e.level),toc:this.toAstProperty(i,F.property_toc,e.toc,t),progress:this.toAstProperty(i,F.property_progress,e.progress,t),anchor:e.anchor,reference:e.reference,referenceEnd:e.referenceEnd,revealSolutions:this.toAstProperty(i,F.property_revealSolutions,e.revealSolutions,t),item:this.handleJsonText(n,ce.tag,e.item),lead:this.handleJsonText(n,ce.tag,e.lead),pageNumber:this.handleJsonText(n,ce.tag,e.pageNumber),marginNumber:this.handleJsonText(n,ce.tag,e.marginNumber),hint:this.handleJsonText(n,ce.tag,e.hint),instruction:this.handleJsonText(n,ce.tag,e.instruction),partialAnswer:this.toAstProperty(i,F.property_partialAnswer,e.partialAnswer,t),sampleSolution:this.toAstProperty(i,F.property_sampleSolution,e.sampleSolution,t),additionalSolutions:this.toAstProperty(i,F.property_additionalSolutions,e.additionalSolutions,t),...this.toExample(e.__isDefaultExample,e.example),imagePlaceholder:this.toImageResource(n,e.imagePlaceholder),resources:Le.asArray(this.resourceBuilder.resourceFromResourceJson(n,e.resources)),body:this.buildBody(n,e.body),cardNode:s,footer:this.buildFooter(n,e.footer),extraProperties:this.parseExtraProperties(e.extraProperties),markup:e.markup,parser:e.parser,__isDefaultExample:e.__isDefaultExample??!1};return H.isOfBitType(p.bitType,d.interview)&&this.pushDownTree(n,void 0,void 0,s,"questions","reasonableNumOfChars",e.reasonableNumOfChars),H.isOfBitType(p.bitType,d.feedback)&&this.pushDownTree(n,void 0,void 0,s,["feedbacks","reason"],"reasonableNumOfChars",e.reasonableNumOfChars),this.pushDownTree(n,[p.body,...s?.cardBits?.map(e=>e.body)||[]],[oe.gap],void 0,void 0,"isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,s,"pairs","isCaseSensitive",e.isCaseSensitive??!0),this.pushDownTree(n,void 0,void 0,s,["matrix","cells"],"isCaseSensitive",e.isCaseSensitive??!0),this.pushExampleDownTree(n,p.body,s,p.__isDefaultExample,c.example),this.setDefaultBitValues(p),this.setIsExampleFlags(p),this.addVersionToParserInfo(p),M.removeUnwantedProperties(p,{ignoreAllFalse:!0,ignoreUndefined:["example"],ignoreEmptyArrays:["item","lead","pageNumber","marginNumber","hint","instruction"]}),lt.validateBit(p)}buildBooks(e,t){if(V.isString(t))return t;if(!Array.isArray(t))return;const i=t.map(t=>this.buildBook(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildBook(e,t){if(!t)return;const i={book:t.book??"",reference:t.reference??"",referenceEnd:t.referenceEnd??void 0};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["book","reference"]}),i}buildGroupTags(e,t){if(!t)return;Array.isArray(t)||(t=[t]);let i=t.map(t=>this.buildGroupTag(e,t)).filter(e=>null!=e);const r={};for(const e of i)e&&(r[e.name]?r[e.name].tags=Le.removeDuplicates([...r[e.name].tags,...e.tags]):r[e.name]=e);return i=Object.values(r),i.length>0?i:void 0}buildGroupTag(e,t){if(!t)return;const i=Array.isArray(t.tags)?t.tags:[];return{name:t.name??"",tags:i.map(e=>e?.trim()??"")??[]}}buildFeedbackChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedbackChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedbackChoice(e,t){if(!t)return;const i={choice:t.choice??"",requireReason:!!t.requireReason,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildFeedbackReason(e,t){if(!t)return;const i=this.handleJsonText(e,ce.tag,"true"),r={text:t.text??"",reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__textAst:t.__textAst};return M.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example","reasonableNumOfChars"]}),r}buildChoices(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildChoice(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildChoice(e,t){if(!t)return;const i={choice:t.choice??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildResponse(e,t){if(!t)return;const i={response:t.response??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"]}),i}buildBotResponses(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.botResponse(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}botResponse(e,t){if(!t)return;const i={response:t.response??"",reaction:t.reaction??"",feedback:t.feedback??"",item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint)};return M.removeUnwantedProperties(i,{ignoreEmptyString:["response","reaction","feedback"],ignoreAllFalse:!0,ignoreEmptyArrays:["item"],ignoreUndefined:["example"]}),i}buildFeedbacks(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFeedback(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFeedback(e,t){if(!t)return;let i,r;if(!t.choices)return;i=this.buildFeedbackChoices(e,t.choices),t.reason&&(r=this.buildFeedbackReason(e,t.reason));const o={item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),choices:i,reason:r};return M.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),o}buildQuizzes(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuiz(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuiz(e,t){if(!t)return;const i={...this.toExample(t.__isDefaultExample,t.__defaultExample)};let r,o;if(t.choices)r=this.buildChoices(e,t.choices),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!0,r);else{if(!t.responses)return;o=this.buildResponses(e,t.responses),this.pushExampleDownTreeBoolean(e,t.__isDefaultExample,i.example,!1,o)}const a={item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),isExample:!!t.__defaultExample,choices:r,responses:o};return M.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"]}),a}buildHeading(e,t){if(!t)return;if(null==t.forKeys)return;const i={forKeys:t.forKeys??"",forValues:t.forValues??t.__forValuesDefault??""};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["forKeys","forValues"],ignoreEmptyArrays:["forValues"]}),i}buildPairs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildPair(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildPair(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r=this.resourceBuilder.resourceFromResourceJson(e,t.keyAudio),o=this.resourceBuilder.resourceFromResourceJson(e,t.keyImage),a={key:t.key??"",keyAudio:r,keyImage:o,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),values:t.values||[],__valuesAst:t.__valuesAst};return M.removeUnwantedProperties(a,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction","values"],ignoreUndefined:["example","isCaseSensitive"]}),a}buildMatricies(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMatrix(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMatrix(e,t){if(!t)return;let i=!1;for(const e of t.cells||[])t.__isDefaultExample&&!e.isExample&&(e.isExample=!0),i=!!e.isExample||i;const r={key:t.key??"",item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),isExample:i,cells:(t.cells||[]).map(t=>this.buildMatrixCell(e,t)).filter(e=>null!=e)};return M.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["hint","item","cells"],ignoreUndefined:["isCaseSensitive"]}),r}buildMatrixCell(e,t){if(!t)return;const i=Array.isArray(t.__valuesAst)&&t.__valuesAst.length>0?t.__valuesAst[0]:null,r={values:t.values||[],item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__valuesAst:t.__valuesAst};return M.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["instruction","item","values"],ignoreUndefined:["example","isCaseSensitive"]}),r}buildPronunciationTable(e,t){if(!t)return;return{data:(t.data||[]).map(t=>(t||[]).map(t=>{const i=this.resourceBuilder.resourceFromResourceJson(e,t.audio);return{title:this.handleJsonText(e,ce.tag,t.title),body:this.handleJsonText(e,ce.tag,t.body),audio:i}}))}}buildTable(e,t){if(!t)return;return{columns:(t.columns||[]).map(t=>this.handleJsonText(e,ce.tag,t)),data:(t.data||[]).map(t=>(t||[]).map(t=>this.handleJsonText(e,ce.tag,t)))}}buildQuestions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildQuestion(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildQuestion(e,t){if(!t)return;const i=t.__sampleSolutionAst,r={question:t.question??"",partialAnswer:t.partialAnswer??"",sampleSolution:t.sampleSolution??"",additionalSolutions:t.additionalSolutions??void 0,reasonableNumOfChars:t.reasonableNumOfChars??void 0,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,i),__sampleSolutionAst:t.__sampleSolutionAst};return M.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreEmptyArrays:["item","hint","instruction"],ignoreUndefined:["example"],ignoreEmptyString:["question","partialAnswer","sampleSolution"]}),r}buildIngredients(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildIngredient(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildIngredient(e,t){if(!t)return;const i={title:this.handleJsonText(e,ce.tag,t.title),checked:t.checked??!1,ingredient:this.handleJsonText(e,ce.tag,t.ingredient),quantity:t.quantity??0,unit:t.unit??"",unitAbbr:t.unitAbbr??"",decimalPlaces:t.decimalPlaces??1,disableCalculation:t.disableCalculation??!1,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyString:["item","unit"]}),i}buildBody(e,t){if(!t)return;let i;const r=[],o=t.placeholders,a=t.bodyString,{textFormat:n}=e,s=()=>{let a,s=t.body;const l={};if(V.isString(t.body)?(a=(t.body??"").trim(),s=[]):Array.isArray(t.body)||(s=[]),o)for(const[e,t]of Object.entries(o))l[e]=t;if(a){a=Pe.breakscape(a,{format:n,location:ce.body,v2:!0});let e=0;const t=[];for(const[i,r]of Object.entries(l))if(a){const o=`[!${e}]`;a=a.replace(`${i}`,o),t.push(r),e++}s=this.textParser.toAst(a,{format:n,location:ce.body});const i=e=>{for(let r=0,o=e.length;r<o;r++){const o=e[r];if("bit"===o.type){const i=o.index;null!=t[i]&&(e[r]=t[i])}else o.content&&i(o.content)}};i(s)}s=structuredClone(s),this.textParser.walkBodyBits(s,(t,i,o)=>{let a;switch(o.type){case oe.gap:a=this.buildGap(e,o);break;case oe.mark:a=this.buildMark(e,o);break;case oe.select:a=this.buildSelect(e,o);break;case oe.highlight:a=this.buildHighlight(e,o)}null!=a&&(t[i]=a,r.push(a))}),i=s,i.__tag="text"},l=n===b.bitmarkText;n===b.json?(()=>{if("string"==typeof t.body)try{i=JSON.parse(t.body)}catch(e){i=null}else i=t.body})():l?s():i=t.body;return{body:i,bodyBits:r,bodyString:a}}buildFooter(e,t){if(!t)return;return{footer:this.handleJsonText(e,ce.body,t.footer)}}buildGap(e,t){if(!t)return;const i=Array.isArray(t.__solutionsAst)&&t.__solutionsAst.length>0?t.__solutionsAst[0]:null;t=this.bodyBitCopyFromAttrs(t);const r={type:oe.gap,solutions:t.solutions||[],item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),isCaseSensitive:t.isCaseSensitive,...this.toExample(t.__isDefaultExample,t.example,i),__solutionsAst:t.__solutionsAst,attrs:{}};return M.removeUnwantedProperties(r,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example","isCaseSensitive"]}),r}buildMarkConfigs(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildMarkConfig(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildMarkConfig(e,t){if(!t)return;const i={mark:t.mark??"unknown",color:t.color??"",emphasis:t.emphasis??""};return M.removeUnwantedProperties(i,{ignoreAllEmptyString:!0}),i}buildMark(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:oe.mark,solution:t.solution??"",mark:t.mark??"",item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0),attrs:{}};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"],ignoreEmptyString:["solution","mark"]}),i}buildSelect(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:oe.select,options:this.buildSelectOptions(e,t.options)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(!1,void 0,void 0),__hintString:t.__hintString,__instructionString:t.__instructionString,attrs:{}};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildSelectOptions(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildSelectOption(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildSelectOption(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildHighlight(e,t){if(!t)return;t=this.bodyBitCopyFromAttrs(t);const i={type:oe.highlight,texts:this.buildHighlightTexts(e,t.texts)||[],prefix:t.prefix??"",postfix:t.postfix??"",item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(!1,void 0,void 0),attrs:{}};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreEmptyString:["prefix","postfix"]}),i}buildHighlightTexts(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildHighlightText(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildHighlightText(e,t){if(!t)return;const i={text:t.text??"",isCorrect:!!t.isCorrect,isHighlighted:!!t.isHighlighted,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreAllEmptyArrays:!0,ignoreUndefined:["example"]}),i}buildFlashcards(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildFlashcard(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildFlashcard(e,t){if(!t)return;const i={question:this.buildTextAndIcon(e,t.question),answer:this.buildTextAndIcon(e,t.answer),alternativeAnswers:(t.alternativeAnswers||[]).map(t=>this.buildTextAndIcon(e,t)).filter(e=>null!=e),item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeAnswers","item","hint","instruction"],ignoreUndefined:["example"]}),i}buildDefinitionList(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildDefinitionListItem(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildDefinitionListItem(e,t){if(!t)return;const{bitType:i}=e,r=H.isOfBitType(i,[d.metaSearchDefaultTerms]),o={term:this.buildTextAndIcon(e,t.term,r),definition:this.buildTextAndIcon(e,t.definition,r),alternativeDefinitions:(t.alternativeDefinitions||[]).map(t=>this.buildTextAndIcon(e,t,r)).filter(e=>null!=e),item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!0)};return M.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreEmptyArrays:["question","answer","alternativeDefinitions","item","hint","instruction"],ignoreUndefined:["example"]}),o}buildTextAndIcon(e,t,i=!1){const r=this.resourceBuilder.resourceFromResourceJson(e,t?.icon);let o=this.handleJsonText(e,ce.tag,t?.text||t);i&&(o=this.textGenerator.generateSync(o,b.plainText,ce.body,{noBreakscaping:!0}).trim());const a={text:o,icon:r};return M.removeUnwantedProperties(a,{ignoreEmptyArrays:["text"],ignoreUndefined:["icon"]}),a}buildStatements(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildStatement(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildStatement(e,t){if(!t)return;const i={statement:t.statement??"",isCorrect:!!t.isCorrect,item:this.handleJsonText(e,ce.tag,t.item),lead:this.handleJsonText(e,ce.tag,t.lead),hint:this.handleJsonText(e,ce.tag,t.hint),instruction:this.handleJsonText(e,ce.tag,t.instruction),...this.toExample(t.__isDefaultExample,t.example,!!t.isCorrect)};return M.removeUnwantedProperties(i,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),i}buildImageSource(e,t){if(!t)return;const{url:i,mockupId:r,size:o,format:a,trim:n}=t,s={url:i??"",mockupId:r??"",size:o??null,format:a??null,trim:it.isBoolean(n)?n:null};return M.removeUnwantedProperties(s,{ignoreFalse:["trim"],ignoreEmptyString:["url","mockupId"],ignoreAllUndefined:!0}),s}buildPerson(e,t){if(!t)return;const{name:i,title:r,avatarImage:o}=t,a={name:i??"",title:r??void 0,avatarImage:this.resourceBuilder.resourceFromResourceJson(e,o)};return M.removeUnwantedProperties(a,{ignoreEmptyString:["name"],ignoreAllUndefined:!0}),a}buildTechnicalTerm(e,t){if(!t)return;const{technicalTerm:i,lang:r}=t,o={technicalTerm:i??"",lang:r??""};return M.removeUnwantedProperties(o,{ignoreEmptyString:["technicalTerm"]}),o}buildServings(e,t){if(!t)return;const{servings:i,unit:r,unitAbbr:o,decimalPlaces:a,disableCalculation:n,hint:s}=t,l={servings:i??0,unit:r??"",unitAbbr:o??"",decimalPlaces:a??1,disableCalculation:n??!1,hint:s??""};return M.removeUnwantedProperties(l,{ignoreEmptyString:["servings","unit"]}),l}buildRatingLevelStartEnd(e,t){if(!t)return;const{level:i,label:r}=t,o={level:i??0,label:this.handleJsonText(e,ce.tag,r)};return M.removeUnwantedProperties(o,{}),o}buildCardBits(e,t){if(!Array.isArray(t))return;const i=t.map(t=>this.buildCardBit(e,t)).filter(e=>null!=e);return i.length>0?i:void 0}buildCardBit(e,t){if(!t)return;const{bitType:i,textFormat:r}=e,o=this.buildBit({...t,bitType:i,textFormat:r},{cardSet:{sideNo:0,variantNo:0}});return M.removeUnwantedProperties(o,{ignoreAllFalse:!0,ignoreUndefined:["example"]}),lt.validateCardBit(o)}toImageResource(e,t){return Le.asSingle(this.resourceBuilder.resourceFromResourceDataJson(e,N.image,t?.image))}buildCardNode(e,t){const i={heading:this.buildHeading(e,t.heading),questions:this.buildQuestions(e,t.questions),elements:t.elements,flashcards:this.buildFlashcards(e,t.flashcards),definitions:this.buildDefinitionList(e,t.definitions??t.legend),statement:this.buildStatement(e,t.statement),statements:this.buildStatements(e,t.statements),choices:this.buildChoices(e,t.choices),responses:this.buildResponses(e,t.responses),feedbacks:this.buildFeedbacks(e,t.feedbacks),quizzes:this.buildQuizzes(e,t.quizzes),pairs:this.buildPairs(e,t.pairs),matrix:this.buildMatricies(e,t.matrix),pronunciationTable:this.buildPronunciationTable(e,t.pronunciationTable),table:this.buildTable(e,t.table),botResponses:this.buildBotResponses(e,t.botResponses),ingredients:this.buildIngredients(e,t.ingredients),cardBits:this.buildCardBits(e,t.cardBits)};return M.removeUnwantedProperties(i),Object.keys(i).length>0?i:void 0}bodyBitCopyFromAttrs(e){const t={...e};if(e.attrs)for(const[i,r]of Object.entries(e.attrs))t[i]=r;return t}pushExampleDownTree(e,t,i,r,o){if(r||null!=o){if(i){if(this.pushExampleDownTreeString(e,r,o,i.pairs),this.pushExampleDownTreeBoolean(e,r,o,!1,i.flashcards),this.pushExampleDownTreeBoolean(e,r,o,!1,i.definitions),this.pushExampleDownTreeBoolean(e,r,o,!0,i.choices),this.pushExampleDownTreeBoolean(e,r,o,!1,i.responses,i.statements,i.statement),i.quizzes)for(const t of i.quizzes)this.pushExampleDownTreeBoolean(e,r,o,!0,t.choices),this.pushExampleDownTreeBoolean(e,r,o,!1,t.responses);if(i.matrix)for(const t of i.matrix)this.pushExampleDownTreeString(e,r,o,t.cells)}t&&this.pushExampleDownTreeBodyBits(e,r,o,t)}}pushExampleDownTreeBoolean(e,t,i,r,...o){if((t||null!=i)&&Array.isArray(o))for(const e of o)if(e){const o=Array.isArray(e)?e:[e];nt.fillBooleanExample(o,t,i,r)}}pushExampleDownTreeString(e,t,i,...r){if((t||i)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];nt.fillStringExample(e.textFormat,r,t,i,!1)}}pushExampleDownTreeBodyBits(e,t,i,r){if(!t&&!i)return;const o=this.textParser.extractBodyBits(r?.body);for(const r of o)if(r)switch(r.type){case oe.gap:{const o=r;nt.fillStringExample(e.textFormat,[o],t,i,!1);break}case oe.mark:{const e=r;nt.fillBooleanExample([e],t,i,!1);break}case oe.select:{const e=r;nt.fillBooleanExample(e.options,t,i,!0);break}case oe.highlight:{const e=r;nt.fillBooleanExample(e.texts,t,i,!0);break}}}pushDownTree(e,t,i,r,o,a,n){if(void 0!==n){if(r&&o){Array.isArray(o)||(o=[o]);const e=M.flatMapPath(r,o);for(const t of e)null==t[a]&&(t[a]=n)}if(t){const e=Array.isArray(t)?t:[t];for(const t of e)if(t&&t.body&&i){const e=this.textParser.extractBodyBits(t.body);if(i&&e&&e.length>0)for(const t of e)if(t&&-1!==i.indexOf(t.type)){const e=t;null==e[a]&&(e[a]=n)}}}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const i={};for(const[e,r]of t)i[e]=Le.asArray(r)||[r];return i}setIsExampleFlags(e){const t=t=>!!t&&(t.isExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:i,cardNode:r}=e,o=this.textParser.extractBodyBits(i?.body);for(const e of o)switch(e.type){case oe.gap:case oe.mark:t(e);break;case oe.select:{const i=e;let r=!1;for(const e of i.options)r=!!t(e)||r;i.isExample=r;break}case oe.highlight:{const i=e;let r=!1;for(const e of i.texts)r=!!t(e)||r;i.isExample=r;break}}if(r){for(const e of r.flashcards||[])t(e);for(const e of r.definitions||[])t(e);for(const e of r.pairs||[])t(e);for(const e of r.matrix||[]){let i=!1;for(const r of e.cells||[])i=!!t(r)||i;e.isExample=i}for(const e of r.quizzes||[]){let i=!1;for(const r of e.responses||[])i=!!t(r)||i;for(const r of e.choices||[])i=!!t(r)||i;e.isExample=i}for(const e of r.responses||[])t(e);for(const e of r.choices||[])t(e);for(const e of r.statements||[])t(e);t(r.statement);for(const e of r.questions||[])t(e)}t(e.statement);for(const i of e.responses||[])t(i);for(const i of e.choices||[])t(i);t(e)}setDefaultBitValues(e){const{bitType:t}=e;switch(t){case d.articleAi:case d.noteAi:case d.summaryAi:e.aiGenerated=this.toAstProperty(t,F.property_aiGenerated,!0,void 0)}}addVersionToParserInfo(e){const t=e.parser??{};t.version=ee.appVersion.full,e.parser=t}},pt=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 i="";for(let r=0,o=e.length;r<o;r++){const a=e[r];this._buffer.push(a),i+=a,t&&r<o-1&&(this._buffer.push(t),i+=t),this._buffer.push(this.endOfLineString),i+=this.endOfLineString}return this.lastWrite=i,this}write(e){return this._buffer?(null==e||(e&&(this.lastWrite=e),this._buffer.push(e)),this):this}writeWhiteSpace(){return this.write(" "),this}getLastWrite(){return this.lastWrite}},ut=i(718),ht=(0,i(718).superenum)({v1:1,v2:2}),mt={debugGenerationInline:!1},gt=class extends Ne{constructor(e,t){super(),l(this,"ast",new le),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",b.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),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=Ee.fromValue(t?.bitmarkVersion)??Ve,this.options={...mt,...t?.bitmarkOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.bitmarkVersion===Ee.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=ht.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=ht.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 Ge(this.bitmarkVersion,{writeCallback:this.write,bodyBitCallback:this.bodyBitCallback,debugGenerationInline:this.debugGenerationInline}),this.mainWriter=e,this.partWriter=new pt,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=b.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,se.bitmarkAst,this,void 0),this.writeLine()}enter_bitsValue(e,t){const i=e.value,r=H.getBitConfig(i.bitType),o=H.getBitResourcesConfig(i.bitType,i.resourceType);if(this.bitType=i.bitType,this.textFormat=i.textFormat??r.textFormatDefault,this.isBodyBitmarkText=this.textFormat===b.bitmarkText,this.isCardAllowed=this.calculateIsCardAllowed(),this.hasCardSet=this.haveValidCardSet(i),this.hasFooter=this.haveValidFooter(i),this.firstBit||(this.writeNL(),this.writeNL(),this.writeNL()),this.writeOPD(i.bitLevel),i.isCommented&&this.writeString("|"),this.writeTagKey(i.bitType),i.textFormat){this.isWriteTextFormat(i.textFormat,r.textFormatDefault)&&(this.writeColon(),this.writeTagKey(i.textFormat))}let a;if(r.resourceAttachmentAllowed&&i.resources&&i.resources.length>0){const e=o.comboResourceConfigKeysMap;if(o.comboResourceConfigKeysMap.size>0)for(const t of e.keys())a=z(t);else a=i.resources[0].type}return a&&(this.writeAmpersand(),this.writeTagKey(a)),this.writeCL(),!0}exit_bitsValue(e,t){this.firstBit=!1}enter_internalComment(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;for(let e=0;e<i.length;e++){const r=i[e];this.writeNL(),this.writeProperty("internalComment",r,t,{format:g.plainText,array:!0})}return!1}enter_groupTag(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;for(const e of i){const{name:i,tags:r}=e;if(this.writeNL(),this.writeProperty("groupTag",i,t,{format:g.plainText,writeEmpty:!0}),r&&r.length>0)for(const e of r)this.writeProperty("tag",e,t,{format:g.plainText,writeEmpty:!0})}return!1}enter_labelTrue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const o=r?.value;if(o){const e=""!=i,r=o.labelFalse&&""!=o.labelFalse;(e||r)&&this.writeNL(),e&&this.writeProperty("labelTrue",i,t,{format:g.plainText}),r&&this.writeProperty("labelFalse",o.labelFalse,t,{format:g.plainText})}return!1}enter_labelFalse(e,t){return!0}enter_imageSource(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const{url:o,mockupId:a,size:n,format:s,trim:l}=i;return this.writeNL(),this.writeProperty("imageSource",o,t,{format:g.plainText}),o&&(a&&this.writeProperty("mockupId",a,t,{format:g.plainText}),n&&this.writeProperty("size",n,t,{format:g.plainText}),s&&this.writeProperty("format",s,t,{format:g.plainText}),it.isBoolean(l)&&this.writeProperty("trim",l,t,{format:g.plainText})),!1}enter_technicalTerm(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const{technicalTerm:o,lang:a}=i;return this.writeNL(),this.writeProperty("technicalTerm",o,t,{format:g.plainText}),null!=a&&this.writeProperty("lang",a,t,{format:g.plainText}),!1}enter_servings(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const{servings:o,unit:a,unitAbbr:n,decimalPlaces:s,disableCalculation:l,hint:c}=i;return this.writeNL(),this.writeProperty("servings",o,t,{format:g.plainText}),null!=a&&this.writeProperty("unit",a,t,{format:g.plainText}),null!=n&&this.writeProperty("unitAbbr",n,t,{format:g.plainText}),null!=s&&this.writeProperty("decimalPlaces",s,t,{format:g.plainText}),null!=l&&this.writeProperty("disableCalculation",l,t,{format:g.plainText}),null!=c&&(this.writeOPQ(),this.writeTextOrValue(c,b.plainText,ce.tag),this.writeCL()),!1}enter_person(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const{name:o,title:a,avatarImage:n}=i;return this.writeNL(),this.writeProperty("person",o,t,{format:g.plainText}),a&&this.writeProperty("title",a,t,{format:g.plainText}),n&&this.writeResource(N.image,n.image.src),!1}enter_text(e,t){const i=this.getParentNode(t);return!i||i.key!==se.term&&i.key!==se.definition&&i.key!==se.alternativeDefinitionsValue&&i.key!==se.question&&i.key!==se.answer&&i.key!==se.alternativeAnswersValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body)),!1)}leaf_text(e,t){const i=this.getParentNode(t);return!i||i.key!==se.term&&i.key!==se.definition&&i.key!==se.alternativeDefinitionsValue&&i.key!==se.question&&i.key!==se.answer&&i.key!==se.alternativeAnswersValue&&i.key!==se.reason||(V.isString(e.value)&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body)),!1)}enter_icon(e,t){const i=e.value,r=this.getParentNode(t);return!r||(r.key!==se.term&&r.key!==se.definition&&r.key!==se.alternativeDefinitionsValue&&r.key!==se.question&&r.key!==se.answer&&r.key!==se.alternativeAnswersValue||(this.writeNL(),this.writeResource(N.icon,i.image.src)),!0)}leaf_iconValue(e,t){return this.writeNL(),this.writeProperty("icon",e.value,t,{format:g.plainText}),!1}enter_ratingLevelStart(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enter_ratingLevelEnd(e,t){return this.enterRatingLevelStartEndCommon(e,t),!1}enterRatingLevelStartEndCommon(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;const{level:o,label:a}=i,n=e.key===se.ratingLevelStart?"ratingLevelStart":"ratingLevelEnd";return this.writeNL(),this.writeProperty(n,o,t,{format:g.plainText}),a&&this.writeProperty("label",a,t,{format:g.bitmarkText}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.markConfig)return!0;const{mark:o,color:a,emphasis:n}=i;return o&&(this.writeNL(),this.writeProperty("mark",o,t,{format:g.plainText}),a&&this.writeProperty("color",a,t,{format:g.plainText}),n&&this.writeProperty("emphasis",n,t,{format:g.plainText})),!1}enter_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:g.plainText})),!1}leaf_partialAnswer(e,t){return e.value&&(this.writeNL(),this.writeProperty("partialAnswer",e.value,t,{format:g.plainText})),!1}enter_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:g.plainText})),!1}leaf_sampleSolution(e,t){return e.value&&(this.writeNL(),this.writeProperty("sampleSolution",e.value,t,{format:g.plainText})),!1}leaf_reasonableNumOfChars(e,t){this.writeNL(),this.writeProperty("reasonableNumOfChars",e.value,t,{format:g.plainText})}leaf_additionalSolutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===se.questionsValue&&(this.writeNL(),this.writeProperty("additionalSolutions",e.value,t,{format:g.plainText,array:!0,writeEmpty:!0}))}enter_item(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.lead)||(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(i,b.bitmarkText,ce.tag),this.writeCL(),!0))))}enter_lead(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.pageNumber)||(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,b.bitmarkText,ce.tag),this.writeCL(),!0)))}enter_pageNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(!this.isEmptyText(r?.value?.marginNumber)||(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i??"",b.bitmarkText,ce.tag),this.writeCL(),!0))}enter_marginNumber(e,t){const i=e.value,r=this.getParentNode(t);return!this.isEmptyText(i)&&(this.writeNL_IfNotChain(t),this.writeOPC(),this.writeTextOrValue(r?.value?.item??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.lead??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(r?.value?.pageNumber??"",b.bitmarkText,ce.tag),this.writeCL(),this.writeOPC(),this.writeTextOrValue(i,b.bitmarkText,ce.tag),this.writeCL(),!0)}enter_body(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue&&i?.key!==se.cardBitsValue)return!0;this.inTag=!1;const r=e.value;if(this.textFormat===b.json){const e=r.body??null;if(Array.isArray(e)||M.isObject(e)){const t=JSON.stringify(e,null,this.prettifySpace);t&&(this.writePlainTextDivider(),this.writeNL(),this.writeTextOrValue(t,b.plainText,ce.body))}}else if(this.isBodyBitmarkText){const e=!(this.hasCardSet||this.hasFooter);this.writeNL();const t=Array.isArray(r.body)?r.body:[];this.writeTextOrValue(t,this.textFormat,ce.body,{plainTextDividerAllowed:e})}else{this.writePlainTextDivider(),this.writeNL();const e=V.isString(r.body)?r.body:"";this.writeTextOrValue(`${e}`,b.plainText,ce.body)}return!1}exit_body(e,t){this.inTag=!0}bodyBitCallback(e,t,i){const r=se.fromValue(e.type)??se.bodyBit;return this.ast.walk(e,r,this,void 0),""}enter_gap(e,t){const i=e.value;if(i.solutions&&0===i.solutions.length)this.writeOPU(),this.writeCL();else for(const e of i.solutions)this.writeOPU(),this.writeTextOrValue(e,b.plainText,ce.tag),this.writeCL();return!0}enter_mark(e,t){const i=e.value;return this.writeOPE(),this.writeTextOrValue(i.solution,b.plainText,ce.tag),this.writeCL(),!0}enter_select(e,t){return!0}enter_highlight(e,t){return!0}enter_footer(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return!0;const r=e.value;return this.textFormat===b.json||r.footer&&r.footer.length>0&&this.isBodyBitmarkText&&(this.writeNL(),this.writeTextOrValue("==== footer ====",b.plainText,ce.body),this.writeNL(),this.writeTextOrValue(r.footer,this.textFormat,ce.body,{plainTextDividerAllowed:!0})),!1}enter_solutions(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return!0;const r=e.value;return r&&0===r.length&&(this.writeOPU(),this.writeCL()),!0}leaf_solution(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return;const r=e.value,o=this.getParentNode(t,2)?.value;o?.type===oe.mark&&r&&(this.writeOPE(),this.writeTextOrValue(r,b.plainText,ce.tag),this.writeCL())}leaf_mark(e,t){const i=t[0];if(i?.key!==se.mark)return;const r=e.value;r&&this.writeProperty("mark",r,t,{format:g.plainText})}enter_optionsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,b.plainText,ce.tag),this.writeCL(),!0}enter_textsValue(e,t){const i=e.value;return i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.text,b.plainText,ce.tag),this.writeCL(),!0}enter_cardNode(e,t){return!this.isCardAllowed||(this.writeCardSetStart(),!0)}between_cardNode(e,t,i,r){this.isCardAllowed&&this.writeCardSetCardDivider()}exit_cardNode(e,t){this.isCardAllowed&&(this.writeCardSetEnd(),this.options.cardSetVersion,ht.v1)}enter_elements(e,t){}between_elements(e,t,i,r){this.writeCardSetVariantDivider()}between_flashcards(e,t,i,r){this.writeCardSetCardDivider()}between_flashcardsValue(e,t,i,r){this.isCardAllowed&&(i.key===se.answer?this.writeCardSetSideDivider():i.key===se.alternativeAnswers&&0!==i.value?.length&&this.writeCardSetVariantDivider())}between_alternativeAnswers(e,t){this.writeCardSetVariantDivider()}between_alternativeDefinitions(e,t){this.writeCardSetVariantDivider()}enter_statements(e,t){}between_statements(e,t,i,r){this.isOfBitType(d.trueFalse1)||this.writeCardSetCardDivider()}enter_statementsValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.statement,b.plainText,ce.tag),this.writeCL(),!0}enter_choicesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect||i.requireReason?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.choice,b.plainText,ce.tag),this.writeCL(),!0}enter_responsesValue(e,t){const i=e.value;return this.writeNL(),i.isCorrect?this.writeOPP():this.writeOPM(),this.writeTextOrValue(i.response,b.plainText,ce.tag),this.writeCL(),!0}between_feedbacks(e,t,i,r){this.writeCardSetCardDivider()}enter_reason(e,t){return this.writeCardSetSideDivider(),!0}enter_quizzes(e,t){}between_quizzes(e,t,i,r){this.writeCardSetCardDivider()}enter_heading(e,t){}between_heading(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_forValues(e,t){}between_forValues(e,t,i,r){this.isCardAllowed&&this.writeCardSetSideDivider()}enter_pairs(e,t){}between_pairs(e,t,i,r){this.writeCardSetCardDivider()}enter_keyAudio(e,t){const i=e.value;return this.writeNL(),this.writeResource(N.audio,i.audio.src),!1}enter_keyImage(e,t){const i=e.value;return this.writeNL(),this.writeResource(N.image,i.image.src),!1}enter_matrix(e,t){}between_matrix(e,t,i,r){this.writeCardSetCardDivider()}enter_values(e,t){this.isCardAllowed&&this.writeCardSetSideDivider()}between_values(e,t,i,r){this.isCardAllowed&&this.writeCardSetVariantDivider()}between_pronunciationTable(e,t,i,r){const o=this.getParentNode(r);o?.key===se.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_table(e,t,i,r){const o=this.getParentNode(r);o?.key===se.cardNode&&this.isCardAllowed&&this.writeCardSetCardDivider()}between_data(e,t,i,r){const o=this.getParentNode(r);o?.key!==se.table&&o?.key!==se.pronunciationTable||this.writeCardSetCardDivider()}between_columns(e,t,i,r){const o=this.getParentNode(r),a=o?.key;a!==se.table&&a!==se.captionDefinitionList||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL()}enter_columnsValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,b.bitmarkText,ce.tag),this.writeCL()}between_dataValue(e,t,i,r){const o=this.getParentNode(r,2);o?.key!==se.table&&o?.key!==se.pronunciationTable||this.isCardAllowed&&this.writeCardSetSideDivider()}leaf_dataValueValue(e,t){const i=this.getParentNode(t,3);i?.key===se.table&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body))}enter_dataValueValue(e,t){const i=this.getParentNode(t,3);if((i?.key===se.table||i?.key===se.pronunciationTable)&&e.value){if(i?.key===se.pronunciationTable){const t=e.value;return t.title&&(this.writeNL(),this.writeOP(),this.writeHash(),this.writeTextOrValue(t.title,b.bitmarkText,ce.tag),this.writeCL()),t.audio&&(this.writeNL(),this.writeResource(N.audio,t.audio.audio.src)),t.body&&(this.writeNL(),this.writeTextOrValue(t.body,this.textFormat,ce.body)),!1}this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body)}}between_captionDefinitionList(e,t,i,r){const o=this.getParentNode(r);o?.key===se.cardNode&&this.writeCardSetCardDivider()}leaf_term(e,t){const i=this.getParentNode(t);return i?.key!==se.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body)),!1)}leaf_definition(e,t){const i=this.getParentNode(t);return i?.key!==se.definitionsValue||(e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body)),!1)}between_definitions(e,t,i,r){const o=this.getParentNode(r);o?.key!==se.cardNode&&o?.key!==se.captionDefinitionList||this.writeCardSetCardDivider()}between_definitionsValue(e,t,i,r){const o=this.getParentNode(r);o?.key===se.definitions&&this.isCardAllowed&&(i.key===se.definition?this.writeCardSetSideDivider():i.key===se.alternativeDefinitions&&i.value?.length>0&&this.writeCardSetVariantDivider())}enter_questions(e,t){}between_questions(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredients(e,t){}between_ingredients(e,t,i,r){this.writeCardSetCardDivider()}enter_ingredientsValue(e,t){const i=e.value;return null!=i.title&&(this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(i.title,b.bitmarkText,ce.tag),this.writeCL()),null!=i.ingredient&&(this.writeNL(),i.checked?this.writeOPP():this.writeOPM(),this.writeCL(),null!=i.quantity&&(this.writeOPB(),this.writeTextOrValue(`${i.quantity}`,b.plainText,ce.tag),this.writeCL()),null!=i.unit&&this.writeProperty("unit",i.unit,t,{format:g.plainText}),null!=i.unitAbbr&&this.writeProperty("unitAbbr",i.unitAbbr,t,{format:g.plainText}),null!=i.decimalPlaces&&this.writeProperty("decimalPlaces",i.decimalPlaces,t,{format:g.plainText}),i.disableCalculation&&this.writeProperty("disableCalculation",!0,t,{format:g.plainText}),this.writeNL(),this.writeTextOrValue(i.ingredient,this.textFormat,ce.body)),!0}enter_botResponses(e,t){}between_botResponses(e,t,i,r){this.writeCardSetCardDivider()}enter_cardBits(e,t){}between_cardBits(e,t,i,r){this.writeCardSetCardDivider()}leaf_response(e,t){const i=this.getParentNode(t);i?.key===se.botResponsesValue&&(this.writeNL(),this.writeOPB(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL())}leaf_reaction(e,t){const i=this.getParentNode(t);i?.key===se.botResponsesValue&&(this.writeNL(),this.writeProperty("reaction",e.value,t,{format:g.plainText}))}leaf_feedback(e,t){const i=this.getParentNode(t);if(i?.key!==se.botResponsesValue)return;const r=e.value;r&&(this.writeNL(),this.writeTextOrValue(r,this.textFormat,ce.body))}enter_backgroundWallpaper(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}enter_imagePlaceholder(e,t){const i=e.value;return this.writeNL(),this.writePropertyStyleResource(e.key,i),!0}exit_imagePlaceholder(e,t){}enter_posterImage(e,t){const i=this.getParentNode(t);if(i?.key===se.bitsValue){const i=e.value;i&&this.writeProperty("posterImage",i,t,{format:g.plainText})}else{const i=e.value;i&&i.src&&this.writeProperty("posterImage",i.src,t,{format:g.plainText})}return!0}enter_thumbnails(e,t){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let r=0;r<i.length&&r!==e.length;r++){const o=i[r],a=e[r];this.writeProperty(a,o.src,t,{format:g.plainText})}}return!1}leaf_level(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return!0;if(!H.isOfBitType(this.bitType,[d.chapter]))return!0;const r=e.value,o=i?.value;if(r>0&&null==o.title){this.writeNL(),this.writeOP();for(let e=0;e<+r;e++)this.writeHash();this.writeCL()}return!1}leaf_titleString(e,t){const i=this.getParentNode(t);return i?.key!==se.bitsValue||(e.value&&(this.writeNL(),this.writeProperty("title",e.value,t,{format:g.plainText})),!1)}enter_title(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return!0;const r=e.value,o=i?.value,a=o.level||1;if(a&&r){this.writeNL(),this.writeOP();for(let e=0;e<+a;e++)this.writeHash();this.writeTextOrValue(r,b.bitmarkText,ce.tag),this.writeCL()}return!1}enter_subtitle(e,t){const i=this.getParentNode(t);if(i?.key!==se.bitsValue)return!0;const r=e.value;if(r){this.writeNL(),this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeTextOrValue(r,b.bitmarkText,ce.tag),this.writeCL()}return!1}enter_book(e,t){}enter_bookValue(e,t){const i=e.value;return i&&(this.writeNL(),this.writeProperty("book",i.book,t,{format:g.plainText,writeEmpty:!0}),i.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(i.reference,b.plainText,ce.tag),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(i.referenceEnd,b.plainText,ce.tag),this.writeCL()))),!1}leaf_book(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(this.writeNL(),this.writeProperty("book",e.value,t,{format:g.plainText,writeEmpty:!0}),r.reference&&(this.writeOPRANGLE(),this.writeTextOrValue(r.reference,b.plainText,ce.tag),this.writeCL(),r.referenceEnd&&(this.writeOPRANGLE(),this.writeTextOrValue(r.referenceEnd,b.plainText,ce.tag),this.writeCL())))}leaf_anchor(e,t){e.value&&(this.writeNL(),this.writeOPDANGLE(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL())}leaf_reference(e,t){const i=this.getParentNode(t),r=i?.value;r&&e.value&&(r.book||(this.writeNL(),this.writeOPRANGLE(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL()))}enter_hint(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPQ(),this.writeTextOrValue(i,b.bitmarkText,ce.tag),this.writeCL()),!1}enter_instruction(e,t){const i=e.value;return this.isEmptyText(i)||(this.writeNL_IfNotChain(t),this.writeOPB(),this.writeTextOrValue(i,b.bitmarkText,ce.tag),this.writeCL()),!1}leaf_lang(e,t){e.value&&(this.writeNL(),this.writeProperty("lang",e.value,t,{format:g.boolean}))}enter_refAuthor(e,t){e.value&&(this.writeNL(),this.writeProperty("refAuthor",e.value,t,{format:g.plainText,array:!0}))}leaf_refBookTitle(e,t){e.value&&(this.writeNL(),this.writeProperty("refBookTitle",e.value,t,{format:g.plainText,array:!0}))}enter_refPublisher(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublisher",e.value,t,{format:g.plainText,array:!0}))}leaf_refPublicationYear(e,t){e.value&&(this.writeNL(),this.writeProperty("refPublicationYear",e.value,t,{format:g.plainText}))}leaf_citationStyle(e,t){e.value&&(this.writeNL(),this.writeProperty("citationStyle",e.value,t,{format:g.plainText}))}leaf_isExample(e,t){if(!e.value)return;const i=this.getParentNode(t),r=i?.value.example??null;null!=r&&""!==r&&(this.writeNL_IfNotChain(t),this.writeOPA(),this.writeString("example"),this.writeColon(),!0===r?this.writeString(" true "):!1===r?this.writeString(" false "):Array.isArray(r)?this.writeTextOrValue(r,b.bitmarkText,ce.tag):this.writeTextOrValue(r,b.plainText,ce.tag),this.writeCL())}leaf_elementsValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body))}leaf_solutionsValue(e,t){const i=this.getParentNode(t,2);i?.key===se.bitsValue&&null!=e.value&&(this.writeOPU(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL())}leaf_prefix(e,t){e.value&&(this.writeOPPRE(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL())}leaf_postfix(e,t){e.value&&(this.writeOPPOST(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL())}leaf_isCaseSensitive(e,t){this.writeProperty("isCaseSensitive",e.value,t,{format:g.boolean,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0})}leaf_forKeys(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL()}leaf_forValues(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL()}leaf_forValuesValue(e,t){this.writeNL(),this.writeOPHASH(),this.writeTextOrValue(e.value,b.plainText,ce.tag),this.writeCL()}leaf_key(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body))}leaf_valuesValue(e,t){e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body))}leaf_question(e,t){const i=this.getParentNode(t);i?.key!==se.questionsValue&&i?.key!==se.flashcardsValue||e.value&&(this.writeNL(),this.writeTextOrValue(e.value,this.textFormat,ce.body))}leaf_src1x(e,t){this.writeProperty("src1x",e.value,t,{format:g.plainText})}leaf_src2x(e,t){this.writeProperty("src2x",e.value,t,{format:g.plainText})}leaf_src3x(e,t){this.writeProperty("src3x",e.value,t,{format:g.plainText})}leaf_src4x(e,t){this.writeProperty("src4x",e.value,t,{format:g.plainText})}leaf_width(e,t){this.writeProperty("width",e.value,t,{format:g.plainText})}leaf_height(e,t){this.writeProperty("height",e.value,t,{format:g.plainText})}leaf_alt(e,t){this.writeProperty("alt",e.value,t,{format:g.plainText})}leaf_zoomDisabled(e,t){H.isOfBitType(this.bitType,[d.imageSeparator,d.pageBanner,d.imagesLogoGrave,d.prototypeImages])?this.writeProperty("zoomDisabled",e.value,t,{format:g.boolean,writeEmpty:!0,ignoreFalse:!1,ignoreTrue:!0}):this.writeProperty("zoomDisabled",e.value,t,{format:g.boolean,writeEmpty:!0,ignoreFalse:!0,ignoreTrue:!1})}leaf_license(e,t){this.writeProperty("license",e.value,t,{format:g.plainText})}leaf_copyright(e,t){this.writeProperty("copyright",e.value,t,{format:g.plainText})}leaf_provider(e,t){}leaf_showInIndex(e,t){null!=e.value&&(this.writeNL_IfNotChain(t),this.writeProperty("showInIndex",e.value,t,{format:g.boolean,ignoreFalse:!0}))}enter_caption(e,t){const i=e.value;return this.writeNL_IfNotChain(t),this.writeProperty("caption",i,t,{format:g.bitmarkText}),!1}leaf_search(e,t){const i=e.value;i&&(this.writeNL_IfNotChain(t),this.writeProperty("search",i,t,{format:g.plainText}))}leaf_duration(e,t){const i=this.getParentNode(t);i?.key===se.bitsValue&&this.writeNL(),this.writeProperty("duration",e.value,t,{format:g.plainText})}leaf_mute(e,t){this.writeProperty("mute",e.value,t,{format:g.boolean})}leaf_autoplay(e,t){this.writeProperty("autoplay",e.value,t,{format:g.boolean})}leaf_allowSubtitles(e,t){this.writeProperty("allowSubtitles",e.value,t,{format:g.boolean})}leaf_showSubtitles(e,t){this.writeProperty("showSubtitles",e.value,t,{format:g.boolean})}generateResourceHandlers(){for(const e of N.keys()){if(e===N.keyFromValue(N.unknown))continue;const t=`enter_${e}`;"function"!=typeof this[t]&&(this[t]=(e,t)=>{const i=e.value;if(null==i)return!1;const r=this.getParentNode(t);if(r?.key!==se.resourcesValue)return!0;const o=N.fromValue(r.value.__typeAlias)??N.fromValue(r.value.type);if(!o)return!1;const a=i.url||i.src||i.body||"";return this.writeNL(),this.writeResource(o,a),!0},this[t]=this[t].bind(this))}}generatePropertyHandlers(){for(const e of I.values()){const t=D(e),i=[`enter_${t}`,`leaf_${t}`];for(const r of i)"function"!=typeof this[r]&&"example"!==t&&(this[r]=(t,i)=>{if(null==t.value)return;const r=this.getParentNode(i);if(r?.key!==se.bitsValue)return;const o=this.getBitType(i);if(!o)return;const a=H.getBitConfig(o),n=H.getTagConfigForTag(a.tags,e);n&&(this.writeNL_IfNotChain(i),this.writeProperty(n.tag,t.value,i,{format:n.format??g.plainText,array:n.array??!1,writeEmpty:!0,ignoreFalse:"false"===n.defaultValue,ignoreTrue:"true"===n.defaultValue}))},this[r]=this[r].bind(this))}}getBitType(e){for(const t of e)if(t.key===se.bitsValue){const e=t.value;return e?.bitType}}isChain(e){const t=this.getParentNode(e);return t?.key!==se.bitsValue&&(t?.key!==se.cardBitsValue&&(t?.key!==se.feedbacksValue&&(t?.key!==se.quizzesValue&&(t?.key!==se.pairsValue&&(t?.key!==se.matrixValue&&(t?.key!==se.definitionsValue&&(t?.key!==se.questionsValue&&t?.key!==se.reason)))))))}haveValidCardSet(e){const t=H.getBitConfig(e.bitType);return!!t&&!!t.cardSet}haveValidFooter(e){const t=e.footer;if(!t)return!1;return e.textFormat!==b.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(Pe.breakscape(`${e}`,{format:b.plainText,location:ce.tag}))}writeTextOrValue(e,t,i,r){const o=i===ce.tag,a="string"==typeof e?e:void 0,n=Array.isArray(e)?e:void 0,s=o?this.spacesAroundValuesStr:"",l=t===b.bitmarkText?t:b.plainText,c=e=>o?`${s}${e}${s}`:e,d=e=>{const t=this.writer;this.writer=this.partWriter,this.partWriter.openSync(),e(),this.partWriter.closeSync();const i=this.partWriter.getString().trim();return this.writer=t,i};if(null!=a){const e=()=>this.write(Pe.breakscape(a,{format:l,location:i}));if(o){const t=d(e);t&&this.write(c(t))}else e();return}if(null!=n){const e=()=>this.textGenerator.generateSync(n,t,i,r);if(o){const t=d(e);t&&this.write(c(t))}else e()}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(e){this.write(`[${".".repeat(e)}`)}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){0===this.spacesAroundValues&&this.writer.getLastWrite().endsWith("^")?this.write(" ]"):this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeSpacesAroundValues(){this.write(this.spacesAroundValuesStr)}writePlainTextDivider(){this.writeNL(),this.write("==== text ====")}writeCardSetStart(){this.writeNL(),this.options.cardSetVersion===ht.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.writeNL(),this.options.cardSetVersion===ht.v1&&this.write("===")}writeCardSetCardDivider(){this.writeNL(),this.options.cardSetVersion===ht.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.writeNL(),this.options.cardSetVersion===ht.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.writeNL(),this.options.cardSetVersion===ht.v1?this.write("--"):this.write("++")}writeNL_IfNotChain(e){this.isChain(e)||this.writeNL()}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writePropertyStyleResource(e,t,i=!1){if(e&&t){const r=t[N.keyFromValue(t.type)??""],o=r&&(r.src||r.url||r.body)||"";i?this.writeOPA():this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(o,b.plainText,ce.tag),t.type,N.article,this.writeCL()}}writeResource(e,t){e&&(this.writeOPAMP(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,b.plainText,ce.tag),N.article,this.writeCL())}writeProperty(e,t,i,r){let o;if(void 0!==t){const a=r.format===g.bitmarkText;if(a){if(!r.writeEmpty&&a&&this.isEmptyText(t))return;this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(t,b.bitmarkText,ce.tag),this.writeCL()}else if(o=Array.isArray(t)?t:[t],o.length>0){r.array||(o=o.slice(o.length-1));let t=0;for(const a of o)if(void 0!==a){if(r.ignoreFalse&&!1===a)continue;if(r.ignoreTrue&&!0===a)continue;if(!r.writeEmpty&&""===a)continue;t>0&&this.writeNL_IfNotChain(i),this.writeOPA(),this.writeTagKey(e),this.writeColon(),this.writeTextOrValue(`${a}`,b.plainText,ce.tag),this.writeCL(),t++}}}}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}isEmptyText(e){return!e||(!Array.isArray(e)||0===e.length)}isWriteTextFormat(e,t){return!!(!(b.fromValue(e)===t)||this.options.explicitTextFormat)}calculateIsCardAllowed(){return this.isBodyBitmarkText&&!this.isOfBitType1()}isOfBitType1(){return this.isOfBitType([d.trueFalse1,d.multipleChoice1,d.multipleResponse1])}isOfBitType(e){return H.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}},bt=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new pt,this.generator=new gt(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()}},ft={},yt=class extends Ne{constructor(e,t){super(),l(this,"ast",new le),l(this,"textGenerator"),l(this,"bitmarkVersion"),l(this,"textParserVersion"),l(this,"textParser",new tt),l(this,"options"),l(this,"jsonPrettifySpace"),l(this,"writer"),l(this,"json",[]),l(this,"bitWrapperJson",{}),l(this,"bitJson",{}),l(this,"textDefault",Pe.EMPTY_STRING),l(this,"bodyDefault",Pe.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=Ee.fromValue(t?.bitmarkVersion)??Ve,this.textParserVersion=this.textParser.version(),this.options={...ft,...t?.jsonOptions},this.debugGenerationInline=this.options.debugGenerationInline??!1,this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===Ee.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.textGenerator=new Ge(Ee.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?Pe.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?Pe.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.listItem=void 0,this.placeholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,se.bitmarkAst,this,void 0)}enter_bitmarkAst(e,t){this.json=[]}exit_bitmarkAst(e,t){this.options.textAsPlainText&&this.convertAllBitmarkTextsToStringsForPlainText(this.json),this.removeTemporaryProperties(this.json)}enter_bitsValue(e,t){const i=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(i),this.bitWrapperJson.bit=this.bitJson;const r=H.getBitConfig(i.bitType),o=this.getTextFormat(t),a=!!r.rootExampleType,n=r.rootExampleType===u.boolean;if(a){let e;n?(e=!0,H.isOfBitType(i.bitType,d.trueFalse1)&&void 0!==i.cardNode?.statement?.isCorrect&&(e=i.cardNode.statement.isCorrect)):e="true";const t=this.toExample(i,{defaultExample:e,isBoolean:n,textFormat:o});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else i.isExample&&(this.bitJson.isExample=!0);this.placeholderIndex=0}exit_bitsValue(e,t){const i=this.bitJson.isExample,r=this.bitJson.example;delete this.bitJson.isExample,delete this.bitJson.example,this.bitJson.isExample=i,this.bitJson.example=r,this.cleanBitJson(this.bitJson)}enter_imageSource(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_person(e,t){const i=this.getBitType(t);let r="person";return H.isOfBitType(i,d.conversationLeft1)&&(r="partner"),this.standardHandler(e,t,se.bitsValue,{array:!1,keyOverride:r})}enter_ratingLevelStart(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_ratingLevelEnd(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_productId(e,t){const i=e.value,r=this.getParentNode(t);if(r?.key!==se.bitsValue)return!0;return this.getBitType(t)===d.module?this.addProperty(this.bitJson,"productId",i,{array:!0}):i.length>0&&this.addProperty(this.bitJson,"productId",i[i.length-1],{array:!1}),!1}enter_markConfig(e,t){return!0}enter_markConfigValue(e,t){const i=e.value,r=this.getParentNode(t);return r?.key!==se.markConfig||(this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(i),!1)}enter_item(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_lead(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_pageNumber(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_marginNumber(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_hint(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_instruction(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}leaf_titleString(e,t){const i=this.getParentNode(t);return i?.key!==se.bitsValue||this.standardHandler(e,t,[se.bitsValue],{array:!1,keyOverride:"title"})}enter_title(e,t){return this.standardHandler(e,t,[se.bitsValue,se.cardNode],{array:!0})}enter_subtitle(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_caption(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}enter_width(e,t){let i=e.value;const r=this.getBitType(t),o=this.getParentNode(t);return o?.key===se.bitsValue&&H.isOfBitType(r,d.extractorBlock)&&(i=rt.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_height(e,t){let i=e.value;const r=this.getBitType(t),o=this.getParentNode(t);return o?.key===se.bitsValue&&H.isOfBitType(r,d.extractorBlock)&&(i=rt.asNumber(i,0)??0),this.standardHandler(e,t,void 0,{array:!1,valueOverride:i})}enter_extraProperties(e,t){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let i=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(i=`_${e}`),this.addProperty(this.bitJson,i,t,{array:!0})}}enter_cardBitsValue(e,t){const i=e.value,r=this.getBitType(t);if(!r)return;let o;if(r===d.bookReferenceList){this.bitJson.bookReferences||(this.bitJson.bookReferences=[]);const e={};this.addProperty(e,"lang",i.lang,{array:!1}),this.addProperty(e,"refAuthor",i.refAuthor??[],{array:!0}),this.addProperty(e,"refBookTitle",i.refBookTitle??[],{array:!1}),this.addProperty(e,"refPublisher",i.refPublisher??[],{array:!0}),this.addProperty(e,"refPublicationYear",i.refPublicationYear??[],{array:!1}),this.addProperty(e,"citationStyle",i.citationStyle??[],{array:!1}),this.bitJson.bookReferences.push(e)}else r===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:i.item??[],lead:i.lead??[],hint:i.hint??[],instruction:i.instruction??[],body:this.bodyDefault},o.push(this.listItem)}exit_cardBitsValue(e,t){this.listItem=void 0}enter_body(e,t){const i=e.value,r=this.getParentNode(t);if(!r)return!1;const o=this.getTextFormat(t),a=o===b.bitmarkText;if(this.bodyJson=i.body,r.key===se.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,ce.body,{noBreakscaping:!0});this.bitJson.body=(e??"").trim()}else e&&(this.bitJson.body=this.moveBodyBitPropertiesToAttrs(this.bodyJson))}else r.key===se.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson);return!1}bodyBitCallback(e,t,i){const r=`{${this.placeholderIndex}}`;return this.placeholderIndex++,this.bitJson.placeholders=this.bitJson.placeholders??{},this.bitJson.placeholders[r]=e,r}moveBodyBitPropertiesToAttrs(e,t=0){if(0===t)e=structuredClone(e);else if(t>5e3)throw new Error("Recursion limit exceeded");for(const i of e)if(i.type!==oe.text&&oe.values().includes(i.type)){const e=i;e.attrs={};for(const[t,i]of Object.entries(e))"type"!==t&&"attrs"!==t&&(e.attrs[t]=i,delete e[t])}else Array.isArray(i.content)&&(t++,this.moveBodyBitPropertiesToAttrs(i.content,t));return e}enter_footer(e,t){return this.standardHandler(e,t,void 0,{array:!0,valueOverride:e.value.footer})}enter_elements(e,t){return this.standardHandler(e,t,void 0,{array:!0})}enter_flashcards(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0,keyOverride:"cards"})}enter_definitions(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_statement(e,t){const i=e.value,r=this.getParentNode(t);r?.key===se.cardNode&&i&&(this.bitJson.statement=i.statement??"",this.bitJson.isCorrect=i.isCorrect??!1,this.bitJson.example=i.example,this.bitJson.isExample=i.isExample)}enter_statements(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_choices(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_responses(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_feedbacks(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_quizzes(e,t){return this.standardHandler(e,t,se.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,se.cardNode,{array:!0})}enter_matrix(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_pronunciationTable(e,t){return this.standardHandler(e,t,se.cardNode,{array:!1})}enter_table(e,t){return this.standardHandler(e,t,se.cardNode,{array:!1})}enter_questions(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_botResponses(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0,keyOverride:"responses"})}enter_ingredients(e,t){return this.standardHandler(e,t,se.cardNode,{array:!0})}enter_captionDefinitionList(e,t){return this.standardHandler(e,t,se.cardNode,{array:!1})}enter_backgroundWallpaper(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_imagePlaceholder(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_resources(e,t){const i=e.value,r=this.getBitType(t),o=this.getResourceType(t);if(!i||!r)return!0;let a;const n=H.getBitConfig(r),s=H.getBitResourcesConfig(r,o).comboResourceConfigKeysMap;if(s.size>0)for(const[e,t]of s.entries()){const r=z(e),o={type:r,__typeAlias:r,__configKey:e};for(const e of t){const t=i.find(t=>t.__configKey===e);if(t){const e=H.getTagConfigForTag(n.tags,t.__configKey);if(e){const i=e.jsonKey??e.tag,r=e.configKey??t.__configKey,a=t.__configKey===r?t:void 0;if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(o[i]=t)}}}a=o}else if(H.isOfBitType(r,[d.imagesLogoGrave,d.prototypeImages])){const e=[];for(const t of i)t.type===N.image&&e.push(t);r===d.imagesLogoGrave?this.bitJson.logos=e:this.bitJson.images=e}else i.length>=1&&(a=i[0]);return this.bitJson.resource=a,!1}leaf_level(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}enter_book(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!0})}leaf_book(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}leaf_anchor(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}leaf_reference(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}leaf_referenceEnd(e,t){return this.standardHandler(e,t,se.bitsValue,{array:!1})}leaf_markup(e,t){const i=e.value;return i&&(this.bitWrapperJson.bitmark=i),!1}enter_internalComment(e,t){return!1}enter_parser(e,t){const i=e.value,r=this.getBitType(t),o=this.getParentNode(t);if(i&&r){const{version:e,warnings:r,errors:a,...n}=i,s=`${this.bitmarkVersion}`,l=this.textParserVersion,c=this.getInternalComments(t);o?.key===se.bitsValue&&(this.bitWrapperJson.parser={version:e,bitmarkVersion:s,textParserVersion:l,internalComments:c,...n,warnings:r,errors:a},this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){for(const e of I.values()){const t=D(e),i=[`enter_${t}`,`leaf_${t}`];for(const e of i)"function"!=typeof this[e]&&"example"!==t&&(this[e]=(e,i)=>{const r=e.value;if(null==r)return;const o=this.getParentNode(i);o?.key===se.bitsValue&&(this.bitJson[t]=r)},this[e]=this[e].bind(this))}}standardHandler(e,t,i,r){if(i){const e=Array.isArray(i)?i:[i],r=this.getParentNode(t);if(!r?.key||!e.includes(r?.key))return!0}return this.addProperty(this.bitJson,r.keyOverride??e.key,r.valueOverride??e.value,r),!1}addProperty(e,t,i,r){if(void 0!==i){let o;Array.isArray(i)||(i=[i]);const a=i;o=!r.array&&a.length>=1?a[a.length-1]:a,(r.allowNull||null!=o)&&(e[t]=o)}}toExample(e,t){const{isExample:i,example:r,__isDefaultExample:o}=e,{defaultExample:a,isBoolean:n}=t;if(!i)return{isExample:!1,example:null};let s;return s=o?n?it.toBoolean(a):this.convertBreakscapedStringToJsonText(a,t.textFormat,ce.tag):n?it.toBoolean(r):this.convertBreakscapedStringToJsonText(r,t.textFormat,ce.tag),{isExample:!0,example:s}}getBitType(e){for(const t of e)if(t.key===se.bitsValue){const e=t.value;return e?.bitType}}getTextFormat(e){const t=this.getBitType(e);if(t){const i=H.getBitConfig(t);for(const t of e)if(t.key===se.bitsValue){const e=t.value;return b.fromValue(e?.textFormat)??i.textFormatDefault}}return b.bitmarkText}getResourceType(e){for(const t of e)if(t.key===se.bitsValue){const e=t.value;return e?.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===se.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t,i){if(!e)return"";if(!(t===b.bitmarkText))return e||"";if(this.options.textAsPlainText)return e||"";return this.textParser.toAst(e,{format:t,location:i})}concatenatePlainTextWithJsonTexts(e,t,i){if(Array.isArray(e)){if(i=i.trim()){const r=i.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:ne.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&o.push({text:t,type:ne.text}),e<r.length-1&&o.push({type:ne.hardBreak})}const a=e[e.length-1];a&&a.type===ne.paragraph?a.content=[...a.content??[],...o]:e.push({type:ne.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}isBitmarkText(e){return null!=e&&(!!Array.isArray(e)&&"text"===e.__tag)}writeInlineDebug(e,t){let i=e;t.open?i=`<${e}>`:t.close?i=`</${e}>`:t.single&&(i=`<${e} />`),this.writeString(i)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){const t=e.textFormat;return{type:e.isCommented?d._comment:e.bitType,originalType:e.isCommented?e.bitType:void 0,format:t,bitLevel:e.bitLevel}}cleanBitJson(e){const t=H.getBitType(e.type);if(null==e.originalType&&(e.originalType=void 0),e.item||(e.item=void 0),H.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 i=!1,r=!1;H.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),H.isOfBitType(t,[d.article]),H.isOfBitType(t,[d.example])&&(i=!0,r=!0),H.isOfBitType(t,[d.multipleChoice1,d.multipleResponse1,d.multipleChoiceText,d.highlightText,d.gapText,d.gapTextInstructionGrouped,d.clozeAndMultipleChoiceText,d.sequence,d.mark,d.flashcard,d.definitionList])&&(i=!0,null==e.body&&(e.body=this.bodyDefault)),H.isOfBitType(t,[d.sequence])&&(i=!0,r=!0,null==e.body&&(e.body=this.bodyDefault)),H.isOfBitType(t,d.cloze)&&(i=!0,H.isOfBitType(t,d.clozeSolutionGrouped)?(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!0)):H.isOfBitType(t,d.clozeInstructionGrouped)&&(null==e.quizCountItems&&(e.quizCountItems=!0),null==e.quizStrikethroughSolutions&&(e.quizStrikethroughSolutions=!1))),H.isOfBitType(t,[d.multipleChoice,d.multipleResponse])&&(i=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault)),H.isOfBitType(t,d.essay)&&(i=!0,r=!0,null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="")),H.isOfBitType(t,d.trueFalse1)&&(i=!0,r=!0,null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault)),H.isOfBitType(t,d.trueFalse)&&(i=!0,null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault)),H.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)),H.isOfBitType(t,d.interview)&&(i=!0,null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[])),t===d.matchMatrix&&(i=!0),H.isOfBitType(t,d.match)&&(i=!0,null==e.heading&&(e.heading={})),H.isOfBitType(t,d.learningPathBook)&&(null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1)),H.isOfBitType(t,d.table)&&(null==e.tableFixedHeader&&(e.tableFixedHeader=!1),null==e.tableHeaderWhitespaceNoWrap&&(e.tableHeaderWhitespaceNoWrap=!0),null==e.tableSearch&&(e.tableSearch=!1),null==e.tableSort&&(e.tableSort=!1),null==e.tablePagination&&(e.tablePagination=!1),null==e.tablePaginationLimit&&(e.tablePaginationLimit=0),null==e.tableHeight&&(e.tableHeight=0),null==e.tableWhitespaceNoWrap&&(e.tableWhitespaceNoWrap=!1),null==e.tableAutoWidth&&(e.tableAutoWidth=!0),null==e.tableResizableColumns&&(e.tableResizableColumns=!1),null==e.tableColumnMinWidth&&(e.tableColumnMinWidth=0)),H.isOfBitType(t,d.bookReference)&&(null==e.refAuthor&&(e.refAuthor=[]),null==e.refBookTitle&&(e.refBookTitle=""),null==e.refPublisher&&(e.refPublisher=[]),null==e.refPublicationYear&&(e.refPublicationYear="")),H.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),H.isOfBitType(t,d.pageBuyButton)&&null==e.content2Buy&&(e.content2Buy="")),H.isOfBitType(t,d.tocResource)&&null==e.tocResource&&(e.tocResource=[]),H.isOfBitType(t,d.tocContent)&&null==e.tocContent&&(e.tocContent=[]),H.isOfBitType(t,d.book)&&(null==e.maxTocChapterLevel&&(e.maxTocChapterLevel=-1),null==e.hasMarkAsDone&&(e.hasMarkAsDone=!1),null==e.processHandIn&&(e.processHandIn=!1),null==e.isPublic&&(e.isPublic=!1),null==e.chatWithBook&&(e.chatWithBook=!1),null==e.chatWithBookBrainKey&&(e.chatWithBookBrainKey="")),t!==d.articleAi&&t!==d.noteAi&&t!==d.summaryAi||null==e.aiGenerated&&(e.aiGenerated=!0),H.isOfBitType(t,[d.articleResponsive,d.pageArticleResponsive])&&null==e.imageFirst&&(e.imageFirst=!0),H.isOfBitType(t,d.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy="")),H.isOfBitType(t,[d.imagesLogoGrave,d.prototypeImages])&&(t===d.imagesLogoGrave?null==e.logos&&(e.logos=[]):null==e.images&&(e.images=[])),H.isOfBitType(t,[d.stepImageScreenshotWithPointer,d.surveyMatrix])&&(null==e.pointerTop&&(e.pointerTop=""),null==e.pointerLeft&&(e.pointerLeft=""),H.isOfBitType(t,[d.surveyMatrix])&&null==e.buttonCaption&&(e.buttonCaption="")),H.isOfBitType(t,[d.listItem])&&null==e.listItemIndent&&(e.listItemIndent=0),H.isOfBitType(t,d.surveyRating)&&(null==e.ratingLevelStart&&(e.ratingLevelStart={level:0}),null==e.ratingLevelEnd&&(e.ratingLevelEnd={level:0})),H.isOfBitType(t,d.vendorStripePricingTable)&&(null==e.stripePricingTableId&&(e.stripePricingTableId=""),null==e.stripePublishableKey&&(e.stripePublishableKey="")),H.isOfBitType(t,d.callToAction)&&(null==e.buttonCaption&&(e.buttonCaption=""),null==e.callToActionUrl&&(e.callToActionUrl="")),H.isOfBitType(t,d.handInFile)&&null==e.handInAcceptFileType&&(e.handInAcceptFileType=[]),H.isOfBitType(t,d.handInSubmit)&&(null==e.handInRequirement&&(e.handInRequirement=[]),null==e.handInInstruction&&(e.handInInstruction=""),null==e.buttonCaption&&(e.buttonCaption="")),H.isOfBitType(t,d.module)&&null==e.hasBookNavigation&&(e.hasBookNavigation=!0),H.isOfBitType(t,d.container)&&null==e.allowedBit&&(e.allowedBit=[]),H.isOfBitType(t,d.platformPath)&&null==e.path&&(e.path=""),i?null==e.isExample&&(e.isExample=!1):(delete e.isExample,delete e.example),r?null==e.example&&(e.example=null):delete e.example}return e}convertAllBitmarkTextsToStringsForPlainText(e){if(!this.options.textAsPlainText)return;const t=e;for(const e in t){const i=t[e];if(this.isBitmarkText(i)){const r=this.textGenerator.generateSync(i,b.bitmarkText,ce.tag,{noBreakscaping:!0});t[e]=(r??"").trim()}else"object"==typeof t[e]&&this.convertAllBitmarkTextsToStringsForPlainText(t[e])}}removeTemporaryProperties(e){const t=e;for(const e in t)e.startsWith("__")?delete t[e]:"object"==typeof t[e]&&this.removeTemporaryProperties(t[e])}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}},kt=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new pt,this.generator=new yt(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())}},Tt=class{getSupportedBits(e){const t=e?.includeNonDeprecated??!0,i=e?.includeDeprecated??!1,r=[];for(const e of d.values()){if(e===d._error||e===d._comment)continue;const o=H.getBitType(e),a=H.getBitConfig(o),n=a.inheritedBitTypes.length>0?a.inheritedBitTypes:void 0;(t&&!a.deprecated||i&&a.deprecated)&&r.push({name:e,since:a.since,deprecated:a.deprecated,inheritedBitTypes:n})}return r}getSupportedBitConfigs(){const e=[];for(const t of d.values()){if(t===d._error||t===d._comment)continue;const i=H.getBitType(t),r=H.getBitConfig(i);e.push(r)}return e}},vt=(0,i(718).superenum)({peggy:"peggy"}),xt=(0,i(718).superenum)({text:"text",json:"json",pojo:"pojo"}),_t=(0,i(718).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"}),wt=new dt,Ct=class{toAst(e){const t=this.preprocessJson(e),i=[];for(const e of t){const{bit:t,parser:r}=e,o=this.bitToAst(t,r?.internalComments);o&&i.push(o)}const r=i.length>0?{bits:i}:{};return wt.buildBitmark(r)}preprocessJson(e){const t=[];if(V.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const i=e=>{if(this.isBitWrapper(e)){const i=e;t.push(i)}else if(this.isBit(e)){const i=e;t.push(this.bitToBitWrapper(i))}};if(Array.isArray(e))for(const t of e)i(t);else i(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return H.getBitType(t.type)!==d._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){const{statement:i,reference:r,...o}=e,a=e.type===d._comment&&void 0!==e.originalType,n=H.getBitType(a?e.originalType:e.type),s=H.getBitConfig(n),l=Ie.fromValue(e.format);let c=b.fromValue(e.format)??s.textFormatDefault;l===Ie.bitmarkMinusMinus&&(c=b.bitmarkText);return wt.buildBit({...o,bitType:n,bitLevel:Math.max(Math.min(e.bitLevel??1,H.bitLevelMax),H.bitLevelMin),textFormat:e.format,resourceType:this.getResourceType(e.resource),isCommented:a,internalComment:t,...this.processTitle(n,e.title),...this.processReference(r),...this.parseExample(e.example),person:e.partner??e.person,markConfig:e.marks,resources:this.processResources(n,e.resource,e.images,e.logos),body:this.processBody(e.body,e.placeholders),flashcards:e.cards,statements:this.processStatements(i,e.isCorrect,e.statements,e.example),responses:this.processResponses(n,e.responses),botResponses:this.processBotResponse(n,e.responses),cardBits:this.processListItems(e.listItems??e.sections??e.bookReferences,e.placeholders),footer:this.processFooter(e.footer)})}processStatements(e,t,i,r){const o=[];if(e){const i={statement:e??"",isCorrect:t??!1,...this.parseExample(r)};i&&o.push(i)}if(Array.isArray(i))for(const e of i)o.push(e);if(0!==o.length)return o}processResponses(e,t){if(!H.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processBotResponse(e,t){if(H.isOfBitType(e,d.botActionResponse)&&Array.isArray(t))return t}processListItems(e,t){const i=[];if(Array.isArray(e))for(const r of e){const e={...r};e.body&&(e.body={body:e.body,placeholders:t}),e&&i.push(e)}if(0!==i.length)return i}getResourceType(e){if(e){return N.fromValue(e.type)}}processResources(e,t,i,r){const o=[];if(t&&o.push(t),H.isOfBitType(e,[d.prototypeImages])&&Array.isArray(i))for(const e of i)e&&o.push(e);if(H.isOfBitType(e,[d.imagesLogoGrave])&&Array.isArray(r))for(const e of r)e&&o.push(e);return o}processBody(e,t){return{body:e,placeholders:t}}processFooter(e){if(e)return{footer:e}}processTitle(e,t){return H.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=V.isString(e)||Array.isArray(e)?e:void 0;return t?{example:t}:{example:!!e}}},At=i(718),Bt=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}},St=(0,At.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:m.tag_title,Anchor:m.tag_anchor,Reference:m.tag_reference,ItemLead:m.tag_item,Instruction:m.tag_instruction,Hint:m.tag_hint,True:m.tag_true,False:m.tag_false,Gap:m.tag_gap,Mark:m.tag_mark,SampleSolution:m.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"}),Pt=(0,At.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"}),It=class{constructor(e){l(this,"cardIndex",0),l(this,"cardSideIndex",0),l(this,"cardVariantIndex",0),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 i=this.parserLocation()?.start??{line:1,column:1,offset:0},r=this.parse(e,{startRule:"bit",grammarSource:new Bt("bit",i)});return r.value&&(r.value.markup=t),r}handleTextFormat(e){return{type:St.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:St.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:m.fromValue(e),value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:St.Property,key:`@${Pe.unbreakscape(e,{format:b.plainText,location:ce.tag})}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){const i=Pe.unbreakscape(e,{format:b.plainText,location:ce.tag}),r=V.kebabToCamel(i);return{type:St.Resource,key:`&${r}`,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let i=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),i=[e]}return i}handlePlainTextDivider(e){return e=this.reduceToString(e),{type:St.PlainTextDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleFooterDivider(e){return e=this.reduceToString(e),{type:St.FooterDivider,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSet(e){const t=e,i={cards:[]},r={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:r,parser:o}=e;if(!t||t!==St.Card)continue;const{cardIndex:a,cardSideIndex:n,cardVariantIndex:s,value:l}=r;let c=i.cards[a];c||(c={sides:[]},i.cards[a]=c);let d=c.sides[n];d||(d={variants:[]},c.sides[n]=d);d.variants[s]?d.variants[s].value+=l:d.variants[s]={value:l,parser:o}}i.cards=i.cards.filter(e=>e.sides.some(e=>e.variants.some(e=>0!==V.trimmedString(e.value).length)));for(const t of i.cards){const i={sides:[]};r.cards.push(i);for(const r of t.sides){const t={variants:[]};i.sides.push(t);for(const i of r.variants){let r={line:1,column:1,offset:0};if(i.parser.location){r=i.parser.location.start;const e=i.parser.text,t=e?e.length:0,o=1;r.offset+=t,r.line+=o}let o=this.parse(i.value,{startRule:"cardContent",grammarSource:new Bt("card-content",r)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:St.CardSet,value:r,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let i=!1,r=!1,o=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===ht.v1?(i="==="===e,r="=="===e,o="--"===e):(i="===="===e,r="--"===e,o="++"===e)),i?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):r?(this.cardSideIndex++,this.cardVariantIndex=0):o&&this.cardVariantIndex++,this.isType(e,St.Card)?e:{type:St.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:St.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){const t=[];let i,r;for(const o of e)switch(o.type){case St.BodyChar:if(i){const e=`${i.value??""}${o.value??""}`;i.value=e}else i={type:St.BodyText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case St.CardChar:if(r){const e=`${r.value??""}${o.value??""}`;r.value=e}else r={type:St.CardText,value:o.value??"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:i&&(t.push(i),i=void 0),r&&(t.push(r),r=void 0),t.push(o)}return i&&t.push(i),r&&t.push(r),t}isType(e,t){if(!e)return!1;const{type:i}=e;return t?Array.isArray(t)?t.indexOf(i)>=0:t===i:!!St.fromValue(i)}reduceToArrayOfTypes(e,t,i){if(!Array.isArray(e))return[];return e.reduce((e,r,o)=>{if(null==r)return e;const{type:a,value:n}=r;if(Array.isArray(r)){const i=this.reduceToArrayOfTypes(r,t);e.push(...i)}else{if(!this.isType(r,t))return e;if(i&&Array.isArray(n)){const i=this.reduceToArrayOfTypes(n,t);e.push(...i)}else a&&e.push(r)}return e},[])}reduceToString(e){if(!Array.isArray(e))return"";return e.reduce((e,t,i)=>{if(null==t)return e;if(Array.isArray(t)){e+=this.reduceToString(t)}else e+=t;return e},[])}debugPrint(e,t){}},Lt=["----","\n==\n","\n---\n"],Et=["==\n","--\n"],Vt=["\n==","\n--"],Nt=new class{validateBitTags(e,t){if(!t)return[];const{bitConfig:i,bitType:r,resourceType:o}=e,{tags:a,cardSet:n}=i,s={...a,...H.getBitResourcesConfig(r,o).tags};return this.validateTagChainsRecursive(e,Pt.Bit,r,t,s,n).validated}checkBody(e,t,i,r,o){if(!o)return o;const{bitConfig:a}=e,{bodyAllowed:n}=a;return o.length>0&&!n&&e.addWarning(`Bit '${i}' should not have a body.`),o}checkBodyPart(e,t,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,i),i):i}checkFooter(e,t,i){if(!i)return i;const{bitConfig:r,bitType:o}=e,{footerAllowed:a}=r;return this.checkBodyForCommonPotentialMistakes(e,t,i),a||e.addWarning(`Bit '${o}' should not have a footer.`),i}checkCardBody(e,t,i,r,o,a,n){if(!r||!r.body)return r;const{bitConfig:s}=e;if(!s.cardSet)return r;const l=H.getCardSetVariantConfig(i,a,n);if(!l)return r;const{bodyAllowed:c}=l;return r.bodyString.length>0&&!c&&e.addWarning(`Bit '${i}' should not have a card body at card:${o+1}, side:${a+1}, variant:${n+1}.`),r}validateTagChainsRecursive(e,t,i,r,o,a,n){if(!r)return{validated:[]};let s;const l=[...r],c=this.convertTagsToTypeKeyMap(e,t,i,o),d=(e,t,i)=>{c.set(e,{maxCount:t,minCount:i,_type:e,_tag:e,_seenCount:0})};t===Pt.Bit?(a&&d(St.CardSet,1,0),d(St.TextFormat,1,0),d(St.BodyText,p.infinity,0),d(St.BodyTextPlain,p.infinity,0),d(St.PlainTextDivider,p.infinity,0),d(St.FooterDivider,p.infinity,0)):t===Pt.Card&&d(St.CardText,p.infinity,0);for(let r=0;r<l.length;r++){const o=l[r];if(!o)continue;const{type:d,key:p}=o;let u=St.fromValue(d);if(!u)continue;let h=u;u!==St.Property&&u!==St.Resource||(h=p);let m=c.get(h);if(!m&&u===St.Property){const t=p.replace(/^@/,"&");if((t===F.resource_backgroundWallpaper||t===F.resource_imagePlaceholder)&&(m=c.get(t),m)){u=St.Resource,o.type=St.Resource;const i=`Falling back to '[${t}]' from '[${p}]'. Replace '[${p}]' with '[&${p}]' to avoid this warning.`;e.addWarning(i)}}const{validated:g,warning:b}=this.validateSingleTag(e,t,i,o,u,m,a);u===St.Resource&&(n=St.Resource);let f=!0;if(!g)if(t===Pt.Chain&&n!==St.Resource){s=o;const e=l.slice(r+1);e.length>0&&(s.chain=e),l.splice(r),f=!1}else l.splice(r,1,null);if(b&&f&&e.addWarning(b.warning??"",b.content,b.previousContent),t===Pt.Chain&&m&&m.chain&&g&&!g.chain){const e=l.slice(r+1);e.length>0&&(g.chain=e),l.splice(r+1)}if(g&&Array.isArray(g.chain)&&g.chain.length>0)if(m&&m.chain){const{validated:t,remaining:o}=this.validateTagChainsRecursive(e,Pt.Chain,i,g.chain,m.chain,void 0,g.type);t&&t.length>0?g.chain=t:g.chain=void 0,o&&l.splice(r+1,0,o)}else if(g.type!==St.Resource){const e=g.chain[0];g.chain.length>1&&(e.chain=g.chain.slice(1)),l.splice(r+1,0,e),g.chain=void 0}}for(const t of c.values()){const{minCount:i,_seenCount:r}=t;if(null!=i&&r<i){const r=`${this.getTagSignature(t)} is required at least ${i} time(s)`;e.addWarning(r)}}return{validated:l.filter(e=>null!=e),remaining:s}}validateSingleTag(e,t,i,r,o,a,n){const{type:s,key:l}=r,c=a?this.getTagSignature(a):this.getUnknownTagSignature(s,l),d=" It will be ignored";let p,u,h="";if(a)switch(a._seenCount++,o){case St.Property:{const{content:o,warning:n}=this.validatePropertyTag(e,t,i,a,r);p=o,u=n;break}case St.Resource:{const{content:o,warning:n}=this.validateResourceTag(e,t,i,a,r);p=o,u=n;break}case St.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,i,a,r,n);p=t,u=o;break}default:{const{content:o,warning:n}=this.validateStandardTag(e,t,i,a,r);p=o,u=n}}else switch(o){case St.Property:u={extraProperty:!0},t!==Pt.Chain&&(p=r);break;case St.Resource:u={excessResource:!0},p=r;break;default:u={invalid:!0}}if(u){const e=a?._previous;u.invalid||u.excessResource?h=`${c} is not valid here (incorrectly chained?).${d}`:null!=u.tooMany?(h=`${c} is included more than the required ${u.tooMany} time(s).`,0===u.tooMany&&o===St.Resource&&(h+=` Did you forget the '${l}' in the bit header?`),u.tooMany>0&&(h+=" The earlier ones will be ignored")):u.extraProperty?h=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:u.unexpectedCardSet?h=`${c} is not expected here.${d}`:u.unexpectedCardSideVariant&&(h=`${c} has a card / side / variant that is not expected here.${d}`),u.warning=h,u.content=p,u.previousContent=e}return a&&(a._previous=r),{validated:p,warning:u}}validateStandardTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==p.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validatePropertyTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==p.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateResourceTag(e,t,i,r,o){const a=null==r.maxCount?1:r.maxCount;return a!==p.infinity&&r._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateCardSet(e,t,i,r,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:a}=r,n=a;let s,l=0,c=0;for(const i of n.cards){l=0;for(const r of i.sides){c=0;for(const i of r.variants){const o=i.content;let a;const n=H.getCardSetVariantConfig(t,l,c);if(n){a=this.validateTagChainsRecursive(e,Pt.Card,t,o,n.tags).validated}else s={unexpectedCardSideVariant:!0};a&&a.length>0?r.variants[c]={parser:i.parser,content:a}:r.variants[c]={parser:i.parser,content:[]},c++}l++}}return{content:r,warning:s}}checkBodyForCommonPotentialMistakes(e,t,i){if(!i)return;const{bitType:r}=e;for(const t of Lt)i.includes(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of Et)i.startsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of Vt)i.endsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`)}convertTagsToTypeKeyMap(e,t,i,r){const o=new Map;for(const e of Object.values(r)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===k.tag,isProperty:e.type===k.property,isResource:e.type===k.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)o.set(e.configKey,t);else if(t.isResource)o.set(e.configKey,t);else{const i=St.fromValue(e.tag);i&&o.set(i,t)}}return o}getTagSignature(e){switch(e._type){case k.tag:case k.property:case k.resource:return`[${e._configKey}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case St.Property:case St.Resource:return`[${t}]`;default:return t?`'${e}' tag '${t}'`:`'${e}' tag`}}},Rt=new class{concatenatePlainTextWithAstTexts(e,t,i){if(Array.isArray(e)){if(i=i&&i.trim()){const r=i.split("\n"),o=[];for(let e=0;e<t;e++)o.push({type:ne.hardBreak});for(let e=0;e<r.length;e++){const t=r[e];t&&o.push({text:t,type:ne.text}),e<r.length-1&&o.push({type:ne.hardBreak})}const a=e[e.length-1];a&&a.type===ne.paragraph?a.content=[...a.content??[],...o]:e.push({type:ne.paragraph,content:o,attrs:{}})}return e}return`${e??""}${"\n".repeat(t)}${i??""}`}},Ft=new tt,Ot=new class{process(e,t,i,r,o,a,n,s){const l=[];let c,d;const p=n.length>0?this.trimBodyParts(n):void 0,u=s?p:Nt.checkBody(e,t,i,r,p);if(r===b.json&&u){c=u.reduce((e,t)=>{if(t.type===oe.text&&t.data){return e+(t.data.bodyText??"")}return e},"");try{c=JSON.parse(c)}catch(t){c=null,e.addError("Body JSON is invalid.")}}else{let e="",t="",i="",o=0;const a=e=>`[!${e}]`;if(u)for(let r=0;r<u.length;r++){const n=u[r];if(n.type===oe.text){const r=n,o=r.data.bodyText;r.data.isPlain?t=Pe.concatenate(t,o):e=Pe.concatenate(e,o),i=Pe.concatenate(i,o)}else{const t=a(o);e=Pe.concatenate(e,t),l.push(n),o++}}const n=r===b.bitmarkText?Ft.toAst(e,{format:r,location:ce.body}):Pe.unbreakscape(e,{format:b.plainText,location:ce.body}),s=Pe.unbreakscape(t,{format:b.plainText,location:ce.body}),p=V.countOccurrencesAtEnd(e,"\n")+V.countOccurrencesAtStart(t,"\n");c=Rt.concatenatePlainTextWithAstTexts(n,p,s),d=Pe.unbreakscape(i,{format:r,location:ce.body}).trim();const h=Array.isArray(c)?c:void 0;if(h&&u){o=0;for(let e=0;e<u.length;e++){const t=u[e];if(t.type===oe.text)continue;const i=t;let r;switch(t.type){case oe.gap:case oe.mark:case oe.select:case oe.highlight:r=i}r&&this.replacePlaceholderWithBodyBit(h,r,o),o++}}}return{body:c,bodyBits:l.length>0?l:void 0,bodyString:d}}buildBodyText(e,t){return{type:oe.text,data:{bodyText:e,isPlain:t}}}replacePlaceholderWithBodyBit(e,t,i){const r=(e,o,a)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const i=e[t];if(r(i,e,t))return!0}else{if("bit"===e.type&&e.index===i)return o[a]=t,!0;if(e.content){if(r(e.content,e,"content"))return!0}}return!1};r(e,null,null)}trimBodyParts(e){let t=!1,i=e.reduce((e,i)=>{const r=i;if(t||r.type!==oe.text)t=!0,e.push(i);else{const i=r.data.bodyText.trimStart();i&&(t=!0,r.data.bodyText=i,e.push(r))}return e},[]);return t=!1,i=i.reduceRight((e,i)=>{const r=i;if(t||r.type!==oe.text)t=!0,e.unshift(i);else{const i=r.data.bodyText.trimEnd();i&&(t=!0,r.data.bodyText=i,e.unshift(r))}return e},[]),i}};function Dt(e,t,i,r,o,a,n,s){const{bitConfig:l}=e;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let c={};const p=function(e,t){const i={cards:[],internalComments:[]};if(!t)return i;const{bitType:r}=e;let o=0,a=0,n=0;for(const s of t.cards){const t={no:o++,sides:[]};i.cards.push(t);for(const o of s.sides){const s={no:a++,variants:[]};t.sides.push(s);for(const l of o.variants){const{parser:o,content:c}=l,d={parser:o,no:n++};s.variants.push(d);const p=H.getTagsConfigForCardSet(r,a,n),u=e.bitContentProcessor(Pt.Card,p,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",u),u.cardBody=Nt.checkCardBody(e,Pt.Card,r,u.cardBody,t.no,s.no,d.no),u.cardBodyStr=u.cardBody?.bodyString,d.data=u,u.internalComments&&i.internalComments.push(...u.internalComments)}n=0}a=0}return i}(e,r),u=l.cardSet?.configKey;switch(u){case f.flashcard:case f.definitionList:c=function(e,t,i){const r=[],o=[];let a,n,s,l="",c=[],p=0,u={};const h=t===d.flashcard1,m=zt(i);for(let g=0;g<i.cards.length;g++){const b=i.cards[g];if(!m||0!==g){a=void 0,n=void 0,c=[],p=0,u={};for(const e of b.sides)for(const t of e.variants){const{cardBody:e,resources:i,...r}=t.data;u={...u,...r};const o=i&&i.length>0?i[0]:void 0,d=e?.body;0===p?(s=t,l=e?.bodyString??"",a={text:d,icon:o}):1===p?n={text:d,icon:o}:c.push({text:d,icon:o}),p++}if(0!==g&&h){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${l}'`,s);break}if(H.isOfBitType(t,[d.flashcard])){const e={question:a,answer:n,alternativeAnswers:c,...u};e&&r.push(e)}else{const e={term:a,definition:n,alternativeDefinitions:c,...u};e&&o.push(e)}}}return{heading:m?.heading,flashcards:r.length>0?r:void 0,definitions:o.length>0?o:void 0}}(e,t,p);break;case f.elements:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;r.push(t.cardBodyStr??"")}return{elements:r.length>0?r:void 0}}(0,0,p);break;case f.statements:c=function(e,t,i,r,o){const a=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{statements:t,statement:i,...r}=e.data;if(Array.isArray(t))for(const e of t){const t={statement:e.statement??"",isCorrect:e.isCorrect,item:e.item,lead:e.lead,hint:e.hint,instruction:e.instruction,example:e.example,...r};t&&a.push(t)}}r&&a.push(r);Array.isArray(o)&&o.length>0&&a.push(...o);return{statements:a.length>0?a:void 0}}(0,0,p,o,a);break;case f.feedback:c=function(e,t,i){let r;const o=[],a=zt(i);for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(!a||0!==e){r=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const i=t.data,{cardBody:a,cardBodyStr:n,choices:s,...l}=i;if(0===e){const e=[];if(s&&s.length>0)for(const t of s){const{__isDefaultExample:i,example:r,...o}=t,a={choice:o.choice,requireReason:o.isCorrect,__isDefaultExample:i,example:r};e.push(a)}r={...i,choices:e},r&&o.push(r)}else if(1===e){const e={text:n??"",__textAst:a?.body,...l};r&&(r.reason=e)}}}}}return{heading:a?.heading,feedbacks:o.length>0?o:void 0}}(0,0,p);break;case f.quiz:c=function(e,t,i,r,o){const a=[],n=H.isOfBitType(t,d.multipleChoice),s=H.isOfBitType(t,d.multipleResponse);if(!n&&!s)return{};let l,c=!1;for(const e of i.cards){c=!1,l=void 0;for(const t of e.sides)for(const e of t.variants){const{__isDefaultExample:t,example:i,...r}=e.data;if(c=!0===t||c,l=i||l,r.trueFalse&&r.trueFalse.length>0){const e=[];for(const t of r.trueFalse){const{__isDefaultExample:i,example:r,...o}=t,a=i||c,n=r||l,d={isCorrect:o.isCorrect,__isDefaultExample:a,example:n};s?d.response=o.text:d.choice=o.text,d&&e.push(d)}s?r.responses=e:r.choices=e}const o={...r,choices:r.choices,responses:r.responses,__isDefaultExample:c,__defaultExample:l};o&&a.push(o)}}if(n&&Array.isArray(r)&&r.length>0){const e={choices:r};e&&a.push(e)}if(s&&Array.isArray(o)&&o.length>0){const e={responses:o};e&&a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,p,n,s);break;case f.questions:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,i={question:t.cardBodyStr??"",...t};i&&r.push(i)}return{questions:r.length>0?r:void 0}}(0,0,p);break;case f.matchPairs:c=function(e,t,i){const r=[];let o,a,n,s,l=[],c=[],p={},u=!1;const h=H.isOfBitType(t,d.matchMatrix),m=zt(i,h),g=m?.isDefaultExampleCardSet??!1;let b=m?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(m&&0===e)continue;o=void 0,l=[],c=[],a=void 0,n=void 0,p={},u=!1,s=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];for(const t of i.variants){const{cardBody:i,cardBodyStr:r,resources:d,__isDefaultExample:h,example:m,...b}=t.data;if(u=!0===h||u,s=m||s,0===e)if(Array.isArray(d)&&d.length>0){const e=d[0];e.type===N.audio?a=e:e.type===N.image&&(n=e)}else o=r;else{const e=r??"",t=i?.body;l.push(e),c.push(t),!g&&!u||s||(s=t),delete b.item,delete b.lead}p={...p,...b}}}u&&(b=void 0);const d=u||g,h=s||b,f={key:o??"",keyAudio:a,keyImage:n,values:l,__valuesAst:c,...p,__isDefaultExample:d,example:h};f&&r.push(f)}return{heading:m?.heading,pairs:r.length>0?r:void 0}}(0,t,p);break;case f.matchMatrix:c=function(e,t,i){let r,o;const a=[];let n,s,l,c,d=[],p=[],u=[],h={},m=!1,g=!1;const b=zt(i,!0),f=b?.isDefaultExampleCardSet??!1;let y=b?.exampleCardSet;for(let e=0;e<i.cards.length;e++){const t=i.cards[e];if(b&&0===e)continue;r=void 0,o=void 0,d=[],p=[],u=[],m=!1,n=void 0,l=void 0;for(let e=0;e<t.sides.length;e++){const i=t.sides[e];p=[],u=[],h={},g=!1,s=void 0,c=void 0;for(const t of i.variants){const i=t.data,{cardBody:a,cardBodyStr:d,__isDefaultExample:b,example:y,isCaseSensitive:k,...T}=i;if(g=!0===b||g,s=y||s,Object.assign(h,T),0===e)r=d,o=T,m=!0===b||m,n=y||n,l=null!=k?k:l;else{const e=d??Pe.EMPTY_STRING,t=a?.body;p.push(e),u.push(t),!f&&!g||s||(s=t),c=null!=k?k:l}}if(e>0){g&&(n=y=void 0),m&&(y=void 0);const e=g||m||f,t=s||n||y,i={values:p,__valuesAst:u,...h,__isDefaultExample:e,example:t,isCaseSensitive:c};i&&d.push(i)}}const k={key:r??Pe.EMPTY_STRING,cells:d,...o};k&&a.push(k)}return{heading:b?.heading,matrix:a.length>0?a:void 0}}(0,0,p);break;case f.pronunciationTable:c=function(e,t,i){const r=[];let o=[];for(const e of i.cards){o=[];for(const t of e.sides)for(const e of t.variants){const t=e.data,{title:i,cardBody:r,resources:a}=t,n=i&&i[1].titleAst,s=a&&a.length>0?a.find(e=>e.type===N.audio):void 0,l={title:n??[],body:r?.body??[],audio:s};o.push(l)}r.push(o)}return{pronunciationTable:{data:r}}}(0,0,p);break;case f.table:c=function(e,t,i){let r=!1;const o=[],a=[];let n=[];for(let e=0;e<i.cards.length;e++){const t=i.cards[e];r=!1,n=[];for(const i of t.sides)for(const t of i.variants){const i=t.data,{title:a,cardBody:s}=i,l=a&&a[1].titleAst;if(0===e&&null!=l&&(r=!0),r)o.push(l??[]);else{const e=s?.body??[];n.push(e)}}r||a.push(n)}return{table:{columns:o,data:a}}}(0,0,p);break;case f.botActionResponses:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{__instructionString:t,reaction:i,cardBodyStr:o,...a}=e.data,n={response:t??Pe.EMPTY_STRING,reaction:i??Pe.EMPTY_STRING,feedback:o??Pe.EMPTY_STRING,...a};n&&r.push(n)}return{botResponses:r.length>0?r:void 0}}(0,0,p);break;case f.ingredients:c=function(e,t,i){const r=[];for(const e of i.cards)for(const t of e.sides)for(const e of t.variants){const{title:t,__instructionString:i,unit:o,unitAbbr:a,decimalPlaces:n,disableCalculation:s,cardBodyStr:l,cardBody:c,...d}=e.data,p=Array.isArray(t)&&t.length>0?t[t.length-1].titleString:void 0;let u=!1,h=rt.asNumber(i);if(c&&c.bodyBits){const e=c.bodyBits.find(e=>e.type===oe.select);e&&(h=e.__instructionString?rt.asNumber(e.__instructionString):h,e.options&&e.options.length>0&&(u=e.options[0].isCorrect))}const m={title:p,checked:u,ingredient:l,quantity:h,unit:o??Pe.EMPTY_STRING,unitAbbr:a??Pe.EMPTY_STRING,decimalPlaces:n??1,disableCalculation:s,...d};m&&r.push(m)}return{ingredients:r.length>0?r:void 0}}(0,0,p);break;case f.clozeList:case f.exampleBitList:case f.bookReferenceList:c=function(e,t,i,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const{cardBody:t,...i}=e.data,r={body:t,...i};r&&o.push(r)}return{cardBits:o.length>0?o:void 0}}(0,0,0,p)}return c.internalComments=p.internalComments.length>0?p.internalComments:void 0,c}function zt(e,t=!1){let i,r,o=!1;const a=[];let n,s=!1;if(0===e.cards.length)return;const l=e.cards[0];for(let e=0;e<l.sides.length;e++){const t=l.sides[e];if(0===t.variants.length)continue;const i=t.variants[0].data,{title:c,__isDefaultExample:d,example:p}=i,u=c&&c[1].titleString;null!=u&&(o=!0),0===e?o&&(r=u,s=!0===d||s,n=p||n):o&&(a.push(u??""),s=!0===d||s,n=p||n)}if(o){let e=a;e=t?a:a.length>=1?a[a.length-1]:"",i={forKeys:r??"",forValues:e}}return i?{heading:i,isDefaultExampleCardSet:s,exampleCardSet:n}:void 0}function qt(e,t,i,r,o){const{type:a,value:n}=r,{textFormat:s}=e,l=new tt,c=V.trimmedString(n);switch(a){case St.Instruction:o.instruction=l.toAst(c,{format:s,location:ce.tag}),o.__instructionString=Pe.unbreakscape(c,{format:b.bitmarkText,location:ce.tag});break;case St.Hint:o.hint=l.toAst(c,{format:s,location:ce.tag}),o.__hintString=Pe.unbreakscape(c,{format:b.bitmarkText,location:ce.tag});break;case St.Anchor:o.anchor=Pe.unbreakscape(c,{format:b.bitmarkText,location:ce.tag});break;case St.Reference:o.reference=Pe.unbreakscape(c,{format:b.bitmarkText,location:ce.tag});break;case St.SampleSolution:o.sampleSolution=Pe.unbreakscape(c,{format:b.bitmarkText,location:ce.tag}),o.__sampleSolutionAst=l.toAst(c,{format:s,location:ce.tag}),e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",r)}}var Mt=new tt,$t=new class{process(e,t,i,r,o,a){const{textFormat:n}=e;let s;o=o.trimStart(),a=a.trimEnd();const l=!!o.trim(),c=!!a.trim();let d=0;if(l&&c&&(d=V.countOccurrencesAtEnd(o,"\n")+V.countOccurrencesAtStart(a,"\n")),o||a){const i=n===b.bitmarkText;o&&(o=Nt.checkFooter(e,t,o));const r=i?Mt.toAst(o,{format:n,location:ce.body}):Pe.unbreakscape(o,{format:b.plainText,location:ce.body}),l=Pe.unbreakscape(a,{format:b.plainText,location:ce.body});s=Rt.concatenatePlainTextWithAstTexts(r,d,l)}return s?{footer:s}:void 0}},jt=new tt;function Wt(e,t,i,r,o,a){if(t===Pt.Chain)!function(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=o.solutions,l=o.__solutionsAst;if(s&&l&&V.isString(n)){const e=V.trimmedString(n);s.push(Pe.unbreakscape(e,{format:b.bitmarkText,location:ce.tag}));const t=jt.toAst(e,{format:a,location:ce.tag});l.push(t)}}(e,0,0,r,o);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const o=H.getTagConfigForTag(i,m.fromValue(r.type)),a=[r,...r.chain??[]],n=e.bitContentProcessor(Pt.Chain,o?.chain,a);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",n);const s={type:oe.gap,...n};return s}(e,0,i,r);t&&a.push(t)}}function Jt(e,t,i,r,o){t===Pt.Chain?function(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=new tt,l=V.trimmedString(n);o.itemLead||(o.itemLead=[]);const c=s.toAst(l,{format:a,location:ce.tag});o.itemLead.push(c)}(e,0,0,r,o):function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("item lead content",r);const a=H.getTagConfigForTag(i,m.fromValue(r.type)),n=[r,...r.chain??[]],s=e.bitContentProcessor(Pt.Chain,a?.chain,n);e.DEBUG_CHAIN_TAGS&&e.debugPrint("item lead TAGS",s);o.itemLead=s.itemLead}(e,0,i,r,o)}function Ht(e,t,i,r,o,a){if(t===Pt.Chain)!function(e,t,i,r){const{value:o}=i;V.isString(o)&&(r.solution=V.trimmedString(o))}(0,Pt.Chain,r,o);else{const t=function(e,t,i,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const o=H.getTagConfigForTag(i,m.fromValue(r.type)),a=e.bitContentProcessor(Pt.Chain,i,[r]),n=e.bitContentProcessor(Pt.Chain,o?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",n);const{solution:s}=a,{mark:l,...c}=n,d={type:oe.mark,solution:s??"",mark:Le.asSingle(l)??"",...c};return d}(e,0,i,r);t&&a.push(t)}}function Gt(e,t,i,r,o){t===Pt.Chain||function(e,t,i,r,o){const{bitConfig:a}=e;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const n=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",n);const{reference:s,referenceEnd:l}=n,c=Pe.unbreakscape(V.trimmedString(r.value),{format:b.bitmarkText,location:ce.tag}),d=a.tags[F.property_book];if(d&&(d.maxCount===p.infinity||d.maxCount>1))return Array.isArray(o.book)||(o.book=[]),void o.book.push({book:c,reference:s??"",referenceEnd:l??void 0});o.book=c,o.reference=s,o.referenceEnd=l}(e,0,i,r,o)}var Ut=new tt;function Kt(e,t,i,r){const{bitType:o}=e,{value:a}=i,n=a;H.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,i,r){const{bitType:o,textFormat:a}=e;let n;Array.isArray(r.trueFalse)&&r.trueFalse.length>0&&(n=r.trueFalse[r.trueFalse.length-1]??void 0);n?!0===i?(n.__isDefaultExample=!0,n.example=!!n.isCorrect):it.isBooleanString(i)?n.example=it.toBoolean(i):(n.__isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t)):Array.isArray(r.__solutionsAst)&&r.__solutionsAst.length>0?r.example=!0===i?r.__solutionsAst[r.__solutionsAst.length-1]??void 0:i?Ut.toAst(i,{format:a,location:ce.tag}):void 0:H.isOfBitType(o,[d.multipleChoiceText,d.highlightText,d.trueFalse,d.trueFalse1,d.multipleResponse,d.multipleResponse1])?function(e,t,i,r){if(!0===i)r.__isDefaultExample=!0,r.example=void 0;else{const o=i?Pe.unbreakscape(i,{format:b.bitmarkText,location:ce.tag}):void 0;it.isBooleanString(o)?r.example=it.toBoolean(o):(r.__isDefaultExample=!0,r.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",t))}}(e,t,i,r):H.isOfBitType(o,[d.clozeAndMultipleChoiceText,d.multipleChoice,d.multipleChoice1])?(r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("At this level, only default [@example] is allowed, using default",t)):Yt(e,t,i,r)}(e,i,n,r):H.isOfBitType(o,d.mark)?function(e,t,i,r){r.__isDefaultExample=!0,r.example=void 0,!0!==i&&e.addWarning("Only default [@example] is allowed, using default",t)}(e,i,n,r):Yt(e,i,n,r)}function Yt(e,t,i,r){const{textFormat:o}=e;!0===i||"true"===i?(r.__isDefaultExample=!0,r.example=void 0):r.example=i?Ut.toAst(i,{format:o,location:ce.tag}):void 0}function Qt(e,t,i,r,o){t===Pt.Chain?function(e,t,i,r,o){const{value:a}=r,n=Pe.unbreakscape(V.trimmedString(a),{format:b.bitmarkText,location:ce.tag});o.imageSourceUrl=n}(0,0,0,r,o):function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",r);const{key:a}=r,n=H.getTagConfigForTag(i,F.fromValue(a)),s=e.bitContentProcessor(Pt.Chain,i,[r]),l=e.bitContentProcessor(Pt.Chain,n?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",l);const{imageSourceUrl:c}=s,{mockupId:d,...p}=l;c||e.addWarning("[@imageSource] is missing the image url",r);d||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",r);const u={url:c??"",mockupId:d??"",...p};o.imageSource=u}(e,0,i,r,o)}function Xt(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("person content",r);const a=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("person TAGS",a);const{propertyTitle:n,resources:s}=a,l=Pe.unbreakscape(V.trimmedString(r.value),{format:b.bitmarkText,location:ce.tag}),c=V.trimmedString(n),d=function(e,t){let i;const r=[];if(t)for(const e of t.reverse())i||N.image!==e.type?r.push(e):i=e;r.length>0&&e.addWarning(`${r.length} excess resource(s) present in the [@person] chain.`);return i}(e,s),p={name:l,title:c,avatarImage:d};o.person=p}var Zt=new tt;var ei=new tt;function ti(e,t,i,r,o){const{value:a}=r,{key:n}=r,s=t===Pt.Chain,l=H.getTagConfigForTag(i,I.fromValue(n)),c=l?l.configKey:void 0;let d=D(n);if(c===F.property_internalComment)return void function(e,t,i,r){if(!r.internalComments)return;const{value:o}=i,a=V.isString(o)?V.trimmedString(o):void 0;a&&r.internalComments.push(a)}(0,0,r,o);if(l){if(c===F.property_example)return void Kt(e,0,r,o);if(c===F.property_groupTag)return void function(e,t,i,r,o){const{value:a}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("groupTag content",r);const n=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("groupTag TAGS",n);const{tag:s}=n,l={name:V.trimmedString(a)??"",tags:s??[]};Array.isArray(o.groupTag)||(o.groupTag=[]),o.groupTag.push(l)}(e,0,l.chain,r,o);if(c===F.property_ratingLevelStart||c===F.property_ratingLevelEnd)return void function(e,t,i,r,o){const{textFormat:a}=e,{key:n,value:s}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("ratingLevel content",r);const l=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("ratingLevel TAGS",l);const{label:c}=l,d={level:rt.asNumber(s)??0,label:c?Zt.toAst(c,{format:a,location:ce.tag}):void 0};switch(n){case F.property_ratingLevelStart:o.ratingLevelStart=d;break;case F.property_ratingLevelEnd:o.ratingLevelEnd=d}}(e,0,l.chain,r,o);if(c===F.property_technicalTerm)return void function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("technicalTerm content",r);const a=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("technicalTerm TAGS",a);const{lang:n}=a,s={technicalTerm:Pe.unbreakscape(V.trimmedString(r.value),{format:b.bitmarkText,location:ce.tag}),lang:n};o.technicalTerm=s}(e,0,l.chain,r,o);if(c===F.property_servings)return void function(e,t,i,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("servings content",r);const a=e.bitContentProcessor(Pt.Chain,i,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("servings TAGS",a);const{unit:n,unitAbbr:s,decimalPlaces:l,disableCalculation:c,__hintString:d}=a,p={servings:rt.asNumber(r.value)??1,unit:n,unitAbbr:s,decimalPlaces:l??1,disableCalculation:c,hint:d};o.servings=p}(e,0,l.chain,r,o);if(c===F.property_person||c===F.property_partner)return void Xt(e,0,l.chain,r,o);if(c===F.property_imageSource)return void Qt(e,t,i,r,o);if(c===F.property_book)return void Gt(e,t,l.chain,r,o);if(c===F.property_mark&&!s)return void function(e,t,i,r,o){const{key:a}=r;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const n=o.markConfig;if(!n)return;const s=H.getTagConfigForTag(i,F.fromValue(a)),{mark:l,...c}=e.bitContentProcessor(Pt.Chain,s?.chain,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const d={mark:Pe.unbreakscape(V.trimmedString(r.value)??"unknown",{format:b.bitmarkText,location:ce.tag}),emphasis:"underline",...c};d&&n.push(d)}(e,0,i,r,o);c===F.property_title&&s&&(d="propertyTitle")}const p=(e,t,i,r)=>{if(i=(e=>{if(null!=e){if(r)switch(r.format){case g.plainText:return Pe.unbreakscape(V.isString(e)?V.trimmedString(e):void 0,{format:b.plainText,location:ce.tag});case g.number:return rt.asNumber(Pe.unbreakscape(e,{format:b.plainText,location:ce.tag}));case g.boolean:return it.toBoolean(Pe.unbreakscape(e,{format:b.plainText,location:ce.tag}),!0);case g.invertedBoolean:return!it.toBoolean(Pe.unbreakscape(e,{format:b.plainText,location:ce.tag}),!0);case g.bitmarkText:return e=V.isString(e)?e:"",ei.toAst(e,{format:b.bitmarkText,location:ce.tag})}return Pe.unbreakscape(e,{format:b.plainText,location:ce.tag})}})(i),null==r||r.array)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];e[t]=[...r,i]}else e[t]=[i];else e[t]=i};p(l?o:o.extraProperties,d,a,l),c===F.property_sampleSolution&&p(o,"__sampleSolutionAst",a,new x({configKey:F.property_sampleSolution,tag:"sampleSolution",maxCount:1,minCount:1,chain:void 0,jsonKey:void 0,format:g.bitmarkText,defaultValue:void 0,deprecated:void 0}))}function ii(e,t,i,r,o,a){const{value:n}=r,s=V.trimmedString(n);a?o.referenceEnd=Pe.unbreakscape(s,{format:b.bitmarkText,location:ce.tag}):o.reference=Pe.unbreakscape(s,{format:b.bitmarkText,location:ce.tag})}var ri=new ct;function oi(e,t,i,r,o){const{type:a,key:n,value:s,chain:l}=r,c=o.resources;if(!c)return;const d=F.fromValue(n);if(!d)return;const p=N.fromKey(d.replace(/^&/,""))??N.unknown,u=H.getTagConfigForTag(i,d),{posterImage:h,...m}=e.bitContentProcessor(Pt.Chain,u?.chain,l);let g;if(h){const{subConfig:t,subChain:i}=function(e,t,i){let r;e&&(r=e[i]?.chain);const o=t?.reduce((e,t)=>{if(e)return e;const r=t;return r.key===i?r.chain:void 0},void 0);return{subConfig:r,subChain:o}}(u?.chain,l,F.property_posterImage),{posterImage:r,...o}=e.bitContentProcessor(Pt.Chain,t,i);g=ri.resource(e,{type:N.image,value:h,...o}).image}const f=ri.resource(e,{type:p,value:Pe.unbreakscape(s,{format:b.bitmarkText,location:ce.tag}),posterImage:g,...m});f&&(d===F.resource_backgroundWallpaper||d===F.resource_imagePlaceholder?o.propertyStyleResources&&(o.propertyStyleResources[p]=f):c.push(f))}var ai=new tt;function ni(e,t,i,r,o){const{textFormat:a}=e,{value:n}=r,s=o.title;if(!s)return;const l=n,c=V.trimmedString(l.title);s[l.level.length]={titleAst:ai.toAst(c??"",{format:a,location:ce.tag}),titleString:c??""}}function si(e,t,i,r,o,a){t===Pt.Chain?function(e,t,i,r){const{type:o,value:a}=i,n=r.trueFalse;if(!n)return;const s=Pe.unbreakscape(V.trimmedString(a),{format:b.bitmarkText,location:ce.tag});n.push({text:s,isCorrect:o===St.True,__isDefaultExample:!1})}(0,Pt.Chain,r,o):function(e,t,i,r,o,a){const{bitType:n}=e,s=[r,...r.chain??[]],l=o.statements,c=o.choices,p=o.responses;if(!(l&&c&&p&&a))return;if(H.isOfBitType(n,d.trueFalse1))o.statement=function(e,t,i){const{bitType:r}=e;if(!H.isOfBitType(r,d.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const{trueFalse:o,...a}=e.bitContentProcessor(Pt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",a);let n,s;o&&o.length>0&&(s=o[0]);if(s){const{statement:e,...t}=a;n={...s,statement:s.text,...t}}return n}(e,i,s);else if(H.isOfBitType(n,[d.trueFalse,d.multipleChoice,d.multipleChoice1,d.multipleResponse,d.multipleResponse1,d.feedback])){const t=function(e,t,i){const{bitType:r}=e,o=H.isOfBitType(r,d.trueFalse),a=H.isOfBitType(r,[d.multipleChoice,d.multipleChoice1,d.feedback]),n=H.isOfBitType(r,[d.multipleResponse,d.multipleResponse1]);if(!o&&!a&&!n)return{};const s=[],l=[],c=[],p=e.splitBitContent(i,[St.True,St.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",p);for(const i of p){const{trueFalse:r,...d}=e.bitContentProcessor(Pt.Chain,t,i);let p;if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",d),r&&r.length>0&&(p=r[0]),p)if(o){const{statement:e,...t}=d,i={...p,statement:p.text,...t};i&&s.push(i)}else if(a){const e={...p,choice:p.text,...d};e&&l.push(e)}else if(n){const e={...p,response:p.text,...d};e&&c.push(e)}}const u={};o?u.statements=s:a?u.choices=l:n&&(u.responses=c);return u}(e,i,s);t.statements&&l.push(...t.statements),t.choices&&c.push(...t.choices),t.responses&&p.push(...t.responses)}else if(H.isOfBitType(n,d.highlightText)){const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const{trueFalse:r,...o}=e.bitContentProcessor(Pt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",{trueFalse:r,...o});const a=[];if(r)for(const e of r){const t={...e,isHighlighted:!1};t&&a.push(t)}const n={type:oe.highlight,texts:a,...o};return n}(e,i,s);t&&a.push(t)}else{const t=function(e,t,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const{trueFalse:r,...o}=e.bitContentProcessor(Pt.Chain,t,i);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",{trueFalse:r,...o});const a=[];if(r)for(const e of r){const t=e;t&&a.push(t)}const n={type:oe.select,options:a,...o};return n}(e,i,s);t&&a.push(t)}}(e,0,i,r,o,a)}var li=!1,ci=!0,di=!0,pi=!0,ui=!0,hi=new dt,mi=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:H.getBitConfig(d._error),bitType:d._error,textFormat:b.bitmarkText,DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:li,DEBUG_BIT_CONTENT:ci,DEBUG_BIT_TAGS:di,DEBUG_BODY:pi,DEBUG_FOOTER:ui,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this),state:{}}}buildBits(e){const t=[];let i=[];for(const r of e){if(!r)continue;const e=r.value;e?t.push(e):i=i.concat(r.errors??[])}return hi.buildBitmark({bits:t,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:i,textFormat:r,resourceType:o,bitLevel:a,isCommented:n}=e;if(!i||H.isOfBitType(i,d._error))return this.invalidBit();const s=H.getBitConfig(i);this.context.bitConfig=s,this.context.bitType=i,this.context.textFormat=r,this.context.resourceType=o;const l=H.isOfBitType(i,d.trueFalse1),c=H.isOfBitType(i,d.multipleChoice1),u=H.isOfBitType(i,d.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=this.squashUnwantedInlineBodyBits(t),t=Nt.validateBitTags(this.context,t);const{body:h,footer:m,cardSet:g,title:b,statement:f,statements:y,choices:k,responses:T,propertyStyleResources:v,resources:x,posterImage:_,internalComments:w,...C}=this.bitContentProcessor(Pt.Bit,s.tags,t);this.debugPrint("BIT TAGS",C),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",m);const A=function(e,t,i){if(i=i??[],H.isOfBitType(t,d.chapter)){let e;return i.length>0&&(e=i[i.length-1]),{title:e?.titleAst??[],titleString:e?.titleString??"",level:i.length>0?i.length-1:void 0}}return Array.isArray(i)?{title:i[1]?.titleAst??void 0,titleString:i[1]?.titleString??void 0,subtitle:i[2]?.titleAst??void 0,subtitleString:i[2]?.titleString??void 0}:{title:void 0,titleString:i??void 0,subtitle:void 0,subtitleString:void 0}}(this.context,i,b),B=Dt(this.context,i,0,g,f,y,k,T),S=function(e,t,i){const{bitType:r}=e,o=[],a=[],n=N.fromValue(t),s=H.getBitResourcesConfig(r,n),l=s.resourceAttachmentAllowed,c=s.getCountsMin(),d=s.getCountsMax();if(i)for(const t of i.reverse()){const i=t.__configKey;let r=c.get(i)??0,n=d.get(i)??0;r=Math.max(0,r-1),n===p.infinity?o.unshift(t):n>0?(o.unshift(t),n--):a.unshift(t),c.set(i,r),d.set(i,n),t.__invalid&&e.addWarning(`Resource type [&${t.type}] is not valid`)}if(!l&&t){const i=`Resource type [&${t}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(i)}else 0===o.length&&t&&e.addWarning(`Resource type [&${t}] is specified in the bit header, but no such resource is present`);return a.forEach(e=>{e.__excessResource=!0,o.push(e)}),o}(this.context,o,x),P=[...w??[],...B.internalComments??[]],I=this.buildBitLevelWarnings(),L=this.buildBitLevelErrors();I&&(this.parser.warnings=I),L&&(this.parser.errors=L);return{value:hi.buildBit({bitType:i,bitLevel:a,isCommented:n,textFormat:r,resourceType:o,...A,posterImage:_,statement:l?f:void 0,choices:c?k:void 0,responses:u?T:void 0,...C,...v,resources:S,...B,body:h,footer:m,internalComment:P,parser:this.parser})}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:hi.buildBit({bitType:H.getBitType(d._error),bitLevel:1,parser:this.parser})}}buildBitHeader(e,t,i){const r=Pe.unbreakscape(e,{format:b.plainText,location:ce.tag}),o=H.getBitType(r),a=H.isBitTypeCommented(r);H.isOfBitType(o,d._error)&&this.addError(`Invalid bit type: '${r}'`);const n=H.getBitConfig(o);t>H.bitLevelMax?(this.addWarning(`Bit level of ${t} too high, setting to max value of ${H.bitLevelMax}`),t=H.bitLevelMax):t<H.bitLevelMin&&(this.addWarning(`Bit level of ${t} too low, setting to min value of ${H.bitLevelMin}`),t=H.bitLevelMin);let s=b.fromValue(i.textFormat);i.textFormat&&!s&&this.addWarning(`Invalid text format '${i.textFormat}', defaulting to '${de.bitmarkPlusPlus}'`);const l=Ie.fromValue(i.textFormat);l&&(s=b.bitmarkText,this.addWarning(`${l} text format is deprecated. Bit will be parsed as '${de.bitmarkPlusPlus}'`)),s=s??n.textFormatDefault;const c=N.fromValue(i.resourceType);return i.resourceType&&!c&&this.addWarning(`Invalid resource type '${i.resourceType}', it will be ignored`),{bitType:o,bitLevel:t,textFormat:s??n.textFormatDefault,resourceType:c,isCommented:a}}buildTextAndResourceType(e,t){const i={},r=e=>{if(e){const t=Pe.unbreakscape(V.string(e.value),{format:b.plainText,location:ce.tag});e.type===St.TextFormat?i.textFormat=t:i.resourceType=t}};return r(e),r(t),i}resetParserState(){this.context.state={}}squashUnwantedInlineBodyBits(e){const t=[];if(!e)return t;const{textFormat:i}=this.context,r=i===b.bitmarkText,o=(e,t="")=>{const{chain:i,parser:r}=e;if(t+=r.text,i)for(const e of i)t=o(e,t);return t};let a=!1;for(const i of e){const{type:e,value:n}=i,s=n??"";let l=!1;if(a||(e===St.BodyText&&!r&&s&&s.trim()&&(a=!0),e===St.PlainTextDivider&&(a=!0,l=!0)),l)t.push({type:St.BodyText,value:"\n"});else if(a)if(e===St.BodyText)t.push({type:St.BodyTextPlain,value:n});else{const e=o(i);t.push({type:St.BodyTextPlain,value:e})}else t.push(i)}return t}bitContentProcessor(e,t,i){const r={};if(!i)return r;const{bitType:o,textFormat:a}=this.context;r.title=[],r.solutions=[],r.__solutionsAst=[],r.statements=[],r.choices=[],r.responses=[],r.propertyStyleResources={},r.resources=[],r.trueFalse=[],r.markConfig=[],r.extraProperties={},r.internalComments=[];let n=!1,s=!1;const l=[];let c=Pe.EMPTY_STRING,d=Pe.EMPTY_STRING,p=Pe.EMPTY_STRING,u=Pe.EMPTY_STRING;const h=e===Pt.Bit,m=e===Pt.Card,g=e===Pt.Chain,b=()=>{if(c){c=Nt.checkBodyPart(this.context,e,c);const t=Ot.buildBodyText(c,!1);l.push(t)}c=Pe.EMPTY_STRING};for(const o of i){const{type:i,value:a}=o;switch(i){case St.ItemLead:Jt(this.context,e,t,o,r);break;case St.Instruction:case St.Hint:case St.Anchor:case St.SampleSolution:qt(this.context,0,0,o,r);break;case St.Reference:ii(this.context,0,0,o,r,n),n=!0;break;case St.Title:ni(this.context,0,0,o,r);break;case St.Property:ti(this.context,e,t,o,r);break;case St.Gap:g||b(),Wt(this.context,e,t,o,r,l);break;case St.Mark:g||b(),Ht(this.context,e,t,o,r,l);break;case St.True:case St.False:g||b(),si(this.context,e,t,o,r,l);break;case St.Resource:oi(this.context,0,t,o,r);break;case St.CardSet:r.cardSet=a,s=!0;break;case St.BodyText:case St.CardText:s?d=Pe.concatenate(d,a):c=Pe.concatenate(c,a);break;case St.BodyTextPlain:s?u=Pe.concatenate(u,a):p=Pe.concatenate(p,a);break;case St.FooterDivider:s&&(d=Pe.concatenate(d,a)),s=!0}}b();const f=p?Ot.buildBodyText(p,!0):void 0;if(f&&l.push(f),r.itemLead){const e=r.itemLead.length;e>0&&(r.item=r.itemLead[0]),e>1&&(r.lead=r.itemLead[1]),e>2&&(r.pageNumber=r.itemLead[2]),e>3&&(r.marginNumber=r.itemLead[e-1])}return h?r.body=Ot.process(this.context,e,o,a,t,r,l,!1):m&&(r.cardBody=Ot.process(this.context,e,o,a,t,r,l,!0)),r.footer=$t.process(this.context,e,t,r,d,u),0===Object.keys(r.extraProperties).length&&delete r.extraProperties,0===r.title.length&&delete r.title,0===r.solutions.length&&delete r.solutions,0===r.statements.length&&delete r.statements,0===r.choices.length&&delete r.choices,0===r.responses.length&&delete r.responses,0===r.trueFalse.length&&delete r.trueFalse,0===r.markConfig.length&&delete r.markConfig,0===Object.keys(r.propertyStyleResources).length&&delete r.propertyStyleResources,0===r.resources.length&&delete r.resources,0===r.internalComments.length&&delete r.internalComments,r}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const i=[];let r=[];for(const o of e)t.includes(o.type)&&(r.length>0&&i.push(r),r=[]),r.push(o);return r.length>0&&i.push(r),i}addWarning(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalWarnings.push(r)}addError(e,t,i){const r={message:e,text:t?.parser.text??this.parserText(),location:t?.parser.location??this.parserLocation(),original:i?.parser??void 0};r.original||delete r.original,this.nonFatalErrors.push(r)}debugPrint(e,t){}},gi=class extends SyntaxError{constructor(e,t,i,r){super(e),this.expected=t,this.found=i,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let i=null;const r=e.find(e=>e.source===this.location.source);r&&(i=r.text.split(/\r\n|\n|\r/g));const o=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+a.line+":"+a.column;if(i){const e=this.location.end,r="".padEnd(a.line.toString().length," "),s=i[o.line-1],l=(o.line===e.line?e.column:s.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+r+" |\n"+a.line+" | "+s+"\n"+r+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+n}return t}static buildMessage(e,t){function i(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return r?e.replace(r,e=>"\\u{"+i(e)+"}"):e}function a(e){return o(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}function n(e){return o(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+i(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+i(e)))}const s={literal:e=>'"'+a(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let i=1;i<t.length;i++)t[i-1]!==t[i]&&(t[e]=t[i],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+(((c=t)?'"'+a(c)+'"':"end of input")+" found.");var c}};var bi=function e(t,i){const r={},o=(i=void 0!==i?i:{}).grammarSource,a={bitmark:tt,bit:function(){let e,t,i,o,a;e=qe,t=[],i=At();for(;i!==r;)t.push(i),i=At();if(i=ot(),i!==r){for(o=[],a=At();a!==r;)o.push(a),a=At();Me=e,e=i}else qe=e,e=r;return e},cardContent:function(){let e,t,i;e=qe,t=[],i=lt(),i===r&&(i=yt());for(;i!==r;)t.push(i),i=lt(),i===r&&(i=yt());return Me=e,t=ze(t),e=t,e}};let n=tt;const s="[.",l="]",c="[",d=":",p="&",u="$$$$",h="====",m="text",g="~~~~",b="footer",f="--",y="++",k="===",T="==",v="[@id",x="#",_="[▼",w="[►",C="[@",A="[%",B="[!",S="[?",P="[+",I="[-",L="[$",E="[_",V="[=",N="[&",R="^]",F="id:",O=".",D="\n",z="\r\n",q=/^[^\]]/,M=/^[^:\]]/,$=/^[^&:\]]/,j=/^[^\n\r\u2028\u2029]/,W=/^[ \t]/,J=/^[\r\u2028-\u2029]/,H=/^[ \t\n\r\u2028\u2029]/,G=Ue("[.",!1),U=Ke(["]"],!0,!1,!1),K=Ue("]",!1),Y=Ue("[",!1),Q=Ue(":",!1),X=Ue("&",!1),Z={type:"any"},ee=Ue("$$$$",!1),te=Ue("====",!1),ie=Ue("text",!1),re=Ue("~~~~",!1),oe=Ue("footer",!1),ae=Ue("--",!1),ne=Ue("++",!1),se=Ue("===",!1),le=Ue("==",!1),ce=Ue("[@id",!1),de=Ue("#",!1),pe=Ue("[▼",!1),ue=Ue("[►",!1),he=Ue("[@",!1),me=Ue("[%",!1),ge=Ue("[!",!1),be=Ue("[?",!1),fe=Ue("[+",!1),ye=Ue("[-",!1),ke=Ue("[$",!1),Te=Ue("[_",!1),ve=Ue("[=",!1),xe=Ue("[&",!1),_e=Ue("^]",!1),we=Ue("id:",!1),Ce=Ke([":","]"],!0,!1,!1),Ae=Ue(".",!1),Be=Ke(["&",":","]"],!0,!1,!1),Se=Ye("Character"),Pe=Ke(["\n","\r","\u2028","\u2029"],!0,!1,!1),Ie=Ye("Blank Line"),Le=Ke([" ","\t"],!1,!1,!1),Ee=Ye("Line Terminator"),Ve=Ue("\n",!1),Ne=Ue("\r\n",!1),Re=Ke(["\r",["\u2028","\u2029"]],!1,!1,!1),Fe=Ye("Whitespace, then Line Terminator"),Oe=Ye("whitespace"),De=Ke([" ","\t","\n","\r","\u2028","\u2029"],!1,!1,!1);function ze(e){return Nt.handleCardContent(e)}let qe=0|i.peg$currPos,Me=qe;const $e=[{line:1,column:1}];let je,We=qe,Je=i.peg$maxFailExpected||[],He=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in a))throw new Error("Can't start parsing from rule \""+i.startRule+'".');n=a[i.startRule]}function Ge(){return t.substring(Me,qe)}function Ue(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ke(e,t,i,r){return{type:"class",parts:e,inverted:t,ignoreCase:i,unicode:r}}function Ye(e){return{type:"other",description:e}}function Qe(e){let i,r=$e[e];if(r)return r;if(e>=$e.length)i=$e.length-1;else for(i=e;!$e[--i];);for(r=$e[i],r={line:r.line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return $e[e]=r,r}function Xe(e,t,i){const r=Qe(e),a=Qe(t),n={source:o,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return i&&o&&"function"==typeof o.offset&&(n.start=o.offset(n.start),n.end=o.offset(n.end)),n}function Ze(e){qe<We||(qe>We&&(We=qe,Je=[]),Je.push(e))}function et(e,t,i){return new gi(gi.buildMessage(e,t),e,t,i)}function tt(){let e;return e=function(){let e,i,o,a;e=qe,i=[],o=Lt();for(;o!==r;)i.push(o),o=Lt();return o=function(){let e,i,o,a;e=qe,i=qe,o=[],a=rt();for(;a!==r;)o.push(a),a=rt();return i=t.substring(i,qe),Me=e,i=function(e){return Nt.handleRawBit(e)}(i),e=i,e}(),a=function(){let e,t;e=[],t=it();for(;t!==r;)e.push(t),t=it();return e}(),Me=e,e=function(e,t){return Rt.buildBits([e,...t])}(o,a),e}(),e}function it(){let e,i,o,a;for(e=qe,i=[],o=At();o!==r;)i.push(o),o=At();return o=Bt(),o===r&&(o=null),a=function(){let e,i,o,a,n,c;if(e=qe,i=qe,o=qe,a=function(){let e,i,o,a;e=qe,t.substr(qe,2)===s?(i=s,qe+=2):(i=r,0===He&&Ze(G));if(i!==r){for(o=[],a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(U));a!==r;)o.push(a),a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(U));93===t.charCodeAt(qe)?(a=l,qe++):(a=r,0===He&&Ze(K)),a!==r?(Me=e,e=i):(qe=e,e=r)}else qe=e,e=r;return e}(),a!==r){for(n=[],c=rt();c!==r;)n.push(c),c=rt();a=[a,n],o=a}else qe=o,o=r;i=o!==r?t.substring(i,qe):o;i!==r&&(Me=e,d=i,i=Nt.handleRawBit(d));var d;return e=i,e}(),a!==r?(Me=e,e=a):(qe=e,e=r),e}function rt(){let e,t,i,o;if(e=qe,t=Bt(),t!==r?(i=qe,He++,o=at(),He--,o===r?i=void 0:(qe=i,i=r),i!==r?(t=[t,i],e=t):(qe=e,e=r)):(qe=e,e=r),e===r)if(e=[],t=wt(),t!==r)for(;t!==r;)e.push(t),t=wt();else e=r;return e}function ot(){let e,i,o;var a,n,s;return e=qe,i=at(),i!==r?(o=function(){let e,t,i;e=qe,t=[],i=ut(),i===r&&(i=mt(),i===r&&(i=bt(),i===r&&(i=lt(),i===r&&(i=pt()))));for(;i!==r;)t.push(i),i=ut(),i===r&&(i=mt(),i===r&&(i=bt(),i===r&&(i=lt(),i===r&&(i=pt()))));return Me=e,t=function(e){return Nt.handleBitContent(e)}(t),e=t,e}(),Me=e,a=i,n=o,e=Rt.buildBit(a,n)):(qe=e,e=r),e===r&&(e=qe,i=qe,o=function(){let e,i;He++,e=[],t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));for(;i!==r;)e.push(i),t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));return He--,e}(),i=t.substring(i,qe),Me=e,s=i,i=Rt.invalidBit(s),e=i),e}function at(){let e,i,o,a,n,s;var d,p,u;return e=qe,91===t.charCodeAt(qe)?(i=c,qe++):(i=r,0===He&&Ze(Y)),i!==r?(o=function(){let e,i,o;e=qe,i=[],46===t.charCodeAt(qe)?(o=O,qe++):(o=r,0===He&&Ze(Ae));if(o!==r)for(;o!==r;)i.push(o),46===t.charCodeAt(qe)?(o=O,qe++):(o=r,0===He&&Ze(Ae));else i=r;i!==r&&(Me=e,i=i.length);return e=i,e}(),o!==r?(a=xt(),n=function(){let e,t,i;e=qe,t=nt(),t===r&&(t=st());t===r&&(t=null);i=nt(),i===r&&(i=st());i===r&&(i=null);return Me=e,e=function(e,t){return Rt.buildTextAndResourceType(e,t)}(t,i),e}(),93===t.charCodeAt(qe)?(s=l,qe++):(s=r,0===He&&Ze(K)),s!==r?(Me=e,d=o,p=a,u=n,e=Rt.buildBitHeader(p,d,u)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r),e}function nt(){let e,i,o;var a;return e=qe,58===t.charCodeAt(qe)?(i=d,qe++):(i=r,0===He&&Ze(Q)),i!==r?(o=xt(),Me=e,a=o,e=Nt.handleTextFormat(a)):(qe=e,e=r),e}function st(){let e,i,o;var a;return e=qe,38===t.charCodeAt(qe)?(i=p,qe++):(i=r,0===He&&Ze(X)),i!==r?(o=xt(),Me=e,a=o,e=Nt.handleResourceType(a)):(qe=e,e=r),e}function lt(){let e,t,i,o,a;if(e=qe,t=qe,i=dt(),i!==r){for(o=[],a=ct();a!==r;)o.push(a),a=ct();i=[i,o],t=i}else qe=t,t=r;var n;return t!==r&&(Me=e,n=t,t=Nt.handleTagChain(n)),e=t,e}function ct(){let e,t;return e=qe,t=dt(),t!==r&&(Me=e),e=t,e}function dt(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,t.substr(qe,4)===v?(i=v,qe+=4):(i=r,0===He&&Ze(ce));i!==r?(o=_t(),o!==r?(a=function(){let e;93===t.charCodeAt(qe)?(e=l,qe++):(e=r,0===He&&Ze(K));return e}(),a!==r?(Me=e,n=o,e=Nt.handlePropertyTag("id",n)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,t.substr(qe,2)===C?(i=C,qe+=2):(i=r,0===He&&Ze(he));i!==r?(o=Tt(),o!==r?(a=_t(),a!==r?(n=vt(),n!==r?(Me=e,s=o,l=a,e=Nt.handlePropertyTag(s,l)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var s,l;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,91===t.charCodeAt(qe)?(i=c,qe++):(i=r,0===He&&Ze(Y));if(i!==r){if(o=[],35===t.charCodeAt(qe)?(a=x,qe++):(a=r,0===He&&Ze(de)),a!==r)for(;a!==r;)o.push(a),35===t.charCodeAt(qe)?(a=x,qe++):(a=r,0===He&&Ze(de));else o=r;o!==r?(a=kt(),n=vt(),n!==r?(Me=e,s=o,l=a,e=Nt.handleTag(St.Title,{level:s,title:l})):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;var s,l;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===_?(i=_,qe+=2):(i=r,0===He&&Ze(pe));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Anchor,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===w?(i=w,qe+=2):(i=r,0===He&&Ze(ue));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Reference,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===A?(i=A,qe+=2):(i=r,0===He&&Ze(me));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.ItemLead,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===B?(i=B,qe+=2):(i=r,0===He&&Ze(ge));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Instruction,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===S?(i=S,qe+=2):(i=r,0===He&&Ze(be));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Hint,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===E?(i=E,qe+=2):(i=r,0===He&&Ze(Te));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Gap,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===V?(i=V,qe+=2):(i=r,0===He&&Ze(ve));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.Mark,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===L?(i=L,qe+=2):(i=r,0===He&&Ze(ke));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.SampleSolution,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===P?(i=P,qe+=2):(i=r,0===He&&Ze(fe));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.True,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a;e=qe,t.substr(qe,2)===I?(i=I,qe+=2):(i=r,0===He&&Ze(ye));i!==r?(o=kt(),a=vt(),a!==r?(Me=e,n=o,e=Nt.handleTag(St.False,n)):(qe=e,e=r)):(qe=e,e=r);var n;return e}(),i===r&&(i=function(){let e,i,o,a,n;e=qe,t.substr(qe,2)===N?(i=N,qe+=2):(i=r,0===He&&Ze(xe));i!==r?(o=Tt(),o!==r?(a=_t(),a!==r?(n=vt(),n!==r?(Me=e,s=o,l=a,e=Nt.handleResourceTag(s,l)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r)):(qe=e,e=r);var s,l;return e}()))))))))))))),i!==r&&(Me=e,o=i,i=Nt.handleBitTag(o)),e=i,e}function pt(){let e,i;var o;return e=qe,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),i!==r&&(Me=e,o=i,i={type:St.BodyChar,value:o}),e=i,e}function ut(){let e;return e=function(){let e,t,i,o,a;e=qe,t=qe,i=Bt(),i!==r?(o=ht(),o!==r?(a=Pt(),a!==r?(i=[i,o,a],t=i):(qe=t,t=r)):(qe=t,t=r)):(qe=t,t=r);t!==r&&(Me=e,n=t,t=Nt.handleFooterDivider(n));var n;return e=t,e}(),e===r&&(e=function(){let e,i,o,a,n;e=qe,i=qe,o=Bt(),o!==r?(a=function(){let e,i,o,a,n,s;t.substr(qe,4)===u?(e=u,qe+=4):(e=r,0===He&&Ze(ee));if(e===r)if(e=qe,t.substr(qe,4)===h?(i=h,qe+=4):(i=r,0===He&&Ze(te)),i!==r){if(o=[],a=Lt(),a!==r)for(;a!==r;)o.push(a),a=Lt();else o=r;if(o!==r)if(t.substr(qe,4)===m?(a=m,qe+=4):(a=r,0===He&&Ze(ie)),a!==r){if(n=[],s=Lt(),s!==r)for(;s!==r;)n.push(s),s=Lt();else n=r;n!==r?(t.substr(qe,4)===h?(s=h,qe+=4):(s=r,0===He&&Ze(te)),s!==r?(i=[i,o,a,n,s],e=i):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;else qe=e,e=r}else qe=e,e=r;return e}(),a!==r?(n=Pt(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)):(qe=i,i=r)):(qe=i,i=r);i!==r&&(Me=e,s=i,i=Nt.handlePlainTextDivider(s));var s;return e=i,e}()),e}function ht(){let e,i,o,a,n,s;if(t.substr(qe,4)===g?(e=g,qe+=4):(e=r,0===He&&Ze(re)),e===r)if(e=qe,t.substr(qe,4)===h?(i=h,qe+=4):(i=r,0===He&&Ze(te)),i!==r){if(o=[],a=Lt(),a!==r)for(;a!==r;)o.push(a),a=Lt();else o=r;if(o!==r)if(t.substr(qe,6)===b?(a=b,qe+=6):(a=r,0===He&&Ze(oe)),a!==r){if(n=[],s=Lt(),s!==r)for(;s!==r;)n.push(s),s=Lt();else n=r;n!==r?(t.substr(qe,4)===h?(s=h,qe+=4):(s=r,0===He&&Ze(te)),s!==r?(i=[i,o,a,n,s],e=i):(qe=e,e=r)):(qe=e,e=r)}else qe=e,e=r;else qe=e,e=r}else qe=e,e=r;return e}function mt(){let e,i,o,a,n;if(e=qe,i=qe,o=function(){let e,i,o,a,n,s;e=qe,i=Bt(),i!==r?(o=qe,He++,a=qe,t.substr(qe,4)===h?(n=h,qe+=4):(n=r,0===He&&Ze(te)),n!==r?(s=Pt(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r),He--,a!==r?(qe=o,o=void 0):o=r,o!==r?(Me=e,e=void Nt.handleCardSetStart()):(qe=e,e=r)):(qe=e,e=r);return e}(),o!==r){for(a=[],n=gt();n!==r;)a.push(n),n=gt();n=function(){let e,t,i,o,a;e=qe,t=qe,i=ht(),i===r&&(i=null);o=qe,He++,a=Vt(),He--,a!==r?(qe=o,o=void 0):o=r;o!==r?(i=[i,o],t=i):(qe=t,t=r);t!==r&&(Me=e,t=void Nt.handleCardSetEnd());return e=t,e}(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)}else qe=i,i=r;var s;return i!==r&&(Me=e,s=i,i=Nt.handleCardSet(s[1].flat())),e=i,e}function gt(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,i=qe,t.substr(qe,4)===h?(o=h,qe+=4):(o=r,0===He&&Ze(te));o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r);i===r&&(i=qe,t.substr(qe,2)===f?(o=f,qe+=2):(o=r,0===He&&Ze(ae)),o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=qe,t.substr(qe,2)===y?(o=y,qe+=2):(o=r,0===He&&Ze(ne)),o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=function(){let e,i,o,a,n,s;e=qe,i=qe,He++,o=qe,a=ht(),a!==r?(n=Vt(),n!==r?(a=[a,n],o=a):(qe=o,o=r)):(qe=o,o=r);He--,o===r?i=void 0:(qe=i,i=r);if(i!==r){if(o=qe,a=qe,n=Ct(),s=Bt(),s!==r?(n=[n,s],a=n):(qe=a,a=r),a===r){if(a=qe,n=[],s=wt(),s!==r)for(;s!==r;)n.push(s),s=wt();else n=r;n!==r?(s=Et(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r)}o=a!==r?t.substring(o,qe):a,o!==r?(Me=e,l=o,e=Nt.handleCardLine(l)):(qe=e,e=r)}else qe=e,e=r;var l;return e}())));i!==r&&(Me=e,n=i,i=Nt.handleCardLineOrDivider(n,2));var n;return e=i,e}(),i!==r&&(Me=e,o=i,i=Nt.handleCards(o)),e=i,e}function bt(){let e,i,o,a,n;if(e=qe,i=qe,o=function(){let e,i,o,a,n,s;e=qe,i=Bt(),i!==r?(o=qe,He++,a=qe,t.substr(qe,3)===k?(n=k,qe+=3):(n=r,0===He&&Ze(se)),n!==r?(s=Pt(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r),He--,a!==r?(qe=o,o=void 0):o=r,o!==r?(Me=e,e=void Nt.handleCardSetStart()):(qe=e,e=r)):(qe=e,e=r);return e}(),o!==r){for(a=[],n=ft();n!==r;)a.push(n),n=ft();n=function(){let e,t,i,o,a;e=qe,t=qe,i=ht(),i===r&&(i=null);o=qe,He++,a=Vt(),He--,a!==r?(qe=o,o=void 0):o=r;o!==r?(i=[i,o],t=i):(qe=t,t=r);t!==r&&(Me=e,t=void Nt.handleCardSetEnd());return e=t,e}(),n!==r?(o=[o,a,n],i=o):(qe=i,i=r)}else qe=i,i=r;var s;return i!==r&&(Me=e,s=i,i=Nt.handleCardSet(s[1].flat())),e=i,e}function ft(){let e,i;var o;return e=qe,i=function(){let e,i,o,a;e=qe,i=qe,t.substr(qe,3)===k?(o=k,qe+=3):(o=r,0===He&&Ze(se));o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r);i===r&&(i=qe,t.substr(qe,2)===T?(o=T,qe+=2):(o=r,0===He&&Ze(le)),o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=qe,t.substr(qe,2)===f?(o=f,qe+=2):(o=r,0===He&&Ze(ae)),o!==r?(a=Pt(),a===r&&(a=Vt()),a!==r?(o=[o,a],i=o):(qe=i,i=r)):(qe=i,i=r),i===r&&(i=function(){let e,i,o,a,n,s;e=qe,i=qe,He++,o=qe,a=ht(),a!==r?(n=Vt(),n!==r?(a=[a,n],o=a):(qe=o,o=r)):(qe=o,o=r);He--,o===r?i=void 0:(qe=i,i=r);if(i!==r){if(o=qe,a=qe,n=Ct(),s=Bt(),s!==r?(n=[n,s],a=n):(qe=a,a=r),a===r){if(a=qe,n=[],s=wt(),s!==r)for(;s!==r;)n.push(s),s=wt();else n=r;n!==r?(s=Et(),s!==r?(n=[n,s],a=n):(qe=a,a=r)):(qe=a,a=r)}o=a!==r?t.substring(o,qe):a,o!==r?(Me=e,l=o,e=Nt.handleCardLine(l)):(qe=e,e=r)}else qe=e,e=r;var l;return e}())));i!==r&&(Me=e,n=i,i=Nt.handleCardLineOrDivider(n,1));var n;return e=i,e}(),i!==r&&(Me=e,o=i,i=Nt.handleCards(o)),e=i,e}function yt(){let e,i;var o;return e=qe,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),i!==r&&(Me=e,o=i,i={type:St.CardChar,value:o}),e=i,e}function kt(){let e,i,o,a;for(e=qe,i=qe,o=[],t.substr(qe,2)===R?(a=R,qe+=2):(a=r,0===He&&Ze(_e)),a===r&&(a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(U)));a!==r;)o.push(a),t.substr(qe,2)===R?(a=R,qe+=2):(a=r,0===He&&Ze(_e)),a===r&&(a=t.charAt(qe),q.test(a)?qe++:(a=r,0===He&&Ze(U)));return i=t.substring(i,qe),Me=e,e=i,e}function Tt(){let e,i,o,a,n;if(e=qe,i=qe,He++,t.substr(qe,3)===F?(o=F,qe+=3):(o=r,0===He&&Ze(we)),He--,o===r?i=void 0:(qe=i,i=r),i!==r){for(o=qe,a=[],n=t.charAt(qe),M.test(n)?qe++:(n=r,0===He&&Ze(Ce));n!==r;)a.push(n),n=t.charAt(qe),M.test(n)?qe++:(n=r,0===He&&Ze(Ce));o=t.substring(o,qe),Me=e,e=(s=o)?s.trim():""}else qe=e,e=r;var s;return e}function vt(){let e,i,o;if(93===t.charCodeAt(qe)?(e=l,qe++):(e=r,0===He&&Ze(K)),e===r){for(e=qe,i=[],o=Lt();o!==r;)i.push(o),o=Lt();o=function(){let e,i;e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z));He--,i===r?e=void 0:(qe=e,e=r);return e}(),o!==r?(i=[i,o],e=i):(qe=e,e=r)}return e}function xt(){let e,i,o,a;for(e=qe,i=qe,o=[],a=t.charAt(qe),$.test(a)?qe++:(a=r,0===He&&Ze(Be));a!==r;)o.push(a),a=t.charAt(qe),$.test(a)?qe++:(a=r,0===He&&Ze(Be));var n;return i=t.substring(i,qe),Me=e,i=(n=i)?n.trim():null,e=i,e}function _t(){let e,i,o;var a;return e=qe,58===t.charCodeAt(qe)?(i=d,qe++):(i=r,0===He&&Ze(Q)),i!==r?(o=kt(),Me=e,e=(a=o)?a.trim():""):(qe=e,e=r),e===r&&(e=qe,i="",Me=e,i=!0,e=i),e}function wt(){let e,i;return He++,e=t.charAt(qe),j.test(e)?qe++:(e=r,0===He&&Ze(Pe)),He--,e===r&&(i=r,0===He&&Ze(Se)),e}function Ct(){let e,t;for(He++,e=[],t=wt();t!==r;)e.push(t),t=wt();return He--,e}function At(){let e,i,o;for(He++,e=qe,i=[],o=t.charAt(qe),W.test(o)?qe++:(o=r,0===He&&Ze(Le));o!==r;)i.push(o),o=t.charAt(qe),W.test(o)?qe++:(o=r,0===He&&Ze(Le));return o=Bt(),o!==r?(i=[i,o],e=i):(qe=e,e=r),He--,e===r&&(i=r,0===He&&Ze(Ie)),e}function Bt(){let e,i;return He++,10===t.charCodeAt(qe)?(e=D,qe++):(e=r,0===He&&Ze(Ve)),e===r&&(t.substr(qe,2)===z?(e=z,qe+=2):(e=r,0===He&&Ze(Ne)),e===r&&(e=t.charAt(qe),J.test(e)?qe++:(e=r,0===He&&Ze(Re)))),He--,e===r&&(i=r,0===He&&Ze(Ee)),e}function Pt(){let e,i,o;for(He++,e=qe,i=[],o=t.charAt(qe),W.test(o)?qe++:(o=r,0===He&&Ze(Le));o!==r;)i.push(o),o=t.charAt(qe),W.test(o)?qe++:(o=r,0===He&&Ze(Le));return o=Bt(),o!==r?(i=[i,o],e=i):(qe=e,e=r),He--,e===r&&(i=r,0===He&&Ze(Fe)),e}function Lt(){let e,i;return He++,e=t.charAt(qe),H.test(e)?qe++:(e=r,0===He&&Ze(De)),He--,e===r&&(i=r,0===He&&Ze(Oe)),e}function Et(){let e,i;return e=Bt(),e===r&&(e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),He--,i===r?e=void 0:(qe=e,e=r)),e}function Vt(){let e,i;return e=Pt(),e===r&&(e=qe,He++,t.length>qe?(i=t.charAt(qe),qe++):(i=r,0===He&&Ze(Z)),He--,i===r?e=void 0:(qe=e,e=r)),e}const Nt=new It({parse:e,parserText:Ge,parserLocation:Ft}),Rt=new mi({parse:e,parserText:Ge,parserLocation:Ft});function Ft(){const e=Xe(Me,qe);return e?(delete e.source,e):e}function Xe(e,t,i){var r=Qe(e),a=Qe(t),n={source:o,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:a.line,column:a.column}};return o&&"function"==typeof o.offset&&(n.start=o.offset(n.start),n.end=o.offset(n.end)),n}je=n();const Ot=je!==r&&qe===t.length;function Dt(){throw je!==r&&qe<t.length&&Ze({type:"end"}),et(Je,We<t.length?function(e=qe){const i=t.codePointAt(e);return void 0===i?"":String.fromCodePoint(i)}(We):null,We<t.length?Xe(We,We+1):Xe(We,We))}return i.peg$library?{peg$result:je,peg$currPos:qe,peg$FAILED:r,peg$maxFailExpected:Je,peg$maxFailPos:We,peg$success:Ot,peg$throw:Ot?void 0:Dt}:Ot?je:void Dt()},fi=class{constructor(){l(this,"jsonParser",new Ct)}toAst(e,t){return bi(e)}},yi=(0,ut.superenum)({string:"string",file:"file"}),ki=(0,ut.superenum)({bitmark:"bitmark",json:"json",ast:"ast"}),Ti=class{constructor(){l(this,"ast",new le),l(this,"jsonParser",new Ct),l(this,"bitmarkParser",new fi),l(this,"textParser",new tt),l(this,"textGenerator",new Ge),l(this,"jsonStringifyPrettify",(e,t,i)=>{const r=!0===t.prettify?2:t.prettify||void 0;return i||!0===t.stringify||void 0!==r?JSON.stringify(e,null,r):e})}version(){return ee.appVersion.full}info(e){const t=Object.assign({},e),i=new Tt;let r;const o=!t.outputFormat||t.outputFormat===xt.text,a=t.outputFormat===xt.json,n=t.type===_t.all,s=t.type===_t.deprecated,l=n||!s,c=n||s;if(t.type===_t.bit){const e=i.getSupportedBitConfigs().filter(e=>{if(!t.bit)return!0;return H.getBitType(t.bit)===e.bitType});r=o?e.map(e=>e.toString({includeChains:!0,includeConfigs:!0})).join("\n\n--------------\n\n"):e}else{const e=i.getSupportedBits({includeNonDeprecated:l,includeDeprecated:c}).filter(e=>{if(!t.bit)return!0;const i=H.getBitType(t.bit);return e.name===i||void 0});r=o?this.supportedBitsAsString(e):e}if(a){const e=!0===t.prettify?2:t.prettify||void 0;r=JSON.stringify(r,null,e)}return r}generateConfig(e){const t=Object.assign({},e);(new ConfigBuilder).build(t)}convert(e,t){let i;const r=Object.assign({},t),o=Object.assign({},r.jsonOptions),a=r.outputFormat,n=a===ki.bitmark,s=a===ki.json,l=a===ki.ast,c=vt.peggy;let d=e;const p="string"==typeof e;if(ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==yi.file||ee.isNode&&p&&fs.existsSync(d)&&(d=fs.readFileSync(d,{encoding:"utf8"}));let u=this.ast.preprocessAst(d);const h=!!u;h||(u=this.jsonParser.toAst(d));const m=!!u?.bits,g=e=>{i=this.bitmarkParser.toAst(e,{parserType:c})},b=e=>{if(c===vt.peggy)if(u=this.bitmarkParser.toAst(e,{parserType:c}),r.outputFile){new JsonFileGenerator(r.outputFile,r).generateSync(u)}else{const e=new kt(r).generateSync(u);i=this.jsonStringifyPrettify(e,o)}},f=e=>{if(r.outputFile){new BitmarkFileGenerator(r.outputFile,r).generateSync(e)}else{const t=new bt(r);i=t.generateSync(e)}},y=e=>{i=this.jsonStringifyPrettify(e,o)},k=e=>{if(r.outputFile){new JsonFileGenerator(r.outputFile,r).generateSync(e)}else{const t=new kt(r).generateSync(e);i=this.jsonStringifyPrettify(t,o)}},T=e=>{i=this.jsonStringifyPrettify(e,o)};return p&&!m&&!h?n?(g(d),f(i)):l?g(d):b(d):h?l?y(u):s?k(u):f(u):m?s?k(u):l?T(u):(e=>{if(r.outputFile)new BitmarkFileGenerator(r.outputFile,r).generateSync(e);else{const t=new bt(r);i=t.generateSync(e)}})(u):i="",i}upgrade(e,t){let i;const r=Object.assign({},t),o=Object.assign({},r.jsonOptions),a=r.bitmarkParserType;let n=e;const s="string"==typeof e;if(ee.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");r.inputFormat&&r.inputFormat!==yi.file||ee.isNode&&s&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));let l=this.jsonParser.toAst(n);const c=!!l?.bits,d=e=>{if(r.outputFile){new JsonFileGenerator(r.outputFile,r).generateSync(e)}else{const t=new kt(r).generateSync(e);i=this.jsonStringifyPrettify(t,o)}};if(s&&!c)(e=>{const t=this.bitmarkParser.toAst(e,{parserType:a});if(r.outputFile){new BitmarkFileGenerator(r.outputFile,r).generateSync(t)}else{const e=new bt(r);i=e.generateSync(t)}})(n);else{if(!c)return;d(l)}return i}createAst(e,t){let i,r=e;const o="string"==typeof e,a=Object.assign({},t);a.inputFormat&&a.inputFormat!==yi.file||ee.isNode&&o&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let n=this.ast.preprocessAst(r);const s=!!n;s||(n=this.jsonParser.toAst(r));const l=!!n?.bits;return i=o&&!l&&!s?this.bitmarkParser.toAst(r):l?n:{},i}convertText(e,t){let i,r;const o=Object.assign({},t),a=Object.assign({},o.fileOptions),n=Object.assign({},o.jsonOptions),s=TextFormat.fromValue(o.textFormat)??TextFormat.bitmarkText,l=o.textLocation??TextLocation.body;let c=e;const d="string"==typeof e;if(ee.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");o.inputFormat&&o.inputFormat!==yi.file||ee.isNode&&d&&fs.existsSync(c)&&(c=fs.readFileSync(c,{encoding:"utf8"}));const p=this.textParser.preprocessAst(c),u=!!p;if(r=u?this.textGenerator.generateSync(p,s,l):this.textParser.toAst(c,{format:s,location:TextLocation.body}),o.outputFile){const e=o.outputFile.toString();let t=r;u||(t=this.jsonStringifyPrettify(r,n,!0));const i=a.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,t,{flag:i})}else i=u?r:this.jsonStringifyPrettify(r,n);return i}breakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),o=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,a=i.textLocation??TextLocation.body;let n=e;const s="string"==typeof e;if(ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==yi.file||ee.isNode&&s&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));const l=Breakscape.breakscape(n,{format:o,location:a});if(!i.outputFile)return l;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const i=Object.assign({},t),r=Object.assign({},i.fileOptions),o=TextFormat.fromValue(i.textFormat)??TextFormat.bitmarkText,a=i.textLocation??TextLocation.body;let n=e;const s="string"==typeof e;if(ee.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");i.inputFormat&&i.inputFormat!==yi.file||ee.isNode&&s&&fs.existsSync(n)&&(n=fs.readFileSync(n,{encoding:"utf8"}));const l=Breakscape.unbreakscape(n,{format:o,location:a});if(!i.outputFile)return l;{const e=i.outputFile.toString(),t=r.append?"a":"w";fs.ensureDirSync(path.dirname(e)),fs.writeFileSync(e,l,{flag:t})}}supportedBitsAsString(e){let t="";for(const i of e)t+=`${i.name} (since: ${i.since}`,i.deprecated&&(t+=`, deprecated: ${i.deprecated}`),t+=")\n";return t}},vi=class{constructor(e){l(this,"generator"),l(this,"writer"),this.writer=new pt,this.generator=new yt(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()}};re()}},t={};function i(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,i),a.exports}return i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(922)})());