@pie-element/mc-populated-blank 0.3.0-next.7 → 0.3.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/delivery/index.js +145 -127
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/index.d.ts +7 -0
- package/dist/delivery/index.js +36 -7
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +6 -6
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["t","e"],"sources":["../../../../../lib-svelte/delivery-events/dist/index2.js","../../../../../lib-svelte/delivery-events/dist/index3.js","../../../src/delivery/computeAudioMode.ts","../../../src/delivery/AudioPlayer.svelte","../../../src/delivery/ClozeMarker.svelte","../../../src/delivery/ChoiceRow.svelte","../../../src/delivery/computeChoiceCorrectness.ts","../../../src/delivery/computeLayoutProfile.ts","../../../src/delivery/computeLayoutStyle.ts","../../../src/delivery/computeDisplayState.ts","../../../src/delivery/variant-css-map.ts","../../../src/delivery/McPopulatedBlank.svelte","../../../src/delivery/index.ts"],"sourcesContent":["//#region ../../shared/player-events/dist/index.js\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","import { SessionChangedEvent as e } from \"./index2.js\";\n//#region src/session-bridge.ts\nvar t = (e) => {\n\tlet t = e;\n\treturn t ? typeof t.onSessionChange == \"function\" || typeof t.onAudioStarted == \"function\" || typeof t.onAudioEnded == \"function\" : !1;\n};\nfunction n(e, n = {}) {\n\tlet r = n.hostPredicate ?? t, i = e;\n\tfor (; i;) {\n\t\tif (r(i)) return i;\n\t\ti = i.parentElement;\n\t}\n\tif (typeof document < \"u\" && n.fallbackSelector) {\n\t\tlet e = document.querySelector(n.fallbackSelector);\n\t\tif (r(e)) return e;\n\t}\n\treturn null;\n}\nfunction r({ sourceEl: t, fallbackSelector: r, component: i, complete: a, session: o }) {\n\tlet s = n(t, { fallbackSelector: r });\n\treturn s ? typeof s.onSessionChange == \"function\" ? (s.onSessionChange(o), s) : (s.dispatchEvent(new e(i, a)), s) : null;\n}\n//#endregion\nexport { r as forwardSessionChange, n as resolveDeliveryHost };\n","export type AudioMode = 'feature-button' | 'controls' | 'error' | 'none';\n\nexport function computeAudioMode(params: {\n hasAudio: boolean;\n audioUrl: string | undefined;\n useFeatureButtonAudio: boolean;\n}): AudioMode {\n if (!params.hasAudio) return 'none';\n if (!params.audioUrl) return 'error';\n return params.useFeatureButtonAudio ? 'feature-button' : 'controls';\n}\n","<script lang=\"ts\">\nimport { computeAudioMode } from './computeAudioMode';\n\ninterface AudioButtonSkin {\n silentUrl: string;\n playingUrl: string;\n}\n\ninterface UiText {\n clickToEnableAutoplay: string;\n audioResourceUnavailable: string;\n listenSilentAlt?: string;\n listenPlayingAlt?: string;\n listenSilentAltEs?: string;\n listenPlayingAltEs?: string;\n}\n\nconst AUDIO_PLAYBACK = {\n IDLE: 'idle',\n PLAYING: 'playing',\n BLOCKED: 'blocked',\n PAUSED: 'paused',\n} as const;\ntype AudioPlaybackState = (typeof AUDIO_PLAYBACK)[keyof typeof AUDIO_PLAYBACK];\n\nlet {\n hasAudio = false,\n audioUrl,\n useFeatureButtonAudio = false,\n autoplayEnabled = false,\n featureAudioSkin,\n uiText,\n locale = '',\n onaudiostarted,\n onaudioended,\n}: {\n hasAudio?: boolean;\n audioUrl?: string;\n useFeatureButtonAudio?: boolean;\n autoplayEnabled?: boolean;\n featureAudioSkin: AudioButtonSkin;\n uiText: UiText;\n locale?: string;\n onaudiostarted?: () => void;\n onaudioended?: () => void;\n} = $props();\n\nlet audioEl = $state<HTMLAudioElement | null>(null);\nlet featureAudioButtonEl = $state<HTMLButtonElement | null>(null);\nlet autoplayEnableButtonEl = $state<HTMLButtonElement | null>(null);\nlet audioPlaybackState = $state<AudioPlaybackState>(AUDIO_PLAYBACK.IDLE);\n\nconst audioMode = $derived(computeAudioMode({ hasAudio, audioUrl, useFeatureButtonAudio }));\nconst isMediaPlaying = $derived(audioPlaybackState === AUDIO_PLAYBACK.PLAYING);\nconst autoPlayPromptOpen = $derived(audioPlaybackState === AUDIO_PLAYBACK.BLOCKED);\nconst audioErrorMessage = $derived(audioMode === 'error' ? uiText.audioResourceUnavailable : '');\n\n// Reset playback state when audioUrl changes so autoplay re-fires for a new question.\n$effect(() => {\n audioUrl;\n audioPlaybackState = AUDIO_PLAYBACK.IDLE;\n});\n\nfunction playFeatureAudio() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().catch(() => {});\n }\n}\n\nfunction handleEnableAutoplayClick() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().finally(() => {\n if (audioPlaybackState === AUDIO_PLAYBACK.BLOCKED) audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n });\n }\n}\n\nfunction useListener<K extends keyof HTMLElementEventMap>(\n getEl: () => EventTarget | null | undefined,\n event: K,\n handler: (e: HTMLElementEventMap[K]) => void\n) {\n $effect(() => {\n const el = getEl();\n if (!el) return;\n el.addEventListener(event, handler as EventListener);\n return () => el.removeEventListener(event, handler as EventListener);\n });\n}\n\nuseListener(\n () => audioEl,\n 'playing',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PLAYING;\n onaudiostarted?.();\n }\n);\n\nuseListener(\n () => audioEl,\n 'ended',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n onaudioended?.();\n }\n);\n\nuseListener(\n () => featureAudioButtonEl,\n 'click',\n () => playFeatureAudio()\n);\nuseListener(\n () => autoplayEnableButtonEl,\n 'click',\n () => handleEnableAutoplayClick()\n);\n\n$effect(() => {\n if (!autoplayEnabled || audioMode === 'none' || audioMode === 'error') return;\n if (audioPlaybackState !== AUDIO_PLAYBACK.IDLE) return;\n if (audioEl && audioUrl) {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n audioEl.play().catch(() => {\n audioPlaybackState = AUDIO_PLAYBACK.BLOCKED;\n });\n }\n});\n\nfunction speechButtonLabel(loc = '') {\n return loc.toLowerCase().startsWith('es') ? 'Escuchar' : 'Listen';\n}\n\nfunction silentAlt(loc = '') {\n return loc.toLowerCase().startsWith('es')\n ? (uiText.listenSilentAltEs ?? 'Escuchar. Repetir las instrucciones.')\n : (uiText.listenSilentAlt ?? 'Repeat instructions');\n}\n\nfunction playingAlt(loc = '') {\n return loc.toLowerCase().startsWith('es')\n ? (uiText.listenPlayingAltEs ?? 'Escuchar. Estas son las instrucciones.')\n : (uiText.listenPlayingAlt ?? 'Instructions are playing');\n}\n</script>\n\n{#if audioMode !== 'none'}\n <div class=\"mb-4 audio-container pie-audio-container\">\n {#if audioMode === 'feature-button'}\n <audio\n bind:this={audioEl}\n class=\"sr-only pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n aria-hidden=\"true\"\n tabindex=\"-1\"\n ></audio>\n <button\n bind:this={featureAudioButtonEl}\n class=\"listen-button pie-listen-button rli-feature-audio\"\n type=\"button\"\n aria-label={speechButtonLabel(locale)}\n >\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? '' : 'listen-active'}`}\n src={featureAudioSkin.silentUrl}\n alt={silentAlt(locale)}\n />\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? 'listen-active' : ''}`}\n src={featureAudioSkin.playingUrl}\n alt={playingAlt(locale)}\n />\n </button>\n {:else if audioMode === 'controls'}\n <audio\n bind:this={audioEl}\n controls\n class=\"w-full max-w-md pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n >\n <track kind=\"captions\" />\n </audio>\n {#if autoPlayPromptOpen}\n <button\n bind:this={autoplayEnableButtonEl}\n class=\"mt-2 text-sm underline pie-audio-autoplay-enable\"\n type=\"button\"\n >\n {uiText.clickToEnableAutoplay}\n </button>\n {/if}\n {:else if audioMode === 'error'}\n <p class=\"text-sm text-red-700 pie-audio-error\" role=\"alert\">{audioErrorMessage}</p>\n {/if}\n </div>\n{/if}\n\n<style>\n .listen-button {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n border: 0;\n padding: 0;\n background-color: transparent;\n cursor: pointer;\n z-index: 1;\n }\n\n .listen-button:hover {\n background-color: #e2f1fe;\n }\n\n .listen-feature-icon {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n object-fit: contain;\n display: none;\n }\n\n .listen-feature-icon.listen-active {\n display: block;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\ninterface DisplayChoice {\n imageUrl?: string;\n imageAlt?: string;\n labelHtml?: string;\n}\n\nlet {\n choiceMode = 'text',\n displayChoice = undefined,\n displayChoiceLabelHtml = '',\n isStandalone = false,\n blankWidth,\n blankBorderWidth,\n ariaLabel,\n}: {\n choiceMode?: 'text' | 'image';\n displayChoice?: DisplayChoice;\n displayChoiceLabelHtml?: string;\n isStandalone?: boolean;\n blankWidth: string;\n blankBorderWidth: string;\n ariaLabel: string;\n} = $props();\n</script>\n\n<span\n class={`inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline cloze-marker pie-blank-slot ${isStandalone ? 'cloze-marker-standalone pie-blank-slot-standalone' : ''}`}\n style={`width:${blankWidth};border-bottom-width:${blankBorderWidth};`}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-label={ariaLabel}\n>\n {#if choiceMode === 'image' && displayChoice?.imageUrl}\n <img\n src={displayChoice.imageUrl}\n alt={displayChoice.imageAlt || 'Selected answer image'}\n class=\"w-auto object-contain pie-blank-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else if displayChoiceLabelHtml}\n <span class=\"cloze-marker-value pie-blank-value\">{@html displayChoiceLabelHtml}</span>\n {:else}\n <span class=\"cloze-marker-empty\">\n <span aria-hidden=\"true\"> </span>\n <span class=\"sr-only\">(blank)</span>\n </span>\n {/if}\n</span>\n\n<style>\n .cloze-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n vertical-align: baseline;\n }\n\n .cloze-marker:focus-within {\n outline: 2px solid var(--mpb-focus-ring, #1565c0);\n outline-offset: 2px;\n }\n\n .cloze-marker-standalone {\n width: var(--mpb-blank-standalone-width, 7rem);\n }\n\n .cloze-marker-empty {\n display: inline-block;\n min-width: 4ch;\n }\n\n .cloze-marker-value {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n .cloze-marker-value :global(p) {\n margin: 0;\n }\n\n /* Same 150x150 content-element constraint as ChoiceRow.svelte's .choice-html\n img — the selected choice's raw labelHtml can carry an embedded <img> here\n too, regardless of customType. See CONTOOL-3159. */\n .cloze-marker-value :global(img) {\n width: 150px;\n height: 150px;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\ninterface Choice {\n id: string;\n labelHtml?: string;\n imageUrl?: string;\n imageAlt?: string;\n}\n\nlet {\n choice,\n choiceMode = 'text',\n isHorizontal = false,\n isSelected = false,\n isDisabled = false,\n correctness = undefined,\n isEvaluateMode = false,\n instanceId,\n radioGroupName,\n}: {\n choice: Choice;\n choiceMode?: 'text' | 'image';\n isHorizontal?: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n correctness?: 'correct' | 'incorrect' | undefined;\n isEvaluateMode?: boolean;\n instanceId: string;\n radioGroupName: string;\n} = $props();\n</script>\n\n<div\n class={`flex items-start choice-row pie-choice ${isHorizontal ? 'choice-row-horizontal pie-choice-horizontal' : ''} ${isSelected ? 'is-selected pie-choice-selected' : ''} ${correctness ? `choice-${correctness} pie-choice-${correctness}` : ''}`}\n style=\"gap:var(--mpb-choice-row-gap, 0.5rem);\"\n>\n {#if isHorizontal}\n <label\n for={`${instanceId}-opt-${choice.id}`}\n class=\"cursor-pointer choice-tile text-center pie-choice-tile\"\n >\n <span class=\"choice-tile-content pie-choice-tile-content\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || `Choice ${choice.id}`}\n class=\"object-contain pie-choice-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </span>\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-bottom pie-choice-radio pie-choice-radio-bottom\"\n />\n </label>\n {:else}\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-inline pie-choice-radio pie-choice-radio-inline\"\n />\n <label for={`${instanceId}-opt-${choice.id}`} class=\"cursor-pointer flex-1 pie-choice-label-wrap\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || `Choice ${choice.id}`}\n class=\"object-contain pie-choice-image\"\n style=\"max-height:var(--mpb-choice-image-max-height, 5rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </label>\n {/if}\n {#if isEvaluateMode && correctness}\n <span\n class={`pie-choice-feedback-badge ${correctness === 'correct' ? 'pie-choice-feedback-correct' : 'pie-choice-feedback-incorrect'}`}\n aria-hidden=\"true\"\n >\n {correctness === 'correct' ? '✓' : '✕'}\n </span>\n {/if}\n</div>\n\n<style>\n .choice-row-horizontal {\n flex-direction: column;\n align-items: center;\n width: min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n gap: 0;\n }\n\n .choice-tile {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n padding: 0.8rem 0.65rem 0.5rem;\n border-radius: 8px;\n background: transparent;\n transition: background-color 120ms ease-in-out;\n }\n\n .choice-tile-content {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--mpb-choice-content-min-height, 7.5rem);\n }\n\n .choice-row-horizontal:hover .choice-tile {\n background: var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));\n }\n\n .pie-choice-horizontal:not(.is-selected):not(:hover) .pie-choice-tile {\n background: transparent;\n }\n\n .choice-row-horizontal.is-selected .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .choice-row-horizontal.is-selected:hover .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .pie-choice:not(.pie-choice-horizontal):hover .pie-choice-label-wrap {\n background: var(--pie-background-dark, #ecedf1);\n }\n\n .pie-choice:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap {\n background: transparent;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n border-radius: 6px;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected:hover .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n }\n\n .pie-choice.choice-correct {\n border-left: 3px solid var(--pie-correct-tertiary, #0ea449);\n }\n\n .pie-choice.choice-incorrect {\n border-left: 3px solid var(--pie-incorrect-icon, #bf0d00);\n }\n\n .pie-choice-horizontal.choice-correct .choice-tile {\n background: var(--pie-correct-secondary, #e8f5e9);\n }\n\n .pie-choice-horizontal.choice-incorrect .choice-tile {\n background: var(--pie-incorrect-secondary, #ffebee);\n }\n\n .pie-choice-feedback-badge {\n margin-left: auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.1rem;\n height: 1.1rem;\n border-radius: 9999px;\n font-size: 0.72rem;\n line-height: 1;\n font-weight: 700;\n color: var(--pie-white, #ffffff);\n }\n\n .pie-choice-feedback-correct {\n background: var(--pie-correct-icon, #087d38);\n }\n\n .pie-choice-feedback-incorrect {\n background: var(--pie-incorrect-icon, #bf0d00);\n }\n\n .choice-row-horizontal :global(p) {\n margin: 0;\n text-align: center;\n }\n\n .choice-html :global(p) {\n margin: 0;\n }\n\n .choice-html {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n /* Choices carrying raw <img> markup in labelHtml (rather than the dedicated\n imageUrl/imageAlt fields) render unconstrained at their authored size\n otherwise — 3rd-party/CQT-sourced content is typically authored well above\n the platform's 150x150 content-element spec. Applies regardless of\n customType, unlike the r1-CQT-specific cqt-css overlays. See CONTOOL-3159. */\n .choice-html :global(img) {\n width: 150px;\n height: 150px;\n }\n\n .choice-radio-bottom {\n margin-top: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);\n padding: var(--mpb-choice-radio-padding, 0px);\n }\n\n .choice-radio-inline {\n margin-top: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);\n }\n</style>\n","export interface ChoiceCorrectnessParams {\n isEvaluateMode: boolean;\n correctChoiceId: string;\n selectedId: string;\n showCorrectAnswer: boolean;\n}\n\n/**\n * Computes which choice ids should display a correctness badge and what kind.\n *\n * Reveal mode (showCorrectAnswer=true) shows only the canonical correct answer —\n * the student's wrong selection is deliberately suppressed so the UI only\n * highlights what to remember, not what to regret.\n *\n * Unanswered-in-evaluate (selectedId='') treats the correct choice as missed\n * (incorrect badge) rather than triggering the two-badge wrong-answer path.\n */\nexport function computeChoiceCorrectness(\n params: ChoiceCorrectnessParams\n): Map<string, 'correct' | 'incorrect'> {\n const map = new Map<string, 'correct' | 'incorrect'>();\n const { isEvaluateMode, correctChoiceId, selectedId, showCorrectAnswer } = params;\n\n if (!isEvaluateMode || !correctChoiceId) {\n return map;\n }\n if (showCorrectAnswer) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n if (!selectedId) {\n map.set(correctChoiceId, 'incorrect');\n return map;\n }\n if (selectedId === correctChoiceId) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n map.set(selectedId, 'incorrect');\n map.set(correctChoiceId, 'incorrect');\n return map;\n}\n","const BLANK_TOKEN = '{{blank}}';\n\nexport interface LayoutProfileParams {\n interactionMode?: string;\n template?: string;\n choiceLayout?: string;\n layoutProfile?: string;\n hasAudio?: boolean;\n useFeatureButtonAudio?: boolean | null;\n}\n\nexport interface LayoutProfileResult {\n isAudioOnlyMode: boolean;\n isBlankOnlyTemplate: boolean;\n choiceLayout: 'horizontal' | 'vertical';\n isHorizontalChoices: boolean;\n hasInlineSentenceAudioLayout: boolean;\n useFeatureButtonAudio: boolean;\n}\n\nconst FEATURE_BUTTON_PROFILES = new Set([\n 'audio_blank_only',\n 'stimulus_image_blank',\n 'token_sequence',\n]);\n\nexport function computeLayoutProfile(params: LayoutProfileParams): LayoutProfileResult {\n const {\n interactionMode = '',\n template = '',\n choiceLayout: configuredChoiceLayout,\n layoutProfile = '',\n hasAudio = false,\n useFeatureButtonAudio: configuredFeatureButton,\n } = params;\n\n const isAudioOnlyMode = interactionMode === 'audio_mc_only';\n\n const isBlankOnlyTemplate = (() => {\n if (!template) return false;\n const plain = template\n .replace(/<[^>]+>/g, '')\n .replace(/ /g, ' ')\n .trim();\n return plain === BLANK_TOKEN;\n })();\n\n const choiceLayout: 'horizontal' | 'vertical' =\n configuredChoiceLayout === 'horizontal' || configuredChoiceLayout === 'vertical'\n ? (configuredChoiceLayout as 'horizontal' | 'vertical')\n : isAudioOnlyMode || isBlankOnlyTemplate\n ? 'horizontal'\n : 'vertical';\n\n const isHorizontalChoices = choiceLayout === 'horizontal';\n\n const hasInlineSentenceAudioLayout = layoutProfile === 'inline_sentence' && hasAudio;\n\n const useFeatureButtonAudio =\n typeof configuredFeatureButton === 'boolean'\n ? configuredFeatureButton\n : hasAudio && FEATURE_BUTTON_PROFILES.has(layoutProfile);\n\n return {\n isAudioOnlyMode,\n isBlankOnlyTemplate,\n choiceLayout,\n isHorizontalChoices,\n hasInlineSentenceAudioLayout,\n useFeatureButtonAudio,\n };\n}\n","import { type LayoutLimits, DEFAULT_LAYOUT_LIMITS } from '../shared/layoutLimits';\nexport type { LayoutLimits };\nexport { DEFAULT_LAYOUT_LIMITS };\n\n/**\n * Maps every LayoutLimits key (except legendMaxChars, which is a return value not a CSS var)\n * to its --mpb-* CSS variable name and CSS unit.\n * Add a single entry here when adding a new layout limit.\n */\nexport const CSS_VAR_SPEC: Record<\n Exclude<keyof LayoutLimits, 'legendMaxChars'>,\n { varName: string; unit: string }\n> = {\n blankStandaloneWidthRem: { varName: '--mpb-blank-standalone-width', unit: 'rem' },\n blankWideWidthRem: { varName: '--mpb-blank-wide-width', unit: 'rem' },\n blankUnderlineWidthPx: { varName: '--mpb-blank-underline-width', unit: 'px' },\n blankUnderlineWideWidthPx: { varName: '--mpb-blank-underline-wide-width', unit: 'px' },\n horizontalChoiceWidthPx: { varName: '--mpb-choice-width-px', unit: 'px' },\n horizontalChoiceWidthVw: { varName: '--mpb-choice-width-vw', unit: 'vw' },\n horizontalChoiceTileMinHeightRem: { varName: '--mpb-choice-tile-min-height', unit: 'rem' },\n horizontalChoiceContentMinHeightRem: { varName: '--mpb-choice-content-min-height', unit: 'rem' },\n choiceImageMaxHeightRem: { varName: '--mpb-choice-image-max-height', unit: 'rem' },\n choiceImageMaxWidthRem: { varName: '--mpb-choice-image-max-width', unit: 'rem' },\n choiceGroupGapRem: { varName: '--mpb-choice-group-gap', unit: 'rem' },\n choiceRowGapRem: { varName: '--mpb-choice-row-gap', unit: 'rem' },\n horizontalChoiceRadioTopMarginRem: {\n varName: '--mpb-horizontal-choice-radio-top-margin',\n unit: 'rem',\n },\n narrowHorizontalChoiceMaxWidthPx: { varName: '--mpb-narrow-choice-max-width', unit: 'px' },\n toggleButtonGapRem: { varName: '--mpb-toggle-button-gap', unit: 'rem' },\n listenButtonSizePx: { varName: '--mpb-listen-button-size', unit: 'px' },\n audioBlankTemplateMarginTopRem: { varName: '--mpb-audio-blank-template-margin-top', unit: 'rem' },\n audioBlankTemplateMarginBottomRem: {\n varName: '--mpb-audio-blank-template-margin-bottom',\n unit: 'rem',\n },\n audioInstructionsMaxWidthPx: { varName: '--mpb-audio-instructions-max-width', unit: 'px' },\n stimulusMinColumnPx: { varName: '--mpb-stimulus-min-column', unit: 'px' },\n textMinColumnPx: { varName: '--mpb-text-min-column', unit: 'px' },\n stimulusGridColumnGapRem: { varName: '--mpb-stimulus-grid-column-gap', unit: 'rem' },\n stimulusGridRowGapRem: { varName: '--mpb-stimulus-grid-row-gap', unit: 'rem' },\n stimulusSentenceMarginTopRem: { varName: '--mpb-stimulus-sentence-margin-top', unit: 'rem' },\n stimulusChoicesMarginTopRem: { varName: '--mpb-stimulus-choices-margin-top', unit: 'rem' },\n tokenGridColumnGapRem: { varName: '--mpb-token-grid-column-gap', unit: 'rem' },\n tokenGridRowGapRem: { varName: '--mpb-token-grid-row-gap', unit: 'rem' },\n tokenTemplateMarginTopRem: { varName: '--mpb-token-template-margin-top', unit: 'rem' },\n tokenInlineTokenGapRem: { varName: '--mpb-token-inline-token-gap', unit: 'rem' },\n tokenChoicesMarginTopRem: { varName: '--mpb-token-choices-margin-top', unit: 'rem' },\n inlineGridColumnGapRem: { varName: '--mpb-inline-grid-column-gap', unit: 'rem' },\n inlineGridRowGapRem: { varName: '--mpb-inline-grid-row-gap', unit: 'rem' },\n inlineTemplateMarginTopRem: { varName: '--mpb-inline-template-margin-top', unit: 'rem' },\n inlineChoicesMarginTopRem: { varName: '--mpb-inline-choices-margin-top', unit: 'rem' },\n};\n\nexport const DEFAULT_LAYOUT_PROFILE_PRESETS: Record<string, Partial<LayoutLimits>> = {\n audio_blank_only: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n horizontalChoiceTileMinHeightRem: 11.25,\n horizontalChoiceContentMinHeightRem: 9.375,\n choiceGroupGapRem: 1,\n audioBlankTemplateMarginBottomRem: 1.875,\n },\n stimulus_image_blank: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n },\n token_sequence: {\n blankStandaloneWidthRem: 7,\n blankUnderlineWideWidthPx: 6,\n },\n};\n\nexport interface LayoutStyleResult {\n rootStyle: string;\n blankWidth: string;\n blankBorderWidth: string;\n legendMaxChars: number;\n}\n\nexport function computeLayoutStyle(params: {\n layoutProfile: string;\n isBlankOnlyTemplate: boolean;\n configuredLimits: unknown;\n customProfilePresets: unknown;\n}): LayoutStyleResult {\n const { layoutProfile, isBlankOnlyTemplate } = params;\n\n const configured =\n params.configuredLimits && typeof params.configuredLimits === 'object'\n ? (params.configuredLimits as Partial<LayoutLimits>)\n : {};\n const customPresets =\n params.customProfilePresets && typeof params.customProfilePresets === 'object'\n ? (params.customProfilePresets as Record<string, unknown>)\n : {};\n const customForProfile =\n customPresets[layoutProfile] && typeof customPresets[layoutProfile] === 'object'\n ? (customPresets[layoutProfile] as Partial<LayoutLimits>)\n : {};\n const profilePreset: Partial<LayoutLimits> = {\n ...(DEFAULT_LAYOUT_PROFILE_PRESETS[layoutProfile] ?? {}),\n ...customForProfile,\n };\n const l: LayoutLimits = { ...DEFAULT_LAYOUT_LIMITS, ...configured, ...profilePreset };\n\n const wideBlankProfiles = ['audio_blank_only', 'stimulus_image_blank'];\n const wideUnderlineProfiles = ['audio_blank_only', 'stimulus_image_blank', 'token_sequence'];\n\n const blankWidth = wideBlankProfiles.includes(layoutProfile)\n ? `${l.blankWideWidthRem}rem`\n : isBlankOnlyTemplate\n ? `${l.blankStandaloneWidthRem}rem`\n : 'auto';\n\n const blankBorderWidth = wideUnderlineProfiles.includes(layoutProfile)\n ? `${l.blankUnderlineWideWidthPx}px`\n : `${l.blankUnderlineWidthPx}px`;\n\n const cssVars = (Object.keys(CSS_VAR_SPEC) as (keyof typeof CSS_VAR_SPEC)[]).map(\n (key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`\n );\n const rootStyle = cssVars.join(';');\n\n return { rootStyle, blankWidth, blankBorderWidth, legendMaxChars: l.legendMaxChars };\n}\n","export type AudioButtonSkin = { silentUrl: string; playingUrl: string };\n\nexport const DEFAULT_AUDIO_BUTTON_SKINS: Record<string, AudioButtonSkin> = {\n default: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg',\n },\n es: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg',\n },\n};\n\n/**\n * Resolves the audio button skin to display.\n * Priority: byLocale[exact] > byLocale[lang] > byLocale.default > customSingle > built-in default\n */\nexport function computeFeatureAudioSkin(params: {\n locale: unknown;\n audioButtonSkin: unknown;\n audioButtonSkinsByLocale: unknown;\n}): AudioButtonSkin {\n const locale = String(params.locale || '').toLowerCase();\n const lang = locale.slice(0, 2);\n const byLocale =\n params.audioButtonSkinsByLocale && typeof params.audioButtonSkinsByLocale === 'object'\n ? (params.audioButtonSkinsByLocale as Record<string, unknown>)\n : {};\n const customSingle =\n params.audioButtonSkin && typeof params.audioButtonSkin === 'object'\n ? (params.audioButtonSkin as AudioButtonSkin)\n : null;\n const defaultSkin = locale.startsWith('es')\n ? DEFAULT_AUDIO_BUTTON_SKINS.es\n : DEFAULT_AUDIO_BUTTON_SKINS.default;\n return (byLocale[locale] ||\n byLocale[lang] ||\n byLocale.default ||\n customSingle ||\n defaultSkin) as AudioButtonSkin;\n}\n\n/**\n * Returns the choice id that the ClozeMarker and selected-state highlight should display.\n * When the correct answer is revealed (alwaysShowCorrect or evaluate+showCorrectAnswer),\n * it shows the correct choice rather than the student's selection.\n */\nexport function computeDisplayChoiceId(params: {\n selectedId: string;\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n alwaysShowCorrect: boolean;\n correctChoiceId: string;\n}): string {\n const { selectedId, isEvaluateMode, showCorrectAnswer, alwaysShowCorrect, correctChoiceId } =\n params;\n if (alwaysShowCorrect && correctChoiceId) return correctChoiceId;\n if (isEvaluateMode && showCorrectAnswer && correctChoiceId) return correctChoiceId;\n return selectedId;\n}\n\n/**\n * Returns the screen-reader-only result announcement text shown after evaluate mode scoring.\n * Empty string means nothing is announced.\n */\nexport function computeResultText(params: {\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n isCorrect: boolean;\n isIncorrect: boolean;\n selectedId: string;\n}): string {\n const { isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId } = params;\n if (!isEvaluateMode || showCorrectAnswer) return '';\n if (isCorrect) return 'Correct answer selected';\n if (isIncorrect && selectedId) return 'Incorrect answer selected';\n return '';\n}\n\n/**\n * Returns the visible legend text for the choices fieldset.\n * Strips HTML, truncates to legendMaxChars with an ellipsis, falls back to answerChoicesLabel.\n */\nexport function computeLegendText(params: {\n prompt: string;\n legendMaxChars: number;\n answerChoicesLabel: string;\n}): string {\n const { prompt, legendMaxChars, answerChoicesLabel } = params;\n const plain = prompt\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n const maxChars = Math.max(8, legendMaxChars);\n if (!plain) return answerChoicesLabel;\n return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain;\n}\n","import selR1BaseCss from './cqt-css/sel-r1-base.css?raw';\nimport selR1PlusgggCss from './cqt-css/sel-r1-plusggg.css?raw';\nimport srVicCss from './cqt-css/sr-vic.css?raw';\nimport selVicCss from './cqt-css/sel-vic.css?raw';\nimport selR1GplusgggCss from './cqt-css/sel-r1-gplusggg.css?raw';\nimport selR1GStemCss from './cqt-css/sel-r1-g-stem.css?raw';\nimport selR1GgPlusCss from './cqt-css/sel-r1-gg-plus.css?raw';\nimport selR1GgplusCss from './cqt-css/sel-r1-ggplus.css?raw';\nimport selR1S3Css from './cqt-css/sel-r1-s3.css?raw';\n\nexport type VariantCssConfig = {\n variantId: string;\n variantClass: string;\n sourceUrl: string;\n cssText: string;\n};\n\nconst VARIANT_BY_CUSTOM_TYPE: Record<string, VariantCssConfig> = {\n 'sel_r1-_plusggg': {\n variantId: 'sel-r1-plusggg',\n variantClass: 'variant-sel-r1-plusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css',\n cssText: selR1PlusgggCss,\n },\n 'sr-vic': {\n variantId: 'sr-vic',\n variantClass: 'variant-sr-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css',\n cssText: srVicCss,\n },\n sel_vic: {\n variantId: 'sel-vic',\n variantClass: 'variant-sel-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css',\n cssText: selVicCss,\n },\n 'sel_r1-_gplusggg': {\n variantId: 'sel-r1-gplusggg',\n variantClass: 'variant-sel-r1-gplusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css',\n cssText: selR1GplusgggCss,\n },\n 'sel_r1-g_plusggg': {\n variantId: 'sel-r1-g-stem',\n variantClass: 'variant-sel-r1-g-stem',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css',\n cssText: selR1GStemCss,\n },\n 'sel_r1-gg_plusggg': {\n variantId: 'sel-r1-gg-plus',\n variantClass: 'variant-sel-r1-gg-plus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css',\n cssText: selR1GgPlusCss,\n },\n 'sel_r1-_ggplusggg': {\n variantId: 'sel-r1-ggplus',\n variantClass: 'variant-sel-r1-ggplus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css',\n cssText: selR1GgplusCss,\n },\n 'sel_r1-s3_plusggg': {\n variantId: 'sel-r1-s3',\n variantClass: 'variant-sel-r1-s3',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css',\n cssText: selR1S3Css,\n },\n};\n\nconst normalizeCustomType = (value: unknown): string => {\n const normalized = String(value || '')\n .trim()\n .toLowerCase();\n // Accept both base custom types and version-suffixed tags like \"...v0.0.1\".\n return normalized.replace(/v\\d+\\.\\d+\\.\\d+$/i, '');\n};\n\nexport const getVariantCssConfig = (customType: unknown): VariantCssConfig | undefined => {\n const normalized = normalizeCustomType(customType);\n return VARIANT_BY_CUSTOM_TYPE[normalized];\n};\n\nexport const getVariantRootClass = (customType: unknown): string => {\n return getVariantCssConfig(customType)?.variantClass || '';\n};\n\nconst SEL_R1_VARIANT_IDS = new Set([\n 'sel-r1-plusggg',\n 'sel-r1-gplusggg',\n 'sel-r1-g-stem',\n 'sel-r1-gg-plus',\n 'sel-r1-ggplus',\n 'sel-r1-s3',\n]);\n\nconst injectStyleOnce = (id: string, variantName: string, cssText: string): void => {\n const existing = document.getElementById(id) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== cssText) existing.textContent = cssText;\n return;\n }\n const style = document.createElement('style');\n style.id = id;\n style.setAttribute('data-mpb-variant', variantName);\n style.textContent = cssText;\n document.head.appendChild(style);\n};\n\nexport const ensureVariantCssInjected = (config?: VariantCssConfig): void => {\n if (!config?.cssText || typeof document === 'undefined') {\n return;\n }\n if (SEL_R1_VARIANT_IDS.has(config.variantId)) {\n injectStyleOnce('mc-populated-blank-css-sel-r1-base', 'sel-r1-base', selR1BaseCss);\n }\n injectStyleOnce(`mc-populated-blank-css-${config.variantId}`, config.variantId, config.cssText);\n};\n","<svelte:options\n customElement={{\n shadow: 'none',\n props: {\n model: { type: 'Object' },\n session: { type: 'Object' },\n options: { type: 'Object' },\n },\n }}\n/>\n\n<script lang=\"ts\">\nimport { forwardSessionChange, resolveDeliveryHost } from '@pie-lib/delivery-events-svelte';\nimport AudioPlayer from './AudioPlayer.svelte';\nimport ClozeMarker from './ClozeMarker.svelte';\nimport ChoiceRow from './ChoiceRow.svelte';\nimport { computeChoiceCorrectness } from './computeChoiceCorrectness';\nimport { computeLayoutProfile } from './computeLayoutProfile';\nimport { computeLayoutStyle, DEFAULT_LAYOUT_LIMITS } from './computeLayoutStyle';\nimport {\n computeFeatureAudioSkin,\n computeDisplayChoiceId,\n computeResultText,\n computeLegendText,\n} from './computeDisplayState';\nimport {\n ensureVariantCssInjected,\n getVariantCssConfig,\n getVariantRootClass,\n} from './variant-css-map';\n\nconst BLANK_TOKEN = '{{blank}}';\nconst DEFAULT_UI_TEXT = {\n answerChoices: 'Answer choices',\n selectedAnswerInSentence: 'Selected answer in sentence',\n blankPreSelectionHint: 'The answer you choose will appear on the blank line above.',\n showCorrectAnswer: 'Show correct answer',\n hideCorrectAnswer: 'Hide correct answer',\n clickToEnableAutoplay: 'Click to enable audio autoplay',\n audioResourceUnavailable: 'Audio is enabled but no playable audio URL is configured.',\n} as const;\n\nlet { model, session } = $props<{ model?: any; session?: any; options?: any }>();\nlet localChoiceId = $state('');\nlet toggleCorrectAnswerButtonEl = $state<HTMLButtonElement | null>(null);\nlet choicesGroupEl = $state<HTMLDivElement | null>(null);\nlet rootEl = $state<HTMLDivElement | null>(null);\nconst instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;\n\n// ---------------------------------------------------------------------------\n// Cluster: modeFlags — delivery mode, correctness, and answer-reveal state\n// Feeds: shouldShowCorrectAnswerToggle, choiceState, a11y\n// ---------------------------------------------------------------------------\nconst deliveryMode = $derived((model?.mode || model?.env?.mode || '').toString());\nconst isEvaluateMode = $derived(deliveryMode === 'evaluate');\nconst correctness = $derived(model?.correctness);\nconst isResponseCorrect = $derived(\n typeof model?.responseCorrect === 'boolean' ? model.responseCorrect : correctness === 'correct'\n);\nconst isCorrect = $derived(correctness === 'correct');\nconst isIncorrect = $derived(correctness === 'incorrect');\n\nlet showCorrectAnswer = $state(false);\nconst shouldShowCorrectAnswerToggle = $derived(\n isEvaluateMode && !isResponseCorrect && !!model?.correctChoiceId\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: layoutConfig — profile limits, blank sizing, choice layout, audio mode\n// Feeds: layout (rootStyle, blankWidth, blankBorderWidth, legendMaxChars), audioMode, choiceState\n// ---------------------------------------------------------------------------\nconst layoutProfile = $derived(model?.layoutProfile || '');\nconst layoutProfileFlags = $derived(\n computeLayoutProfile({\n interactionMode: model?.interactionMode,\n template: model?.template,\n choiceLayout: model?.choiceLayout,\n layoutProfile,\n hasAudio: model?.hasAudio,\n useFeatureButtonAudio: model?.useFeatureButtonAudio,\n })\n);\nconst isAudioOnlyMode = $derived(layoutProfileFlags.isAudioOnlyMode);\nconst isBlankOnlyTemplate = $derived(layoutProfileFlags.isBlankOnlyTemplate);\nconst isHorizontalChoices = $derived(layoutProfileFlags.isHorizontalChoices);\nconst hasInlineSentenceAudioLayout = $derived(layoutProfileFlags.hasInlineSentenceAudioLayout);\nconst useFeatureButtonAudio = $derived(layoutProfileFlags.useFeatureButtonAudio);\nconst layout = $derived(\n computeLayoutStyle({\n layoutProfile,\n isBlankOnlyTemplate,\n configuredLimits: model?.layoutLimits,\n customProfilePresets: model?.layoutProfilePresets,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: choiceState — selection, display choice, per-choice correctness, result text\n// Feeds: template blank display, choice rendering, fieldset, result sr-only text\n// ---------------------------------------------------------------------------\nconst choices = $derived(Array.isArray(model?.choices) ? model.choices : []);\nconst choiceMode = $derived(model?.choiceMode || 'text');\nconst selectedId = $derived(session?.choiceId || localChoiceId || '');\nconst radioGroupName = $derived(`${instanceId}-choice-group-${model?.id || '1'}`);\nconst displayChoiceId = $derived(\n computeDisplayChoiceId({\n selectedId,\n isEvaluateMode,\n showCorrectAnswer,\n alwaysShowCorrect: !!model?.alwaysShowCorrect,\n correctChoiceId: String(model?.correctChoiceId || ''),\n })\n);\nconst displayChoice = $derived.by(() => choices.find((c: any) => c.id === displayChoiceId));\nconst displayChoiceLabelHtml = $derived.by(() => String(displayChoice?.labelHtml || ''));\nconst resultText = $derived(\n computeResultText({ isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId })\n);\nconst choiceCorrectnessById = $derived(\n computeChoiceCorrectness({\n isEvaluateMode,\n correctChoiceId: String(model?.correctChoiceId || ''),\n selectedId: String(selectedId || ''),\n showCorrectAnswer,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: a11y — stable IDs, aria labelling, described-by relationships\n// Feeds: fieldset legend, radiogroup labelling, template described-by\n// ---------------------------------------------------------------------------\nconst uiText = $derived.by(() => ({\n ...DEFAULT_UI_TEXT,\n ...(model?.uiText || {}),\n}));\nconst promptId = $derived(`${instanceId}-prompt`);\nconst legendId = $derived(`${instanceId}-choices-legend`);\nconst resultId = $derived(`${instanceId}-result`);\nconst blankHintId = $derived(`${instanceId}-blank-hint`);\nconst legendText = $derived(\n computeLegendText({\n prompt: model?.prompt || '',\n legendMaxChars: layout.legendMaxChars,\n answerChoicesLabel: uiText.answerChoices,\n })\n);\nconst choicesGroupLabelledBy = $derived(model?.prompt ? promptId : undefined);\nconst choicesGroupAriaLabel = $derived.by(() => {\n if (model?.prompt) return undefined;\n const explicit = String(model?.choiceGroupLabel || '').trim();\n if (explicit) return explicit;\n return legendText;\n});\n// The transcript is not among these: it is rendered by the player from the item's\n// accessibility catalog (PIE-902), so this element neither owns the node nor has\n// an id to point at. It is placed immediately before this content in reading\n// order instead, as a labelled region.\nconst templateDescribedBy = $derived.by(() => (model?.prompt ? promptId : undefined));\n\n// ---------------------------------------------------------------------------\n// Misc — locale, audio error, template parsing, variant CSS, style strings\n// ---------------------------------------------------------------------------\nconst lang = $derived.by(() => {\n const locale = model?.locale || '';\n return locale ? locale.slice(0, 2) : 'en';\n});\nconst variantCssConfig = $derived(getVariantCssConfig(model?.customType));\nconst variantRootClass = $derived(getVariantRootClass(model?.customType));\nconst templateParts = $derived.by(() => {\n const t = model?.template || '';\n const idx = t.indexOf(BLANK_TOKEN);\n if (idx < 0) return { before: t, after: '' };\n let before = t.slice(0, idx);\n let after = t.slice(idx + BLANK_TOKEN.length);\n // LSY's shared cloze renderer (Renaissance components/src/cloze.js) emits\n // literal ` ` on BOTH sides of the cloze span unconditionally:\n // ` <span ... -cloze-blank></span><span ... -cloze>…</span> `.\n // Mirror that ONLY for inline_sentence layouts (sel-vic, sr-vic, plain\n // sentence). Token-sequence layouts arrange tokens in a grid with explicit\n // sibling-margin spacing, so injecting NBSP throws off those tuned gaps;\n // they don't suffer the wrap-leader symptom either because each token has\n // its own grid placement. This (a) keeps the cloze glued to its neighbors\n // so it doesn't dangle at the start of a wrapped line (CONTOOL-2574), and\n // (b) matches LSY's cloze→adjacent-text gap when the author wrote no\n // whitespace around {{blank}} (CONTOOL-2572: e.g. `…word: {{blank}}.`).\n if (layoutProfile === 'inline_sentence') {\n before = `${before.replace(/\\s+$/, '')} `;\n after = ` ${after.replace(/^\\s+/, '')}`;\n }\n return { before, after };\n});\n\nfunction emitSession(updatedSession: any, sourceEl?: HTMLElement | null) {\n forwardSessionChange({\n sourceEl,\n fallbackSelector: 'mc-populated-blank',\n component: 'mc-populated-blank',\n session: updatedSession,\n complete: !!updatedSession?.choiceId,\n });\n}\n\nfunction onRadioChange(e: Event) {\n const input = e.target as HTMLInputElement;\n if (!input.checked) return;\n const choiceId = input.value;\n localChoiceId = choiceId;\n const updatedSession = {\n ...session,\n id: session?.id || model?.id || '1',\n element: 'mc-populated-blank',\n choiceId,\n };\n emitSession(updatedSession, input);\n}\n\nfunction toggleCorrectAnswer() {\n if (!shouldShowCorrectAnswerToggle) return;\n showCorrectAnswer = !showCorrectAnswer;\n}\n\n$effect(() => {\n if (!isEvaluateMode || isResponseCorrect) {\n showCorrectAnswer = false;\n }\n});\n\nfunction onRadioGroupKeydown(e: KeyboardEvent) {\n if (model?.disabled) return;\n const key = e.key;\n if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(key)) return;\n e.preventDefault();\n const container = e.currentTarget as HTMLElement;\n const inputs = Array.from(\n container.querySelectorAll('input[type=\"radio\"]:not([disabled])')\n ) as HTMLInputElement[];\n if (inputs.length === 0) return;\n let idx = inputs.findIndex((i) => i.checked);\n if (key === 'ArrowDown' || key === 'ArrowRight') {\n idx = idx < 0 ? 0 : (idx + 1) % inputs.length;\n } else {\n idx = idx < 0 ? inputs.length - 1 : (idx - 1 + inputs.length) % inputs.length;\n }\n const next = inputs[idx];\n next.checked = true;\n next.dispatchEvent(new Event('change', { bubbles: true }));\n next.focus();\n}\n\nconst featureAudioSkin = $derived(\n computeFeatureAudioSkin({\n locale: model?.locale,\n audioButtonSkin: model?.audioButtonSkin,\n audioButtonSkinsByLocale: model?.audioButtonSkinsByLocale,\n })\n);\n\nfunction onAudioStarted() {\n resolveDeliveryHost(rootEl, { fallbackSelector: 'mc-populated-blank' })?.onAudioStarted?.();\n}\n\nfunction onAudioEnded() {\n resolveDeliveryHost(rootEl, { fallbackSelector: 'mc-populated-blank' })?.onAudioEnded?.();\n}\n\n$effect(() => {\n if (session?.choiceId) {\n localChoiceId = session.choiceId;\n }\n});\n\n$effect(() => {\n const btn = toggleCorrectAnswerButtonEl;\n if (!btn) return;\n btn.addEventListener('click', toggleCorrectAnswer);\n return () => btn.removeEventListener('click', toggleCorrectAnswer);\n});\n\n// Delegated listeners on the choices group — two events with a radio-guard on change.\n$effect(() => {\n const group = choicesGroupEl;\n if (!group) return;\n const handleChange = (e: Event) => {\n const target = e.target as HTMLInputElement | null;\n if (target?.type !== 'radio') return;\n onRadioChange(e);\n };\n const handleKeydown = (e: KeyboardEvent) => onRadioGroupKeydown(e);\n group.addEventListener('change', handleChange);\n group.addEventListener('keydown', handleKeydown);\n return () => {\n group.removeEventListener('change', handleChange);\n group.removeEventListener('keydown', handleKeydown);\n };\n});\n\n$effect(() => {\n ensureVariantCssInjected(variantCssConfig);\n});\n</script>\n\n<div\n bind:this={rootEl}\n class={`p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${layoutProfile} ${variantRootClass} ${hasInlineSentenceAudioLayout ? 'has-inline-audio' : ''}`}\n lang={lang}\n style={layout.rootStyle}\n>\n {#if model?.prompt}\n <div class=\"mb-4 prose pie-prompt\" id={promptId}>{@html model.prompt}</div>\n {/if}\n\n {#if shouldShowCorrectAnswerToggle}\n <div class=\"pie-correct-answer-toggle-row\">\n <button\n bind:this={toggleCorrectAnswerButtonEl}\n type=\"button\"\n class=\"mb-3 pie-toggle-correct-answer\"\n style=\"gap:var(--mpb-toggle-button-gap, 0.5rem);\"\n aria-pressed={showCorrectAnswer}\n data-testid=\"show-correct-answer\"\n >\n <span class=\"pie-correct-answer-toggle-content\">\n <span class=\"pie-correct-answer-toggle-icon-holder\" aria-hidden=\"true\">\n {#if showCorrectAnswer}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-283 359 34 35\"\n >\n <circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"var(--pie-tertiary-light, #d0e2f0)\" />\n <path\n d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\"\n fill=\"var(--pie-tertiary-light, #d0e2f0)\"\n />\n <polygon\n points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {:else}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-129.5 127 34 35\"\n >\n <path\n d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n fill=\"#D0CAC5\"\n stroke=\"#E6E3E0\"\n stroke-width=\"0.75\"\n />\n <path\n d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n fill=\"#B3ABA4\"\n stroke=\"#CDC7C2\"\n stroke-width=\"0.5\"\n />\n <circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\" />\n <path\n d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\"\n fill=\"var(--pie-background-dark, #ecedf1)\"\n />\n <polygon\n points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {/if}\n </span>\n <span class=\"pie-correct-answer-toggle-label\">\n {showCorrectAnswer ? uiText.hideCorrectAnswer : uiText.showCorrectAnswer}\n </span>\n </span>\n </button>\n </div>\n {/if}\n\n <AudioPlayer\n hasAudio={!!model?.hasAudio}\n audioUrl={model?.audioUrl}\n {useFeatureButtonAudio}\n autoplayEnabled={!!model?.autoplayAudioEnabled}\n {featureAudioSkin}\n {uiText}\n locale={model?.locale}\n onaudiostarted={onAudioStarted}\n onaudioended={onAudioEnded}\n />\n\n {#if model?.sentenceHtml}\n <div class=\"mb-3 prose prose-p:my-1 sentence-line pie-sentence-line\" aria-describedby={templateDescribedBy}>\n {@html model.sentenceHtml}\n </div>\n {/if}\n\n {#if !isAudioOnlyMode}\n <div class=\"mb-4 template-line pie-template-line\" aria-describedby={templateDescribedBy}\n >{@html templateParts.before}<ClozeMarker\n {choiceMode}\n displayChoice={displayChoice}\n {displayChoiceLabelHtml}\n isStandalone={isBlankOnlyTemplate}\n blankWidth={layout.blankWidth}\n blankBorderWidth={layout.blankBorderWidth}\n ariaLabel={uiText.selectedAnswerInSentence}\n />{@html templateParts.after}</div>\n {/if}\n\n {#if resultText}\n <p id={resultId} class=\"sr-only pie-result-feedback\" role=\"status\" aria-live=\"polite\">{resultText}</p>\n {/if}\n\n <p id={blankHintId} class=\"sr-only pie-blank-hint\">{uiText.blankPreSelectionHint}</p>\n\n <fieldset class=\"border-0 p-0 m-0 pie-choices-fieldset\" disabled={model?.disabled}>\n <legend class=\"sr-only pie-choices-legend\" id={legendId}>{legendText}</legend>\n <div\n bind:this={choicesGroupEl}\n class={`pie-choices ${isHorizontalChoices ? 'flex flex-row flex-wrap items-start justify-center' : 'flex flex-col'}`}\n style=\"gap:var(--mpb-choice-group-gap, 0.5rem);\"\n role=\"radiogroup\"\n tabindex=\"-1\"\n aria-labelledby={choicesGroupLabelledBy}\n aria-label={choicesGroupAriaLabel}\n aria-describedby={[blankHintId, resultText ? resultId : undefined].filter(Boolean).join(' ')}\n >\n {#each choices as c (c.id)}\n <ChoiceRow\n choice={c}\n {choiceMode}\n isHorizontal={isHorizontalChoices}\n isSelected={displayChoiceId === c.id}\n isDisabled={!!model?.disabled}\n correctness={choiceCorrectnessById.get(c.id)}\n {isEvaluateMode}\n {instanceId}\n {radioGroupName}\n />\n {/each}\n </div>\n </fieldset>\n</div>\n\n<style>\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n .mc-populated-blank-root {\n --mpb-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );\n }\n\n .mc-populated-blank-root :global(.prose) {\n max-width: none;\n }\n\n .pie-toggle-correct-answer {\n width: 100%;\n cursor: pointer;\n border: 0;\n background: transparent;\n padding: 0;\n display: flex;\n justify-content: center;\n text-align: center;\n color: var(--pie-text, black);\n }\n\n .pie-correct-answer-toggle-row {\n width: 100%;\n display: flex;\n justify-content: flex-end;\n }\n\n .pie-correct-answer-toggle-content {\n display: flex;\n margin: 0 auto;\n align-items: center;\n }\n\n .pie-correct-answer-toggle-icon-holder {\n width: 25px;\n margin-right: 5px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n .pie-correct-answer-toggle-svg {\n width: 25px;\n height: 25px;\n }\n\n .pie-correct-answer-toggle-label {\n width: fit-content;\n min-width: 140px;\n align-self: center;\n vertical-align: middle;\n font-weight: 400;\n user-select: none;\n }\n\n .pie-toggle-correct-answer:hover .pie-correct-answer-toggle-label,\n .pie-toggle-correct-answer:focus-visible .pie-correct-answer-toggle-label {\n text-decoration: underline;\n }\n\n .template-line {\n white-space: pre-wrap;\n }\n\n .template-line :global(p) {\n margin: 0;\n display: inline;\n }\n\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n display: flex;\n width: min(100%, var(--mpb-audio-instructions-max-width, 875px));\n margin-left: auto;\n margin-right: auto;\n justify-content: flex-end;\n }\n\n .layout-audio_blank_only .template-line,\n .layout-stimulus_image_blank .template-line {\n text-align: center;\n margin: var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);\n }\n\n .layout-audio_blank_only fieldset {\n display: flex;\n justify-content: center;\n }\n\n .layout-audio_blank_only :global(.pie-blank-slot),\n .layout-stimulus_image_blank :global(.pie-blank-slot) {\n width: var(--mpb-blank-wide-width, 10rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 6px);\n min-height: 160px;\n padding-bottom: 4px;\n }\n\n .layout-stimulus_image_blank {\n display: grid;\n grid-template-columns: minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;\n grid-template-areas:\n 'sentence audio'\n '. template'\n 'choices choices';\n column-gap: var(--mpb-stimulus-grid-column-gap, 2rem);\n row-gap: var(--mpb-stimulus-grid-row-gap, 0.7rem);\n align-items: start;\n }\n\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n }\n\n .layout-stimulus_image_blank .sentence-line {\n grid-area: sentence;\n margin: var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;\n }\n\n .layout-stimulus_image_blank .template-line {\n grid-area: template;\n margin: 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-stimulus_image_blank fieldset {\n grid-area: choices;\n margin-top: var(--mpb-stimulus-choices-margin-top, 0.9rem);\n }\n\n .layout-token_sequence {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-areas:\n 'audio audio'\n 'template template'\n 'choices choices';\n column-gap: var(--mpb-token-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-token-grid-row-gap, 0.8rem);\n align-items: start;\n }\n\n .layout-token_sequence :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-token_sequence .template-line {\n grid-area: template;\n margin: var(--mpb-token-template-margin-top, 0.6rem) 0 0;\n justify-self: center;\n text-align: center;\n }\n\n .layout-token_sequence .template-line :global(span + span) {\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence :global(.pie-blank-slot) {\n width: var(--mpb-blank-standalone-width, 7rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 4px);\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence fieldset {\n grid-area: choices;\n margin-top: var(--mpb-token-choices-margin-top, 0.2rem);\n }\n\n .layout-inline_sentence.has-inline-audio {\n display: grid;\n grid-template-columns: minmax(var(--mpb-text-min-column, 260px), 1fr) auto;\n grid-template-areas:\n 'template audio'\n 'choices choices';\n column-gap: var(--mpb-inline-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-inline-grid-row-gap, 0.65rem);\n align-items: start;\n }\n\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-inline_sentence.has-inline-audio .template-line {\n grid-area: template;\n margin: var(--mpb-inline-template-margin-top, 0.45rem) 0 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-inline_sentence.has-inline-audio fieldset {\n grid-area: choices;\n margin-top: var(--mpb-inline-choices-margin-top, 0.25rem);\n }\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container),\n .layout-token_sequence :global(.pie-audio-container),\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n justify-content: flex-start;\n justify-self: start;\n }\n\n .layout-audio_blank_only .pie-choices,\n .layout-token_sequence .pie-choices,\n .layout-stimulus_image_blank .pie-choices,\n .layout-inline_sentence.has-inline-audio .pie-choices {\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n .layout-audio_blank_only .choice-row-horizontal,\n .layout-token_sequence .choice-row-horizontal,\n .layout-stimulus_image_blank .choice-row-horizontal,\n .layout-inline_sentence.has-inline-audio .choice-row-horizontal {\n width: min(100%, var(--mpb-narrow-choice-max-width, 230px));\n align-items: flex-start;\n }\n }\n</style>\n","import McPopulatedBlankComponent from './McPopulatedBlank.svelte';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-lib/delivery-events-svelte';\n\nfunction isComplete(model: any, session: any, audioComplete = false): boolean {\n if (!session?.choiceId) return false;\n const requiresAudioCompletion =\n !!model?.autoplayAudioEnabled && !!model?.completeAudioEnabled && !!model?.hasAudio;\n if (requiresAudioCompletion && !audioComplete) return false;\n return true;\n}\n\nconst SvelteElementClass = (McPopulatedBlankComponent as any).element;\n\nclass McPopulatedBlankElement extends SvelteElementClass {\n _internalSession: any = null;\n _model: any = null;\n _options: any = null;\n audioComplete = false;\n\n _dispatchModelSet = () => {\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)\n );\n };\n\n _dispatchSessionChanged = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));\n };\n\n set model(m: any) {\n this._model = m;\n this.audioComplete = false;\n super.model = m;\n this._dispatchModelSet();\n }\n\n get model() {\n return this._model;\n }\n\n set session(s: any) {\n this._internalSession = s;\n super.session = s;\n this._dispatchSessionChanged();\n }\n\n get session() {\n return this._internalSession;\n }\n\n set options(o: any) {\n this._options = o;\n super.options = o;\n }\n\n get options() {\n return this._options;\n }\n\n onSessionChange = (updatedSession: any) => {\n this._internalSession = updatedSession;\n super.session = updatedSession;\n this._dispatchSessionChanged();\n };\n\n onAudioStarted = () => {\n this._internalSession = {\n ...(this._internalSession || {}),\n audioStartTime: Date.now(),\n };\n };\n\n onAudioEnded = () => {\n this.audioComplete = true;\n this._internalSession = {\n ...(this._internalSession || {}),\n audioEndTime: Date.now(),\n };\n this._dispatchSessionChanged();\n };\n\n _isComplete = () => {\n return isComplete(this._model, this._internalSession, this.audioComplete);\n };\n\n connectedCallback() {\n super.connectedCallback();\n (this as any).onSessionChange = this.onSessionChange;\n (this as any).onAudioStarted = this.onAudioStarted;\n (this as any).onAudioEnded = this.onAudioEnded;\n }\n}\n\nexport default McPopulatedBlankElement;\n"],"mappings":";;;AACA,IAAI,IAAI,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GAAGA,IAAI,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;GACZ;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GC5BI,KAAK,MAAM;CACd,IAAI,IAAI;CACR,OAAO,IAAI,OAAO,EAAE,mBAAmB,cAAc,OAAO,EAA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hB,AAHA,KAAK,SAAS,GACd,KAAK,gBAAgB,IACrB,MAAM,QAAQ,GACd,KAAK,kBAAkB;CACzB;CAEA,IAAI,QAAQ;EACV,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ,GAAQ;EAGlB,AAFA,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ,GAAQ;EAElB,AADA,KAAK,WAAW,GAChB,MAAM,UAAU;CAClB;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,mBAAmB,MAAwB;EAGzC,AAFA,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,uBAAuB;EACrB,KAAK,mBAAmB;GACtB,GAAI,KAAK,oBAAoB,CAAC;GAC9B,gBAAgB,KAAK,IAAI;EAC3B;CACF;CAEA,qBAAqB;EAMnB,AALA,KAAK,gBAAgB,IACrB,KAAK,mBAAmB;GACtB,GAAI,KAAK,oBAAoB,CAAC;GAC9B,cAAc,KAAK,IAAI;EACzB,GACA,KAAK,wBAAwB;CAC/B;CAEA,oBACS,GAAW,KAAK,QAAQ,KAAK,kBAAkB,KAAK,aAAa;CAG1E,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,KAAc,kBAAkB,KAAK,iBACrC,KAAc,iBAAiB,KAAK,gBACpC,KAAc,eAAe,KAAK;CACpC;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["t","e"],"sources":["../../../../../lib-svelte/delivery-events/dist/index2.js","../../../../../lib-svelte/delivery-events/dist/index3.js","../../../src/delivery/computeAudioMode.ts","../../../src/delivery/AudioPlayer.svelte","../../../src/delivery/ClozeMarker.svelte","../../../src/delivery/ChoiceRow.svelte","../../../src/delivery/computeChoiceCorrectness.ts","../../../src/delivery/computeLayoutProfile.ts","../../../src/delivery/computeLayoutStyle.ts","../../../src/delivery/computeDisplayState.ts","../../../src/delivery/variant-css-map.ts","../../../src/delivery/McPopulatedBlank.svelte","../../../src/delivery/index.ts"],"sourcesContent":["//#region ../../shared/player-events/dist/index.js\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","import { SessionChangedEvent as e } from \"./index2.js\";\n//#region src/session-bridge.ts\nvar t = (e) => {\n\tlet t = e;\n\treturn t ? typeof t.onSessionChange == \"function\" || typeof t.onAudioStarted == \"function\" || typeof t.onAudioEnded == \"function\" : !1;\n};\nfunction n(e, n = {}) {\n\tlet r = n.hostPredicate ?? t, i = e;\n\tfor (; i;) {\n\t\tif (r(i)) return i;\n\t\ti = i.parentElement;\n\t}\n\tif (typeof document < \"u\" && n.fallbackSelector) {\n\t\tlet e = document.querySelector(n.fallbackSelector);\n\t\tif (r(e)) return e;\n\t}\n\treturn null;\n}\nfunction r(e) {\n\treturn !!e && typeof e == \"object\" && !Array.isArray(e);\n}\nfunction i(e, t) {\n\tif (e === t) return e;\n\tif (!r(e) || !r(t) || Object.isFrozen(e) || !Object.isExtensible(e)) return t;\n\ttry {\n\t\tfor (let n of Object.keys(e)) n in t || delete e[n];\n\t\tObject.assign(e, t);\n\t} catch {\n\t\treturn t;\n\t}\n\treturn e;\n}\nfunction a({ sourceEl: t, fallbackSelector: r, component: i, complete: a, session: o }) {\n\tlet s = n(t, { fallbackSelector: r });\n\treturn s ? typeof s.onSessionChange == \"function\" ? (s.onSessionChange(o), s) : (s.dispatchEvent(new e(i, a)), s) : null;\n}\n//#endregion\nexport { a as forwardSessionChange, n as resolveDeliveryHost, i as writeSessionInPlace };\n","export type AudioMode = 'feature-button' | 'controls' | 'error' | 'none';\n\nexport function computeAudioMode(params: {\n hasAudio: boolean;\n audioUrl: string | undefined;\n useFeatureButtonAudio: boolean;\n}): AudioMode {\n if (!params.hasAudio) return 'none';\n if (!params.audioUrl) return 'error';\n return params.useFeatureButtonAudio ? 'feature-button' : 'controls';\n}\n","<script lang=\"ts\">\nimport { computeAudioMode } from './computeAudioMode';\n\ninterface AudioButtonSkin {\n silentUrl: string;\n playingUrl: string;\n}\n\ninterface UiText {\n clickToEnableAutoplay: string;\n audioResourceUnavailable: string;\n listenSilentAlt?: string;\n listenPlayingAlt?: string;\n listenSilentAltEs?: string;\n listenPlayingAltEs?: string;\n}\n\nconst AUDIO_PLAYBACK = {\n IDLE: 'idle',\n PLAYING: 'playing',\n BLOCKED: 'blocked',\n PAUSED: 'paused',\n} as const;\ntype AudioPlaybackState = (typeof AUDIO_PLAYBACK)[keyof typeof AUDIO_PLAYBACK];\n\nlet {\n hasAudio = false,\n audioUrl,\n useFeatureButtonAudio = false,\n autoplayEnabled = false,\n featureAudioSkin,\n uiText,\n locale = '',\n onaudiostarted,\n onaudioended,\n}: {\n hasAudio?: boolean;\n audioUrl?: string;\n useFeatureButtonAudio?: boolean;\n autoplayEnabled?: boolean;\n featureAudioSkin: AudioButtonSkin;\n uiText: UiText;\n locale?: string;\n onaudiostarted?: () => void;\n onaudioended?: () => void;\n} = $props();\n\nlet audioEl = $state<HTMLAudioElement | null>(null);\nlet featureAudioButtonEl = $state<HTMLButtonElement | null>(null);\nlet autoplayEnableButtonEl = $state<HTMLButtonElement | null>(null);\nlet audioPlaybackState = $state<AudioPlaybackState>(AUDIO_PLAYBACK.IDLE);\n\nconst audioMode = $derived(computeAudioMode({ hasAudio, audioUrl, useFeatureButtonAudio }));\nconst isMediaPlaying = $derived(audioPlaybackState === AUDIO_PLAYBACK.PLAYING);\nconst autoPlayPromptOpen = $derived(audioPlaybackState === AUDIO_PLAYBACK.BLOCKED);\nconst audioErrorMessage = $derived(audioMode === 'error' ? uiText.audioResourceUnavailable : '');\n\n// Reset playback state when audioUrl changes so autoplay re-fires for a new question.\n$effect(() => {\n audioUrl;\n audioPlaybackState = AUDIO_PLAYBACK.IDLE;\n});\n\nfunction playFeatureAudio() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().catch(() => {});\n }\n}\n\nfunction handleEnableAutoplayClick() {\n if (audioMode !== 'none' && audioMode !== 'error' && audioEl) {\n audioEl.play().finally(() => {\n if (audioPlaybackState === AUDIO_PLAYBACK.BLOCKED) audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n });\n }\n}\n\nfunction useListener<K extends keyof HTMLElementEventMap>(\n getEl: () => EventTarget | null | undefined,\n event: K,\n handler: (e: HTMLElementEventMap[K]) => void\n) {\n $effect(() => {\n const el = getEl();\n if (!el) return;\n el.addEventListener(event, handler as EventListener);\n return () => el.removeEventListener(event, handler as EventListener);\n });\n}\n\nuseListener(\n () => audioEl,\n 'playing',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PLAYING;\n onaudiostarted?.();\n }\n);\n\nuseListener(\n () => audioEl,\n 'ended',\n () => {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n onaudioended?.();\n }\n);\n\nuseListener(\n () => featureAudioButtonEl,\n 'click',\n () => playFeatureAudio()\n);\nuseListener(\n () => autoplayEnableButtonEl,\n 'click',\n () => handleEnableAutoplayClick()\n);\n\n$effect(() => {\n if (!autoplayEnabled || audioMode === 'none' || audioMode === 'error') return;\n if (audioPlaybackState !== AUDIO_PLAYBACK.IDLE) return;\n if (audioEl && audioUrl) {\n audioPlaybackState = AUDIO_PLAYBACK.PAUSED;\n audioEl.play().catch(() => {\n audioPlaybackState = AUDIO_PLAYBACK.BLOCKED;\n });\n }\n});\n\nfunction speechButtonLabel(loc = '') {\n return loc.toLowerCase().startsWith('es') ? 'Escuchar' : 'Listen';\n}\n\nfunction silentAlt(loc = '') {\n return loc.toLowerCase().startsWith('es')\n ? (uiText.listenSilentAltEs ?? 'Escuchar. Repetir las instrucciones.')\n : (uiText.listenSilentAlt ?? 'Repeat instructions');\n}\n\nfunction playingAlt(loc = '') {\n return loc.toLowerCase().startsWith('es')\n ? (uiText.listenPlayingAltEs ?? 'Escuchar. Estas son las instrucciones.')\n : (uiText.listenPlayingAlt ?? 'Instructions are playing');\n}\n</script>\n\n{#if audioMode !== 'none'}\n <div class=\"mb-4 audio-container pie-audio-container\">\n {#if audioMode === 'feature-button'}\n <audio\n bind:this={audioEl}\n class=\"sr-only pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n aria-hidden=\"true\"\n tabindex=\"-1\"\n ></audio>\n <button\n bind:this={featureAudioButtonEl}\n class=\"listen-button pie-listen-button rli-feature-audio\"\n type=\"button\"\n aria-label={speechButtonLabel(locale)}\n >\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? '' : 'listen-active'}`}\n src={featureAudioSkin.silentUrl}\n alt={silentAlt(locale)}\n />\n <img\n class={`listen-feature-icon pie-listen-icon rli-feature-listen ${isMediaPlaying ? 'listen-active' : ''}`}\n src={featureAudioSkin.playingUrl}\n alt={playingAlt(locale)}\n />\n </button>\n {:else if audioMode === 'controls'}\n <audio\n bind:this={audioEl}\n controls\n class=\"w-full max-w-md pie-audio-player\"\n preload=\"metadata\"\n src={audioUrl}\n >\n <track kind=\"captions\" />\n </audio>\n {#if autoPlayPromptOpen}\n <button\n bind:this={autoplayEnableButtonEl}\n class=\"mt-2 text-sm underline pie-audio-autoplay-enable\"\n type=\"button\"\n >\n {uiText.clickToEnableAutoplay}\n </button>\n {/if}\n {:else if audioMode === 'error'}\n <p class=\"text-sm text-red-700 pie-audio-error\" role=\"alert\">{audioErrorMessage}</p>\n {/if}\n </div>\n{/if}\n\n<style>\n .listen-button {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n border: 0;\n padding: 0;\n background-color: transparent;\n cursor: pointer;\n z-index: 1;\n }\n\n .listen-button:hover {\n background-color: #e2f1fe;\n }\n\n .listen-feature-icon {\n width: var(--mpb-listen-button-size, 128px);\n height: var(--mpb-listen-button-size, 128px);\n object-fit: contain;\n display: none;\n }\n\n .listen-feature-icon.listen-active {\n display: block;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\ninterface DisplayChoice {\n imageUrl?: string;\n imageAlt?: string;\n labelHtml?: string;\n}\n\nlet {\n choiceMode = 'text',\n displayChoice = undefined,\n displayChoiceLabelHtml = '',\n isStandalone = false,\n blankWidth,\n blankBorderWidth,\n ariaLabel,\n}: {\n choiceMode?: 'text' | 'image';\n displayChoice?: DisplayChoice;\n displayChoiceLabelHtml?: string;\n isStandalone?: boolean;\n blankWidth: string;\n blankBorderWidth: string;\n ariaLabel: string;\n} = $props();\n</script>\n\n<span\n class={`inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline cloze-marker pie-blank-slot ${isStandalone ? 'cloze-marker-standalone pie-blank-slot-standalone' : ''}`}\n style={`width:${blankWidth};border-bottom-width:${blankBorderWidth};`}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-label={ariaLabel}\n>\n {#if choiceMode === 'image' && displayChoice?.imageUrl}\n <img\n src={displayChoice.imageUrl}\n alt={displayChoice.imageAlt || 'Selected answer image'}\n class=\"w-auto object-contain pie-blank-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else if displayChoiceLabelHtml}\n <span class=\"cloze-marker-value pie-blank-value\">{@html displayChoiceLabelHtml}</span>\n {:else}\n <span class=\"cloze-marker-empty\">\n <span aria-hidden=\"true\"> </span>\n <span class=\"sr-only\">(blank)</span>\n </span>\n {/if}\n</span>\n\n<style>\n .cloze-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n vertical-align: baseline;\n }\n\n .cloze-marker:focus-within {\n outline: 2px solid var(--mpb-focus-ring, #1565c0);\n outline-offset: 2px;\n }\n\n .cloze-marker-standalone {\n width: var(--mpb-blank-standalone-width, 7rem);\n }\n\n .cloze-marker-empty {\n display: inline-block;\n min-width: 4ch;\n }\n\n .cloze-marker-value {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n .cloze-marker-value :global(p) {\n margin: 0;\n }\n\n /* Same 150x150 content-element constraint as ChoiceRow.svelte's .choice-html\n img — the selected choice's raw labelHtml can carry an embedded <img> here\n too, regardless of customType. See CONTOOL-3159. */\n .cloze-marker-value :global(img) {\n width: 150px;\n height: 150px;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n</style>\n","<script lang=\"ts\">\ninterface Choice {\n id: string;\n labelHtml?: string;\n imageUrl?: string;\n imageAlt?: string;\n}\n\nlet {\n choice,\n choiceMode = 'text',\n isHorizontal = false,\n isSelected = false,\n isDisabled = false,\n correctness = undefined,\n isEvaluateMode = false,\n instanceId,\n radioGroupName,\n}: {\n choice: Choice;\n choiceMode?: 'text' | 'image';\n isHorizontal?: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n correctness?: 'correct' | 'incorrect' | undefined;\n isEvaluateMode?: boolean;\n instanceId: string;\n radioGroupName: string;\n} = $props();\n</script>\n\n<div\n class={`flex items-start choice-row pie-choice ${isHorizontal ? 'choice-row-horizontal pie-choice-horizontal' : ''} ${isSelected ? 'is-selected pie-choice-selected' : ''} ${correctness ? `choice-${correctness} pie-choice-${correctness}` : ''}`}\n style=\"gap:var(--mpb-choice-row-gap, 0.5rem);\"\n>\n {#if isHorizontal}\n <label\n for={`${instanceId}-opt-${choice.id}`}\n class=\"cursor-pointer choice-tile text-center pie-choice-tile\"\n >\n <span class=\"choice-tile-content pie-choice-tile-content\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || `Choice ${choice.id}`}\n class=\"object-contain pie-choice-image\"\n style=\"max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </span>\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-bottom pie-choice-radio pie-choice-radio-bottom\"\n />\n </label>\n {:else}\n <input\n type=\"radio\"\n name={radioGroupName}\n id={`${instanceId}-opt-${choice.id}`}\n value={choice.id}\n checked={isSelected}\n disabled={isDisabled}\n class=\"choice-radio-inline pie-choice-radio pie-choice-radio-inline\"\n />\n <label for={`${instanceId}-opt-${choice.id}`} class=\"cursor-pointer flex-1 pie-choice-label-wrap\">\n {#if choiceMode === 'image' && choice.imageUrl}\n <img\n src={choice.imageUrl}\n alt={choice.imageAlt || `Choice ${choice.id}`}\n class=\"object-contain pie-choice-image\"\n style=\"max-height:var(--mpb-choice-image-max-height, 5rem);\"\n />\n {:else}\n <span class=\"choice-html pie-choice-label\">{@html choice.labelHtml || ''}</span>\n {/if}\n </label>\n {/if}\n {#if isEvaluateMode && correctness}\n <span\n class={`pie-choice-feedback-badge ${correctness === 'correct' ? 'pie-choice-feedback-correct' : 'pie-choice-feedback-incorrect'}`}\n aria-hidden=\"true\"\n >\n {correctness === 'correct' ? '✓' : '✕'}\n </span>\n {/if}\n</div>\n\n<style>\n .choice-row-horizontal {\n flex-direction: column;\n align-items: center;\n width: min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n gap: 0;\n }\n\n .choice-tile {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n min-height: var(--mpb-choice-tile-min-height, 11rem);\n padding: 0.8rem 0.65rem 0.5rem;\n border-radius: 8px;\n background: transparent;\n transition: background-color 120ms ease-in-out;\n }\n\n .choice-tile-content {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--mpb-choice-content-min-height, 7.5rem);\n }\n\n .choice-row-horizontal:hover .choice-tile {\n background: var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));\n }\n\n .pie-choice-horizontal:not(.is-selected):not(:hover) .pie-choice-tile {\n background: transparent;\n }\n\n .choice-row-horizontal.is-selected .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .choice-row-horizontal.is-selected:hover .choice-tile {\n background: var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));\n }\n\n .pie-choice:not(.pie-choice-horizontal):hover .pie-choice-label-wrap {\n background: var(--pie-background-dark, #ecedf1);\n }\n\n .pie-choice:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap {\n background: transparent;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n border-radius: 6px;\n }\n\n .pie-choice:not(.pie-choice-horizontal).is-selected:hover .pie-choice-label-wrap {\n background: var(--pie-secondary-background, rgba(241, 241, 241, 1));\n }\n\n .pie-choice.choice-correct {\n border-left: 3px solid var(--pie-correct-tertiary, #0ea449);\n }\n\n .pie-choice.choice-incorrect {\n border-left: 3px solid var(--pie-incorrect-icon, #bf0d00);\n }\n\n .pie-choice-horizontal.choice-correct .choice-tile {\n background: var(--pie-correct-secondary, #e8f5e9);\n }\n\n .pie-choice-horizontal.choice-incorrect .choice-tile {\n background: var(--pie-incorrect-secondary, #ffebee);\n }\n\n .pie-choice-feedback-badge {\n margin-left: auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.1rem;\n height: 1.1rem;\n border-radius: 9999px;\n font-size: 0.72rem;\n line-height: 1;\n font-weight: 700;\n color: var(--pie-white, #ffffff);\n }\n\n .pie-choice-feedback-correct {\n background: var(--pie-correct-icon, #087d38);\n }\n\n .pie-choice-feedback-incorrect {\n background: var(--pie-incorrect-icon, #bf0d00);\n }\n\n .choice-row-horizontal :global(p) {\n margin: 0;\n text-align: center;\n }\n\n .choice-html :global(p) {\n margin: 0;\n }\n\n .choice-html {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n\n /* Choices carrying raw <img> markup in labelHtml (rather than the dedicated\n imageUrl/imageAlt fields) render unconstrained at their authored size\n otherwise — 3rd-party/CQT-sourced content is typically authored well above\n the platform's 150x150 content-element spec. Applies regardless of\n customType, unlike the r1-CQT-specific cqt-css overlays. See CONTOOL-3159. */\n .choice-html :global(img) {\n width: 150px;\n height: 150px;\n }\n\n .choice-radio-bottom {\n margin-top: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);\n padding: var(--mpb-choice-radio-padding, 0px);\n }\n\n .choice-radio-inline {\n margin-top: var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);\n }\n</style>\n","export interface ChoiceCorrectnessParams {\n isEvaluateMode: boolean;\n correctChoiceId: string;\n selectedId: string;\n showCorrectAnswer: boolean;\n}\n\n/**\n * Computes which choice ids should display a correctness badge and what kind.\n *\n * Reveal mode (showCorrectAnswer=true) shows only the canonical correct answer —\n * the student's wrong selection is deliberately suppressed so the UI only\n * highlights what to remember, not what to regret.\n *\n * Unanswered-in-evaluate (selectedId='') treats the correct choice as missed\n * (incorrect badge) rather than triggering the two-badge wrong-answer path.\n */\nexport function computeChoiceCorrectness(\n params: ChoiceCorrectnessParams\n): Map<string, 'correct' | 'incorrect'> {\n const map = new Map<string, 'correct' | 'incorrect'>();\n const { isEvaluateMode, correctChoiceId, selectedId, showCorrectAnswer } = params;\n\n if (!isEvaluateMode || !correctChoiceId) {\n return map;\n }\n if (showCorrectAnswer) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n if (!selectedId) {\n map.set(correctChoiceId, 'incorrect');\n return map;\n }\n if (selectedId === correctChoiceId) {\n map.set(correctChoiceId, 'correct');\n return map;\n }\n map.set(selectedId, 'incorrect');\n map.set(correctChoiceId, 'incorrect');\n return map;\n}\n","const BLANK_TOKEN = '{{blank}}';\n\nexport interface LayoutProfileParams {\n interactionMode?: string;\n template?: string;\n choiceLayout?: string;\n layoutProfile?: string;\n hasAudio?: boolean;\n useFeatureButtonAudio?: boolean | null;\n}\n\nexport interface LayoutProfileResult {\n isAudioOnlyMode: boolean;\n isBlankOnlyTemplate: boolean;\n choiceLayout: 'horizontal' | 'vertical';\n isHorizontalChoices: boolean;\n hasInlineSentenceAudioLayout: boolean;\n useFeatureButtonAudio: boolean;\n}\n\nconst FEATURE_BUTTON_PROFILES = new Set([\n 'audio_blank_only',\n 'stimulus_image_blank',\n 'token_sequence',\n]);\n\nexport function computeLayoutProfile(params: LayoutProfileParams): LayoutProfileResult {\n const {\n interactionMode = '',\n template = '',\n choiceLayout: configuredChoiceLayout,\n layoutProfile = '',\n hasAudio = false,\n useFeatureButtonAudio: configuredFeatureButton,\n } = params;\n\n const isAudioOnlyMode = interactionMode === 'audio_mc_only';\n\n const isBlankOnlyTemplate = (() => {\n if (!template) return false;\n const plain = template\n .replace(/<[^>]+>/g, '')\n .replace(/ /g, ' ')\n .trim();\n return plain === BLANK_TOKEN;\n })();\n\n const choiceLayout: 'horizontal' | 'vertical' =\n configuredChoiceLayout === 'horizontal' || configuredChoiceLayout === 'vertical'\n ? (configuredChoiceLayout as 'horizontal' | 'vertical')\n : isAudioOnlyMode || isBlankOnlyTemplate\n ? 'horizontal'\n : 'vertical';\n\n const isHorizontalChoices = choiceLayout === 'horizontal';\n\n const hasInlineSentenceAudioLayout = layoutProfile === 'inline_sentence' && hasAudio;\n\n const useFeatureButtonAudio =\n typeof configuredFeatureButton === 'boolean'\n ? configuredFeatureButton\n : hasAudio && FEATURE_BUTTON_PROFILES.has(layoutProfile);\n\n return {\n isAudioOnlyMode,\n isBlankOnlyTemplate,\n choiceLayout,\n isHorizontalChoices,\n hasInlineSentenceAudioLayout,\n useFeatureButtonAudio,\n };\n}\n","import { type LayoutLimits, DEFAULT_LAYOUT_LIMITS } from '../shared/layoutLimits';\nexport type { LayoutLimits };\nexport { DEFAULT_LAYOUT_LIMITS };\n\n/**\n * Maps every LayoutLimits key (except legendMaxChars, which is a return value not a CSS var)\n * to its --mpb-* CSS variable name and CSS unit.\n * Add a single entry here when adding a new layout limit.\n */\nexport const CSS_VAR_SPEC: Record<\n Exclude<keyof LayoutLimits, 'legendMaxChars'>,\n { varName: string; unit: string }\n> = {\n blankStandaloneWidthRem: { varName: '--mpb-blank-standalone-width', unit: 'rem' },\n blankWideWidthRem: { varName: '--mpb-blank-wide-width', unit: 'rem' },\n blankUnderlineWidthPx: { varName: '--mpb-blank-underline-width', unit: 'px' },\n blankUnderlineWideWidthPx: { varName: '--mpb-blank-underline-wide-width', unit: 'px' },\n horizontalChoiceWidthPx: { varName: '--mpb-choice-width-px', unit: 'px' },\n horizontalChoiceWidthVw: { varName: '--mpb-choice-width-vw', unit: 'vw' },\n horizontalChoiceTileMinHeightRem: { varName: '--mpb-choice-tile-min-height', unit: 'rem' },\n horizontalChoiceContentMinHeightRem: { varName: '--mpb-choice-content-min-height', unit: 'rem' },\n choiceImageMaxHeightRem: { varName: '--mpb-choice-image-max-height', unit: 'rem' },\n choiceImageMaxWidthRem: { varName: '--mpb-choice-image-max-width', unit: 'rem' },\n choiceGroupGapRem: { varName: '--mpb-choice-group-gap', unit: 'rem' },\n choiceRowGapRem: { varName: '--mpb-choice-row-gap', unit: 'rem' },\n horizontalChoiceRadioTopMarginRem: {\n varName: '--mpb-horizontal-choice-radio-top-margin',\n unit: 'rem',\n },\n narrowHorizontalChoiceMaxWidthPx: { varName: '--mpb-narrow-choice-max-width', unit: 'px' },\n toggleButtonGapRem: { varName: '--mpb-toggle-button-gap', unit: 'rem' },\n listenButtonSizePx: { varName: '--mpb-listen-button-size', unit: 'px' },\n audioBlankTemplateMarginTopRem: { varName: '--mpb-audio-blank-template-margin-top', unit: 'rem' },\n audioBlankTemplateMarginBottomRem: {\n varName: '--mpb-audio-blank-template-margin-bottom',\n unit: 'rem',\n },\n audioInstructionsMaxWidthPx: { varName: '--mpb-audio-instructions-max-width', unit: 'px' },\n stimulusMinColumnPx: { varName: '--mpb-stimulus-min-column', unit: 'px' },\n textMinColumnPx: { varName: '--mpb-text-min-column', unit: 'px' },\n stimulusGridColumnGapRem: { varName: '--mpb-stimulus-grid-column-gap', unit: 'rem' },\n stimulusGridRowGapRem: { varName: '--mpb-stimulus-grid-row-gap', unit: 'rem' },\n stimulusSentenceMarginTopRem: { varName: '--mpb-stimulus-sentence-margin-top', unit: 'rem' },\n stimulusChoicesMarginTopRem: { varName: '--mpb-stimulus-choices-margin-top', unit: 'rem' },\n tokenGridColumnGapRem: { varName: '--mpb-token-grid-column-gap', unit: 'rem' },\n tokenGridRowGapRem: { varName: '--mpb-token-grid-row-gap', unit: 'rem' },\n tokenTemplateMarginTopRem: { varName: '--mpb-token-template-margin-top', unit: 'rem' },\n tokenInlineTokenGapRem: { varName: '--mpb-token-inline-token-gap', unit: 'rem' },\n tokenChoicesMarginTopRem: { varName: '--mpb-token-choices-margin-top', unit: 'rem' },\n inlineGridColumnGapRem: { varName: '--mpb-inline-grid-column-gap', unit: 'rem' },\n inlineGridRowGapRem: { varName: '--mpb-inline-grid-row-gap', unit: 'rem' },\n inlineTemplateMarginTopRem: { varName: '--mpb-inline-template-margin-top', unit: 'rem' },\n inlineChoicesMarginTopRem: { varName: '--mpb-inline-choices-margin-top', unit: 'rem' },\n};\n\nexport const DEFAULT_LAYOUT_PROFILE_PRESETS: Record<string, Partial<LayoutLimits>> = {\n audio_blank_only: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n horizontalChoiceTileMinHeightRem: 11.25,\n horizontalChoiceContentMinHeightRem: 9.375,\n choiceGroupGapRem: 1,\n audioBlankTemplateMarginBottomRem: 1.875,\n },\n stimulus_image_blank: {\n blankWideWidthRem: 10,\n blankUnderlineWideWidthPx: 6,\n },\n token_sequence: {\n blankStandaloneWidthRem: 7,\n blankUnderlineWideWidthPx: 6,\n },\n};\n\nexport interface LayoutStyleResult {\n rootStyle: string;\n blankWidth: string;\n blankBorderWidth: string;\n legendMaxChars: number;\n}\n\nexport function computeLayoutStyle(params: {\n layoutProfile: string;\n isBlankOnlyTemplate: boolean;\n configuredLimits: unknown;\n customProfilePresets: unknown;\n}): LayoutStyleResult {\n const { layoutProfile, isBlankOnlyTemplate } = params;\n\n const configured =\n params.configuredLimits && typeof params.configuredLimits === 'object'\n ? (params.configuredLimits as Partial<LayoutLimits>)\n : {};\n const customPresets =\n params.customProfilePresets && typeof params.customProfilePresets === 'object'\n ? (params.customProfilePresets as Record<string, unknown>)\n : {};\n const customForProfile =\n customPresets[layoutProfile] && typeof customPresets[layoutProfile] === 'object'\n ? (customPresets[layoutProfile] as Partial<LayoutLimits>)\n : {};\n const profilePreset: Partial<LayoutLimits> = {\n ...(DEFAULT_LAYOUT_PROFILE_PRESETS[layoutProfile] ?? {}),\n ...customForProfile,\n };\n const l: LayoutLimits = { ...DEFAULT_LAYOUT_LIMITS, ...configured, ...profilePreset };\n\n const wideBlankProfiles = ['audio_blank_only', 'stimulus_image_blank'];\n const wideUnderlineProfiles = ['audio_blank_only', 'stimulus_image_blank', 'token_sequence'];\n\n const blankWidth = wideBlankProfiles.includes(layoutProfile)\n ? `${l.blankWideWidthRem}rem`\n : isBlankOnlyTemplate\n ? `${l.blankStandaloneWidthRem}rem`\n : 'auto';\n\n const blankBorderWidth = wideUnderlineProfiles.includes(layoutProfile)\n ? `${l.blankUnderlineWideWidthPx}px`\n : `${l.blankUnderlineWidthPx}px`;\n\n const cssVars = (Object.keys(CSS_VAR_SPEC) as (keyof typeof CSS_VAR_SPEC)[]).map(\n (key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`\n );\n const rootStyle = cssVars.join(';');\n\n return { rootStyle, blankWidth, blankBorderWidth, legendMaxChars: l.legendMaxChars };\n}\n","export type AudioButtonSkin = { silentUrl: string; playingUrl: string };\n\nexport const DEFAULT_AUDIO_BUTTON_SKINS: Record<string, AudioButtonSkin> = {\n default: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/0c9f2aa3-3cd5-4de7-93ef-541c24ca35da.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/231dfdc2-c113-4be5-91fb-e75a0ca5994b.svg',\n },\n es: {\n silentUrl:\n 'https://assets.learnosity.com/organisations/844/27a9d5b5-d873-4bd5-b9ba-22748782d8ba.svg',\n playingUrl:\n 'https://assets.learnosity.com/organisations/844/120f216d-96b7-4560-94b8-1d90710216b7.svg',\n },\n};\n\n/**\n * Resolves the audio button skin to display.\n * Priority: byLocale[exact] > byLocale[lang] > byLocale.default > customSingle > built-in default\n */\nexport function computeFeatureAudioSkin(params: {\n locale: unknown;\n audioButtonSkin: unknown;\n audioButtonSkinsByLocale: unknown;\n}): AudioButtonSkin {\n const locale = String(params.locale || '').toLowerCase();\n const lang = locale.slice(0, 2);\n const byLocale =\n params.audioButtonSkinsByLocale && typeof params.audioButtonSkinsByLocale === 'object'\n ? (params.audioButtonSkinsByLocale as Record<string, unknown>)\n : {};\n const customSingle =\n params.audioButtonSkin && typeof params.audioButtonSkin === 'object'\n ? (params.audioButtonSkin as AudioButtonSkin)\n : null;\n const defaultSkin = locale.startsWith('es')\n ? DEFAULT_AUDIO_BUTTON_SKINS.es\n : DEFAULT_AUDIO_BUTTON_SKINS.default;\n return (byLocale[locale] ||\n byLocale[lang] ||\n byLocale.default ||\n customSingle ||\n defaultSkin) as AudioButtonSkin;\n}\n\n/**\n * Returns the choice id that the ClozeMarker and selected-state highlight should display.\n * When the correct answer is revealed (alwaysShowCorrect or evaluate+showCorrectAnswer),\n * it shows the correct choice rather than the student's selection.\n */\nexport function computeDisplayChoiceId(params: {\n selectedId: string;\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n alwaysShowCorrect: boolean;\n correctChoiceId: string;\n}): string {\n const { selectedId, isEvaluateMode, showCorrectAnswer, alwaysShowCorrect, correctChoiceId } =\n params;\n if (alwaysShowCorrect && correctChoiceId) return correctChoiceId;\n if (isEvaluateMode && showCorrectAnswer && correctChoiceId) return correctChoiceId;\n return selectedId;\n}\n\n/**\n * Returns the screen-reader-only result announcement text shown after evaluate mode scoring.\n * Empty string means nothing is announced.\n */\nexport function computeResultText(params: {\n isEvaluateMode: boolean;\n showCorrectAnswer: boolean;\n isCorrect: boolean;\n isIncorrect: boolean;\n selectedId: string;\n}): string {\n const { isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId } = params;\n if (!isEvaluateMode || showCorrectAnswer) return '';\n if (isCorrect) return 'Correct answer selected';\n if (isIncorrect && selectedId) return 'Incorrect answer selected';\n return '';\n}\n\n/**\n * Returns the visible legend text for the choices fieldset.\n * Strips HTML, truncates to legendMaxChars with an ellipsis, falls back to answerChoicesLabel.\n */\nexport function computeLegendText(params: {\n prompt: string;\n legendMaxChars: number;\n answerChoicesLabel: string;\n}): string {\n const { prompt, legendMaxChars, answerChoicesLabel } = params;\n const plain = prompt\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n const maxChars = Math.max(8, legendMaxChars);\n if (!plain) return answerChoicesLabel;\n return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain;\n}\n","import selR1BaseCss from './cqt-css/sel-r1-base.css?raw';\nimport selR1PlusgggCss from './cqt-css/sel-r1-plusggg.css?raw';\nimport srVicCss from './cqt-css/sr-vic.css?raw';\nimport selVicCss from './cqt-css/sel-vic.css?raw';\nimport selR1GplusgggCss from './cqt-css/sel-r1-gplusggg.css?raw';\nimport selR1GStemCss from './cqt-css/sel-r1-g-stem.css?raw';\nimport selR1GgPlusCss from './cqt-css/sel-r1-gg-plus.css?raw';\nimport selR1GgplusCss from './cqt-css/sel-r1-ggplus.css?raw';\nimport selR1S3Css from './cqt-css/sel-r1-s3.css?raw';\n\nexport type VariantCssConfig = {\n variantId: string;\n variantClass: string;\n sourceUrl: string;\n cssText: string;\n};\n\nconst VARIANT_BY_CUSTOM_TYPE: Record<string, VariantCssConfig> = {\n 'sel_r1-_plusggg': {\n variantId: 'sel-r1-plusggg',\n variantClass: 'variant-sel-r1-plusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css',\n cssText: selR1PlusgggCss,\n },\n 'sr-vic': {\n variantId: 'sr-vic',\n variantClass: 'variant-sr-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css',\n cssText: srVicCss,\n },\n sel_vic: {\n variantId: 'sel-vic',\n variantClass: 'variant-sel-vic',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css',\n cssText: selVicCss,\n },\n 'sel_r1-_gplusggg': {\n variantId: 'sel-r1-gplusggg',\n variantClass: 'variant-sel-r1-gplusggg',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css',\n cssText: selR1GplusgggCss,\n },\n 'sel_r1-g_plusggg': {\n variantId: 'sel-r1-g-stem',\n variantClass: 'variant-sel-r1-g-stem',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css',\n cssText: selR1GStemCss,\n },\n 'sel_r1-gg_plusggg': {\n variantId: 'sel-r1-gg-plus',\n variantClass: 'variant-sel-r1-gg-plus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css',\n cssText: selR1GgPlusCss,\n },\n 'sel_r1-_ggplusggg': {\n variantId: 'sel-r1-ggplus',\n variantClass: 'variant-sel-r1-ggplus',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css',\n cssText: selR1GgplusCss,\n },\n 'sel_r1-s3_plusggg': {\n variantId: 'sel-r1-s3',\n variantClass: 'variant-sel-r1-s3',\n sourceUrl:\n 'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css',\n cssText: selR1S3Css,\n },\n};\n\nconst normalizeCustomType = (value: unknown): string => {\n const normalized = String(value || '')\n .trim()\n .toLowerCase();\n // Accept both base custom types and version-suffixed tags like \"...v0.0.1\".\n return normalized.replace(/v\\d+\\.\\d+\\.\\d+$/i, '');\n};\n\nexport const getVariantCssConfig = (customType: unknown): VariantCssConfig | undefined => {\n const normalized = normalizeCustomType(customType);\n return VARIANT_BY_CUSTOM_TYPE[normalized];\n};\n\nexport const getVariantRootClass = (customType: unknown): string => {\n return getVariantCssConfig(customType)?.variantClass || '';\n};\n\nconst SEL_R1_VARIANT_IDS = new Set([\n 'sel-r1-plusggg',\n 'sel-r1-gplusggg',\n 'sel-r1-g-stem',\n 'sel-r1-gg-plus',\n 'sel-r1-ggplus',\n 'sel-r1-s3',\n]);\n\nconst injectStyleOnce = (id: string, variantName: string, cssText: string): void => {\n const existing = document.getElementById(id) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== cssText) existing.textContent = cssText;\n return;\n }\n const style = document.createElement('style');\n style.id = id;\n style.setAttribute('data-mpb-variant', variantName);\n style.textContent = cssText;\n document.head.appendChild(style);\n};\n\nexport const ensureVariantCssInjected = (config?: VariantCssConfig): void => {\n if (!config?.cssText || typeof document === 'undefined') {\n return;\n }\n if (SEL_R1_VARIANT_IDS.has(config.variantId)) {\n injectStyleOnce('mc-populated-blank-css-sel-r1-base', 'sel-r1-base', selR1BaseCss);\n }\n injectStyleOnce(`mc-populated-blank-css-${config.variantId}`, config.variantId, config.cssText);\n};\n","<svelte:options\n customElement={{\n shadow: 'none',\n props: {\n model: { type: 'Object' },\n session: { type: 'Object' },\n options: { type: 'Object' },\n },\n }}\n/>\n\n<script lang=\"ts\">\nimport { forwardSessionChange, resolveDeliveryHost } from '@pie-lib/delivery-events-svelte';\nimport AudioPlayer from './AudioPlayer.svelte';\nimport ClozeMarker from './ClozeMarker.svelte';\nimport ChoiceRow from './ChoiceRow.svelte';\nimport { computeChoiceCorrectness } from './computeChoiceCorrectness';\nimport { computeLayoutProfile } from './computeLayoutProfile';\nimport { computeLayoutStyle, DEFAULT_LAYOUT_LIMITS } from './computeLayoutStyle';\nimport {\n computeFeatureAudioSkin,\n computeDisplayChoiceId,\n computeResultText,\n computeLegendText,\n} from './computeDisplayState';\nimport {\n ensureVariantCssInjected,\n getVariantCssConfig,\n getVariantRootClass,\n} from './variant-css-map';\n\nconst BLANK_TOKEN = '{{blank}}';\nconst DEFAULT_UI_TEXT = {\n answerChoices: 'Answer choices',\n selectedAnswerInSentence: 'Selected answer in sentence',\n blankPreSelectionHint: 'The answer you choose will appear on the blank line above.',\n showCorrectAnswer: 'Show correct answer',\n hideCorrectAnswer: 'Hide correct answer',\n clickToEnableAutoplay: 'Click to enable audio autoplay',\n audioResourceUnavailable: 'Audio is enabled but no playable audio URL is configured.',\n} as const;\n\nlet { model, session } = $props<{ model?: any; session?: any; options?: any }>();\nlet localChoiceId = $state('');\nlet toggleCorrectAnswerButtonEl = $state<HTMLButtonElement | null>(null);\nlet choicesGroupEl = $state<HTMLDivElement | null>(null);\nlet rootEl = $state<HTMLDivElement | null>(null);\nconst instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;\n\n// ---------------------------------------------------------------------------\n// Cluster: modeFlags — delivery mode, correctness, and answer-reveal state\n// Feeds: shouldShowCorrectAnswerToggle, choiceState, a11y\n// ---------------------------------------------------------------------------\nconst deliveryMode = $derived((model?.mode || model?.env?.mode || '').toString());\nconst isEvaluateMode = $derived(deliveryMode === 'evaluate');\nconst correctness = $derived(model?.correctness);\nconst isResponseCorrect = $derived(\n typeof model?.responseCorrect === 'boolean' ? model.responseCorrect : correctness === 'correct'\n);\nconst isCorrect = $derived(correctness === 'correct');\nconst isIncorrect = $derived(correctness === 'incorrect');\n\nlet showCorrectAnswer = $state(false);\nconst shouldShowCorrectAnswerToggle = $derived(\n isEvaluateMode && !isResponseCorrect && !!model?.correctChoiceId\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: layoutConfig — profile limits, blank sizing, choice layout, audio mode\n// Feeds: layout (rootStyle, blankWidth, blankBorderWidth, legendMaxChars), audioMode, choiceState\n// ---------------------------------------------------------------------------\nconst layoutProfile = $derived(model?.layoutProfile || '');\nconst layoutProfileFlags = $derived(\n computeLayoutProfile({\n interactionMode: model?.interactionMode,\n template: model?.template,\n choiceLayout: model?.choiceLayout,\n layoutProfile,\n hasAudio: model?.hasAudio,\n useFeatureButtonAudio: model?.useFeatureButtonAudio,\n })\n);\nconst isAudioOnlyMode = $derived(layoutProfileFlags.isAudioOnlyMode);\nconst isBlankOnlyTemplate = $derived(layoutProfileFlags.isBlankOnlyTemplate);\nconst isHorizontalChoices = $derived(layoutProfileFlags.isHorizontalChoices);\nconst hasInlineSentenceAudioLayout = $derived(layoutProfileFlags.hasInlineSentenceAudioLayout);\nconst useFeatureButtonAudio = $derived(layoutProfileFlags.useFeatureButtonAudio);\nconst layout = $derived(\n computeLayoutStyle({\n layoutProfile,\n isBlankOnlyTemplate,\n configuredLimits: model?.layoutLimits,\n customProfilePresets: model?.layoutProfilePresets,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: choiceState — selection, display choice, per-choice correctness, result text\n// Feeds: template blank display, choice rendering, fieldset, result sr-only text\n// ---------------------------------------------------------------------------\nconst choices = $derived(Array.isArray(model?.choices) ? model.choices : []);\nconst choiceMode = $derived(model?.choiceMode || 'text');\nconst selectedId = $derived(session?.choiceId || localChoiceId || '');\nconst radioGroupName = $derived(`${instanceId}-choice-group-${model?.id || '1'}`);\nconst displayChoiceId = $derived(\n computeDisplayChoiceId({\n selectedId,\n isEvaluateMode,\n showCorrectAnswer,\n alwaysShowCorrect: !!model?.alwaysShowCorrect,\n correctChoiceId: String(model?.correctChoiceId || ''),\n })\n);\nconst displayChoice = $derived.by(() => choices.find((c: any) => c.id === displayChoiceId));\nconst displayChoiceLabelHtml = $derived.by(() => String(displayChoice?.labelHtml || ''));\nconst resultText = $derived(\n computeResultText({ isEvaluateMode, showCorrectAnswer, isCorrect, isIncorrect, selectedId })\n);\nconst choiceCorrectnessById = $derived(\n computeChoiceCorrectness({\n isEvaluateMode,\n correctChoiceId: String(model?.correctChoiceId || ''),\n selectedId: String(selectedId || ''),\n showCorrectAnswer,\n })\n);\n\n// ---------------------------------------------------------------------------\n// Cluster: a11y — stable IDs, aria labelling, described-by relationships\n// Feeds: fieldset legend, radiogroup labelling, template described-by\n// ---------------------------------------------------------------------------\nconst uiText = $derived.by(() => ({\n ...DEFAULT_UI_TEXT,\n ...(model?.uiText || {}),\n}));\nconst promptId = $derived(`${instanceId}-prompt`);\nconst legendId = $derived(`${instanceId}-choices-legend`);\nconst resultId = $derived(`${instanceId}-result`);\nconst blankHintId = $derived(`${instanceId}-blank-hint`);\nconst legendText = $derived(\n computeLegendText({\n prompt: model?.prompt || '',\n legendMaxChars: layout.legendMaxChars,\n answerChoicesLabel: uiText.answerChoices,\n })\n);\nconst choicesGroupLabelledBy = $derived(model?.prompt ? promptId : undefined);\nconst choicesGroupAriaLabel = $derived.by(() => {\n if (model?.prompt) return undefined;\n const explicit = String(model?.choiceGroupLabel || '').trim();\n if (explicit) return explicit;\n return legendText;\n});\n// The transcript is not among these: it is rendered by the player from the item's\n// accessibility catalog (PIE-902), so this element neither owns the node nor has\n// an id to point at. It is placed immediately before this content in reading\n// order instead, as a labelled region.\nconst templateDescribedBy = $derived.by(() => (model?.prompt ? promptId : undefined));\n\n// ---------------------------------------------------------------------------\n// Misc — locale, audio error, template parsing, variant CSS, style strings\n// ---------------------------------------------------------------------------\nconst lang = $derived.by(() => {\n const locale = model?.locale || '';\n return locale ? locale.slice(0, 2) : 'en';\n});\nconst variantCssConfig = $derived(getVariantCssConfig(model?.customType));\nconst variantRootClass = $derived(getVariantRootClass(model?.customType));\nconst templateParts = $derived.by(() => {\n const t = model?.template || '';\n const idx = t.indexOf(BLANK_TOKEN);\n if (idx < 0) return { before: t, after: '' };\n let before = t.slice(0, idx);\n let after = t.slice(idx + BLANK_TOKEN.length);\n // LSY's shared cloze renderer (Renaissance components/src/cloze.js) emits\n // literal ` ` on BOTH sides of the cloze span unconditionally:\n // ` <span ... -cloze-blank></span><span ... -cloze>…</span> `.\n // Mirror that ONLY for inline_sentence layouts (sel-vic, sr-vic, plain\n // sentence). Token-sequence layouts arrange tokens in a grid with explicit\n // sibling-margin spacing, so injecting NBSP throws off those tuned gaps;\n // they don't suffer the wrap-leader symptom either because each token has\n // its own grid placement. This (a) keeps the cloze glued to its neighbors\n // so it doesn't dangle at the start of a wrapped line (CONTOOL-2574), and\n // (b) matches LSY's cloze→adjacent-text gap when the author wrote no\n // whitespace around {{blank}} (CONTOOL-2572: e.g. `…word: {{blank}}.`).\n if (layoutProfile === 'inline_sentence') {\n before = `${before.replace(/\\s+$/, '')} `;\n after = ` ${after.replace(/^\\s+/, '')}`;\n }\n return { before, after };\n});\n\nfunction emitSession(updatedSession: any, sourceEl?: HTMLElement | null) {\n forwardSessionChange({\n sourceEl,\n fallbackSelector: 'mc-populated-blank',\n component: 'mc-populated-blank',\n session: updatedSession,\n complete: !!updatedSession?.choiceId,\n });\n}\n\nfunction onRadioChange(e: Event) {\n const input = e.target as HTMLInputElement;\n if (!input.checked) return;\n const choiceId = input.value;\n localChoiceId = choiceId;\n const updatedSession = {\n ...session,\n id: session?.id || model?.id || '1',\n element: 'mc-populated-blank',\n choiceId,\n };\n emitSession(updatedSession, input);\n}\n\nfunction toggleCorrectAnswer() {\n if (!shouldShowCorrectAnswerToggle) return;\n showCorrectAnswer = !showCorrectAnswer;\n}\n\n$effect(() => {\n if (!isEvaluateMode || isResponseCorrect) {\n showCorrectAnswer = false;\n }\n});\n\nfunction onRadioGroupKeydown(e: KeyboardEvent) {\n if (model?.disabled) return;\n const key = e.key;\n if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(key)) return;\n e.preventDefault();\n const container = e.currentTarget as HTMLElement;\n const inputs = Array.from(\n container.querySelectorAll('input[type=\"radio\"]:not([disabled])')\n ) as HTMLInputElement[];\n if (inputs.length === 0) return;\n let idx = inputs.findIndex((i) => i.checked);\n if (key === 'ArrowDown' || key === 'ArrowRight') {\n idx = idx < 0 ? 0 : (idx + 1) % inputs.length;\n } else {\n idx = idx < 0 ? inputs.length - 1 : (idx - 1 + inputs.length) % inputs.length;\n }\n const next = inputs[idx];\n next.checked = true;\n next.dispatchEvent(new Event('change', { bubbles: true }));\n next.focus();\n}\n\nconst featureAudioSkin = $derived(\n computeFeatureAudioSkin({\n locale: model?.locale,\n audioButtonSkin: model?.audioButtonSkin,\n audioButtonSkinsByLocale: model?.audioButtonSkinsByLocale,\n })\n);\n\nfunction onAudioStarted() {\n resolveDeliveryHost(rootEl, { fallbackSelector: 'mc-populated-blank' })?.onAudioStarted?.();\n}\n\nfunction onAudioEnded() {\n resolveDeliveryHost(rootEl, { fallbackSelector: 'mc-populated-blank' })?.onAudioEnded?.();\n}\n\n$effect(() => {\n if (session?.choiceId) {\n localChoiceId = session.choiceId;\n }\n});\n\n$effect(() => {\n const btn = toggleCorrectAnswerButtonEl;\n if (!btn) return;\n btn.addEventListener('click', toggleCorrectAnswer);\n return () => btn.removeEventListener('click', toggleCorrectAnswer);\n});\n\n// Delegated listeners on the choices group — two events with a radio-guard on change.\n$effect(() => {\n const group = choicesGroupEl;\n if (!group) return;\n const handleChange = (e: Event) => {\n const target = e.target as HTMLInputElement | null;\n if (target?.type !== 'radio') return;\n onRadioChange(e);\n };\n const handleKeydown = (e: KeyboardEvent) => onRadioGroupKeydown(e);\n group.addEventListener('change', handleChange);\n group.addEventListener('keydown', handleKeydown);\n return () => {\n group.removeEventListener('change', handleChange);\n group.removeEventListener('keydown', handleKeydown);\n };\n});\n\n$effect(() => {\n ensureVariantCssInjected(variantCssConfig);\n});\n</script>\n\n<div\n bind:this={rootEl}\n class={`p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${layoutProfile} ${variantRootClass} ${hasInlineSentenceAudioLayout ? 'has-inline-audio' : ''}`}\n lang={lang}\n style={layout.rootStyle}\n>\n {#if model?.prompt}\n <div class=\"mb-4 prose pie-prompt\" id={promptId}>{@html model.prompt}</div>\n {/if}\n\n {#if shouldShowCorrectAnswerToggle}\n <div class=\"pie-correct-answer-toggle-row\">\n <button\n bind:this={toggleCorrectAnswerButtonEl}\n type=\"button\"\n class=\"mb-3 pie-toggle-correct-answer\"\n style=\"gap:var(--mpb-toggle-button-gap, 0.5rem);\"\n aria-pressed={showCorrectAnswer}\n data-testid=\"show-correct-answer\"\n >\n <span class=\"pie-correct-answer-toggle-content\">\n <span class=\"pie-correct-answer-toggle-icon-holder\" aria-hidden=\"true\">\n {#if showCorrectAnswer}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-283 359 34 35\"\n >\n <circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"var(--pie-tertiary-light, #d0e2f0)\" />\n <path\n d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\"\n fill=\"var(--pie-tertiary-light, #d0e2f0)\"\n />\n <polygon\n points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {:else}\n <svg\n class=\"pie-correct-answer-toggle-svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n version=\"1.1\"\n viewBox=\"-129.5 127 34 35\"\n >\n <path\n d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n fill=\"#D0CAC5\"\n stroke=\"#E6E3E0\"\n stroke-width=\"0.75\"\n />\n <path\n d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n fill=\"#B3ABA4\"\n stroke=\"#CDC7C2\"\n stroke-width=\"0.5\"\n />\n <circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\" />\n <path\n d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\"\n fill=\"var(--pie-background-dark, #ecedf1)\"\n />\n <polygon\n points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\"\n fill=\"var(--pie-tertiary, #146eb3)\"\n />\n </svg>\n {/if}\n </span>\n <span class=\"pie-correct-answer-toggle-label\">\n {showCorrectAnswer ? uiText.hideCorrectAnswer : uiText.showCorrectAnswer}\n </span>\n </span>\n </button>\n </div>\n {/if}\n\n <AudioPlayer\n hasAudio={!!model?.hasAudio}\n audioUrl={model?.audioUrl}\n {useFeatureButtonAudio}\n autoplayEnabled={!!model?.autoplayAudioEnabled}\n {featureAudioSkin}\n {uiText}\n locale={model?.locale}\n onaudiostarted={onAudioStarted}\n onaudioended={onAudioEnded}\n />\n\n {#if model?.sentenceHtml}\n <div class=\"mb-3 prose prose-p:my-1 sentence-line pie-sentence-line\" aria-describedby={templateDescribedBy}>\n {@html model.sentenceHtml}\n </div>\n {/if}\n\n {#if !isAudioOnlyMode}\n <div class=\"mb-4 template-line pie-template-line\" aria-describedby={templateDescribedBy}\n >{@html templateParts.before}<ClozeMarker\n {choiceMode}\n displayChoice={displayChoice}\n {displayChoiceLabelHtml}\n isStandalone={isBlankOnlyTemplate}\n blankWidth={layout.blankWidth}\n blankBorderWidth={layout.blankBorderWidth}\n ariaLabel={uiText.selectedAnswerInSentence}\n />{@html templateParts.after}</div>\n {/if}\n\n {#if resultText}\n <p id={resultId} class=\"sr-only pie-result-feedback\" role=\"status\" aria-live=\"polite\">{resultText}</p>\n {/if}\n\n <p id={blankHintId} class=\"sr-only pie-blank-hint\">{uiText.blankPreSelectionHint}</p>\n\n <fieldset class=\"border-0 p-0 m-0 pie-choices-fieldset\" disabled={model?.disabled}>\n <legend class=\"sr-only pie-choices-legend\" id={legendId}>{legendText}</legend>\n <div\n bind:this={choicesGroupEl}\n class={`pie-choices ${isHorizontalChoices ? 'flex flex-row flex-wrap items-start justify-center' : 'flex flex-col'}`}\n style=\"gap:var(--mpb-choice-group-gap, 0.5rem);\"\n role=\"radiogroup\"\n tabindex=\"-1\"\n aria-labelledby={choicesGroupLabelledBy}\n aria-label={choicesGroupAriaLabel}\n aria-describedby={[blankHintId, resultText ? resultId : undefined].filter(Boolean).join(' ')}\n >\n {#each choices as c (c.id)}\n <ChoiceRow\n choice={c}\n {choiceMode}\n isHorizontal={isHorizontalChoices}\n isSelected={displayChoiceId === c.id}\n isDisabled={!!model?.disabled}\n correctness={choiceCorrectnessById.get(c.id)}\n {isEvaluateMode}\n {instanceId}\n {radioGroupName}\n />\n {/each}\n </div>\n </fieldset>\n</div>\n\n<style>\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n .mc-populated-blank-root {\n --mpb-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );\n }\n\n .mc-populated-blank-root :global(.prose) {\n max-width: none;\n }\n\n .pie-toggle-correct-answer {\n width: 100%;\n cursor: pointer;\n border: 0;\n background: transparent;\n padding: 0;\n display: flex;\n justify-content: center;\n text-align: center;\n color: var(--pie-text, black);\n }\n\n .pie-correct-answer-toggle-row {\n width: 100%;\n display: flex;\n justify-content: flex-end;\n }\n\n .pie-correct-answer-toggle-content {\n display: flex;\n margin: 0 auto;\n align-items: center;\n }\n\n .pie-correct-answer-toggle-icon-holder {\n width: 25px;\n margin-right: 5px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n .pie-correct-answer-toggle-svg {\n width: 25px;\n height: 25px;\n }\n\n .pie-correct-answer-toggle-label {\n width: fit-content;\n min-width: 140px;\n align-self: center;\n vertical-align: middle;\n font-weight: 400;\n user-select: none;\n }\n\n .pie-toggle-correct-answer:hover .pie-correct-answer-toggle-label,\n .pie-toggle-correct-answer:focus-visible .pie-correct-answer-toggle-label {\n text-decoration: underline;\n }\n\n .template-line {\n white-space: pre-wrap;\n }\n\n .template-line :global(p) {\n margin: 0;\n display: inline;\n }\n\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n display: flex;\n width: min(100%, var(--mpb-audio-instructions-max-width, 875px));\n margin-left: auto;\n margin-right: auto;\n justify-content: flex-end;\n }\n\n .layout-audio_blank_only .template-line,\n .layout-stimulus_image_blank .template-line {\n text-align: center;\n margin: var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);\n }\n\n .layout-audio_blank_only fieldset {\n display: flex;\n justify-content: center;\n }\n\n .layout-audio_blank_only :global(.pie-blank-slot),\n .layout-stimulus_image_blank :global(.pie-blank-slot) {\n width: var(--mpb-blank-wide-width, 10rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 6px);\n min-height: 160px;\n padding-bottom: 4px;\n }\n\n .layout-stimulus_image_blank {\n display: grid;\n grid-template-columns: minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;\n grid-template-areas:\n 'sentence audio'\n '. template'\n 'choices choices';\n column-gap: var(--mpb-stimulus-grid-column-gap, 2rem);\n row-gap: var(--mpb-stimulus-grid-row-gap, 0.7rem);\n align-items: start;\n }\n\n .layout-stimulus_image_blank :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n }\n\n .layout-stimulus_image_blank .sentence-line {\n grid-area: sentence;\n margin: var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;\n }\n\n .layout-stimulus_image_blank .template-line {\n grid-area: template;\n margin: 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-stimulus_image_blank fieldset {\n grid-area: choices;\n margin-top: var(--mpb-stimulus-choices-margin-top, 0.9rem);\n }\n\n .layout-token_sequence {\n display: grid;\n grid-template-columns: 1fr auto;\n grid-template-areas:\n 'audio audio'\n 'template template'\n 'choices choices';\n column-gap: var(--mpb-token-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-token-grid-row-gap, 0.8rem);\n align-items: start;\n }\n\n .layout-token_sequence :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-token_sequence .template-line {\n grid-area: template;\n margin: var(--mpb-token-template-margin-top, 0.6rem) 0 0;\n justify-self: center;\n text-align: center;\n }\n\n .layout-token_sequence .template-line :global(span + span) {\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence :global(.pie-blank-slot) {\n width: var(--mpb-blank-standalone-width, 7rem);\n border-bottom-width: var(--mpb-blank-underline-wide-width, 4px);\n margin-left: var(--mpb-token-inline-token-gap, 0.35rem);\n }\n\n .layout-token_sequence fieldset {\n grid-area: choices;\n margin-top: var(--mpb-token-choices-margin-top, 0.2rem);\n }\n\n .layout-inline_sentence.has-inline-audio {\n display: grid;\n grid-template-columns: minmax(var(--mpb-text-min-column, 260px), 1fr) auto;\n grid-template-areas:\n 'template audio'\n 'choices choices';\n column-gap: var(--mpb-inline-grid-column-gap, 1.5rem);\n row-gap: var(--mpb-inline-grid-row-gap, 0.65rem);\n align-items: start;\n }\n\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n }\n\n .layout-inline_sentence.has-inline-audio .template-line {\n grid-area: template;\n margin: var(--mpb-inline-template-margin-top, 0.45rem) 0 0;\n text-align: center;\n justify-self: center;\n }\n\n .layout-inline_sentence.has-inline-audio fieldset {\n grid-area: choices;\n margin-top: var(--mpb-inline-choices-margin-top, 0.25rem);\n }\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {\n .layout-audio_blank_only :global(.pie-audio-container),\n .layout-stimulus_image_blank :global(.pie-audio-container),\n .layout-token_sequence :global(.pie-audio-container),\n .layout-inline_sentence.has-inline-audio :global(.pie-audio-container) {\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n justify-content: flex-start;\n justify-self: start;\n }\n\n .layout-audio_blank_only .pie-choices,\n .layout-token_sequence .pie-choices,\n .layout-stimulus_image_blank .pie-choices,\n .layout-inline_sentence.has-inline-audio .pie-choices {\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n .layout-audio_blank_only .choice-row-horizontal,\n .layout-token_sequence .choice-row-horizontal,\n .layout-stimulus_image_blank .choice-row-horizontal,\n .layout-inline_sentence.has-inline-audio .choice-row-horizontal {\n width: min(100%, var(--mpb-narrow-choice-max-width, 230px));\n align-items: flex-start;\n }\n }\n</style>\n","import McPopulatedBlankComponent from './McPopulatedBlank.svelte';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n writeSessionInPlace,\n} from '@pie-lib/delivery-events-svelte';\n\nfunction isComplete(model: any, session: any, audioComplete = false): boolean {\n if (!session?.choiceId) return false;\n const requiresAudioCompletion =\n !!model?.autoplayAudioEnabled && !!model?.completeAudioEnabled && !!model?.hasAudio;\n if (requiresAudioCompletion && !audioComplete) return false;\n return true;\n}\n\nconst SvelteElementClass = (McPopulatedBlankComponent as any).element;\n\nclass McPopulatedBlankElement extends SvelteElementClass {\n _internalSession: any = null;\n /**\n * The session object the player handed us. A player reads the learner's\n * response back off this object, so every update is written into it as well\n * as into the copy the component renders from.\n */\n _playerSession: any = null;\n _model: any = null;\n _options: any = null;\n audioComplete = false;\n\n _dispatchModelSet = () => {\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)\n );\n };\n\n _dispatchSessionChanged = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));\n };\n\n set model(m: any) {\n this._model = m;\n this.audioComplete = false;\n super.model = m;\n this._dispatchModelSet();\n }\n\n get model() {\n return this._model;\n }\n\n set session(s: any) {\n this._playerSession = s;\n this._internalSession = s;\n super.session = s;\n this._dispatchSessionChanged();\n }\n\n get session() {\n return this._internalSession;\n }\n\n set options(o: any) {\n this._options = o;\n super.options = o;\n }\n\n get options() {\n return this._options;\n }\n\n onSessionChange = (updatedSession: any) => {\n this._writeSession(updatedSession);\n super.session = updatedSession;\n this._dispatchSessionChanged();\n };\n\n onAudioStarted = () => {\n this._writeSession({\n ...(this._internalSession || {}),\n audioStartTime: Date.now(),\n });\n };\n\n onAudioEnded = () => {\n this.audioComplete = true;\n this._writeSession({\n ...(this._internalSession || {}),\n audioEndTime: Date.now(),\n });\n this._dispatchSessionChanged();\n };\n\n _writeSession = (updatedSession: any) => {\n writeSessionInPlace(this._playerSession, updatedSession);\n this._internalSession = updatedSession;\n };\n\n _isComplete = () => {\n return isComplete(this._model, this._internalSession, this.audioComplete);\n };\n\n connectedCallback() {\n super.connectedCallback();\n (this as any).onSessionChange = this.onSessionChange;\n (this as any).onAudioStarted = this.onAudioStarted;\n (this as any).onAudioEnded = this.onAudioEnded;\n }\n}\n\nexport default McPopulatedBlankElement;\n"],"mappings":";;;AACA,IAAI,IAAI,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GAAGA,IAAI,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;GACZ;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GC5BI,KAAK,MAAM;CACd,IAAI,IAAI;CACR,OAAO,IAAI,OAAO,EAAE,mBAAmB,cAAc,OAAO,EAAE,kBAAkB,cAAc,OAAO,EAAE,gBAAgB,aAAa,CAAC;AACtI;AACA,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG;CACrB,IAAI,IAAI,EAAE,iBAAiB,GAAG,IAAI;CAClC,OAAO,IAAI;EACV,IAAI,EAAE,CAAC,GAAG,OAAO;EACjB,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AAK,iBACrC,KAAc,iBAAiB,KAAK,gBACpC,KAAc,eAAe,KAAK;CACpC;AACF"}
|
package/dist/delivery/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
declare const SvelteElementClass: any;
|
|
2
2
|
declare class McPopulatedBlankElement extends SvelteElementClass {
|
|
3
3
|
_internalSession: any;
|
|
4
|
+
/**
|
|
5
|
+
* The session object the player handed us. A player reads the learner's
|
|
6
|
+
* response back off this object, so every update is written into it as well
|
|
7
|
+
* as into the copy the component renders from.
|
|
8
|
+
*/
|
|
9
|
+
_playerSession: any;
|
|
4
10
|
_model: any;
|
|
5
11
|
_options: any;
|
|
6
12
|
audioComplete: boolean;
|
|
@@ -15,6 +21,7 @@ declare class McPopulatedBlankElement extends SvelteElementClass {
|
|
|
15
21
|
onSessionChange: (updatedSession: any) => void;
|
|
16
22
|
onAudioStarted: () => void;
|
|
17
23
|
onAudioEnded: () => void;
|
|
24
|
+
_writeSession: (updatedSession: any) => void;
|
|
18
25
|
_isComplete: () => boolean;
|
|
19
26
|
connectedCallback(): void;
|
|
20
27
|
}
|
package/dist/delivery/index.js
CHANGED
|
@@ -5329,7 +5329,21 @@ function n(e, n = {}) {
|
|
|
5329
5329
|
}
|
|
5330
5330
|
return null;
|
|
5331
5331
|
}
|
|
5332
|
-
function r(
|
|
5332
|
+
function r(e) {
|
|
5333
|
+
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
5334
|
+
}
|
|
5335
|
+
function i(e, t) {
|
|
5336
|
+
if (e === t) return e;
|
|
5337
|
+
if (!r(e) || !r(t) || Object.isFrozen(e) || !Object.isExtensible(e)) return t;
|
|
5338
|
+
try {
|
|
5339
|
+
for (let n of Object.keys(e)) n in t || delete e[n];
|
|
5340
|
+
Object.assign(e, t);
|
|
5341
|
+
} catch {
|
|
5342
|
+
return t;
|
|
5343
|
+
}
|
|
5344
|
+
return e;
|
|
5345
|
+
}
|
|
5346
|
+
function a({ sourceEl: t, fallbackSelector: r, component: i, complete: a, session: o }) {
|
|
5333
5347
|
let s = n(t, { fallbackSelector: r });
|
|
5334
5348
|
return s ? typeof s.onSessionChange == "function" ? (s.onSessionChange(o), s) : (s.dispatchEvent(new t$1(i, a)), s) : null;
|
|
5335
5349
|
}
|
|
@@ -6429,7 +6443,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6429
6443
|
};
|
|
6430
6444
|
});
|
|
6431
6445
|
function emitSession(updatedSession, sourceEl) {
|
|
6432
|
-
|
|
6446
|
+
a({
|
|
6433
6447
|
sourceEl,
|
|
6434
6448
|
fallbackSelector: "mc-populated-blank",
|
|
6435
6449
|
component: "mc-populated-blank",
|
|
@@ -6749,6 +6763,16 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
6749
6763
|
constructor(..._args) {
|
|
6750
6764
|
super(..._args);
|
|
6751
6765
|
_defineProperty(this, "_internalSession", null);
|
|
6766
|
+
_defineProperty(
|
|
6767
|
+
this,
|
|
6768
|
+
/**
|
|
6769
|
+
* The session object the player handed us. A player reads the learner's
|
|
6770
|
+
* response back off this object, so every update is written into it as well
|
|
6771
|
+
* as into the copy the component renders from.
|
|
6772
|
+
*/
|
|
6773
|
+
"_playerSession",
|
|
6774
|
+
null
|
|
6775
|
+
);
|
|
6752
6776
|
_defineProperty(this, "_model", null);
|
|
6753
6777
|
_defineProperty(this, "_options", null);
|
|
6754
6778
|
_defineProperty(this, "audioComplete", false);
|
|
@@ -6759,24 +6783,28 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
6759
6783
|
this.dispatchEvent(new t$1(this.tagName.toLowerCase(), this._isComplete()));
|
|
6760
6784
|
});
|
|
6761
6785
|
_defineProperty(this, "onSessionChange", (updatedSession) => {
|
|
6762
|
-
this.
|
|
6786
|
+
this._writeSession(updatedSession);
|
|
6763
6787
|
super.session = updatedSession;
|
|
6764
6788
|
this._dispatchSessionChanged();
|
|
6765
6789
|
});
|
|
6766
6790
|
_defineProperty(this, "onAudioStarted", () => {
|
|
6767
|
-
this.
|
|
6791
|
+
this._writeSession({
|
|
6768
6792
|
...this._internalSession || {},
|
|
6769
6793
|
audioStartTime: Date.now()
|
|
6770
|
-
};
|
|
6794
|
+
});
|
|
6771
6795
|
});
|
|
6772
6796
|
_defineProperty(this, "onAudioEnded", () => {
|
|
6773
6797
|
this.audioComplete = true;
|
|
6774
|
-
this.
|
|
6798
|
+
this._writeSession({
|
|
6775
6799
|
...this._internalSession || {},
|
|
6776
6800
|
audioEndTime: Date.now()
|
|
6777
|
-
};
|
|
6801
|
+
});
|
|
6778
6802
|
this._dispatchSessionChanged();
|
|
6779
6803
|
});
|
|
6804
|
+
_defineProperty(this, "_writeSession", (updatedSession) => {
|
|
6805
|
+
i(this._playerSession, updatedSession);
|
|
6806
|
+
this._internalSession = updatedSession;
|
|
6807
|
+
});
|
|
6780
6808
|
_defineProperty(this, "_isComplete", () => {
|
|
6781
6809
|
return isComplete(this._model, this._internalSession, this.audioComplete);
|
|
6782
6810
|
});
|
|
@@ -6791,6 +6819,7 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
6791
6819
|
return this._model;
|
|
6792
6820
|
}
|
|
6793
6821
|
set session(s) {
|
|
6822
|
+
this._playerSession = s;
|
|
6794
6823
|
this._internalSession = s;
|
|
6795
6824
|
super.session = s;
|
|
6796
6825
|
this._dispatchSessionChanged();
|