@astl/astrolabe 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/LICENSE +202 -0
- package/README.md +65 -0
- package/dist/cdn/astrolabe-editor.js +1441 -0
- package/dist/cdn/astrolabe-editor.js.map +1 -0
- package/dist/cdn/astrolabe-player.js +2 -0
- package/dist/cdn/astrolabe-player.js.map +1 -0
- package/dist/cdn/astrolabe.css +238 -0
- package/dist/cdn/astrolabe.js +3 -0
- package/dist/cdn/astrolabe.js.map +1 -0
- package/dist/cdn/astrolabe.standalone.js +8007 -0
- package/dist/cdn/chunks/audio-B0LSIn5N.js +48 -0
- package/dist/cdn/chunks/audio-B0LSIn5N.js.map +1 -0
- package/dist/cdn/chunks/audio-manifest-B9FWQzRy.js +2 -0
- package/dist/cdn/chunks/audio-manifest-B9FWQzRy.js.map +1 -0
- package/dist/cdn/chunks/block-styles-CKo9x7Vt.js +68 -0
- package/dist/cdn/chunks/block-styles-CKo9x7Vt.js.map +1 -0
- package/dist/cdn/chunks/book-CHzDDaim.js +15 -0
- package/dist/cdn/chunks/book-CHzDDaim.js.map +1 -0
- package/dist/cdn/chunks/callout-QFLFLPc5.js +49 -0
- package/dist/cdn/chunks/callout-QFLFLPc5.js.map +1 -0
- package/dist/cdn/chunks/callout-manifest-Cb12O4jl.js +2 -0
- package/dist/cdn/chunks/callout-manifest-Cb12O4jl.js.map +1 -0
- package/dist/cdn/chunks/categorise-BO2tNVJ3.js +203 -0
- package/dist/cdn/chunks/categorise-BO2tNVJ3.js.map +1 -0
- package/dist/cdn/chunks/categorise-manifest-C_hEDVYQ.js +2 -0
- package/dist/cdn/chunks/categorise-manifest-C_hEDVYQ.js.map +1 -0
- package/dist/cdn/chunks/chip-styles-Dme5daTO.js +77 -0
- package/dist/cdn/chunks/chip-styles-Dme5daTO.js.map +1 -0
- package/dist/cdn/chunks/choice-CExBvqKj.js +136 -0
- package/dist/cdn/chunks/choice-CExBvqKj.js.map +1 -0
- package/dist/cdn/chunks/choice-manifest-C-XahD7m.js +2 -0
- package/dist/cdn/chunks/choice-manifest-C-XahD7m.js.map +1 -0
- package/dist/cdn/chunks/color-control-Cl5cuMSO.js +91 -0
- package/dist/cdn/chunks/color-control-Cl5cuMSO.js.map +1 -0
- package/dist/cdn/chunks/crossword-Cb-a3Tjj.js +270 -0
- package/dist/cdn/chunks/crossword-Cb-a3Tjj.js.map +1 -0
- package/dist/cdn/chunks/crossword-manifest-2qlu7AYd.js +2 -0
- package/dist/cdn/chunks/crossword-manifest-2qlu7AYd.js.map +1 -0
- package/dist/cdn/chunks/declarations-BhqOz1ap.js +2 -0
- package/dist/cdn/chunks/declarations-BhqOz1ap.js.map +1 -0
- package/dist/cdn/chunks/definitions-CNX90WtL.js +6 -0
- package/dist/cdn/chunks/definitions-CNX90WtL.js.map +1 -0
- package/dist/cdn/chunks/directive-helpers-D7lOZKnB.js +14 -0
- package/dist/cdn/chunks/directive-helpers-D7lOZKnB.js.map +1 -0
- package/dist/cdn/chunks/drop-manifest-bzNOa5ks.js +2 -0
- package/dist/cdn/chunks/drop-manifest-bzNOa5ks.js.map +1 -0
- package/dist/cdn/chunks/drop-vRXndjHu.js +86 -0
- package/dist/cdn/chunks/drop-vRXndjHu.js.map +1 -0
- package/dist/cdn/chunks/flash-cards-0NrrKdrx.js +87 -0
- package/dist/cdn/chunks/flash-cards-0NrrKdrx.js.map +1 -0
- package/dist/cdn/chunks/flash-cards-manifest-B8nWXbRy.js +2 -0
- package/dist/cdn/chunks/flash-cards-manifest-B8nWXbRy.js.map +1 -0
- package/dist/cdn/chunks/gap-lor-khst.js +78 -0
- package/dist/cdn/chunks/gap-lor-khst.js.map +1 -0
- package/dist/cdn/chunks/gap-manifest-RSydA41N.js +2 -0
- package/dist/cdn/chunks/gap-manifest-RSydA41N.js.map +1 -0
- package/dist/cdn/chunks/help-C-woafz5.js +138 -0
- package/dist/cdn/chunks/help-C-woafz5.js.map +1 -0
- package/dist/cdn/chunks/help-form-DaC6KaFG.js +160 -0
- package/dist/cdn/chunks/help-form-DaC6KaFG.js.map +1 -0
- package/dist/cdn/chunks/hotspot-manifest-CNs1oiZ_.js +2 -0
- package/dist/cdn/chunks/hotspot-manifest-CNs1oiZ_.js.map +1 -0
- package/dist/cdn/chunks/hotspot-oel1Eelo.js +154 -0
- package/dist/cdn/chunks/hotspot-oel1Eelo.js.map +1 -0
- package/dist/cdn/chunks/image-drop-Dkprw0Kn.js +295 -0
- package/dist/cdn/chunks/image-drop-Dkprw0Kn.js.map +1 -0
- package/dist/cdn/chunks/image-drop-manifest-BZ6hCoAd.js +2 -0
- package/dist/cdn/chunks/image-drop-manifest-BZ6hCoAd.js.map +1 -0
- package/dist/cdn/chunks/image-label-Dm5shQSh.js +177 -0
- package/dist/cdn/chunks/image-label-Dm5shQSh.js.map +1 -0
- package/dist/cdn/chunks/image-label-manifest--1CLRJzd.js +2 -0
- package/dist/cdn/chunks/image-label-manifest--1CLRJzd.js.map +1 -0
- package/dist/cdn/chunks/inline-styles-CTgXWnHb.js +80 -0
- package/dist/cdn/chunks/inline-styles-CTgXWnHb.js.map +1 -0
- package/dist/cdn/chunks/insert-menu-LgrifBYT.js +80 -0
- package/dist/cdn/chunks/insert-menu-LgrifBYT.js.map +1 -0
- package/dist/cdn/chunks/issue-list-BgnXzXRM.js +51 -0
- package/dist/cdn/chunks/issue-list-BgnXzXRM.js.map +1 -0
- package/dist/cdn/chunks/keys-DU-Qknmz.js +2 -0
- package/dist/cdn/chunks/keys-DU-Qknmz.js.map +1 -0
- package/dist/cdn/chunks/live-jdiyYln2.js +7 -0
- package/dist/cdn/chunks/live-jdiyYln2.js.map +1 -0
- package/dist/cdn/chunks/long-answer-CtzClLAx.js +71 -0
- package/dist/cdn/chunks/long-answer-CtzClLAx.js.map +1 -0
- package/dist/cdn/chunks/long-answer-manifest-BYJpZRtB.js +2 -0
- package/dist/cdn/chunks/long-answer-manifest-BYJpZRtB.js.map +1 -0
- package/dist/cdn/chunks/mark-words-CpH3gTcX.js +131 -0
- package/dist/cdn/chunks/mark-words-CpH3gTcX.js.map +1 -0
- package/dist/cdn/chunks/mark-words-manifest-Cs2pXCEx.js +2 -0
- package/dist/cdn/chunks/mark-words-manifest-Cs2pXCEx.js.map +1 -0
- package/dist/cdn/chunks/match-DKE_4o-x.js +352 -0
- package/dist/cdn/chunks/match-DKE_4o-x.js.map +1 -0
- package/dist/cdn/chunks/match-manifest-D0UfoajU.js +2 -0
- package/dist/cdn/chunks/match-manifest-D0UfoajU.js.map +1 -0
- package/dist/cdn/chunks/memory-B6hSyHyz.js +187 -0
- package/dist/cdn/chunks/memory-B6hSyHyz.js.map +1 -0
- package/dist/cdn/chunks/memory-manifest-D1589iR0.js +2 -0
- package/dist/cdn/chunks/memory-manifest-D1589iR0.js.map +1 -0
- package/dist/cdn/chunks/menu-messages-Dx3jYUEp.js +2 -0
- package/dist/cdn/chunks/menu-messages-Dx3jYUEp.js.map +1 -0
- package/dist/cdn/chunks/messages-9xiYDvRT.js +2 -0
- package/dist/cdn/chunks/messages-9xiYDvRT.js.map +1 -0
- package/dist/cdn/chunks/option-styles-WKzjKmCH.js +50 -0
- package/dist/cdn/chunks/option-styles-WKzjKmCH.js.map +1 -0
- package/dist/cdn/chunks/order-BhG_6IC-.js +225 -0
- package/dist/cdn/chunks/order-BhG_6IC-.js.map +1 -0
- package/dist/cdn/chunks/order-manifest-J5IXN0he.js +2 -0
- package/dist/cdn/chunks/order-manifest-J5IXN0he.js.map +1 -0
- package/dist/cdn/chunks/pick-and-place-DVQIPYuL.js +2 -0
- package/dist/cdn/chunks/pick-and-place-DVQIPYuL.js.map +1 -0
- package/dist/cdn/chunks/picture-D10YRMYH.js +2 -0
- package/dist/cdn/chunks/picture-D10YRMYH.js.map +1 -0
- package/dist/cdn/chunks/picture-view-BKnAyScQ.js +92 -0
- package/dist/cdn/chunks/picture-view-BKnAyScQ.js.map +1 -0
- package/dist/cdn/chunks/repeat-CY2W2URZ.js +8 -0
- package/dist/cdn/chunks/repeat-CY2W2URZ.js.map +1 -0
- package/dist/cdn/chunks/roving-focus-BxGgi2DD.js +2 -0
- package/dist/cdn/chunks/roving-focus-BxGgi2DD.js.map +1 -0
- package/dist/cdn/chunks/runtime-DxAbpr3S.js +526 -0
- package/dist/cdn/chunks/runtime-DxAbpr3S.js.map +1 -0
- package/dist/cdn/chunks/scan-jWgPnVxA.js +2 -0
- package/dist/cdn/chunks/scan-jWgPnVxA.js.map +1 -0
- package/dist/cdn/chunks/select-DTA3dJzr.js +345 -0
- package/dist/cdn/chunks/select-DTA3dJzr.js.map +1 -0
- package/dist/cdn/chunks/select-manifest-BBMbvdkH.js +2 -0
- package/dist/cdn/chunks/select-manifest-BBMbvdkH.js.map +1 -0
- package/dist/cdn/chunks/source-view-DXKPFCl9.js +29 -0
- package/dist/cdn/chunks/source-view-DXKPFCl9.js.map +1 -0
- package/dist/cdn/chunks/style-form-D5haJtWM.js +240 -0
- package/dist/cdn/chunks/style-form-D5haJtWM.js.map +1 -0
- package/dist/cdn/chunks/style-messages-BbZpeD2a.js +2 -0
- package/dist/cdn/chunks/style-messages-BbZpeD2a.js.map +1 -0
- package/dist/cdn/chunks/style-model-ZXNe_c8R.js +2 -0
- package/dist/cdn/chunks/style-model-ZXNe_c8R.js.map +1 -0
- package/dist/cdn/chunks/style-placing-DPw1zyrz.js +2 -0
- package/dist/cdn/chunks/style-placing-DPw1zyrz.js.map +1 -0
- package/dist/cdn/chunks/style-popups-BobgX1WK.js +74 -0
- package/dist/cdn/chunks/style-popups-BobgX1WK.js.map +1 -0
- package/dist/cdn/chunks/style-rules-D45PZLCv.js +136 -0
- package/dist/cdn/chunks/style-rules-D45PZLCv.js.map +1 -0
- package/dist/cdn/chunks/styled-Dmx5Yjv7.js +57 -0
- package/dist/cdn/chunks/styled-Dmx5Yjv7.js.map +1 -0
- package/dist/cdn/chunks/styles-DxJJxVNH.js +136 -0
- package/dist/cdn/chunks/styles-DxJJxVNH.js.map +1 -0
- package/dist/cdn/chunks/surface-CgxfAwCR.js +1019 -0
- package/dist/cdn/chunks/surface-CgxfAwCR.js.map +1 -0
- package/dist/cdn/chunks/true-false-DP3MO599.js +146 -0
- package/dist/cdn/chunks/true-false-DP3MO599.js.map +1 -0
- package/dist/cdn/chunks/true-false-manifest-B4exv60u.js +2 -0
- package/dist/cdn/chunks/true-false-manifest-B4exv60u.js.map +1 -0
- package/dist/cdn/chunks/video-j9MCH6Kw.js +98 -0
- package/dist/cdn/chunks/video-j9MCH6Kw.js.map +1 -0
- package/dist/cdn/chunks/video-manifest-8OwkhhAI.js +2 -0
- package/dist/cdn/chunks/video-manifest-8OwkhhAI.js.map +1 -0
- package/dist/cdn/chunks/word-bank-ARjwUKZf.js +80 -0
- package/dist/cdn/chunks/word-bank-ARjwUKZf.js.map +1 -0
- package/dist/cdn/chunks/word-bank-manifest-C1FSo1kH.js +2 -0
- package/dist/cdn/chunks/word-bank-manifest-C1FSo1kH.js.map +1 -0
- package/dist/cdn/chunks/word-search-AHvM7yCJ.js +274 -0
- package/dist/cdn/chunks/word-search-AHvM7yCJ.js.map +1 -0
- package/dist/cdn/chunks/word-search-manifest-Fg1a59Z1.js +2 -0
- package/dist/cdn/chunks/word-search-manifest-Fg1a59Z1.js.map +1 -0
- package/dist/editor.d.ts +32 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +51 -0
- package/dist/editor.js.map +1 -0
- package/dist/engine.d.ts +33 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +53 -0
- package/dist/engine.js.map +1 -0
- package/dist/player.d.ts +19 -0
- package/dist/player.d.ts.map +1 -0
- package/dist/player.js +22 -0
- package/dist/player.js.map +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +8 -0
- package/dist/server.js.map +1 -0
- package/package.json +70 -4
- package/src/bundles/astrolabe-editor.ts +11 -0
- package/src/bundles/astrolabe-player.ts +10 -0
- package/src/bundles/astrolabe-standalone.ts +23 -0
- package/src/bundles/astrolabe.ts +12 -0
- package/src/editor.ts +98 -0
- package/src/engine.ts +59 -0
- package/src/player.ts +23 -0
- package/src/server.ts +7 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{$ as e,$t as t,Bt as n,Et as r,F as i,Ft as a,Gt as o,Ht as s,I as c,It as l,J as u,Jt as d,K as f,Kt as p,L as m,Lt as h,Nt as g,Ot as _,Pt as v,Rt as y,St as b,Tt as x,U as S,Vt as C,Wt as ee,Y as te,an as ne,at as re,bn as ie,bt as ae,cn as oe,dn as w,en as se,et as ce,fn as T,hn as le,it as ue,jt as E,kt as de,ln as fe,lt as pe,mn as me,nn as he,on as ge,ot as _e,pn as ve,rn as ye,rt as be,st as D,tn as xe,un as Se,xt as Ce,yn as we,zt as Te}from"./runtime-DxAbpr3S.js";import{c as Ee,d as De,l as Oe,n as ke,o as Ae,p as je,s as Me,t as Ne,u as Pe}from"./declarations-BhqOz1ap.js";import{n as Fe,r as Ie,t as Le}from"./audio-manifest-B9FWQzRy.js";import{n as Re,r as ze,t as Be}from"./callout-manifest-Cb12O4jl.js";import{n as Ve,r as He,t as Ue}from"./categorise-manifest-C_hEDVYQ.js";import{n as We,r as Ge,t as Ke}from"./choice-manifest-C-XahD7m.js";import{a as qe,i as Je,n as Ye,r as Xe,t as Ze}from"./crossword-manifest-2qlu7AYd.js";import{n as Qe,r as $e,t as et}from"./drop-manifest-bzNOa5ks.js";import{n as tt,r as nt,t as rt}from"./flash-cards-manifest-B8nWXbRy.js";import{n as it,r as at,t as ot}from"./gap-manifest-RSydA41N.js";import{a as st,i as ct,o as lt,r as ut}from"./picture-D10YRMYH.js";import{n as dt,r as ft,t as pt}from"./hotspot-manifest-CNs1oiZ_.js";import{n as mt,r as ht,t as gt}from"./image-drop-manifest-BZ6hCoAd.js";import{n as _t,r as vt,t as yt}from"./image-label-manifest--1CLRJzd.js";import{n as bt,r as xt,t as St}from"./long-answer-manifest-BYJpZRtB.js";import{n as Ct,r as wt,t as Tt}from"./mark-words-manifest-Cs2pXCEx.js";import{n as Et,r as Dt,t as Ot}from"./match-manifest-D0UfoajU.js";import{n as kt,r as At,t as jt}from"./memory-manifest-D1589iR0.js";import{n as Mt,r as Nt,t as Pt}from"./order-manifest-J5IXN0he.js";import{n as Ft,r as It,t as Lt}from"./select-manifest-BBMbvdkH.js";import{n as Rt,r as zt,t as Bt}from"./true-false-manifest-B4exv60u.js";import{n as Vt,r as Ht,t as Ut}from"./video-manifest-8OwkhhAI.js";import{n as Wt,r as Gt,t as Kt}from"./word-bank-manifest-C1FSo1kH.js";import{a as qt,i as Jt,o as Yt,t as Xt}from"./word-search-manifest-Fg1a59Z1.js";var Zt=Object.defineProperty,Qt=(e,t)=>{let n={};for(var r in e)Zt(n,r,{get:e[r],enumerable:!0});return t||Zt(n,Symbol.toStringTag,{value:`Module`}),n};function $t(e,t){let n=u(e),r=n=>t===`check`?n===`check`:n!==`never`&&e.reveal===`answers`;return{feedback:r(n.feedback),explanations:r(n.explanations)}}function en(e){let t={};return e.hints.length>0&&(t.hints=e.hints.map(String).join(` `)),e.explanation&&(t.explanation=``),e.feedback.length>0&&(t.feedback=e.feedback.join(` `)),t}var tn=e=>e===`empty`?`omitted`:e,nn=(e,t)=>e.help!==void 0&&Object.hasOwn(e.help,t)?e.help[t]:void 0;function rn(e){let t=new Map;for(let n of e.groups){let r=n.slots[0],i=r!==void 0&&Object.hasOwn(e.slots,r)?e.slots[r]?.group:void 0;i!==void 0&&t.set(n.id,i)}return t}function an(e,t){return[...rn(e).values()].includes(t)}function on(e){return e.every(e=>e===`empty`)?`empty`:e.every(e=>e===`correct`)?`correct`:e.some(e=>e===`correct`||e===`partial`)?`partial`:`incorrect`}function sn(e,t){let n=tn(t),r=e.feedback[n]??(n===`partial`?e.feedback.incorrect:void 0);return typeof r==`string`?{variant:n,html:r}:null}function cn(e,t,n,r){if(e.help===void 0||!n.feedback&&!n.explanations)return{};let i=rn(e),a=new Map(e.groups.map(e=>[e.id,e.page])),o=new Map,s=new Map;for(let e of t.groups){let t=(t,n)=>{n!==void 0&&t.set(n,[...t.get(n)??[],e.verdict])};t(o,i.get(e.id)),t(s,a.get(e.id))}let c={},l={},u=(t,r)=>{let i=nn(e,t);if(i===void 0)return;let a=n.feedback?sn(i,on(r)):null;a!==null&&(c[t]=a),n.explanations&&typeof i.explanation==`string`&&(l[t]=i.explanation)};for(let[e,t]of o)u(e,t);if(r===void 0)for(let e of Object.keys(t.pages)){let t=s.get(e);t!==void 0&&u(e,t)}return{...Object.keys(c).length===0?{}:{feedback:c},...Object.keys(l).length===0?{}:{explanations:l}}}function ln(e,t){let n=nn(e,t)?.hints;return Array.isArray(n)?n.length:0}function un(e,t,n){let r=nn(e,t)?.hints??[],i=Number.isInteger(n)&&n>=0?r[n]:void 0;return i===void 0?null:{html:i.html,index:n,left:r.length-n-1,cost:i.cost}}function dn(e){return Math.round(e*1e6)/1e6}var fn={invalid_request:{status:400,title:`A check names a page or an element, not both`},check_not_allowed:{status:403,title:`Checking is not allowed in this attempt`},checks_exhausted:{status:403,title:`No checks are left in this attempt`},hints_not_allowed:{status:403,title:`Hints are not offered in this attempt`},hints_exhausted:{status:403,title:`Every hint of it is used`},not_found:{status:404,title:`Unknown page or element`},attempt_closed:{status:409,title:`The attempt is already submitted`}};function O(e){let{status:t,title:n}=fn[e];return new fe({type:`urn:astrolabe:problem:${e}`,title:n,status:t,code:e})}function pn(e,t){return e.max===0||dn(e.score/e.max)>=t}function mn(e,t,n=f){if(!oe(t))throw TypeError(`localChecker: invalid answer key`);if(!te(n))throw TypeError(`localChecker: invalid attempt policy`);let r=0,i=!1,a={},o=()=>n.mode===`practice`?n.maxChecks===null?null:Math.max(0,n.maxChecks-r):0;return{get checksLeft(){return o()},get hintsUsed(){return{...a}},async check(s){let{page:c,element:l}=s;if(n.mode!==`practice`)throw O(S.checkNotAllowed);if(i)throw O(S.attemptClosed);if(c!==void 0&&l!==void 0)throw O(S.invalidRequest);if(l!==void 0&&u(n).checkScope!==`interaction`)throw O(S.checkNotAllowed);if(c!==void 0&&!t.pages.includes(c)||l!==void 0&&!an(t,l))throw O(S.notFound);if(o()===0)throw O(S.checksExhausted);r++;let d=c===void 0?l===void 0?{}:{element:l}:{page:c},f=e.grade(t,s.answers,{...d,hintsUsed:{...a}}),p=cn(t,f,$t(n,`check`),l);return{result:f,checksLeft:o(),...p}},async hint(e){if(!u(n).hints)throw O(S.hintsNotAllowed);if(i)throw O(S.attemptClosed);let r=e.element;if(ln(t,r)===0)throw O(S.notFound);let o=un(t,r,a[r]??0);if(o===null)throw O(S.hintsExhausted);return a[r]=o.index+1,o},async submit(r){if(i||n.mode===`review`)throw O(S.attemptClosed);i=!0;let o=e.grade(t,r.answers,{hintsUsed:{...a}}),s=n.reveal!==`nothing`;return{result:s?o:null,solution:n.reveal===`answers`?e.solution(t):null,passed:s&&n.passMark!==null?pn(o,n.passMark):null,submittedAt:new Date().toISOString(),...s?cn(t,o,$t(n,`submit`)):{}}}}}var hn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),k;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(k||={});var A={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function gn(e){return e>=55296&&e<=57343}function _n(e){return e>=56320&&e<=57343}function vn(e,t){return(e-55296)*1024+9216+t}function yn(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function bn(e){return e>=64976&&e<=65007||hn.has(e)}var j;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(j||={});var xn=65536,Sn=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=xn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(_n(t))return this.pos++,this._addGap(),vn(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,k.EOF;return this._err(j.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,k.EOF;let n=this.html.charCodeAt(t);return n===k.CARRIAGE_RETURN?k.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,k.EOF;let e=this.html.charCodeAt(this.pos);return e===k.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,k.LINE_FEED):e===k.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,gn(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===k.LINE_FEED||e===k.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){yn(e)?this._err(j.controlCharacterInInputStream):bn(e)&&this._err(j.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},M;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(M||={});function Cn(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var wn=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function Tn(e){return e===0||e>=55296&&e<=57343||e>1114111}function En(e){return Tn(e)?65533:e>=128&&e<=159&&wn[e-128]||e}function Dn(e){return Tn(e)?65533:e}var On=(()=>{let e=new Uint8Array(127),t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function kn(e,t,n,r,i,a){let o=e.length,s=a*90,c=0,l=()=>{let t=On[e.charCodeAt(c++)];return t<a?t:t*91-s+On[e.charCodeAt(c++)]},u=n-r,d=n+i,f=new Int32Array(d);f.fill(-1,r,a),f.fill(-1,a+u,d);let p=new Int32Array(d),m=new Int32Array(d);function h(t,n){let r=0,i=n,a=n+t;for(;i<a;){let t=On[e.charCodeAt(c++)];if(t<89)r+=t,f[i++]=r;else if(t===89){let t=On[e.charCodeAt(c++)]+2;for(;t--;)f[i++]=++r}else{let t=On[e.charCodeAt(c++)];r+=89+(t<90?t*91+On[e.charCodeAt(c++)]:On[e.charCodeAt(c++)]*8281+On[e.charCodeAt(c++)]*91+On[e.charCodeAt(c++)]),f[i++]=r}}}h(r,0),h(u,a);let g=new Int32Array(i*2),_=0,v=0;function y(e,t){for(let n=0;n<e;n++){let e=t+n,r=l(),i=l();g[v*2]=r,g[v*2+1]=i,v+=1,p[e]=_;let a=(f[r]<0?m[r]:1)+(f[i]<0?m[i]:1);m[e]=a,_+=a}}y(i-a+r,a+u),y(a-r,r);let b=new Uint16Array(_),x=0;for(let e=0;e<v;e++)for(let t=0;t<2;t++){let n=g[e*2+t],r=f[n];if(r<0){let e=p[n],t=e+m[n];for(;e<t;)b[x++]=b[e++]}else b[x++]=r}let S=new Uint16Array(t),C=0;for(;c<o;){let t=On[e.charCodeAt(c++)];t>=a&&(t=t*91-s+On[e.charCodeAt(c++)]);let n=f[t];if(n<0){let e=p[t],n=e+m[t];for(;e<n;)S[C++]=b[e++]}else S[C++]=n}return S}var An=kn("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61),jn=new Uint16Array([512,26465,29036,7,0,2,4,116,24638,116,24636,8693,29807,24610,621,1,0,0,3,112,24614,111,115,24615]),N;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`,e[e.VALUE_MASK=8191]=`VALUE_MASK`})(N||={});var P;(function(e){e[e.AMP=38]=`AMP`,e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_X=120]=`LOWER_X`})(P||={});var Mn=32;function Nn(e){return e-P.ZERO>>>0<=9}function Pn(e){return(e|Mn)-P.LOWER_A>>>0<=5}function Fn(e){return(e|Mn)-P.LOWER_A>>>0<=25}function In(e){return e===P.EQUALS||Fn(e)||Nn(e)}var F;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(F||={});var Ln;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Ln||={});var Rn=class{decodeTree;emitCodePoint;errors;state=F.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Ln.Strict;runConsumed=0;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}startEntity(e){this.decodeMode=e,this.state=F.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case F.EntityStart:return e.charCodeAt(t)===P.NUM?(this.state=F.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=F.NamedEntity,this.stateNamedEntity(e,t));case F.NumericStart:return this.stateNumericStart(e,t);case F.NumericDecimal:return this.stateNumericDecimal(e,t);case F.NumericHex:return this.stateNumericHex(e,t);default:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Mn)===P.LOWER_X?(this.state=F.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=F.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){let n=e.length,{result:r}=this,{consumed:i}=this;for(;t<n;){let n=e.charCodeAt(t);if(Nn(n)||Pn(n)){let e=n<=P.NINE?n-P.ZERO:(n|Mn)-P.LOWER_A+10;r=r*16+e,i+=1,t+=1}else return this.result=r,this.consumed=i,this.emitNumericEntity(n,3)}return this.result=r,this.consumed=i,-1}stateNumericDecimal(e,t){let n=e.length,{result:r}=this,{consumed:i}=this;for(;t<n;){let n=e.charCodeAt(t)-P.ZERO;if(n>>>0>9)return this.result=r,this.consumed=i,this.emitNumericEntity(n+P.ZERO,2);r=r*10+n,i+=1,t+=1}return this.result=r,this.consumed=i,-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===P.SEMI)this.consumed+=1;else if(this.decodeMode===Ln.Strict)return 0;return this.emitCodePoint((this.decodeTree===jn?Dn:En)(this.result),this.consumed),this.errors&&(e!==P.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}flushAndEmitLegacyOrReject(e,t,n,r){return this.consumed=e,this.excess=t,this.result===0||this.decodeMode===Ln.Attribute&&(r===0||t>1||In(n))?0:this.emitNotTerminatedNamedEntity()}stateNamedEntity(e,t){let{decodeTree:n}=this,r=e.length,i=this.decodeMode===Ln.Strict,{treeIndex:a}=this,{excess:o}=this,{consumed:s}=this,c=n[a];for(;t<r;){for(;(c&(N.VALUE_LENGTH|N.FLAG13))===0&&(c&N.JUMP_TABLE)!==0;){let i=e.charCodeAt(t),l=c&N.JUMP_TABLE,u=(c&N.BRANCH_LENGTH)>>7;if(u===0){if(i!==l)return this.flushAndEmitLegacyOrReject(s,o,i,0);a+=1}else{let e=i-l;if(e>>>0>=u)return this.flushAndEmitLegacyOrReject(s,o,i,0);let t=n[a+1+e];if(t===0)return this.flushAndEmitLegacyOrReject(s,o,i,0);a=a+u+t&65535}if(c=n[a],t+=1,o+=1,t>=r)break}if(t>=r)break;if((c&(N.VALUE_LENGTH|N.FLAG13))===N.FLAG13){let i=(c&N.BRANCH_LENGTH)>>7,{runConsumed:l}=this;if(l===0){let n=e.charCodeAt(t);if(n!==(c&N.JUMP_TABLE))return this.flushAndEmitLegacyOrReject(s,o,n,0);t+=1,o+=1,l=1}for(;l<i;){if(t>=r)return this.treeIndex=a,this.excess=o,this.consumed=s,this.runConsumed=l,-1;let i=l-1,c=n[a+1+(i>>1)]>>((i&1)<<3)&255,u=e.charCodeAt(t);if(u!==c)return this.runConsumed=0,this.flushAndEmitLegacyOrReject(s,o,u,0);t+=1,o+=1,l+=1}this.runConsumed=0,a+=1+(i>>1),c=n[a];continue}let l=c>>>14,u=e.charCodeAt(t);if(l!==0){if(!i&&(c&N.FLAG13)===0&&(this.result=a,s+=o-1,o=1),u===P.SEMI)return this.emitNamedEntityData(a,l,s+o);if(l===1)return this.flushAndEmitLegacyOrReject(s,o,u,l)}let d=zn(n,c,a+(l||1),u);if(d<0)return this.flushAndEmitLegacyOrReject(s,o,u,l);a=d,c=n[a],t+=1,o+=1}return!i&&c>>>14&&(c&N.FLAG13)===0&&(this.result=a,s+=o-1,o=1),this.treeIndex=a,this.excess=o,this.consumed=s,-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=t[e]>>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&N.VALUE_MASK:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case F.NamedEntity:return this.result!==0&&(this.decodeMode!==Ln.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case F.NumericDecimal:return this.emitNumericEntity(0,2);case F.NumericHex:return this.emitNumericEntity(0,3);case F.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;default:return 0}}};function zn(e,t,n,r){let i=(t&N.BRANCH_LENGTH)>>7,a=t&N.JUMP_TABLE;if(a){if(i===0)return r===a?n:-1;let t=r-a;if(t>>>0>=i)return-1;let o=e[n+t];return o===0?-1:n+i+o-1&65535}if(i===0)return-1;let o=i+1>>1,s=n+o+i;for(let t=0;t<i;t++){let i=e[n+(t>>1)]>>((t&1)<<3)&255;if(i===r)return s+e[n+o+t]&65535;if(i>r)return-1}return-1}var I;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(I||={});var Bn;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(Bn||={});var Vn;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(Vn||={});var L;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(L||={});var R;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(R||={});var Hn=new Map([[L.A,R.A],[L.ADDRESS,R.ADDRESS],[L.ANNOTATION_XML,R.ANNOTATION_XML],[L.APPLET,R.APPLET],[L.AREA,R.AREA],[L.ARTICLE,R.ARTICLE],[L.ASIDE,R.ASIDE],[L.B,R.B],[L.BASE,R.BASE],[L.BASEFONT,R.BASEFONT],[L.BGSOUND,R.BGSOUND],[L.BIG,R.BIG],[L.BLOCKQUOTE,R.BLOCKQUOTE],[L.BODY,R.BODY],[L.BR,R.BR],[L.BUTTON,R.BUTTON],[L.CAPTION,R.CAPTION],[L.CENTER,R.CENTER],[L.CODE,R.CODE],[L.COL,R.COL],[L.COLGROUP,R.COLGROUP],[L.DD,R.DD],[L.DESC,R.DESC],[L.DETAILS,R.DETAILS],[L.DIALOG,R.DIALOG],[L.DIR,R.DIR],[L.DIV,R.DIV],[L.DL,R.DL],[L.DT,R.DT],[L.EM,R.EM],[L.EMBED,R.EMBED],[L.FIELDSET,R.FIELDSET],[L.FIGCAPTION,R.FIGCAPTION],[L.FIGURE,R.FIGURE],[L.FONT,R.FONT],[L.FOOTER,R.FOOTER],[L.FOREIGN_OBJECT,R.FOREIGN_OBJECT],[L.FORM,R.FORM],[L.FRAME,R.FRAME],[L.FRAMESET,R.FRAMESET],[L.H1,R.H1],[L.H2,R.H2],[L.H3,R.H3],[L.H4,R.H4],[L.H5,R.H5],[L.H6,R.H6],[L.HEAD,R.HEAD],[L.HEADER,R.HEADER],[L.HGROUP,R.HGROUP],[L.HR,R.HR],[L.HTML,R.HTML],[L.I,R.I],[L.IMG,R.IMG],[L.IMAGE,R.IMAGE],[L.INPUT,R.INPUT],[L.IFRAME,R.IFRAME],[L.KEYGEN,R.KEYGEN],[L.LABEL,R.LABEL],[L.LI,R.LI],[L.LINK,R.LINK],[L.LISTING,R.LISTING],[L.MAIN,R.MAIN],[L.MALIGNMARK,R.MALIGNMARK],[L.MARQUEE,R.MARQUEE],[L.MATH,R.MATH],[L.MENU,R.MENU],[L.META,R.META],[L.MGLYPH,R.MGLYPH],[L.MI,R.MI],[L.MO,R.MO],[L.MN,R.MN],[L.MS,R.MS],[L.MTEXT,R.MTEXT],[L.NAV,R.NAV],[L.NOBR,R.NOBR],[L.NOFRAMES,R.NOFRAMES],[L.NOEMBED,R.NOEMBED],[L.NOSCRIPT,R.NOSCRIPT],[L.OBJECT,R.OBJECT],[L.OL,R.OL],[L.OPTGROUP,R.OPTGROUP],[L.OPTION,R.OPTION],[L.P,R.P],[L.PARAM,R.PARAM],[L.PLAINTEXT,R.PLAINTEXT],[L.PRE,R.PRE],[L.RB,R.RB],[L.RP,R.RP],[L.RT,R.RT],[L.RTC,R.RTC],[L.RUBY,R.RUBY],[L.S,R.S],[L.SCRIPT,R.SCRIPT],[L.SEARCH,R.SEARCH],[L.SECTION,R.SECTION],[L.SELECT,R.SELECT],[L.SOURCE,R.SOURCE],[L.SMALL,R.SMALL],[L.SPAN,R.SPAN],[L.STRIKE,R.STRIKE],[L.STRONG,R.STRONG],[L.STYLE,R.STYLE],[L.SUB,R.SUB],[L.SUMMARY,R.SUMMARY],[L.SUP,R.SUP],[L.TABLE,R.TABLE],[L.TBODY,R.TBODY],[L.TEMPLATE,R.TEMPLATE],[L.TEXTAREA,R.TEXTAREA],[L.TFOOT,R.TFOOT],[L.TD,R.TD],[L.TH,R.TH],[L.THEAD,R.THEAD],[L.TITLE,R.TITLE],[L.TR,R.TR],[L.TRACK,R.TRACK],[L.TT,R.TT],[L.U,R.U],[L.UL,R.UL],[L.SVG,R.SVG],[L.VAR,R.VAR],[L.WBR,R.WBR],[L.XMP,R.XMP]]);function Un(e){return Hn.get(e)??R.UNKNOWN}var z=R,Wn={[I.HTML]:new Set([z.ADDRESS,z.APPLET,z.AREA,z.ARTICLE,z.ASIDE,z.BASE,z.BASEFONT,z.BGSOUND,z.BLOCKQUOTE,z.BODY,z.BR,z.BUTTON,z.CAPTION,z.CENTER,z.COL,z.COLGROUP,z.DD,z.DETAILS,z.DIR,z.DIV,z.DL,z.DT,z.EMBED,z.FIELDSET,z.FIGCAPTION,z.FIGURE,z.FOOTER,z.FORM,z.FRAME,z.FRAMESET,z.H1,z.H2,z.H3,z.H4,z.H5,z.H6,z.HEAD,z.HEADER,z.HGROUP,z.HR,z.HTML,z.IFRAME,z.IMG,z.INPUT,z.LI,z.LINK,z.LISTING,z.MAIN,z.MARQUEE,z.MENU,z.META,z.NAV,z.NOEMBED,z.NOFRAMES,z.NOSCRIPT,z.OBJECT,z.OL,z.P,z.PARAM,z.PLAINTEXT,z.PRE,z.SCRIPT,z.SECTION,z.SELECT,z.SOURCE,z.STYLE,z.SUMMARY,z.TABLE,z.TBODY,z.TD,z.TEMPLATE,z.TEXTAREA,z.TFOOT,z.TH,z.THEAD,z.TITLE,z.TR,z.TRACK,z.UL,z.WBR,z.XMP]),[I.MATHML]:new Set([z.MI,z.MO,z.MN,z.MS,z.MTEXT,z.ANNOTATION_XML]),[I.SVG]:new Set([z.TITLE,z.FOREIGN_OBJECT,z.DESC]),[I.XLINK]:new Set,[I.XML]:new Set,[I.XMLNS]:new Set},Gn=new Set([z.H1,z.H2,z.H3,z.H4,z.H5,z.H6]);L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT;var B;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(B||={});var V={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function Kn(e){return e>=k.DIGIT_0&&e<=k.DIGIT_9}function qn(e){return e>=k.LATIN_CAPITAL_A&&e<=k.LATIN_CAPITAL_Z}function Jn(e){return e>=k.LATIN_SMALL_A&&e<=k.LATIN_SMALL_Z}function Yn(e){return Jn(e)||qn(e)}function Xn(e){return Yn(e)||Kn(e)}function Zn(e){return e+32}function Qn(e){return e===k.SPACE||e===k.LINE_FEED||e===k.TABULATION||e===k.FORM_FEED}function $n(e){return Qn(e)||e===k.SOLIDUS||e===k.GREATER_THAN_SIGN}function er(e){return e===k.NULL?j.nullCharacterReference:e>1114111?j.characterReferenceOutsideUnicodeRange:gn(e)?j.surrogateCharacterReference:bn(e)?j.noncharacterCharacterReference:yn(e)||e===k.CARRIAGE_RETURN?j.controlCharacterReference:null}var tr=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=B.DATA,this.returnState=B.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new Sn(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Rn(An,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(j.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(j.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=er(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:M.START_TAG,tagName:``,tagID:R.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:M.END_TAG,tagName:``,tagID:R.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:M.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:M.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(Cn(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(j.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Un(e.tagName),e.type===M.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(j.endTagWithAttributes),e.selfClosing&&this._err(j.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case M.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case M.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case M.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:M.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Qn(e)?M.WHITESPACE_CHARACTER:e===k.NULL?M.NULL_CHARACTER:M.CHARACTER;this._appendCharToCurrentCharacterToken(t,e<65536?String.fromCharCode(e):String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(M.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=B.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ln.Attribute:Ln.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case B.DATA:this._stateData(e);break;case B.RCDATA:this._stateRcdata(e);break;case B.RAWTEXT:this._stateRawtext(e);break;case B.SCRIPT_DATA:this._stateScriptData(e);break;case B.PLAINTEXT:this._statePlaintext(e);break;case B.TAG_OPEN:this._stateTagOpen(e);break;case B.END_TAG_OPEN:this._stateEndTagOpen(e);break;case B.TAG_NAME:this._stateTagName(e);break;case B.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case B.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case B.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case B.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case B.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case B.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case B.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case B.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case B.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case B.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case B.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case B.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case B.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case B.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case B.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case B.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case B.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case B.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case B.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case B.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case B.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case B.BOGUS_COMMENT:this._stateBogusComment(e);break;case B.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case B.COMMENT_START:this._stateCommentStart(e);break;case B.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case B.COMMENT:this._stateComment(e);break;case B.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case B.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case B.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case B.COMMENT_END:this._stateCommentEnd(e);break;case B.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case B.DOCTYPE:this._stateDoctype(e);break;case B.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case B.DOCTYPE_NAME:this._stateDoctypeName(e);break;case B.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case B.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case B.CDATA_SECTION:this._stateCdataSection(e);break;case B.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case B.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case B.CHARACTER_REFERENCE:this._stateCharacterReference();break;case B.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case k.LESS_THAN_SIGN:this.state=B.TAG_OPEN;break;case k.AMPERSAND:this._startCharacterReference();break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitCodePoint(e);break;case k.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case k.AMPERSAND:this._startCharacterReference();break;case k.LESS_THAN_SIGN:this.state=B.RCDATA_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case k.LESS_THAN_SIGN:this.state=B.RAWTEXT_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Yn(e))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(e);else switch(e){case k.EXCLAMATION_MARK:this.state=B.MARKUP_DECLARATION_OPEN;break;case k.SOLIDUS:this.state=B.END_TAG_OPEN;break;case k.QUESTION_MARK:this._err(j.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(e);break;case k.EOF:this._err(j.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(j.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=B.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Yn(e))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(e);else switch(e){case k.GREATER_THAN_SIGN:this._err(j.missingEndTagName),this.state=B.DATA;break;case k.EOF:this._err(j.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(j.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.BEFORE_ATTRIBUTE_NAME;break;case k.SOLIDUS:this.state=B.SELF_CLOSING_START_TAG;break;case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentTagToken();break;case k.NULL:this._err(j.unexpectedNullCharacter),t.tagName+=`�`;break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(qn(e)?Zn(e):e)}}_stateRcdataLessThanSign(e){e===k.SOLIDUS?this.state=B.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=B.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Yn(e)?(this.state=B.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=B.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=B.BEFORE_ATTRIBUTE_NAME,!1;case k.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=B.SELF_CLOSING_START_TAG,!1;case k.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=B.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=B.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===k.SOLIDUS?this.state=B.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=B.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Yn(e)?(this.state=B.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=B.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=B.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case k.SOLIDUS:this.state=B.SCRIPT_DATA_END_TAG_OPEN;break;case k.EXCLAMATION_MARK:this.state=B.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=B.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Yn(e)?(this.state=B.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=B.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=B.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===k.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=B.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===k.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=B.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case k.HYPHEN_MINUS:this.state=B.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case k.HYPHEN_MINUS:this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case k.HYPHEN_MINUS:this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case k.GREATER_THAN_SIGN:this.state=B.SCRIPT_DATA,this._emitChars(`>`);break;case k.NULL:this._err(j.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===k.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Yn(e)?(this._emitChars(`<`),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Yn(e)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(A.SCRIPT,!1)&&$n(this.preprocessor.peek(A.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<A.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case k.HYPHEN_MINUS:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case k.NULL:this._err(j.unexpectedNullCharacter),this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case k.HYPHEN_MINUS:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case k.NULL:this._err(j.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case k.HYPHEN_MINUS:this._emitChars(`-`);break;case k.LESS_THAN_SIGN:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case k.GREATER_THAN_SIGN:this.state=B.SCRIPT_DATA,this._emitChars(`>`);break;case k.NULL:this._err(j.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case k.EOF:this._err(j.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===k.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(A.SCRIPT,!1)&&$n(this.preprocessor.peek(A.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<A.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.SOLIDUS:case k.GREATER_THAN_SIGN:case k.EOF:this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case k.EQUALS_SIGN:this._err(j.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=B.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:case k.SOLIDUS:case k.GREATER_THAN_SIGN:case k.EOF:this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case k.EQUALS_SIGN:this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break;case k.QUOTATION_MARK:case k.APOSTROPHE:case k.LESS_THAN_SIGN:this._err(j.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case k.NULL:this._err(j.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(qn(e)?Zn(e):e)}}_stateAfterAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.SOLIDUS:this.state=B.SELF_CLOSING_START_TAG;break;case k.EQUALS_SIGN:this.state=B.BEFORE_ATTRIBUTE_VALUE;break;case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentTagToken();break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case k.APOSTROPHE:this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case k.GREATER_THAN_SIGN:this._err(j.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break;default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case k.QUOTATION_MARK:this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case k.AMPERSAND:this._startCharacterReference();break;case k.NULL:this._err(j.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case k.APOSTROPHE:this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case k.AMPERSAND:this._startCharacterReference();break;case k.NULL:this._err(j.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break;case k.AMPERSAND:this._startCharacterReference();break;case k.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break;case k.NULL:this._err(j.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case k.QUOTATION_MARK:case k.APOSTROPHE:case k.LESS_THAN_SIGN:case k.EQUALS_SIGN:case k.GRAVE_ACCENT:this._err(j.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break;case k.SOLIDUS:this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break;case k.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break;case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this._err(j.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case k.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case k.EOF:this._err(j.eofInTag),this._emitEOFToken();break;default:this._err(j.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentComment(t);break;case k.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case k.NULL:this._err(j.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(A.DASH_DASH,!0)?(this._createCommentToken(A.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(A.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(A.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(A.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(j.cdataInHtmlContent),this._createCommentToken(A.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(j.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case k.HYPHEN_MINUS:this.state=B.COMMENT_START_DASH;break;case k.GREATER_THAN_SIGN:{this._err(j.abruptClosingOfEmptyComment),this.state=B.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=B.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case k.HYPHEN_MINUS:this.state=B.COMMENT_END;break;case k.GREATER_THAN_SIGN:this._err(j.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(t);break;case k.EOF:this._err(j.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=B.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case k.HYPHEN_MINUS:this.state=B.COMMENT_END_DASH;break;case k.LESS_THAN_SIGN:t.data+=`<`,this.state=B.COMMENT_LESS_THAN_SIGN;break;case k.NULL:this._err(j.unexpectedNullCharacter),t.data+=`�`;break;case k.EOF:this._err(j.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case k.EXCLAMATION_MARK:t.data+=`!`,this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break;case k.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=B.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===k.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===k.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==k.GREATER_THAN_SIGN&&e!==k.EOF&&this._err(j.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case k.HYPHEN_MINUS:this.state=B.COMMENT_END;break;case k.EOF:this._err(j.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=B.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentComment(t);break;case k.EXCLAMATION_MARK:this.state=B.COMMENT_END_BANG;break;case k.HYPHEN_MINUS:t.data+=`-`;break;case k.EOF:this._err(j.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=B.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case k.HYPHEN_MINUS:t.data+=`--!`,this.state=B.COMMENT_END_DASH;break;case k.GREATER_THAN_SIGN:this._err(j.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(t);break;case k.EOF:this._err(j.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=B.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.BEFORE_DOCTYPE_NAME;break;case k.GREATER_THAN_SIGN:this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case k.EOF:{this._err(j.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(j.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(qn(e))this._createDoctypeToken(String.fromCharCode(Zn(e))),this.state=B.DOCTYPE_NAME;else switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.NULL:this._err(j.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=B.DOCTYPE_NAME;break;case k.GREATER_THAN_SIGN:{this._err(j.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=B.DATA;break}case k.EOF:{this._err(j.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=B.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.AFTER_DOCTYPE_NAME;break;case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.NULL:this._err(j.unexpectedNullCharacter),t.name+=`�`;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(qn(e)?Zn(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(A.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(A.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(j.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case k.QUOTATION_MARK:this._err(j.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:this._err(j.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case k.GREATER_THAN_SIGN:this._err(j.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:t.publicId=``,this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:t.publicId=``,this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case k.GREATER_THAN_SIGN:this._err(j.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case k.QUOTATION_MARK:this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case k.NULL:this._err(j.unexpectedNullCharacter),t.publicId+=`�`;break;case k.GREATER_THAN_SIGN:this._err(j.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case k.APOSTROPHE:this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case k.NULL:this._err(j.unexpectedNullCharacter),t.publicId+=`�`;break;case k.GREATER_THAN_SIGN:this._err(j.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case k.GREATER_THAN_SIGN:this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.QUOTATION_MARK:this._err(j.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:this._err(j.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.QUOTATION_MARK:t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case k.QUOTATION_MARK:this._err(j.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:this._err(j.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case k.GREATER_THAN_SIGN:this._err(j.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case k.APOSTROPHE:t.systemId=``,this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case k.GREATER_THAN_SIGN:this._err(j.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(t);break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case k.QUOTATION_MARK:this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case k.NULL:this._err(j.unexpectedNullCharacter),t.systemId+=`�`;break;case k.GREATER_THAN_SIGN:this._err(j.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case k.APOSTROPHE:this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case k.NULL:this._err(j.unexpectedNullCharacter),t.systemId+=`�`;break;case k.GREATER_THAN_SIGN:this._err(j.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.EOF:this._err(j.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(j.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=B.DATA;break;case k.NULL:this._err(j.unexpectedNullCharacter);break;case k.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case k.RIGHT_SQUARE_BRACKET:this.state=B.CDATA_SECTION_BRACKET;break;case k.EOF:this._err(j.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===k.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars(`]`),this.state=B.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case k.GREATER_THAN_SIGN:this.state=B.DATA;break;case k.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=B.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(k.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Xn(this.preprocessor.peek(1))?B.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Xn(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===k.SEMICOLON&&this._err(j.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},nr=new Set([R.DD,R.DT,R.LI,R.OPTGROUP,R.OPTION,R.P,R.RB,R.RP,R.RT,R.RTC]),rr=new Set([...nr,R.CAPTION,R.COLGROUP,R.TBODY,R.TD,R.TFOOT,R.TH,R.THEAD,R.TR]),ir=new Set([R.APPLET,R.CAPTION,R.HTML,R.MARQUEE,R.OBJECT,R.TABLE,R.TD,R.TEMPLATE,R.TH]),ar=new Set([...ir,R.OL,R.UL]),or=new Set([...ir,R.BUTTON]),sr=new Set([R.ANNOTATION_XML,R.MI,R.MN,R.MO,R.MS,R.MTEXT]),cr=new Set([R.DESC,R.FOREIGN_OBJECT,R.TITLE]),lr=new Set([R.TR,R.TEMPLATE,R.HTML]),ur=new Set([R.TBODY,R.TFOOT,R.THEAD,R.TEMPLATE,R.HTML]),dr=new Set([R.TABLE,R.TEMPLATE,R.HTML]),fr=new Set([R.TD,R.TH]),pr=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=R.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===R.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===I.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==I.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Gn,I.HTML)}popUntilTableCellPopped(){this.popUntilPopped(fr,I.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(dr,I.HTML)}clearBackToTableBodyContext(){this.clearBackTo(ur,I.HTML)}clearBackToTableRowContext(){this.clearBackTo(lr,I.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===R.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===R.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case I.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case I.SVG:if(cr.has(r))return!1;break;case I.MATHML:if(sr.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,ir)}hasInListItemScope(e){return this.hasInDynamicScope(e,ar)}hasInButtonScope(e){return this.hasInDynamicScope(e,or)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case I.HTML:if(Gn.has(t))return!0;if(ir.has(t))return!1;break;case I.SVG:if(cr.has(t))return!1;break;case I.MATHML:if(sr.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===I.HTML)switch(this.tagIDs[t]){case e:return!0;case R.TABLE:case R.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===I.HTML)switch(this.tagIDs[e]){case R.TBODY:case R.THEAD:case R.TFOOT:return!0;case R.TABLE:case R.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===I.HTML)switch(this.tagIDs[t]){case e:return!0;case R.OPTION:case R.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nr.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&rr.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&rr.has(this.currentTagId);)this.pop()}},mr=3,hr;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(hr||={});var gr={type:hr.Marker},_r=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===hr.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<mr)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<mr)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=mr&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(gr)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:hr.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:hr.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(gr);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===hr.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===hr.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===hr.Element&&t.element===e)}},H={createDocument(){return{nodeName:`#document`,mode:Vn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};H.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(H.isTextNode(n)){n.value+=t;return}}H.appendChild(e,H.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&H.isTextNode(r)?r.value+=t:H.insertBefore(e,H.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},vr=`html`,yr=`about:legacy-compat`,br=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,xr=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Sr=[...xr,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Cr=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),wr=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Tr=[...wr,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Er(e,t){return t.some(t=>e.startsWith(t))}function Dr(e){return e.name===vr&&e.publicId===null&&(e.systemId===null||e.systemId===yr)}function Or(e){if(e.name!==vr)return Vn.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===br)return Vn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Cr.has(n))return Vn.QUIRKS;let e=t===null?Sr:xr;if(Er(n,e))return Vn.QUIRKS;if(e=t===null?wr:Tr,Er(n,e))return Vn.LIMITED_QUIRKS}return Vn.NO_QUIRKS}var kr={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Ar=`definitionurl`,jr=`definitionURL`,Mr=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),Nr=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:I.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:I.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:I.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:I.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:I.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:I.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:I.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:I.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:I.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:I.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:I.XMLNS}]]),Pr=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),Fr=new Set([R.B,R.BIG,R.BLOCKQUOTE,R.BODY,R.BR,R.CENTER,R.CODE,R.DD,R.DIV,R.DL,R.DT,R.EM,R.EMBED,R.H1,R.H2,R.H3,R.H4,R.H5,R.H6,R.HEAD,R.HR,R.I,R.IMG,R.LI,R.LISTING,R.MENU,R.META,R.NOBR,R.OL,R.P,R.PRE,R.RUBY,R.S,R.SMALL,R.SPAN,R.STRONG,R.STRIKE,R.SUB,R.SUP,R.TABLE,R.TT,R.U,R.UL,R.VAR]);function Ir(e){let t=e.tagID;return t===R.FONT&&e.attrs.some(({name:e})=>e===Bn.COLOR||e===Bn.SIZE||e===Bn.FACE)||Fr.has(t)}function Lr(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Ar){e.attrs[t].name=jr;break}}function Rr(e){for(let t=0;t<e.attrs.length;t++){let n=Mr.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function zr(e){for(let t=0;t<e.attrs.length;t++){let n=Nr.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Br(e){let t=Pr.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Un(e.tagName))}function Vr(e,t){return t===I.MATHML&&(e===R.MI||e===R.MO||e===R.MN||e===R.MS||e===R.MTEXT)}function Hr(e,t,n){if(t===I.MATHML&&e===R.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===Bn.ENCODING){let t=n[e].value.toLowerCase();return t===kr.TEXT_HTML||t===kr.APPLICATION_XML}}return t===I.SVG&&(e===R.FOREIGN_OBJECT||e===R.DESC||e===R.TITLE)}function Ur(e,t,n,r){return(!r||r===I.HTML)&&Hr(e,t,n)||(!r||r===I.MATHML)&&Vr(e,t)}var Wr=`hidden`,Gr=8,Kr=3,U;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(U||={});var qr={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Jr=new Set([R.TABLE,R.TBODY,R.TFOOT,R.THEAD,R.TR]),Yr={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:H,onParseError:null},Xr=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Yr,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new tr(this.options,this),this.activeFormattingElements=new _r(this.treeAdapter),this.fragmentContextID=n?Un(this.treeAdapter.getTagName(n)):R.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new pr(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...Yr,...t};e??=n.treeAdapter.createElement(L.TEMPLATE,I.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,I.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===R.TEMPLATE&&i.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??qr,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===I.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,I.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=V.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===I.HTML)switch(this.fragmentContextID){case R.TITLE:case R.TEXTAREA:this.tokenizer.state=V.RCDATA;break;case R.STYLE:case R.XMP:case R.IFRAME:case R.NOEMBED:case R.NOFRAMES:case R.NOSCRIPT:this.tokenizer.state=V.RAWTEXT;break;case R.SCRIPT:this.tokenizer.state=V.SCRIPT_DATA;break;case R.PLAINTEXT:this.tokenizer.state=V.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,I.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,I.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(L.HTML,I.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,R.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===M.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===R.SVG&&this.treeAdapter.getTagName(t)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===I.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===R.MGLYPH||e.tagID===R.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,I.HTML)}_processToken(e){switch(e.type){case M.CHARACTER:this.onCharacter(e);break;case M.NULL_CHARACTER:this.onNullCharacter(e);break;case M.COMMENT:this.onComment(e);break;case M.DOCTYPE:this.onDoctype(e);break;case M.START_TAG:this._processStartTag(e);break;case M.END_TAG:this.onEndTag(e);break;case M.EOF:this.onEof(e);break;case M.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Ur(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===hr.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(R.P),this.openElements.popUntilTagNamePopped(R.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case R.TR:this.insertionMode=U.IN_ROW;return;case R.TBODY:case R.THEAD:case R.TFOOT:this.insertionMode=U.IN_TABLE_BODY;return;case R.CAPTION:this.insertionMode=U.IN_CAPTION;return;case R.COLGROUP:this.insertionMode=U.IN_COLUMN_GROUP;return;case R.TABLE:this.insertionMode=U.IN_TABLE;return;case R.BODY:this.insertionMode=U.IN_BODY;return;case R.FRAMESET:this.insertionMode=U.IN_FRAMESET;return;case R.SELECT:this._resetInsertionModeForSelect(e);return;case R.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case R.HTML:this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return;case R.TD:case R.TH:if(e>0){this.insertionMode=U.IN_CELL;return}break;case R.HEAD:if(e>0){this.insertionMode=U.IN_HEAD;return}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===R.TEMPLATE)break;if(e===R.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(e){return Jr.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case R.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===I.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case R.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Wn[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)po(this,e);else switch(this.insertionMode){case U.INITIAL:li(this,e);break;case U.BEFORE_HTML:fi(this,e);break;case U.BEFORE_HEAD:hi(this,e);break;case U.IN_HEAD:vi(this,e);break;case U.IN_HEAD_NO_SCRIPT:xi(this,e);break;case U.AFTER_HEAD:wi(this,e);break;case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:Di(this,e);break;case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:xa(this,e);break;case U.IN_TABLE_TEXT:Pa(this,e);break;case U.IN_COLUMN_GROUP:Va(this,e);break;case U.AFTER_BODY:ro(this,e);break;case U.AFTER_AFTER_BODY:lo(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)fo(this,e);else switch(this.insertionMode){case U.INITIAL:li(this,e);break;case U.BEFORE_HTML:fi(this,e);break;case U.BEFORE_HEAD:hi(this,e);break;case U.IN_HEAD:vi(this,e);break;case U.IN_HEAD_NO_SCRIPT:xi(this,e);break;case U.AFTER_HEAD:wi(this,e);break;case U.TEXT:this._insertCharacters(e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:xa(this,e);break;case U.IN_COLUMN_GROUP:Va(this,e);break;case U.AFTER_BODY:ro(this,e);break;case U.AFTER_AFTER_BODY:lo(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)ii(this,e);else switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:ii(this,e);break;case U.IN_TABLE_TEXT:Fa(this,e);break;case U.AFTER_BODY:ai(this,e);break;case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:oi(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:ci(this,e);break;case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:this._err(e,j.misplacedDoctype);break;case U.IN_TABLE_TEXT:Fa(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,j.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?ho(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case U.INITIAL:li(this,e);break;case U.BEFORE_HTML:ui(this,e);break;case U.BEFORE_HEAD:pi(this,e);break;case U.IN_HEAD:W(this,e);break;case U.IN_HEAD_NO_SCRIPT:yi(this,e);break;case U.AFTER_HEAD:Si(this,e);break;case U.IN_BODY:G(this,e);break;case U.IN_TABLE:Aa(this,e);break;case U.IN_TABLE_TEXT:Fa(this,e);break;case U.IN_CAPTION:La(this,e);break;case U.IN_COLUMN_GROUP:za(this,e);break;case U.IN_TABLE_BODY:Ha(this,e);break;case U.IN_ROW:Wa(this,e);break;case U.IN_CELL:Ka(this,e);break;case U.IN_SELECT:Ja(this,e);break;case U.IN_SELECT_IN_TABLE:Xa(this,e);break;case U.IN_TEMPLATE:Qa(this,e);break;case U.AFTER_BODY:to(this,e);break;case U.IN_FRAMESET:io(this,e);break;case U.AFTER_FRAMESET:oo(this,e);break;case U.AFTER_AFTER_BODY:co(this,e);break;case U.AFTER_AFTER_FRAMESET:uo(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?go(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case U.INITIAL:li(this,e);break;case U.BEFORE_HTML:di(this,e);break;case U.BEFORE_HEAD:mi(this,e);break;case U.IN_HEAD:gi(this,e);break;case U.IN_HEAD_NO_SCRIPT:bi(this,e);break;case U.AFTER_HEAD:Ci(this,e);break;case U.IN_BODY:_a(this,e);break;case U.TEXT:ya(this,e);break;case U.IN_TABLE:ja(this,e);break;case U.IN_TABLE_TEXT:Fa(this,e);break;case U.IN_CAPTION:Ra(this,e);break;case U.IN_COLUMN_GROUP:Ba(this,e);break;case U.IN_TABLE_BODY:Ua(this,e);break;case U.IN_ROW:Ga(this,e);break;case U.IN_CELL:qa(this,e);break;case U.IN_SELECT:Ya(this,e);break;case U.IN_SELECT_IN_TABLE:Za(this,e);break;case U.IN_TEMPLATE:$a(this,e);break;case U.AFTER_BODY:no(this,e);break;case U.IN_FRAMESET:ao(this,e);break;case U.AFTER_FRAMESET:so(this,e);break;case U.AFTER_AFTER_BODY:lo(this,e)}}onEof(e){switch(this.insertionMode){case U.INITIAL:li(this,e);break;case U.BEFORE_HTML:fi(this,e);break;case U.BEFORE_HEAD:hi(this,e);break;case U.IN_HEAD:vi(this,e);break;case U.IN_HEAD_NO_SCRIPT:xi(this,e);break;case U.AFTER_HEAD:wi(this,e);break;case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:va(this,e);break;case U.TEXT:ba(this,e);break;case U.IN_TABLE_TEXT:Fa(this,e);break;case U.IN_TEMPLATE:eo(this,e);break;case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:si(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===k.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:this._insertCharacters(e);break;case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:Ei(this,e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:xa(this,e);break;case U.IN_TABLE_TEXT:Na(this,e)}}};function Zr(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ga(e,t),n}function Qr(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function $r(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Kr;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=ei(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function ei(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function ti(e,t,n){let r=Un(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===R.TEMPLATE&&i===I.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function ni(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function ri(e,t){for(let n=0;n<Gr;n++){let n=Zr(e,t);if(!n)break;let r=Qr(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=$r(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&ti(e,a,i),ni(e,r,n)}}function ii(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function ai(e,t){e._appendCommentNode(t,e.openElements.items[0])}function oi(e,t){e._appendCommentNode(t,e.document)}function si(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function ci(e,t){e._setDocumentType(t);let n=t.forceQuirks?Vn.QUIRKS:Or(t);Dr(t)||e._err(t,j.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function li(e,t){e._err(t,j.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Vn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function ui(e,t){t.tagID===R.HTML?(e._insertElement(t,I.HTML),e.insertionMode=U.BEFORE_HEAD):fi(e,t)}function di(e,t){let n=t.tagID;(n===R.HTML||n===R.HEAD||n===R.BODY||n===R.BR)&&fi(e,t)}function fi(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function pi(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.HEAD:e._insertElement(t,I.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break;default:hi(e,t)}}function mi(e,t){let n=t.tagID;n===R.HEAD||n===R.BODY||n===R.HTML||n===R.BR?hi(e,t):e._err(t,j.endTagWithoutMatchingOpenElement)}function hi(e,t){e._insertFakeElement(L.HEAD,R.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function W(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.BASE:case R.BASEFONT:case R.BGSOUND:case R.LINK:case R.META:e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break;case R.TITLE:e._switchToTextParsing(t,V.RCDATA);break;case R.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,V.RAWTEXT):(e._insertElement(t,I.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break;case R.NOFRAMES:case R.STYLE:e._switchToTextParsing(t,V.RAWTEXT);break;case R.SCRIPT:e._switchToTextParsing(t,V.SCRIPT_DATA);break;case R.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break;case R.HEAD:e._err(t,j.misplacedStartTagForHeadElement);break;default:vi(e,t)}}function gi(e,t){switch(t.tagID){case R.HEAD:e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break;case R.BODY:case R.BR:case R.HTML:vi(e,t);break;case R.TEMPLATE:_i(e,t);break;default:e._err(t,j.endTagWithoutMatchingOpenElement)}}function _i(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==R.TEMPLATE&&e._err(t,j.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(R.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,j.endTagWithoutMatchingOpenElement)}function vi(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function yi(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.BASEFONT:case R.BGSOUND:case R.HEAD:case R.LINK:case R.META:case R.NOFRAMES:case R.STYLE:W(e,t);break;case R.NOSCRIPT:e._err(t,j.nestedNoscriptInHead);break;default:xi(e,t)}}function bi(e,t){switch(t.tagID){case R.NOSCRIPT:e.openElements.pop(),e.insertionMode=U.IN_HEAD;break;case R.BR:xi(e,t);break;default:e._err(t,j.endTagWithoutMatchingOpenElement)}}function xi(e,t){let n=t.type===M.EOF?j.openElementsLeftAfterEof:j.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function Si(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.BODY:e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break;case R.FRAMESET:e._insertElement(t,I.HTML),e.insertionMode=U.IN_FRAMESET;break;case R.BASE:case R.BASEFONT:case R.BGSOUND:case R.LINK:case R.META:case R.NOFRAMES:case R.SCRIPT:case R.STYLE:case R.TEMPLATE:case R.TITLE:e._err(t,j.abandonedHeadElementChild),e.openElements.push(e.headElement,R.HEAD),W(e,t),e.openElements.remove(e.headElement);break;case R.HEAD:e._err(t,j.misplacedStartTagForHeadElement);break;default:wi(e,t)}}function Ci(e,t){switch(t.tagID){case R.BODY:case R.HTML:case R.BR:wi(e,t);break;case R.TEMPLATE:_i(e,t);break;default:e._err(t,j.endTagWithoutMatchingOpenElement)}}function wi(e,t){e._insertFakeElement(L.BODY,R.BODY),e.insertionMode=U.IN_BODY,Ti(e,t)}function Ti(e,t){switch(t.type){case M.CHARACTER:Di(e,t);break;case M.WHITESPACE_CHARACTER:Ei(e,t);break;case M.COMMENT:ii(e,t);break;case M.START_TAG:G(e,t);break;case M.END_TAG:_a(e,t);break;case M.EOF:va(e,t)}}function Ei(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Di(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Oi(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ki(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Ai(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_FRAMESET)}function ji(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function Mi(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Gn.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,I.HTML)}function Ni(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Pi(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML),n||(e.formElement=e.openElements.current))}function Fi(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===R.LI&&r===R.LI||(n===R.DD||n===R.DT)&&(r===R.DD||r===R.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==R.ADDRESS&&r!==R.DIV&&r!==R.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML)}function Ii(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.tokenizer.state=V.PLAINTEXT}function Li(e,t){e.openElements.hasInScope(R.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(R.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1}function Ri(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&(ri(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zi(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Bi(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(R.NOBR)&&(ri(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,I.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Vi(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Hi(e,t){e.treeAdapter.getDocumentMode(e.document)!==Vn.QUIRKS&&e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function Ui(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Wi(e){let t=Cn(e,Bn.TYPE);return t!=null&&t.toLowerCase()===Wr}function Gi(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,I.HTML),Wi(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Ki(e,t){e._appendElement(t,I.HTML),t.ackSelfClosing=!0}function qi(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._appendElement(t,I.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ji(e,t){t.tagName=L.IMG,t.tagID=R.IMG,Ui(e,t)}function Yi(e,t){e._insertElement(t,I.HTML),e.skipNextNewLine=!0,e.tokenizer.state=V.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function Xi(e,t){e.openElements.hasInButtonScope(R.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,V.RAWTEXT)}function Zi(e,t){e.framesetOk=!1,e._switchToTextParsing(t,V.RAWTEXT)}function Qi(e,t){e._switchToTextParsing(t,V.RAWTEXT)}function $i(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function ea(e,t){e.openElements.currentTagId===R.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function ta(e,t){e.openElements.hasInScope(R.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,I.HTML)}function na(e,t){e.openElements.hasInScope(R.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(R.RTC),e._insertElement(t,I.HTML)}function ra(e,t){e._reconstructActiveFormattingElements(),Lr(t),zr(t),t.selfClosing?e._appendElement(t,I.MATHML):e._insertElement(t,I.MATHML),t.ackSelfClosing=!0}function ia(e,t){e._reconstructActiveFormattingElements(),Rr(t),zr(t),t.selfClosing?e._appendElement(t,I.SVG):e._insertElement(t,I.SVG),t.ackSelfClosing=!0}function aa(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,I.HTML)}function G(e,t){switch(t.tagID){case R.I:case R.S:case R.B:case R.U:case R.EM:case R.TT:case R.BIG:case R.CODE:case R.FONT:case R.SMALL:case R.STRIKE:case R.STRONG:zi(e,t);break;case R.A:Ri(e,t);break;case R.H1:case R.H2:case R.H3:case R.H4:case R.H5:case R.H6:Mi(e,t);break;case R.P:case R.DL:case R.OL:case R.UL:case R.DIV:case R.DIR:case R.NAV:case R.MAIN:case R.MENU:case R.ASIDE:case R.CENTER:case R.FIGURE:case R.FOOTER:case R.HEADER:case R.HGROUP:case R.DIALOG:case R.DETAILS:case R.ADDRESS:case R.ARTICLE:case R.SEARCH:case R.SECTION:case R.SUMMARY:case R.FIELDSET:case R.BLOCKQUOTE:case R.FIGCAPTION:ji(e,t);break;case R.LI:case R.DD:case R.DT:Fi(e,t);break;case R.BR:case R.IMG:case R.WBR:case R.AREA:case R.EMBED:case R.KEYGEN:Ui(e,t);break;case R.HR:qi(e,t);break;case R.RB:case R.RTC:ta(e,t);break;case R.RT:case R.RP:na(e,t);break;case R.PRE:case R.LISTING:Ni(e,t);break;case R.XMP:Xi(e,t);break;case R.SVG:ia(e,t);break;case R.HTML:Oi(e,t);break;case R.BASE:case R.LINK:case R.META:case R.STYLE:case R.TITLE:case R.SCRIPT:case R.BGSOUND:case R.BASEFONT:case R.TEMPLATE:W(e,t);break;case R.BODY:ki(e,t);break;case R.FORM:Pi(e,t);break;case R.NOBR:Bi(e,t);break;case R.MATH:ra(e,t);break;case R.TABLE:Hi(e,t);break;case R.INPUT:Gi(e,t);break;case R.PARAM:case R.TRACK:case R.SOURCE:Ki(e,t);break;case R.IMAGE:Ji(e,t);break;case R.BUTTON:Li(e,t);break;case R.APPLET:case R.OBJECT:case R.MARQUEE:Vi(e,t);break;case R.IFRAME:Zi(e,t);break;case R.SELECT:$i(e,t);break;case R.OPTION:case R.OPTGROUP:ea(e,t);break;case R.NOEMBED:case R.NOFRAMES:Qi(e,t);break;case R.FRAMESET:Ai(e,t);break;case R.TEXTAREA:Yi(e,t);break;case R.NOSCRIPT:e.options.scriptingEnabled?Qi(e,t):aa(e,t);break;case R.PLAINTEXT:Ii(e,t);break;case R.COL:case R.TH:case R.TD:case R.TR:case R.HEAD:case R.FRAME:case R.TBODY:case R.TFOOT:case R.THEAD:case R.CAPTION:case R.COLGROUP:break;default:aa(e,t)}}function oa(e,t){if(e.openElements.hasInScope(R.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function sa(e,t){e.openElements.hasInScope(R.BODY)&&(e.insertionMode=U.AFTER_BODY,no(e,t))}function ca(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function la(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(R.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(R.FORM):n&&e.openElements.remove(n))}function ua(e){e.openElements.hasInButtonScope(R.P)||e._insertFakeElement(L.P,R.P),e._closePElement()}function da(e){e.openElements.hasInListItemScope(R.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(R.LI),e.openElements.popUntilTagNamePopped(R.LI))}function fa(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function pa(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ma(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function ha(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(L.BR,R.BR),e.openElements.pop(),e.framesetOk=!1}function ga(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==R.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function _a(e,t){switch(t.tagID){case R.A:case R.B:case R.I:case R.S:case R.U:case R.EM:case R.TT:case R.BIG:case R.CODE:case R.FONT:case R.NOBR:case R.SMALL:case R.STRIKE:case R.STRONG:ri(e,t);break;case R.P:ua(e);break;case R.DL:case R.UL:case R.OL:case R.DIR:case R.DIV:case R.NAV:case R.PRE:case R.MAIN:case R.MENU:case R.ASIDE:case R.BUTTON:case R.CENTER:case R.FIGURE:case R.FOOTER:case R.HEADER:case R.HGROUP:case R.DIALOG:case R.ADDRESS:case R.ARTICLE:case R.DETAILS:case R.SEARCH:case R.SECTION:case R.SUMMARY:case R.LISTING:case R.FIELDSET:case R.BLOCKQUOTE:case R.FIGCAPTION:ca(e,t);break;case R.LI:da(e);break;case R.DD:case R.DT:fa(e,t);break;case R.H1:case R.H2:case R.H3:case R.H4:case R.H5:case R.H6:pa(e);break;case R.BR:ha(e);break;case R.BODY:oa(e,t);break;case R.HTML:sa(e,t);break;case R.FORM:la(e);break;case R.APPLET:case R.OBJECT:case R.MARQUEE:ma(e,t);break;case R.TEMPLATE:_i(e,t);break;default:ga(e,t)}}function va(e,t){e.tmplInsertionModeStack.length>0?eo(e,t):si(e,t)}function ya(e,t){var n;t.tagID===R.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ba(e,t){e._err(t,j.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function xa(e,t){if(e.openElements.currentTagId!==void 0&&Jr.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case M.CHARACTER:Pa(e,t);break;case M.WHITESPACE_CHARACTER:Na(e,t)}else Ma(e,t)}function Sa(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_CAPTION}function Ca(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function wa(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(L.COLGROUP,R.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,za(e,t)}function Ta(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_TABLE_BODY}function Ea(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(L.TBODY,R.TBODY),e.insertionMode=U.IN_TABLE_BODY,Ha(e,t)}function Da(e,t){e.openElements.hasInTableScope(R.TABLE)&&(e.openElements.popUntilTagNamePopped(R.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Oa(e,t){Wi(t)?e._appendElement(t,I.HTML):Ma(e,t),t.ackSelfClosing=!0}function ka(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,I.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Aa(e,t){switch(t.tagID){case R.TD:case R.TH:case R.TR:Ea(e,t);break;case R.STYLE:case R.SCRIPT:case R.TEMPLATE:W(e,t);break;case R.COL:wa(e,t);break;case R.FORM:ka(e,t);break;case R.TABLE:Da(e,t);break;case R.TBODY:case R.TFOOT:case R.THEAD:Ta(e,t);break;case R.INPUT:Oa(e,t);break;case R.CAPTION:Sa(e,t);break;case R.COLGROUP:Ca(e,t);break;default:Ma(e,t)}}function ja(e,t){switch(t.tagID){case R.TABLE:e.openElements.hasInTableScope(R.TABLE)&&(e.openElements.popUntilTagNamePopped(R.TABLE),e._resetInsertionMode());break;case R.TEMPLATE:_i(e,t);break;case R.BODY:case R.CAPTION:case R.COL:case R.COLGROUP:case R.HTML:case R.TBODY:case R.TD:case R.TFOOT:case R.TH:case R.THEAD:case R.TR:break;default:Ma(e,t)}}function Ma(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Ti(e,t),e.fosterParentingEnabled=n}function Na(e,t){e.pendingCharacterTokens.push(t)}function Pa(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Fa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ma(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Ia=new Set([R.CAPTION,R.COL,R.COLGROUP,R.TBODY,R.TD,R.TFOOT,R.TH,R.THEAD,R.TR]);function La(e,t){let n=t.tagID;Ia.has(n)?e.openElements.hasInTableScope(R.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(R.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,Aa(e,t)):G(e,t)}function Ra(e,t){let n=t.tagID;switch(n){case R.CAPTION:case R.TABLE:e.openElements.hasInTableScope(R.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(R.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===R.TABLE&&ja(e,t));break;case R.BODY:case R.COL:case R.COLGROUP:case R.HTML:case R.TBODY:case R.TD:case R.TFOOT:case R.TH:case R.THEAD:case R.TR:break;default:_a(e,t)}}function za(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.COL:e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break;case R.TEMPLATE:W(e,t);break;default:Va(e,t)}}function Ba(e,t){switch(t.tagID){case R.COLGROUP:e.openElements.currentTagId===R.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break;case R.TEMPLATE:_i(e,t);break;case R.COL:break;default:Va(e,t)}}function Va(e,t){e.openElements.currentTagId===R.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function Ha(e,t){switch(t.tagID){case R.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_ROW;break;case R.TH:case R.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(L.TR,R.TR),e.insertionMode=U.IN_ROW,Wa(e,t);break;case R.CAPTION:case R.COL:case R.COLGROUP:case R.TBODY:case R.TFOOT:case R.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Aa(e,t));break;default:Aa(e,t)}}function Ua(e,t){let n=t.tagID;switch(t.tagID){case R.TBODY:case R.TFOOT:case R.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break;case R.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,ja(e,t));break;case R.BODY:case R.CAPTION:case R.COL:case R.COLGROUP:case R.HTML:case R.TD:case R.TH:case R.TR:break;default:ja(e,t)}}function Wa(e,t){switch(t.tagID){case R.TH:case R.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,I.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break;case R.CAPTION:case R.COL:case R.COLGROUP:case R.TBODY:case R.TFOOT:case R.THEAD:case R.TR:e.openElements.hasInTableScope(R.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Ha(e,t));break;default:Aa(e,t)}}function Ga(e,t){switch(t.tagID){case R.TR:e.openElements.hasInTableScope(R.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break;case R.TABLE:e.openElements.hasInTableScope(R.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Ua(e,t));break;case R.TBODY:case R.TFOOT:case R.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(R.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Ua(e,t));break;case R.BODY:case R.CAPTION:case R.COL:case R.COLGROUP:case R.HTML:case R.TD:case R.TH:break;default:ja(e,t)}}function Ka(e,t){let n=t.tagID;Ia.has(n)?(e.openElements.hasInTableScope(R.TD)||e.openElements.hasInTableScope(R.TH))&&(e._closeTableCell(),Wa(e,t)):G(e,t)}function qa(e,t){let n=t.tagID;switch(n){case R.TD:case R.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break;case R.TABLE:case R.TBODY:case R.TFOOT:case R.THEAD:case R.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Ga(e,t));break;case R.BODY:case R.CAPTION:case R.COL:case R.COLGROUP:case R.HTML:break;default:_a(e,t)}}function Ja(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.OPTION:e.openElements.currentTagId===R.OPTION&&e.openElements.pop(),e._insertElement(t,I.HTML);break;case R.OPTGROUP:e.openElements.currentTagId===R.OPTION&&e.openElements.pop(),e.openElements.currentTagId===R.OPTGROUP&&e.openElements.pop(),e._insertElement(t,I.HTML);break;case R.HR:e.openElements.currentTagId===R.OPTION&&e.openElements.pop(),e.openElements.currentTagId===R.OPTGROUP&&e.openElements.pop(),e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break;case R.INPUT:case R.KEYGEN:case R.TEXTAREA:case R.SELECT:e.openElements.hasInSelectScope(R.SELECT)&&(e.openElements.popUntilTagNamePopped(R.SELECT),e._resetInsertionMode(),t.tagID!==R.SELECT&&e._processStartTag(t));break;case R.SCRIPT:case R.TEMPLATE:W(e,t)}}function Ya(e,t){switch(t.tagID){case R.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===R.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===R.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===R.OPTGROUP&&e.openElements.pop();break;case R.OPTION:e.openElements.currentTagId===R.OPTION&&e.openElements.pop();break;case R.SELECT:e.openElements.hasInSelectScope(R.SELECT)&&(e.openElements.popUntilTagNamePopped(R.SELECT),e._resetInsertionMode());break;case R.TEMPLATE:_i(e,t)}}function Xa(e,t){let n=t.tagID;n===R.CAPTION||n===R.TABLE||n===R.TBODY||n===R.TFOOT||n===R.THEAD||n===R.TR||n===R.TD||n===R.TH?(e.openElements.popUntilTagNamePopped(R.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Ja(e,t)}function Za(e,t){let n=t.tagID;n===R.CAPTION||n===R.TABLE||n===R.TBODY||n===R.TFOOT||n===R.THEAD||n===R.TR||n===R.TD||n===R.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(R.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Ya(e,t)}function Qa(e,t){switch(t.tagID){case R.BASE:case R.BASEFONT:case R.BGSOUND:case R.LINK:case R.META:case R.NOFRAMES:case R.SCRIPT:case R.STYLE:case R.TEMPLATE:case R.TITLE:W(e,t);break;case R.CAPTION:case R.COLGROUP:case R.TBODY:case R.TFOOT:case R.THEAD:e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,Aa(e,t);break;case R.COL:e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,za(e,t);break;case R.TR:e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,Ha(e,t);break;case R.TD:case R.TH:e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,Wa(e,t);break;default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,G(e,t)}}function $a(e,t){t.tagID===R.TEMPLATE&&_i(e,t)}function eo(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(R.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):si(e,t)}function to(e,t){t.tagID===R.HTML?G(e,t):ro(e,t)}function no(e,t){if(t.tagID===R.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===R.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else ro(e,t)}function ro(e,t){e.insertionMode=U.IN_BODY,Ti(e,t)}function io(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.FRAMESET:e._insertElement(t,I.HTML);break;case R.FRAME:e._appendElement(t,I.HTML),t.ackSelfClosing=!0;break;case R.NOFRAMES:W(e,t)}}function ao(e,t){t.tagID===R.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==R.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function oo(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.NOFRAMES:W(e,t)}}function so(e,t){t.tagID===R.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function co(e,t){t.tagID===R.HTML?G(e,t):lo(e,t)}function lo(e,t){e.insertionMode=U.IN_BODY,Ti(e,t)}function uo(e,t){switch(t.tagID){case R.HTML:G(e,t);break;case R.NOFRAMES:W(e,t)}}function fo(e,t){t.chars=`�`,e._insertCharacters(t)}function po(e,t){e._insertCharacters(t),e.framesetOk=!1}function mo(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==I.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function ho(e,t){if(Ir(t))mo(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===I.MATHML?Lr(t):r===I.SVG&&(Br(t),Rr(t)),zr(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function go(e,t){if(t.tagID===R.P||t.tagID===R.BR)mo(e),e._endTagOutsideForeignContent(t);else for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===I.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR;function _o(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=Xr.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var vo=9,yo=10,bo=12,xo=13,So=32,Co=34,wo=39,To=47,Eo=60,Do=61,Oo=62,ko=0,Ao=1,jo=2,Mo=3,No=4,Po=5,Fo=6,Io=7,Lo=8,Ro=9,zo=10,Bo=-1;function Vo(e){return e===So||e===yo||e===vo||e===bo||e===xo}function Ho(e){return e>=65&&e<=90||e>=97&&e<=122}function Uo(e,t,n){switch(n.starts=!1,e){case ko:return t===Oo?Bo:t===To?Ro:Vo(t)?Ao:ko;case Ao:case Ro:return t===Oo?Bo:t===To?Ro:Vo(t)?Ao:(n.starts=!0,jo);case jo:return t===Oo?Bo:t===To?Ro:t===Do?No:Vo(t)?Mo:jo;case Mo:return t===Oo?Bo:t===To?Ro:t===Do?No:Vo(t)?Mo:(n.starts=!0,jo);case No:return t===Oo?Bo:t===Co?Po:t===wo?Fo:Vo(t)?No:Io;case Po:return t===Co?Lo:Po;case Fo:return t===wo?Lo:Fo;case Io:return t===Oo?Bo:Vo(t)?Ao:Io;default:return t===Oo?Bo:t===To?Ro:Vo(t)?Ao:(n.starts=!0,jo)}}function Wo(e,t){let n=new Int32Array(zo).fill(-1),r=new Int32Array(zo).fill(-1),i={starts:!1},a=0,o=0;for(let s=0;s<e.length;s++){let c=e.charCodeAt(s),l=Ho(c)&&s>0&&Go(e,s);if(a===0&&!l){let t=Ko(e,s)-1;if(t<0)break;s=t}else{r.fill(-1),a=0;for(let e=0;e<zo;e++){let t=n[e]??-1;if(t<0)continue;let s=Uo(e,c,i),l=i.starts?t+1:t;l>o&&(o=l),s!==Bo&&(r[s]??-1)<l&&((r[s]??-1)<0&&a++,r[s]=l)}if(o>t)return o;l&&(r[ko]??-1)<0&&(a++,r[ko]=0),[n,r]=[r,n]}}return o}function Go(e,t){let n=e.charCodeAt(t-1);return n===Eo||n===To&&t>1&&e.charCodeAt(t-2)===Eo}function Ko(e,t){for(let n=e.indexOf(`<`,t);n>=0;n=e.indexOf(`<`,n+1)){if(Ho(e.charCodeAt(n+1)))return n+1;if(e.charCodeAt(n+1)===To&&Ho(e.charCodeAt(n+2)))return n+2}return-1}function qo(e){if(Wo(e,256)>256)throw RangeError(`HTML has an element with more than 256 attributes`);let t=Jo(e);if(t===null)throw RangeError(`HTML is nested deeper than 100 elements`);return t}function Jo(e){let t=ts(e);if(t===null)return null;let n=ls(t);for(let e=0;e<Yo;e++){let e=ts(n);if(e===null)return null;let r=ls(e);if(r===n)return t;t=e,n=r}return t}var Yo=8,Xo=class extends Error{};function Zo(e){let t=0;for(let n=e;n!==null&&`tagName`in n&&!(++t>Qo);n=n.parentNode);return t}var Qo=102,$o={...H,appendChild(e,t){if(`tagName`in t&&Zo(e)>=Qo)throw new Xo;H.appendChild(e,t)},insertBefore(e,t,n){if(`tagName`in t&&Zo(e)>=Qo)throw new Xo;H.insertBefore(e,t,n)}};function es(e){let t=0,n=e.childNodes.map(e=>[e,1]);for(let e=n.pop();e!==void 0;e=n.pop()){let[r,i]=e;if(`tagName`in r){i>t&&(t=i);for(let e of r.childNodes)n.push([e,i+1])}}return t}function ts(e){let t;try{t=_o(e,{treeAdapter:$o})}catch(e){if(e instanceof Xo)return null;throw e}return es(t)>100?null:ns(t.childNodes)}function ns(e){let t=[];for(let n of e)if(n.nodeName===`#text`)rs(t,n.value);else if(`tagName`in n){let e={};for(let t of n.attrs){let n=(t.prefix?`${t.prefix}:${t.name}`:t.name).toLowerCase();Object.hasOwn(e,n)||Object.defineProperty(e,n,{value:t.value,enumerable:!0,writable:!0,configurable:!0})}let r=n.nodeName===`template`?[]:ns(n.childNodes);t.push(w(n.tagName.toLowerCase(),e,r))}return t}function rs(e,t){let n=e[e.length-1];n?.type===`text`?e[e.length-1]=ve(n.value+t):t!==``&&e.push(ve(t))}var is=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),as=new Set([`script`,`style`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`]),os=new Set([`pre`,`textarea`,`listing`]),ss=new Set([`foreignobject`,`desc`,`title`]),cs=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`]);function ls(e){return us(e,`html`,!1,{ended:!1})}function us(e,t,n,r){let i=``;for(let a of e){if(r.ended)break;i+=a.type===`text`?n?a.value:_s(a.value):ds(a,t,r)}return i}function ds(e,t,n){let r=e.tag,i=t===`html`&&(r===`svg`||r===`math`)?r:t,a=`<${r}`;for(let[t,n]of Object.entries(e.attrs))a+=n===``?` ${t}`:` ${t}="${vs(n)}"`;if(a+=`>`,i===`html`&&is.has(r))return a;let o=e.children[0];return i===`html`&&os.has(r)&&o?.type===`text`&&o.value.startsWith(`
|
|
2
|
+
`)&&(a+=`
|
|
3
|
+
`),a+=us(e.children,fs(e,i),i===`html`&&as.has(r),n),i===`html`&&r===`plaintext`&&(n.ended=!0),n.ended?a:`${a}</${r}>`}function fs(e,t){if(t===`svg`&&ss.has(e.tag)||t===`math`&&cs.has(e.tag))return`html`;if(t===`math`&&e.tag===`annotation-xml`){let t=(e.attrs.encoding??``).toLowerCase();if(t===`text/html`||t===`application/xhtml+xml`)return`html`}return t}var ps=String.fromCodePoint(160),ms=RegExp(`[&<>${ps}]`,`g`),hs=RegExp(`[&"${ps}]`,`g`),gs={"&":`&`,"<":`<`,">":`>`,'"':`"`,[ps]:` `};function _s(e){return e.replace(ms,e=>gs[e]??e)}function vs(e){return e.replace(hs,e=>gs[e]??e)}function ys(e){return/^[\t\n\f\r ]*$/.test(e)}var bs=new Set([`ltr`,`rtl`,`auto`]);function xs(t,n,r,i){let a=e=>{throw Error(`Component definition ${r.tag}: toView ${e}`)};(t?.type!==`element`||t.tag!==r.tag)&&a(`must return a <${r.tag}> element`);let o=Object.keys(t.attrs);(o[0]!==`id`||t.attrs.id!==i.id)&&a(`must write id = context.opaque() first`),(o[1]!==`v`||t.attrs.v!==String(r.version))&&a(`must write v="${r.version}" second`);let s=(e,t,n)=>{for(let[r,o]of Object.entries(e.attrs).slice(n)){let n=Cs(e.tag,r,o,Ss(t,r),i.urlPolicy);n!==null&&a(n)}};s(t,e(r),2);let c=e=>{let t=r.children.find(t=>t.tag===e.tag);if(t===void 0)a(`writes <${e.tag}>, which is not a declared child`);else if(t.visibility===`private`)a(`keeps the private child <${e.tag}>`);else if(s(e,t.attributes,0),t.content===`text`)e.children.some(e=>e.type===`element`)&&a(`writes elements inside text-only <${e.tag}>`);else{let t=ws(e.children,i.urlPolicy);t!==null&&a(`${t} inside <${e.tag}>`)}};if(r.content===`flow`){let e=ws(t.children,i.urlPolicy,{manifest:r,child:c});e!==null&&a(e)}else for(let e of t.children)e.type===`element`?c(e):ys(e.value)||a(`writes text directly inside the element`);let[l]=Ts(n,t,r);l!==void 0&&a(`puts private data (${l.what}) into the view`)}function Ss(e,t){return e.find(e=>e.name===t)}function Cs(e,t,n,r,i){return/^on/i.test(t)?`writes the event handler ${t} on <${e}>`:t===`style`?Ae(n).removed.length===0?null:`writes a style the format refuses on <${e}>`:s.has(t)?(t===`lang`?_.test(n):bs.has(n))?null:`writes an invalid ${t} on <${e}>`:r===void 0||r.visibility===`private`?`writes the attribute ${t} on <${e}>, which is not public or derived`:r.type===`id`&&!a(n)?`writes the source id ${n} on <${e}>`:r.type===`url`&&!i(n,{tag:e,attribute:t})?`writes a blocked URL in ${t} on <${e}>`:null}function ws(e,t,n,r=n!==void 0){for(let i of e){if(i.type===`text`)continue;if(n?.manifest.children.some(e=>e.tag===i.tag)){n.child(i);continue}let e=d.has(i.tag),a=h.has(i.tag)||i.tag===`figure`||i.tag===`figcaption`;if(!e&&!(r&&a))return`writes <${i.tag}>`;let o=Object.hasOwn(he,i.tag)?he[i.tag]??[]:[];for(let[e,n]of Object.entries(i.attrs)){if(/^on/i.test(e))return`writes the event handler ${e} on <${i.tag}>`;if(s.has(e)){let r=Cs(i.tag,e,n,void 0,t);if(r!==null)return r}else if(!o.includes(e))return`writes the attribute ${e} on <${i.tag}>`;else if(e===ye[i.tag]&&!t(n,{tag:i.tag,attribute:e}))return`writes a blocked URL in ${e} on <${i.tag}>`}if(i.tag===`img`&&!(Object.hasOwn(i.attrs,`src`)&&Object.hasOwn(i.attrs,`alt`)))return`writes <img> without src or alt`;let c=ws(i.children,t,n,r&&!e);if(c!==null)return c}return null}function Ts(t,n,r){let i=[];for(let t of e(r))t.visibility===`private`&&Object.hasOwn(n.attrs,t.name)&&i.push({kind:`attribute`,what:`@${t.name}`});for(let e of Os(n)){let t=r.children.find(t=>t.tag===e.tag);if(t!==void 0){t.visibility===`private`&&i.push({kind:`child`,what:e.tag});for(let n of t.attributes)n.visibility===`private`&&Object.hasOwn(e.attrs,n.name)&&i.push({kind:`attribute`,what:`${e.tag}@${n.name}`})}}let a=ks([n]),o=js(n,r),s=ks(Ds(t,r)),c=js(t,r,!0);for(let{what:e,value:n}of Ms(t,r)){let t=o.includes(n)&&!c.includes(n),r=Fs(a,n)&&!Fs(s,n);(t||r)&&i.push({kind:`value`,what:e,value:n})}return i}var Es=(e,t,n)=>e.type===`element`&&t.children.some(t=>t.tag===e.tag&&t.visibility===n);function Ds(e,t){if(t.content!==`flow`)return e.children.filter(e=>Es(e,t,`public`));let n=e=>e.flatMap(e=>e.type===`text`?[e]:Es(e,t,`private`)?[]:[{...e,children:n(e.children)}]);return n(e.children)}function Os(e){let t=[],n=[...e.children].reverse();for(let e=n.pop();e!==void 0;e=n.pop())if(e.type===`element`){t.push(e);for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}return t}function ks(e){let t=[],n=[...e].reverse();for(let e=n.pop();e!==void 0;e=n.pop())if(e.type===`text`)t.push(e.value);else{e.tag===`img`&&Object.hasOwn(e.attrs,`alt`)&&t.push(e.attrs.alt??``);let r=ye[e.tag];r!==void 0&&Object.hasOwn(e.attrs,r)&&t.push(...As(e.attrs[r]??``));for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}return t.join(` `)}function As(e){try{let t=decodeURIComponent(e.replace(/\+/g,` `));return t===e?[e]:[e,t]}catch{return[e]}}function js(t,n,r=!1){let i=e=>e!==void 0&&(e.type===`string`||e.type===`url`)&&(r?e.visibility===`public`:e.visibility!==`private`),a=[],o=e(n);for(let[e,n]of Object.entries(t.attrs))i(Ss(o,e))&&a.push(n);for(let e of Os(t)){let t=n.children.find(t=>t.tag===e.tag);if(!(t===void 0||r&&t.visibility!==`public`))for(let[n,r]of Object.entries(e.attrs))i(Ss(t.attributes,n))&&a.push(r)}return a}function Ms(e,t){let n=[],r=(e,t)=>{let r=t?.trim()??``;r!==``&&n.push({what:e,value:r})},i=e=>e.visibility===`private`&&e.type===`string`;for(let n of t.attributes)i(n)&&Object.hasOwn(e.attrs,n.name)&&r(`@${n.name}`,e.attrs[n.name]);for(let n of Os(e)){let e=t.children.find(e=>e.tag===n.tag);if(e!==void 0){e.visibility===`private`&&r(n.tag,ks(n.children));for(let t of e.attributes)i(t)&&Object.hasOwn(n.attrs,t.name)&&r(`${n.tag}@${t.name}`,n.attrs[t.name])}}return n}var Ns=/^[\p{L}\p{N}]$/u;function Ps(e,t,n){if(t<0||t>=e.length)return!1;let r=t,i=e.charCodeAt(r);if(n&&i>=56320&&i<=57343&&r>0){let t=e.charCodeAt(r-1);t>=55296&&t<=56319&&r--}return Ns.test(String.fromCodePoint(e.codePointAt(r)??0))}function Fs(e,t){let n=t.length;if(n===0||n>e.length)return!1;let r=new Int32Array(n);for(let e=1,i=0;e<n;e++){for(;i>0&&t[e]!==t[i];)i=r[i-1]??0;t[e]===t[i]&&i++,r[e]=i}for(let i=0,a=0;i<e.length;i++){for(;a>0&&e[i]!==t[a];)a=r[a-1]??0;if(e[i]===t[a]&&a++,a===n){if(!Ps(e,i-n+1-1,!0)&&!Ps(e,i+1,!1))return!0;a=r[a-1]??0}}return!1}var Is=new TextEncoder;function Ls(e){return typeof e==`string`?Is.encode(e):new Uint8Array(e)}function Rs(e){let t;return async n=>(t??=crypto.subtle.importKey(`raw`,e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),new Uint8Array(await crypto.subtle.sign(`HMAC`,await t,Is.encode(n))))}var zs=String.fromCodePoint(31);function Bs(e,t){return`${e}${zs}${t}`}function Vs(e){return`page:${e??`#0`}`}function Hs(e,t){return t===void 0?`el:${e}`:`el:${e}/${t}`}var Us=`abcdefghijklmnopqrstuvwxyz234567`;function Ws(e){let t=``,n=0,r=0;for(let i of e)for(n=(n<<8|i)&65535,r+=8;r>=5;)r-=5,t+=Us[n>>>r&31];return r>0&&(t+=Us[n<<5-r&31]),t}function Gs(e){return`k${Ws(e.subarray(0,10))}`}function Ks(e){let t=new DataView(e.buffer,e.byteOffset+16,16);return[t.getUint32(0),t.getUint32(4),t.getUint32(8),t.getUint32(12)]}function qs(e){let t=2166136261;for(let n of Is.encode(e))t=Math.imul(t^n,16777619);return t>>>0}function Js(e){let t=(e[0]??0)|0,n=(e[1]??0)|0,r=(e[2]??0)|0,i=(e[3]??0)|0;return()=>{let e=(t+n|0)+i|0;return i=i+1|0,t=n^n>>>9,n=r+(r<<3)|0,r=r<<21|r>>>11,r=r+e|0,e>>>0}}function Ys(e,t,n,r){let i=Js([(e[0]??0)^qs(t),e[1]??0,e[2]??0,e[3]??0]);for(let e=0;e<12;e++)i();let a=()=>{let e=Array.from({length:n},(e,t)=>t);for(let t=n-1;t>0;t--){let n=Math.floor(i()*(t+1)/4294967296),r=e[t];e[t]=e[n],e[n]=r}return e};if(r&&n===2)return[1,0];let o=a();for(let e=0;r&&n>2&&Zs(o)&&e<Xs;e++)o=a();return r&&n>2&&Zs(o)&&o.push(o.shift()),o}var Xs=64;function Zs(e){return e.every((e,t)=>e===t)}async function Qs(e){let t=new Uint8Array(await crypto.subtle.digest(`SHA-256`,Is.encode(e))),n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return n}var $s=/^-?\d+$/,ec=/^-?(\d+(\.\d+)?|\.\d+)$/;function tc(e){if(!$s.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function nc(e){if(!ec.test(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}function rc(e,t){return t===``||t.toLowerCase()===e}var ic=new Set([...[...h].filter(e=>e!==`ul`&&e!==`ol`),...[...d].filter(e=>e!==`a`&&e!==`br`&&e!==`img`),y]),ac=new Set([`ltr`,`rtl`,`auto`]),oc=[`name`,`label`,`for`,`style`],sc=new Set([x,E,n,C,p,y]),cc=4.5;function lc(e,t){return new Sc(t).run(e)}var uc=()=>({hints:[],explanation:null,feedback:{},where:[]}),dc=e=>e.where.length===0?null:{hints:e.hints,explanation:e.explanation,feedback:e.feedback};function K(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function fc(e,t){let n=K(e.attrs,`id`);return n?`${e.tag}#${n}`:`${e.tag}[${t}]`}function pc(e){return e.some(e=>e.type===`element`||e.value.trim()!==``)}function mc(e){return e.every(e=>e.type===`text`?e.value.trim()===``:e.tag===`br`||(e.tag===`p`||e.tag===`astl-columns`||e.tag===`astl-column`)&&mc(e.children))}function hc(e,t){let n=t?.trim()??``;return{page:e,title:n,titled:n===``?`no`:`yes`}}function gc(e){return/^\d+$/.test(e)&&g.includes(Number(e))}function _c(e,t){return e===`inline`?!t.inLink&&ic.has(t.parent):t.parent===`astl-page`||t.parent===`astl-doc`||t.parent===`astl-column`}function vc(e,t){return t.min!==void 0&&e<t.min||t.max!==void 0&&e>t.max}function yc(e,t){let n=K(e,`lang`),r=K(e,`dir`);return{lang:n??t.lang,dir:r===`ltr`||r===`rtl`?r:n===void 0?t.dir:v(n)}}var bc={ink:null,ground:null};function xc(e,t){let n=K(e,`style`);if(n===void 0)return t;let{ink:r,ground:i}=t;for(let[e,t]of Ae(n).declarations)if(e===`color`)t!==`currentcolor`&&(r=Pe(t));else if(e===`background-color`&&t!==`transparent`){let e=Pe(t);e===null?i=null:e[3]===1?i=e:i!==null&&(i=Oe(e,i))}return{ink:r,ground:i}}var Sc=class{options;found=[];ids=new Set;components=new Map;bySource=new Map;checks=[];order=0;errors=0;componentCount=0;gradedPages=new Set;pageHelp=new Map;explicitPages=!1;inHelp=!1;owners=new Map;namedStyles=new Map;tagStyles=new Map;inlined=0;lowContrast=new Set;page;tracksColours;constructor(e){this.options=e;let t=e.groundColors&&Pe(e.groundColors.surface),n=e.groundColors&&Pe(e.groundColors.ink);this.tracksColours=t!=null&&n!=null,this.page=this.tracksColours?{ink:n??null,ground:t??null}:bc;for(let{manifest:t}of e.definitions.values())for(let{tag:e}of t.children){let n=this.owners.get(e);this.owners.set(e,n===void 0?t.tag:`${n}, ${t.tag}`)}}run(e){let t={order:0,page:null,element:null,tag:null,path:``};if(e.length>1e6)return this.add(D.SOURCE_TOO_LARGE,{max:de},t),this.result(null);if(Wo(e,256)>256)return this.add(D.SOURCE_TOO_COMPLEX,{max:256},t),this.result(null);let n=Jo(e);if(n===null)return this.add(D.SOURCE_TOO_DEEP,{max:100},t),this.result(null);let r=n.filter(e=>e.type===`element`||!ys(e.value)),i=r[0];if(r.length!==1||!T(i,`astl-doc`))return this.add(D.DOC_ROOT_INVALID,{},t),this.result(null);let a={order:this.order++,page:null,element:null,tag:null,path:x},s=K(i.attrs,`format`);if(s!==void 0&&!gc(s))return this.add(D.DOC_FORMAT_UNSUPPORTED,{format:s},a),this.result(null);let c=this.readRules(i),l={},u={...a,tag:x};for(let[e,t]of Object.entries(i.attrs))e!==`style`&&e!==`class`&&(ee.includes(e)?e===`lang`?_.test(t)?l.lang=t:this.add(D.DOC_LANG_INVALID,{lang:t},a):e===`dir`?t===`ltr`||t===`rtl`?l.dir=t:this.invalid(x,e,t,`enum`,[`ltr`,`rtl`],u):e===`kind`?o.includes(t)?l.kind=t:this.invalid(x,e,t,`enum`,o,u):(l[e]=t,e===`style-template`&&this.styleTemplate(t,x,`document`,u)):this.add(D.ATTRIBUTE_REMOVED,{tag:x,attribute:e},u,`warning`));this.inline(l,i.attrs,x,u,this.page),K(i.attrs,`lang`)===void 0&&this.add(D.DOC_LANG_MISSING,{},a);let d=l.lang??`und`,f=l.dir===`ltr`||l.dir===`rtl`?l.dir:v(d),p=l.kind??`exercise`,m=c.some(e=>T(e,E)),h=c.some(e=>e.type===`element`?e.tag!==E:!ys(e.value));m&&h&&this.add(D.DOC_MIXED_PAGES,{},a),this.explicitPages=m;let g={parent:x,inLink:!1,mode:`flow`,host:null,help:null,page:null,pageIndex:0,pageName:hc(0,void 0),lang:d,dir:f,...this.coloursBelow(l,this.page)},y={...i,children:c},b=[],S=new Map,C,te={},ne=g;m||(this.inline(te,{},E,{...u,tag:E},g),ne={...g,...this.coloursBelow(te,g)}),m?C=this.visitNodes(y,g,x,(e,t)=>{if(e.tag!==`astl-page`)return null;let n=b.length,r=this.visitPage(e,n,t,g),i=this.pageHelpOf(n);return b.push({sourceId:K(e.attrs,`id`)??null,label:K(e.attrs,`label`)??null,help:i}),S.set(r,n),[r]}):(C=this.visitNodes(y,ne,x),b.push({sourceId:null,label:null,help:this.pageHelpOf(0)})),!m&&!pc(C)?this.add(D.DOC_EMPTY,{},a):this.componentCount===0&&this.add(D.NO_COMPONENTS,{},a,`warning`);for(let e of this.checks)e();return this.result({root:w(x,l,C),lang:d,dir:f,kind:p,explicitPages:m,pages:b,pageStyle:K(te,`style`)??null,pageNodes:S,components:this.components})}result(e){let t=[...this.found].sort((e,t)=>e.order-t.order).map(e=>e.issue);return{ok:this.errors===0,issues:t,doc:e}}add(e,t,n,r=`error`,i=_e){r===`error`&&this.errors++;let a={page:n.page,element:n.element,tag:n.tag,path:n.path};this.found.push({order:n.order,issue:{code:e,severity:r,namespace:i,params:t,at:a}})}where(e,t,n){let r=e.host?.id??e.help?.element??null;return{order:t.order,page:e.page,element:r,tag:n,path:t.path}}visitNodes(e,t,n,r){let i=[],a=new Map;for(let o of e.children){let e=this.order++;if(o.type===`text`){rs(i,o.value);continue}let s=(a.get(o.tag)??0)+1;a.set(o.tag,s);let c={path:`${n} > ${fc(o,s)}`,order:e,index:s};for(let e of r?.(o,c)??this.visitElement(o,t,c))e.type===`text`?rs(i,e.value):i.push(e)}return i}readRules(e){let t=0,n=0;for(let[r,i]of e.children.entries()){if(i.type===`text`){if(ys(i.value))continue;break}if(i.tag!==`astl-style`)break;t++,n=r+1;let e=`${x} > ${xe}[${t}]`,a={order:this.order++,page:null,element:null,tag:xe,path:e};t<=100?this.readRule(i,a):t===101&&this.add(D.STYLE_RULES_TOO_MANY,{max:100},a)}return e.children.slice(n)}readRule(e,t){for(let n of Object.keys(e.attrs))oc.includes(n)||this.add(D.ATTRIBUTE_REMOVED,{tag:xe,attribute:n},t,`warning`);if(pc(e.children)){let n=e.children.find(e=>e.type===`element`),r=n===void 0?`text`:n.tag;this.add(D.CHILD_UNEXPECTED,{tag:xe,child:r},t)}let n=this.cleaned(K(e.attrs,`style`)??``,xe,t),r=K(e.attrs,`name`),i=K(e.attrs,`for`);r!==void 0&&i===void 0?(Me(r)&&!this.namedStyles.has(r)?this.namedStyles.set(r,n):this.add(D.STYLE_NAME_INVALID,{name:r},t),(K(e.attrs,`label`)??``).trim()===``&&this.add(D.ATTRIBUTE_REQUIRED,{tag:xe,attribute:`label`},t)):i!==void 0&&r===void 0?this.isRuleTarget(i)&&!this.tagStyles.has(i)?this.tagStyles.set(i,n):this.add(D.STYLE_NAME_INVALID,{name:i},t):this.add(D.STYLE_NAME_INVALID,{name:r??``},t)}isRuleTarget(e){return h.has(e)||d.has(e)||sc.has(e)||this.options.definitions.has(e)||this.owners.has(e)}cleaned(e,t,n){let{declarations:r,removed:i}=Ae(e);if(e.length>2e3)this.add(D.STYLE_TOO_LONG,{tag:t,max:ke},n,`warning`);else for(let e of i)this.add(D.STYLE_REMOVED,{tag:t,property:e},n,`warning`);return r}inline(e,t,n,r,i){if(this.inHelp){for(let e of[`style`,Te])K(t,e)!==void 0&&this.add(D.ATTRIBUTE_REMOVED,{tag:n,attribute:e},r,`warning`);return}let a=K(t,`style`),o=K(t,Te),s=this.tagStyles.get(n);if(a===void 0&&o===void 0&&s===void 0)return;let c=s===void 0?[]:[s];for(let e of o?.split(/\s+/)??[]){if(e===``)continue;let t=this.namedStyles.get(e);t===void 0?this.add(D.STYLE_UNKNOWN,{tag:n,class:e},r,`warning`):c.push(t)}a!==void 0&&c.push(this.cleaned(a,n,r));let l=Ee(...c);if(l.length===0)return;let u=je(l),d=this.inlined;this.inlined+=u.length,this.inlined>1e6?d<=1e6&&this.add(D.STYLE_TOO_LARGE,{max:Ne},r):(e.style=u,this.checkContrast(l,e,n,r,i))}checkContrast(e,t,n,r,i){if(n===`img`||!e.some(([e])=>e===`color`||e===`background-color`))return;let{ink:a,ground:o}=xc(t,i);if(a===null||o===null)return;let s=Oe(a,o),c=De(s,o);if(c>=cc)return;let l=`${s.map(Math.round).join()}/${o.map(Math.round).join()}`;if(this.lowContrast.has(l))return;this.lowContrast.add(l);let u={tag:n,ratio:Math.round(c*100)/100,min:cc};this.add(D.STYLE_LOW_CONTRAST,u,r,`warning`)}coloursBelow(e,t){return this.tracksColours?xc(e,t):bc}below(e,t){return{...yc(e,t),...this.coloursBelow(e,t)}}visitElement(e,t,n){let r=e.tag,i=this.where(t,n,r);if(r===`astl-doc`)return this.add(D.PLACEMENT_INVALID,{tag:r},i),[];if(r===`astl-page`)return this.add(D.PAGE_NESTED,t.pageName,i),this.visitNodes(e,t,n.path);if(b.has(r)){let a=t.host,o=a!==null&&a.manifest.content===`flow`&&t.parent===a.manifest.tag,s=a===null&&t.help===null&&(t.parent===`astl-page`||t.parent===`astl-doc`&&!this.explicitPages);return o?this.visitHelp(e,t,n,i,a.help,a):s?this.visitHelp(e,t,n,i,this.pageHelpParts(t.pageIndex),null):this.add(D.PLACEMENT_INVALID,{tag:r},i),[]}let a=this.options.definitions.get(r);if(a!==void 0){let o=t.host?.manifest.tag??t.help?.tag;return o===void 0?[this.visitComponent(e,a,t,n)]:(this.add(D.COMPONENT_NESTED,{tag:r,parent:o},i),[])}if(se.has(r))return this.add(D.ELEMENT_REMOVED,{tag:r},i,`warning`),[];if(h.has(r)||d.has(r))return t.mode===`text`||t.mode===`inline`&&h.has(r)?(this.add(D.ELEMENT_REMOVED,{tag:r},i,`warning`),this.visitNodes(e,t,n.path)):[this.visitRichText(e,t,n,i)];if(r===`figure`&&t.mode===`flow`)return[this.visitFigure(e,t,n,i)];if(r.includes(`-`)){let a=t.host,o=a?.manifest.children.find(e=>e.tag===r);if(a&&o?.place===`lead`&&a.manifest.content===`flow`)return this.add(D.PLACEMENT_INVALID,{tag:r},i),[];if(a&&o&&a.manifest.content===`flow`&&t.mode===`flow`){(t.inLink||!ic.has(t.parent))&&this.add(D.PLACEMENT_INVALID,{tag:r},i);let s=this.visitDeclaredChild(e,o,t,n,i,a.localIds);return a.places.set(s,i),a.children.push(s),[s]}if(r===`astl-style`)return this.add(D.PLACEMENT_INVALID,{tag:r},i),[];if(r===`astl-columns`)return[this.visitColumns(e,t,n,i)];if(r===`astl-column`&&!(a&&o))return this.add(D.COLUMNS_INVALID,{tag:r},i),this.visitNodes(e,t,n.path);let s=this.owners.get(r);return a&&o?this.add(D.CHILD_UNEXPECTED,{tag:a.manifest.tag,child:r},i):s===void 0?this.add(D.ELEMENT_UNKNOWN,{tag:r},i):this.add(D.CHILD_OUTSIDE,{child:r,parents:s},i),[]}return this.add(D.ELEMENT_REMOVED,{tag:r},i,`warning`),this.visitNodes(e,t,n.path)}visitRichText(e,t,n,r){let i=this.richAttributes(e,r,t),a={...t,...this.below(i,t),parent:e.tag,inLink:t.inLink||e.tag===`a`};return w(e.tag,i,this.visitNodes(e,a,n.path))}visitColumns(e,t,r,i){let a=this.richAttributes(e,i,t),o={...t,...this.below(a,t),parent:n},s=0,c=!1,l=this.visitNodes(e,o,r.path,(e,n)=>{if(e.tag!==`astl-column`)return c=!0,this.visitElement(e,t,n);s++;let r=this.richAttributes(e,this.where(o,n,C),o),i={...o,...this.below(r,o),parent:C};return[w(C,r,this.visitNodes(e,i,n.path))]});return l.some(e=>e.type===`text`&&!ys(e.value))&&(c=!0),(t.host!==null||t.parent!==`astl-page`&&t.parent!==`astl-doc`||c||s<2||s>4)&&this.add(D.COLUMNS_INVALID,{tag:n},i),w(n,a,l.filter(e=>e.type===`element`))}richAttributes(e,t,n){let r={},i=Object.hasOwn(he,e.tag)?he[e.tag]??[]:[],a=e.tag===`img`;for(let[n,o]of Object.entries(e.attrs))if(n!==`style`&&n!==`class`){if(s.has(n))this.globalAttribute(n,o,e.tag,t)&&(r[n]=o);else if(!i.includes(n))this.add(D.ATTRIBUTE_REMOVED,{tag:e.tag,attribute:n},t,`warning`);else if(n===ye[e.tag]){if(a&&o.trim()===``)continue;this.allowsUrl(o,e.tag,n,t,a)&&(r[n]=o)}else n===`start`&&tc(o)===null||(n===`width`||n===`height`)&&!((tc(o)??0)>0)?this.invalid(e.tag,n,o,`integer`,[],t):r[n]=o}return this.inline(r,e.attrs,e.tag,t,n),a&&((K(e.attrs,`src`)??``).trim()===``&&this.add(D.ATTRIBUTE_REQUIRED,{tag:e.tag,attribute:`src`},t),K(e.attrs,`alt`)===void 0&&this.add(D.IMG_ALT_MISSING,{},t)),r}visitFigure(e,t,n,r){t.parent!==`astl-page`&&t.parent!==`astl-doc`&&t.parent!==`astl-column`&&t.parent!==t.host?.manifest.tag&&!b.has(t.parent)&&this.add(D.PLACEMENT_INVALID,{tag:e.tag},r);let i=this.richAttributes(e,r,t),a={...t,...this.below(i,t),parent:p},o=0,s=0,c=!1,l=this.visitNodes(e,a,n.path,(e,t)=>{if(e.tag===`img`)o++;else if(e.tag===`figcaption`){s++;let n=this.richAttributes(e,this.where(a,t,e.tag),a),r={...a,...this.below(n,a),parent:y,mode:`inline`};return[w(y,n,this.visitNodes(e,r,t.path))]}else c=!0;return null});return l.some(e=>e.type===`text`&&!ys(e.value))&&(c=!0),(o!==1||s>1||c)&&this.add(D.FIGURE_INVALID,{},r),w(p,i,l)}visitPage(e,n,r,i){let a=K(e.attrs,`id`),o={order:r.order,page:a??null,element:null,tag:E,path:r.path},c={};for(let[n,r]of Object.entries(e.attrs))n!==`style`&&n!==`class`&&(t.includes(n)?s.has(n)?this.globalAttribute(n,r,`astl-page`,o)&&(c[n]=r):(c[n]=r,n===`id`&&this.sourceId(r,E,o)):this.add(D.ATTRIBUTE_REMOVED,{tag:E,attribute:n},o,`warning`));this.inline(c,e.attrs,E,o,i),a===void 0&&this.add(D.ID_MISSING,{tag:E},o);let l={...i,...this.below(c,i),parent:E,page:a??null,pageIndex:n,pageName:hc(n+1,K(e.attrs,`label`))},u=this.visitNodes(e,l,r.path);return mc(u)&&this.add(D.PAGE_EMPTY,l.pageName,o,`warning`),w(E,c,u)}visitComponent(t,n,r,i){let a=n.manifest,o=a.tag,c=this.errors,l=K(t.attrs,`id`),u={order:i.order,page:r.page,element:l??null,tag:o,path:i.path};this.componentCount++,a.graded&&this.gradedPages.add(r.pageIndex),_c(a.display,r)||this.add(D.PLACEMENT_INVALID,{tag:o},u);let d=this.upgrade(t,n,u),f=e(a),p={};for(let[e,t]of Object.entries(d.attrs)){if(e===`style`||e===`class`)continue;if(s.has(e)){this.globalAttribute(e,t,o,u)&&(p[e]=t);continue}let n=f.find(t=>t.name===e);if(n===void 0||n.visibility===`derived`)this.add(D.ATTRIBUTE_REMOVED,{tag:o,attribute:e},u,`warning`);else if(n.type===`url`)this.allowsUrl(t,o,e,u)&&(p[e]=t);else if(p[e]=t,e===`id`)this.sourceId(t,o,u);else if(e===`scoring`&&a.scoring!==null){let e=a.scoring.modes;if(!Object.hasOwn(e,t)){let n=Object.keys(e).join(`, `);this.add(D.SCORING_MODE_INVALID,{tag:o,mode:t,modes:n},u)}}else if(e===`points`&&a.scoring!==null){let e=nc(t);(e===null||vc(e,n))&&this.add(D.POINTS_INVALID,{value:t},u)}else e===`style-template`?this.styleTemplate(t,o,`component`,u):this.checkValue(n,t,o,u)}this.inline(p,d.attrs,o,u,r),this.checkRequired(f,p,o,u);let m=yc(p,r),h=new Map,g=new Set,_={manifest:a,id:l??null,children:[],places:h,localIds:g,help:uc()},v={...r,...this.below(p,r),parent:o,host:_},y;if(a.content===`flow`)y=this.visitNodes(d,{...v,mode:`flow`},i.path,(e,t)=>this.visitLeadChild(d,e,a,v,t));else{let e=this.visitComponentChildren(d,a,v,i,u,h,g);_.children.push(...e),y=e}for(let e of a.children){let t=_.children.filter(t=>t.tag===e.tag).length;if(t<e.min||e.max!==null&&t>e.max){let n={tag:o,child:e.tag,min:e.min,max:e.max??-1,count:t};this.add(D.CHILD_COUNT,n,u)}}let b=w(o,p,y);if(this.errors===c){let e=r.pageIndex;this.checks.push(()=>this.runDefinition(n,b,m.lang,u,h,e))}if(l!==void 0){let e={definition:n,element:b,sourceId:l,page:r.pageIndex,...m,localIds:[...g],help:dc(_.help)};this.components.set(b,e),this.bySource.has(l)||this.bySource.set(l,e)}return b}upgrade(e,t,n){let r=t.manifest,i=K(e.attrs,`v`),a=i===void 0?null:tc(i);if(a===null||a<1||a===r.version)return e;if(a>r.version)return this.add(D.VERSION_UNSUPPORTED,{tag:r.tag,version:a},n),e;let o=e;for(let i=a;i<r.version;i++){let s=t.migrations?.[i];if(s===void 0)return this.add(D.VERSION_UNSUPPORTED,{tag:r.tag,version:a},n),e;o=s(o)}return{...o,attrs:{...o.attrs,v:String(r.version)}}}visitLeadChild(e,t,n,r,i){let a=n.children.find(e=>e.tag===t.tag),o=r.host;if(a?.place!==`lead`||o===null)return null;let s=this.where(r,i,t.tag),c=e.children.indexOf(t);if(!e.children.slice(0,c).every(e=>e.type===`text`?ys(e.value):n.children.some(t=>t.tag===e.tag&&t.place===`lead`)))return this.add(D.PLACEMENT_INVALID,{tag:t.tag},s),[];let l=this.visitDeclaredChild(t,a,r,i,s,o.localIds);return o.places.set(l,s),o.children.push(l),[l]}visitComponentChildren(e,t,n,r,i,a,o){let s=t.tag,c=[],l=new Map;for(let u of e.children){let e=this.order++;if(u.type===`text`){ys(u.value)||this.add(D.CHILD_UNEXPECTED,{tag:s,child:`text`},{...i,order:e});continue}let d=(l.get(u.tag)??0)+1;l.set(u.tag,d);let f={path:`${r.path} > ${fc(u,d)}`,order:e,index:d},p=this.where(n,f,u.tag),m=t.children.find(e=>e.tag===u.tag);if(m!==void 0){let e=this.visitDeclaredChild(u,m,n,f,p,o);a.set(e,p),c.push(e)}else b.has(u.tag)&&n.host!==null?this.visitHelp(u,n,f,p,n.host.help,n.host):se.has(u.tag)?this.add(D.ELEMENT_REMOVED,{tag:u.tag},p,`warning`):this.options.definitions.has(u.tag)?this.add(D.COMPONENT_NESTED,{tag:u.tag,parent:s},p):u.tag===`astl-columns`||u.tag===`astl-column`?this.add(D.COLUMNS_INVALID,{tag:u.tag},p):u.tag===`astl-style`?this.add(D.PLACEMENT_INVALID,{tag:u.tag},p):u.tag.includes(`-`)&&u.tag!==`astl-doc`&&u.tag!==`astl-page`?this.owners.has(u.tag)?this.add(D.CHILD_UNEXPECTED,{tag:s,child:u.tag},p):this.add(D.ELEMENT_UNKNOWN,{tag:u.tag},p):this.add(D.CHILD_UNEXPECTED,{tag:s,child:u.tag},p)}return c}visitDeclaredChild(e,t,n,r,i,a){let o={};for(let[n,r]of Object.entries(e.attrs)){if(n===`style`||n===`class`)continue;if(s.has(n)){this.globalAttribute(n,r,e.tag,i)&&(o[n]=r);continue}let c=t.attributes.find(e=>e.name===n);c===void 0||c.visibility===`derived`?this.add(D.ATTRIBUTE_REMOVED,{tag:e.tag,attribute:n},i,`warning`):c.type===`url`?this.allowsUrl(r,e.tag,n,i)&&(o[n]=r):(o[n]=r,c.type===`id`?l(r)?a.has(r)?this.add(D.ID_DUPLICATE,{id:r},i):a.add(r):this.add(D.ID_INVALID,{id:r,tag:e.tag},i):this.checkValue(c,r,e.tag,i))}this.inline(o,e.attrs,e.tag,i,n),this.checkRequired(t.attributes,o,e.tag,i);let c={...n,...this.below(o,n),parent:e.tag,mode:t.content};return w(e.tag,o,this.visitNodes(e,c,r.path))}pageHelpParts(e){let t=this.pageHelp.get(e);if(t!==void 0)return t;let n=uc();return this.pageHelp.set(e,n),n}pageHelpOf(e){let t=this.pageHelp.get(e);if(t===void 0)return null;if(this.gradedPages.has(e))return dc(t);for(let{tag:e,at:n}of t.where)this.add(D.HELP_UNGRADED,{tag:e},n,`warning`);return null}visitHelp(e,t,n,r,i,a){let o=e.tag,s=0,c=null,l=!0;for(let[t,n]of Object.entries(e.attrs))if(o===`astl-hint`&&t===`cost`){let e=nc(n);e!==null&&e>=0&&e<=1?s=dn(e):(this.add(D.HINT_COST_INVALID,{value:n},r),l=!1)}else if(o===`astl-feedback`&&t===`when`){let e=ae.find(e=>e===n);e===void 0?(this.add(D.FEEDBACK_WHEN_INVALID,{value:n},r),l=!1):c=e}else this.add(D.ATTRIBUTE_REMOVED,{tag:o,attribute:t},r,`warning`);o===`astl-feedback`&&K(e.attrs,`when`)===void 0&&(this.add(D.ATTRIBUTE_REQUIRED,{tag:o,attribute:`when`},r),l=!1);let u={...t,parent:o,inLink:!1,mode:a?.manifest.display===`inline`?`inline`:`flow`,host:null,help:{tag:o,element:a?.id??null}};this.inHelp=!0;let d;try{d=this.visitNodes(e,u,n.path)}finally{this.inHelp=!1}if(a!==null&&!a.manifest.graded)this.add(D.HELP_UNGRADED,{tag:o},r,`warning`);else if(mc(d))this.add(D.HELP_EMPTY,{tag:o},r,`warning`);else if(l){if(o===`astl-explanation`){if(i.explanation!==null){this.add(D.EXPLANATION_DUPLICATE,{},r);return}i.explanation=d}else if(o===`astl-feedback`&&c!==null){if(Object.hasOwn(i.feedback,c)){this.add(D.FEEDBACK_DUPLICATE,{when:c},r);return}i.feedback[c]=d}else i.hints.push({content:d,cost:s});i.where.push({tag:o,at:r})}}runDefinition(e,t,n,r,i,a){let o=e.manifest;e.validate(t,{lang:n,profile:this.options.profile,find:e=>{let t=this.bySource.get(e);return t?.page===a?t.element:void 0},report:(e,t={},n={})=>{if(!o.issues.includes(e))throw Error(`Component definition ${o.tag}: issue ${e} is not listed in its manifest`);let a=n.child,s=a===void 0?r:i.get(a)??{...r,tag:a.tag};this.add(e,t,s,n.severity??`error`,o.messages)}})}sourceId(e,t,n){l(e)?this.ids.has(e)?this.add(D.ID_DUPLICATE,{id:e},n):this.ids.add(e):this.add(D.ID_INVALID,{id:e,tag:t},n)}allowsUrl(e,t,n,r,i=!1){if(this.options.urlPolicy(e,{tag:t,attribute:n}))return!0;let a={url:e,tag:t};return i?this.add(D.URL_BLOCKED,a,r):this.add(D.URL_BLOCKED,a,r,`warning`),!1}globalAttribute(e,t,n,r){let i=e===`lang`?_.test(t):ac.has(t);return!i&&e===`lang`?this.invalid(n,e,t,`string`,[],r):i||this.invalid(n,e,t,`enum`,[...ac],r),i}invalid(e,t,n,r,i,a){let o={tag:e,attribute:t,value:n,type:r,values:i.join(`, `)};this.add(D.ATTRIBUTE_INVALID,o,a)}styleTemplate(e,t,n,r){let i=this.options.styleTemplates?.get(e);(i?.scopes.includes(n)!==!0||n!==`document`&&i.components!==void 0&&!i.components.includes(t))&&this.add(D.STYLE_TEMPLATE_UNKNOWN,{name:e,tag:t},r,`warning`)}checkValue(e,t,n,r){let i;switch(e.type){case`string`:i=!0;break;case`boolean`:i=rc(e.name,t);break;case`integer`:case`number`:{let n=e.type===`integer`?tc(t):nc(t);i=n!==null&&!vc(n,e);break}case`enum`:i=(e.values??[]).includes(t);break;case`id`:l(t)||this.add(D.ID_INVALID,{id:t,tag:n},r);return;case`url`:return}i||this.invalid(n,e.name,t,e.type,e.type===`enum`?e.values??[]:[],r)}checkRequired(e,t,n,r){for(let i of e)i.required&&i.visibility!==`derived`&&!Object.hasOwn(t,i.name)&&(i.name===`id`?this.add(D.ID_MISSING,{tag:n},r):this.add(D.ATTRIBUTE_REQUIRED,{tag:n,attribute:i.name},r))}};function Cc(e,t){return Error(`Component definition ${e.tag}: ${t}`)}function wc(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Tc(e){let t=e.definition.localIds?.(e.element)??[],n=[...e.localIds,...t];if(new Set(n).size!==n.length)throw Cc(e.definition.manifest,`localIds() returned an id twice or a child id`);return n}async function Ec(e,n){let r=new Map([...e.components.values()].map(e=>[e,Tc(e)])),i=e=>r.get(e)??[],a=e.pages.map(e=>Vs(e.sourceId));for(let t of e.components.values()){a.push(Hs(t.sourceId));for(let e of i(t))a.push(Hs(t.sourceId,e))}let o=await Promise.all(a.map(e=>n.hmac(Bs(n.salt,e)))),s=new Map,c=new Map,l=new Set;a.forEach((e,t)=>{let n=o[t],r=Gs(n);if(l.has(r))throw Error(`Opaque id collision for ${e}`);l.add(r),s.set(e,n),c.set(e,r)});let u=e=>c.get(e),d=e.pages.map(e=>u(Vs(e.sourceId))),f=new Map([...e.components.values()].map(e=>[e.sourceId,e])),p=new Map;for(let t of e.components.values())p.set(t,Ac(t,u,s,n.profile,f,i));let m=e=>p.get(e),h={},g=(e,t)=>t===null?{}:(h[e]=kc(t),en({hints:t.hints.map(e=>e.cost),explanation:t.explanation!==null,feedback:ae.filter(e=>Object.hasOwn(t.feedback,e))})),_=t=>{if(t.type===`text`)return t;let r=e.components.get(t);if(r===void 0)return w(t.tag,t.attrs,t.children.map(_));let i=m(r),a=r.definition.toView(r.element,i);return xs(a,r.element,r.definition.manifest,{id:i.opaque(),urlPolicy:n.urlPolicy}),r.help===null?a:{...a,attrs:{...a.attrs,...g(i.opaque(),r.help)}}},v=(n,r)=>{let i=d[r],a={id:i};for(let e of t){let t=wc(n.attrs,e);e!==`id`&&t!==void 0&&(a[e]=t)}let o=n.children.map(_);return w(E,{...a,...g(i,e.pages[r]?.help??null)},o)},y=e.explicitPages?e.root.children.map(t=>{let n=t.type===`element`?e.pageNodes.get(t):void 0;return n===void 0||t.type!==`element`?_(t):v(t,n)}):[v(w(E,e.pageStyle===null?{}:{style:e.pageStyle},e.root.children),0)],b={format:`1`,lang:e.lang,dir:e.dir},S=wc(e.root.attrs,`style`);S!==void 0&&(b.style=S);let C=wc(e.root.attrs,be);C!==void 0&&(b[be]=C),e.kind!==`exercise`&&(b.kind=e.kind);let ee=w(x,b,y),te={},ne=[],re=[];for(let t of e.components.values()){let e=t.definition.manifest;if(e.slotKinds.length===0)continue;let r=m(t),a=d[t.page],o=r.opaque(),s=new Set([o,...i(t).map(e=>r.opaque(e))]),c=t.definition.slots(t.element,r);if(c.length===0&&e.graded)throw Cc(e,`slots() returned no slots for a graded element`);let l=[];for(let t of c){let r=n.slotKinds.get(t.kind);if(r===void 0||!e.slotKinds.includes(t.kind))throw Cc(e,`slot kind "${t.kind}" is not registered or not in its manifest`);if(!r.isKey(t.key))throw Cc(e,`slot ${t.id} has an invalid ${t.kind} key`);if(!s.has(t.id)||Object.hasOwn(te,t.id))throw Cc(e,`slot id ${t.id} must be a fresh id from context.opaque()`);te[t.id]={kind:t.kind,group:o,page:a,key:t.key},l.push(t.id)}if(!e.graded||e.scoring===null){re.push(...l);continue}let u=wc(t.element.attrs,`scoring`)??e.scoring.default,f=e.scoring.modes[u];if(f===void 0)throw Cc(e,`unknown scoring mode ${u}`);let p=nc(wc(t.element.attrs,`points`)??`1`)??1,h=t.definition.groups?.(t.element,r)??null;if(h===null){ne.push({id:o,rule:f,points:p,slots:l,page:a});continue}let g=new Set(l),_=new Set,v=new Set;for(let t of h){if(t.id===o||g.has(t.id)||!s.has(t.id)||v.has(t.id))throw Cc(e,`group id ${t.id} must be a fresh id from context.opaque(localId)`);if(t.slots.length===0||t.slots.some(e=>!g.has(e))||new Set(t.slots).size<t.slots.length)throw Cc(e,`group ${t.id} must hold some of the element's slots, each once`);v.add(t.id);for(let e of t.slots)_.add(e);ne.push({id:t.id,rule:f,points:p,slots:[...t.slots],page:a})}if(h.length===0||_.size<g.size)throw Cc(e,`groups() must hold every slot of the element`)}let ie=ls(qo(ls([ee]))),oe=await Qs(ie),se={format:1,lang:e.lang,viewHash:oe,pages:d,slots:te,groups:ne,...Object.keys(h).length===0?{}:{help:h}};return{view:ie,viewHash:oe,key:se,metadata:Pc(e,ee,d,se,re)}}var Dc=e=>T(e)&&(h.has(e.tag)||e.tag===`figure`),Oc=e=>ls(qo(ls(e.some(Dc)?e.filter(e=>T(e)||e.value.trim()!==``):e)));function kc(e){let t={};for(let n of ae){let r=e.feedback[n];r!==void 0&&(t[n]=Oc(r))}return{hints:e.hints.map(e=>({html:Oc(e.content),cost:e.cost})),explanation:e.explanation===null?null:Oc(e.explanation),feedback:t}}function Ac(e,t,n,r,i,a){let o=Hs(e.sourceId),s=Ks(n.get(o)),c=new Set(a(e));return{lang:e.lang,dir:e.dir,profile:r,opaque(n){if(n===void 0)return t(o);if(!c.has(n))throw Cc(e.definition.manifest,`"${n}" is not a local id of ${e.sourceId}`);return t(Hs(e.sourceId,n))},opaqueOf(n,r){let o=i.get(n);if(o===void 0||r!==void 0&&!a(o).includes(r)){let t=r===void 0?`component "${n}"`:`local id "${r}" of "${n}"`;throw Cc(e.definition.manifest,`there is no ${t}`)}return t(Hs(n,r))},permute(e,t={}){return Ys(s,t.salt??``,e.length,t.avoidOriginal??!1).map(t=>e[t])}}}var jc=new Set([`strong`,`em`,`b`,`i`,`u`,`s`,`sub`,`sup`,`code`,`mark`,`span`,`a`]);function Mc(e){let t=[],n=e=>{if(e.type===`text`){t.push(e.value);return}let r=!jc.has(e.tag);r&&t.push(` `);for(let t of e.children)n(t);r&&t.push(` `)};return n(e),t.join(``).split(/\s+/u).filter(e=>/[\p{L}\p{N}]/u.test(e)).length}function Nc(e){let t=new Map;for(let[n,r]of e)t.set(n,(t.get(n)??0)+r);let n={};for(let e of[...t.keys()].sort())n[e]=dn(t.get(e)??0);return n}function Pc(e,t,n,r,i){let{groups:a,viewHash:o}=r,s=Object.values(r.slots),c=e=>dn(e.reduce((e,t)=>e+m(t.rule,t.points,t.slots.length),0)),l=e.pages.map((e,t)=>({id:n[t],label:e.label,slots:s.filter(e=>e.page===n[t]).length,maxScore:c(a.filter(e=>e.page===n[t]))})),u=[...e.components.values()],d=[];for(let e of u){let t=e.definition.metadata?.(e.element)??{};for(let[n,r]of Object.entries(t))Number.isFinite(r)&&d.push([`${e.definition.manifest.tag}.${n}`,r])}return{format:1,lang:e.lang,dir:e.dir,...e.kind===`exercise`?{}:{kind:e.kind},viewHash:o,pages:l,elements:Nc(u.map(e=>[e.definition.manifest.tag,1])),slots:s.length,open:i,groups:a.length,maxScore:c(a),words:Mc(t),extra:Nc(d)}}function Fc(e){if(!(oe(e)&&e.pages.every(e=>typeof e==`string`)&&e.groups.every(e=>typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.page==`string`&&c.includes(e.rule)&&typeof e.points==`number`&&Number.isFinite(e.points)&&e.points>=0&&Array.isArray(e.slots)&&e.slots.every(e=>typeof e==`string`))))throw TypeError(`Invalid answer key`)}function Ic(e,t,n){let r=Object.hasOwn(e.slots,t)?e.slots[t]:void 0;if(r===void 0)throw TypeError(`Invalid answer key: unknown slot ${t}`);let i=n.get(r.kind);if(i===void 0)throw TypeError(`Invalid answer key: slot kind "${r.kind}" is not registered`);if(i.graded===!1)throw TypeError(`Invalid answer key: slot ${t} is of the ungraded kind "${r.kind}"`);if(typeof r.key!=`object`||r.key===null||!i.isKey(r.key))throw TypeError(`Invalid answer key: slot ${t} has an invalid ${r.kind} key`);return{slot:r,kind:i}}function Lc(e,t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;return typeof r==`string`&&r!==``&&ie(r,n)?r:null}function Rc(e,t){let n=t.slots[0];return n!==void 0&&Object.hasOwn(e.slots,n)?e.slots[n]?.group:void 0}function zc(e,t){let{page:n,element:r}=t;return e.groups.filter(t=>(n===void 0||t.page===n)&&(r===void 0||Rc(e,t)===r))}function Bc(e,t){let n=n=>{if(n===void 0||!Object.hasOwn(t,n))return 0;let r=t[n];if(typeof r!=`number`||!Number.isInteger(r)||r<=0)return 0;let i=e.help!==void 0&&Object.hasOwn(e.help,n)?e.help[n]?.hints:void 0;if(i===void 0)return 0;if(!Array.isArray(i)||!i.every(e=>Vc(e?.cost)))throw TypeError(`Invalid answer key: the hints of ${n} have invalid costs`);return i.slice(0,r).reduce((e,t)=>e+t.cost,0)};return t=>n(Rc(e,t))+n(t.page)}var Vc=e=>typeof e==`number`&&e>=0&&e<=1;function Hc(e,t,n,r){let i=e.slots.length,a=0,o=0,s=[];for(let i of e.slots){let{slot:e,kind:c}=Ic(t,i,r),l=typeof e.key.lang==`string`?e.key.lang:t.lang,u=Lc(n,i,e.kind),d,f;c.selection?(d=u===le,f=d===c.isCorrect(e.key,le,{lang:l})):(d=u!==null,f=u!==null&&c.isCorrect(e.key,u,{lang:l})),d&&a++,f&&o++,s.push({id:i,answered:d,correct:f})}let c=e.points,l=m(e.rule,c,i),u=0,d;if(a===0)d=`empty`;else{let t=o===i;e.rule===`all-correct`?(u=t?c:0,d=t?`correct`:`incorrect`):(u=e.rule===`per-slot`?c*o:c*o/i,d=t?`correct`:o===0?`incorrect`:`partial`)}let f={};if(d!==`empty`&&!(e.rule===`all-correct`&&i>1))for(let e of s)e.answered&&(f[e.id]=e.correct?`correct`:`incorrect`);return{result:{id:e.id,verdict:d,score:u,max:l},visible:f}}function Uc(e,t,n,r){Fc(e);let i=typeof t==`object`&&t?t:{},a=zc(e,n),o=new Set(a.map(e=>e.page)),s=n.element===void 0?n.page===void 0?e.pages:e.pages.filter(e=>e===n.page):e.pages.filter(e=>o.has(e)),c=n.hintsUsed===void 0?null:Bc(e,n.hintsUsed),l=new Map(s.map(e=>[e,{score:0,max:0}])),u={},d=[],f={correct:0,partial:0,incorrect:0,empty:0},p=0,m=0;for(let t of a){let n=Hc(t,e,i,r),a=c?.(t)??0,o=dn(Math.max(0,n.result.score-a*n.result.max)),s=a>0?{...n.result,score:o}:n.result,h=n.visible;d.push(s),Object.assign(u,h),f[s.verdict]++,p+=s.score,m+=s.max;let g=l.get(t.page);g!==void 0&&(g.score+=s.score,g.max+=s.max)}let h={};for(let[e,t]of l)h[e]={score:dn(t.score),max:dn(t.max)};return{score:dn(p),max:dn(m),correct:a.length>0&&f.correct===a.length,slots:u,groups:d,pages:h,counts:{...f,total:a.length}}}function Wc(e,t,n){Fc(e);let r={};for(let i of zc(e,t))for(let t of i.slots){let{slot:i,kind:a}=Ic(e,t,n),o=a.solution(i.key);o!==``&&(r[t]=o)}return r}var Gc=[{namespace:_e,locale:`en`,messages:{SOURCE_TOO_LARGE:`The document is too long. It can have at most {max, number} characters, so split it into several exercises.`,SOURCE_TOO_DEEP:`Elements are nested more than {max, plural, one {# level} other {# levels}} deep. Simplify the structure, for example by removing wrapper elements.`,SOURCE_TOO_COMPLEX:`An element in the document has more than {max, plural, one {# attribute} other {# attributes}}. Remove the attributes it does not need.`,DOC_ROOT_INVALID:`Put the whole exercise inside one <astl-doc> element, with nothing outside it.`,DOC_FORMAT_UNSUPPORTED:`Content format “{format}” is not supported. Use format="1" or leave the attribute out.`,DOC_LANG_MISSING:`Add the content language to <astl-doc>, for example lang="en".`,DOC_LANG_INVALID:`“{lang}” is not a language tag. Use a tag such as en, pl or pt-BR.`,DOC_EMPTY:`The document is empty. Add some text or an exercise element.`,DOC_MIXED_PAGES:`Some content is outside the pages. Put everything inside <astl-page> elements, or use no pages at all.`,NO_COMPONENTS:`Nothing in this document is graded yet. Add at least one exercise element.`,PAGE_EMPTY:`Page {page}{titled, select, yes { (“{title}”)} other {}} is empty. Add content or delete the page.`,PAGE_NESTED:`A page is inside other content{page, select, 0 {} other { on page {page}{titled, select, yes { (“{title}”)} other {}}}}. Place pages directly inside <astl-doc>.`,ID_MISSING:`Element {tag} has no id. Add an id attribute.`,ID_INVALID:`“{id}” is not a valid id for element {tag}. Start with a letter and use only a-z, A-Z, 0-9, - and _ (at most 64 characters).`,ID_DUPLICATE:`The id “{id}” is used more than once. Give every element its own id.`,ELEMENT_UNKNOWN:`Unknown element {tag}. Check the spelling, or register the component that defines it.`,ELEMENT_REMOVED:`Element {tag} is not allowed and was removed.`,ATTRIBUTE_REMOVED:`Attribute {attribute} is not allowed on element {tag} and was removed.`,ATTRIBUTE_INVALID:`Attribute {attribute} on element {tag} has an invalid value: “{value}”.{type, select, enum { Use one of: {values}.} other {}}`,ATTRIBUTE_REQUIRED:`Element {tag} needs the {attribute} attribute.`,CHILD_UNEXPECTED:`{child, select, text {Element {tag} contains loose text it does not accept. Remove it or put it inside an allowed child element.} other {Element {tag} does not accept <{child}>. Remove it or move it out.}}`,CHILD_OUTSIDE:`Element <{child}> only goes inside {parents}. Move it into one, or remove it.`,CHILD_COUNT:`Element {tag} {count, plural, =0 {has no {child} elements} one {has # {child} element} other {has # {child} elements}}, but {max, select, -1 {needs at least {min}} 1 {{min, select, 1 {needs exactly 1} other {allows at most 1}}} other {{min, select, 0 {allows at most {max}} other {needs {min} to {max}}}}}.`,PLACEMENT_INVALID:`Element {tag} cannot be placed here. Put inline elements inside text (a paragraph, heading or list item) and block elements directly on a page.`,COMPONENT_NESTED:`Element {tag} cannot be placed inside element {parent}. Move it out.`,URL_BLOCKED:`{tag, select, img {The picture address “{url}” is not allowed, so the picture cannot be shown. Use an address the exercise's URL policy accepts (by default https: or http:).} other {The link “{url}” is not allowed and was removed. Use a web or email link (https:, http: or mailto:).}}`,IMG_ALT_MISSING:`A picture has no alt text. Describe in alt what the picture shows, or write alt="" when it is only decoration.`,FIGURE_INVALID:`A figure holds exactly one picture (<img>) and at most one caption (<figcaption>), and nothing else.`,SCORING_MODE_INVALID:`Element {tag} has no scoring mode “{mode}”. Use one of: {modes}.`,POINTS_INVALID:`“{value}” is not a valid number of points. Use a number from 0.01 to 1000.`,VERSION_UNSUPPORTED:`Element {tag} uses version {version}, which this version of Astrolabe does not support. Update Astrolabe or check the v attribute.`,STYLE_TEMPLATE_UNKNOWN:`Style template “{name}” cannot be used on element {tag}: it is not registered, or not made for this element, so it is ignored.`,STYLE_REMOVED:`The style of element {tag} sets {property}, which an exercise may not use, or to a value it may not use, so that declaration is removed.`,STYLE_TOO_LONG:`The style of element {tag} is longer than {max} characters, so it is removed.`,STYLE_UNKNOWN:`Element {tag} uses the style “{class}”, which no <astl-style> defines.`,STYLE_NAME_INVALID:`The rule <astl-style> “{name}” cannot be used: it needs either a name (letters, digits, - and _, starting with a letter, not starting with astl-, tiptap or prosemirror, and used once) or a for naming an element of the format.`,STYLE_RULES_TOO_MANY:`An exercise can have at most {max} <astl-style> rules.`,STYLE_TOO_LARGE:`The <astl-style> rules write more than {max} characters of styles into the exercise. Use fewer rules, or shorter ones.`,STYLE_LOW_CONTRAST:`The text of element {tag} is hard to read on its background: contrast {ratio}:1, at least {min}:1 is recommended.`,COLUMNS_INVALID:`Element {tag} is not a valid layout: <astl-columns> goes directly on a page and holds 2 to 4 <astl-column> elements, with nothing else between them, and layouts do not nest.`,HELP_UNGRADED:`Element <{tag}> works only inside a graded interaction or on a page with one. Move it there: for now it is left out.`,HELP_EMPTY:`Element <{tag}> is empty, so it is left out. Write its text or remove it.`,HINT_COST_INVALID:`The cost of a hint is a fraction of the points from 0 to 1, such as 0.25, not “{value}”.`,FEEDBACK_WHEN_INVALID:`Feedback is for one verdict: when="correct", "incorrect", "partial" or "omitted", not “{value}”.`,FEEDBACK_DUPLICATE:`There are two feedback texts for the verdict “{when}” here. Keep one.`,EXPLANATION_DUPLICATE:`There are two explanations here. Keep one.`}},{namespace:_e,locale:`pl`,messages:{SOURCE_TOO_LARGE:`Dokument jest za długi. Może mieć najwyżej {max, number} znaków, więc podziel go na kilka ćwiczeń.`,SOURCE_TOO_DEEP:`Elementy są zagnieżdżone na więcej niż {max, plural, one {# poziomie} few {# poziomach} many {# poziomach} other {# poziomu}}. Uprość strukturę, na przykład usuń zbędne elementy otaczające.`,SOURCE_TOO_COMPLEX:`Element w dokumencie ma więcej niż {max, plural, one {# atrybut} few {# atrybuty} many {# atrybutów} other {# atrybutu}}. Usuń atrybuty, których nie potrzebuje.`,DOC_ROOT_INVALID:`Umieść całe ćwiczenie w jednym elemencie <astl-doc> i nie dodawaj niczego poza nim.`,DOC_FORMAT_UNSUPPORTED:`Format treści „{format}” nie jest obsługiwany. Wpisz format="1" albo usuń ten atrybut.`,DOC_LANG_MISSING:`Dodaj język treści do elementu <astl-doc>, na przykład lang="pl".`,DOC_LANG_INVALID:`„{lang}” nie jest kodem języka. Użyj kodu takiego jak pl, en albo pt-BR.`,DOC_EMPTY:`Dokument jest pusty. Dodaj tekst albo element ćwiczenia.`,DOC_MIXED_PAGES:`Część treści jest poza stronami. Umieść całą treść w elementach <astl-page> albo nie używaj stron wcale.`,NO_COMPONENTS:`W tym dokumencie nic jeszcze nie jest oceniane. Dodaj co najmniej jeden element ćwiczenia.`,PAGE_EMPTY:`Strona {page}{titled, select, yes { („{title}”)} other {}} jest pusta. Dodaj treść albo usuń stronę.`,PAGE_NESTED:`Strona jest wewnątrz innej treści{page, select, 0 {} other { na stronie {page}{titled, select, yes { („{title}”)} other {}}}}. Umieszczaj strony bezpośrednio w <astl-doc>.`,ID_MISSING:`Element {tag} nie ma identyfikatora. Dodaj atrybut id.`,ID_INVALID:`„{id}” nie jest poprawnym identyfikatorem elementu {tag}. Zacznij od litery i używaj tylko znaków a-z, A-Z, 0-9, - oraz _ (najwyżej 64 znaki).`,ID_DUPLICATE:`Identyfikator „{id}” występuje więcej niż raz. Nadaj każdemu elementowi inny identyfikator.`,ELEMENT_UNKNOWN:`Nieznany element {tag}. Sprawdź pisownię albo zarejestruj komponent, który go definiuje.`,ELEMENT_REMOVED:`Element {tag} jest niedozwolony i został usunięty.`,ATTRIBUTE_REMOVED:`Atrybut {attribute} jest niedozwolony w elemencie {tag} i został usunięty.`,ATTRIBUTE_INVALID:`Atrybut {attribute} w elemencie {tag} ma niepoprawną wartość: „{value}”.{type, select, enum { Użyj jednej z wartości: {values}.} other {}}`,ATTRIBUTE_REQUIRED:`Element {tag} wymaga atrybutu {attribute}.`,CHILD_UNEXPECTED:`{child, select, text {Element {tag} zawiera luźny tekst, którego nie przyjmuje. Usuń go albo umieść w dozwolonym elemencie.} other {Element {tag} nie przyjmuje <{child}>. Usuń go albo przenieś poza ten element.}}`,CHILD_OUTSIDE:`Element <{child}> może być tylko wewnątrz: {parents}. Przenieś go tam albo usuń.`,CHILD_COUNT:`Element {tag} {count, plural, =0 {nie zawiera żadnego elementu {child}} one {zawiera # element {child}} few {zawiera # elementy {child}} many {zawiera # elementów {child}} other {zawiera # elementu {child}}}, a {max, select, -1 {musi mieć co najmniej {min}} 1 {{min, select, 1 {musi mieć dokładnie 1} other {może mieć najwyżej 1}}} other {{min, select, 0 {może mieć najwyżej {max}} other {musi mieć od {min} do {max}}}}}.`,PLACEMENT_INVALID:`Elementu {tag} nie można tu umieścić. Elementy w tekście wstawiaj do akapitu, nagłówka lub punktu listy, a elementy blokowe bezpośrednio na stronę.`,COMPONENT_NESTED:`Elementu {tag} nie można umieścić wewnątrz elementu {parent}. Przenieś go na zewnątrz.`,URL_BLOCKED:`{tag, select, img {Adres obrazka „{url}” jest niedozwolony, więc obrazka nie można pokazać. Użyj adresu, który przyjmuje polityka adresów ćwiczenia (domyślnie https: albo http:).} other {Link „{url}” jest niedozwolony i został usunięty. Użyj adresu strony lub e-maila (https:, http: albo mailto:).}}`,IMG_ALT_MISSING:`Obrazek nie ma tekstu alternatywnego. Opisz w alt, co przedstawia, albo wpisz alt="", jeśli jest tylko ozdobą.`,FIGURE_INVALID:`Element figure zawiera dokładnie jeden obrazek (<img>) i najwyżej jeden podpis (<figcaption>), nic więcej.`,SCORING_MODE_INVALID:`Element {tag} nie ma trybu punktacji „{mode}”. Użyj jednego z: {modes}.`,POINTS_INVALID:`„{value}” nie jest poprawną liczbą punktów. Użyj liczby od 0,01 do 1000.`,VERSION_UNSUPPORTED:`Element {tag} używa wersji {version}, której ta wersja Astrolabe nie obsługuje. Zaktualizuj Astrolabe albo sprawdź atrybut v.`,STYLE_TEMPLATE_UNKNOWN:`Szablonu stylu „{name}” nie można użyć w elemencie {tag}: nie jest zarejestrowany albo nie jest przeznaczony dla tego elementu, więc zostanie pominięty.`,STYLE_REMOVED:`Styl elementu {tag} ustawia {property}, czego ćwiczenie nie może używać, albo używa niedozwolonej wartości, więc ta deklaracja zostanie usunięta.`,STYLE_TOO_LONG:`Styl elementu {tag} jest dłuższy niż {max} znaków, więc zostanie usunięty.`,STYLE_UNKNOWN:`Element {tag} używa stylu „{class}”, którego nie definiuje żadne <astl-style>.`,STYLE_NAME_INVALID:`Reguły <astl-style> „{name}” nie można użyć: potrzebuje albo nazwy (litery, cyfry, - i _, na początku litera, bez przedrostków astl-, tiptap i prosemirror, użytej raz), albo atrybutu for z elementem formatu.`,STYLE_RULES_TOO_MANY:`Ćwiczenie może mieć najwyżej {max} reguł <astl-style>.`,STYLE_TOO_LARGE:`Reguły <astl-style> wpisują do ćwiczenia ponad {max} znaków stylów. Użyj mniejszej liczby reguł albo krótszych.`,STYLE_LOW_CONTRAST:`Tekst elementu {tag} jest trudny do odczytania na swoim tle: kontrast {ratio}:1, zalecane co najmniej {min}:1.`,COLUMNS_INVALID:`Element {tag} nie tworzy poprawnego układu: <astl-columns> stoi bezpośrednio na stronie i zawiera od 2 do 4 elementów <astl-column>, bez niczego między nimi, a układów nie można zagnieżdżać.`,HELP_UNGRADED:`Element <{tag}> działa tylko w ocenianym zadaniu albo na stronie z takim zadaniem. Przenieś go tam: na razie jest pominięty.`,HELP_EMPTY:`Element <{tag}> jest pusty, więc jest pominięty. Wpisz jego treść albo go usuń.`,HINT_COST_INVALID:`Koszt podpowiedzi to część punktów od 0 do 1, np. 0.25, a nie „{value}”.`,FEEDBACK_WHEN_INVALID:`Informacja zwrotna dotyczy jednego wyniku: when="correct", "incorrect", "partial" albo "omitted", a nie „{value}”.`,FEEDBACK_DUPLICATE:`Są tu dwie informacje zwrotne dla wyniku „{when}”. Zostaw jedną.`,EXPLANATION_DUPLICATE:`Są tu dwa wyjaśnienia. Zostaw jedno.`}}];function Kc(...e){return RegExp(`[${String.fromCodePoint(...e)}]`,`gu`)}var qc=Kc(8216,8217,8218,8219,8242),Jc=Kc(8220,8221,8222,8223,8243,171,187),Yc=Kc(8210,8211,8212,8722),Xc=Kc(8230),Zc=Kc(8722),Qc=/\s+/gu,$c=/^\p{P}$/u,el=/^\s$/u,tl=/\p{M}/gu,nl={ł:`l`,Ł:`L`,ø:`o`,Ø:`O`,đ:`d`,Đ:`D`,ß:`ss`,æ:`ae`,Æ:`AE`,œ:`oe`,Œ:`OE`,ı:`i`},rl=/[łŁøØđĐßæÆœŒı]/g;function q(e,t,n){let r=e;for(let e=0;e<il;e++){let e=al(r,t,n);if(e===r)break;r=e}return r}var il=8;function al(e,t,n){let r=e.normalize(t.form);t.quotes===`fold`&&(r=r.replace(qc,`'`).replace(Jc,`"`).replace(Yc,`-`).replace(Xc,`...`));let i=t.space===`collapse`;return i&&(r=r.replace(Qc,` `).trim()),t.punctuation===`ignore-edge`&&(r=ol(r,i)),t.case===`insensitive`&&(r=sl(r,n)),t.marks===`fold`&&(r=r.normalize(`NFD`).replace(tl,``).replace(rl,e=>nl[e]??e).normalize(`NFC`)),r}function ol(e,t){let n=e=>{let n=String.fromCodePoint(e);return $c.test(n)||t&&el.test(n)},r=0,i=e.length;for(;r<i;){let t=e.codePointAt(r)??0;if(!n(t))break;r+=t>65535?2:1}for(;i>r;){let t=i-1,a=e.charCodeAt(t);if(a>=56320&&a<=57343&&t>r){let n=e.charCodeAt(t-1);n>=55296&&n<=56319&&t--}if(!n(e.codePointAt(t)??0))break;i=t}return r===i||r===0&&i===e.length?e:e.slice(r,i)}function sl(e,t){try{return e.toLocaleLowerCase(t)}catch{return e.toLowerCase()}}var cl=new Set(`pl.de.fr.es.it.pt.ru.uk.cs.sk.sl.hr.sr.bg.ro.hu.lt.lv.et.fi.sv.nb.nn.da.nl.tr.el.id.vi.be.kk.az`.split(`.`));function ll(e){return cl.has(e.toLowerCase().split(`-`)[0]??``)}var ul=new Set([`de`,`es`,`it`,`pt`,`sl`,`hr`,`sr`,`ro`,`da`,`nl`,`tr`,`el`,`id`,`vi`,`az`]),dl=/^[+-]?(\d+(\.\d*)?|\.\d+)$/,fl=/^[+-]?\d{1,3}(,\d{3})+(\.\d*)?$/,pl=/^[+-]?\d{1,3}(\.\d{3})+(,\d*)?$/,ml=/^[+-]?\d{1,3}(\.\d{3})+$/;function hl(e,t){let n=e.trim().replace(/(\d)\s+(?=\d)/gu,`$1`).replace(Zc,`-`),r=gl(n,`,`),i=gl(n,`.`),a=t.toLowerCase().split(`-`)[0]??``;if(cl.has(a)){if(r>0&&i>0){if(r>1||!pl.test(n))return null;n=n.replace(/\./g,``).replace(`,`,`.`)}else if(r===1)n=n.replace(`,`,`.`);else if(r>1)return null;else if(i>0&&ml.test(n)&&(i>1||ul.has(a)))n=n.replace(/\./g,``);else if(i>1)return null}else if(r>0){if(!fl.test(n))return null;n=n.replace(/,/g,``)}if(!dl.test(n))return null;let o=Number(n);return Number.isFinite(o)?o:null}function gl(e,t){let n=0;for(let r of e)r===t&&n++;return n}function _l(e,t){let n=String(e);return/e/i.test(n)&&Math.abs(e)<1e21&&(n=e.toFixed(20).replace(/\.?0+$/,``)),ll(t)?n.replace(`.`,`,`):n}var vl={form:[`NFC`,`NFKC`],space:[`strict`,`collapse`],case:[`sensitive`,`insensitive`],marks:[`strict`,`fold`],punctuation:[`strict`,`ignore-edge`],quotes:[`strict`,`fold`]};function yl(e){return!bl(e)||!xl(e,Object.keys(vl))?!1:Object.entries(vl).every(([t,n])=>n.includes(e[t]))}function bl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xl(e,t){return Object.keys(e).length===t.length&&t.every(t=>Object.hasOwn(e,t))}function Sl(e){return Array.isArray(e)&&e.length>0}var Cl={kind:`text`,selection:!1,isKey(e){return xl(e,[`accept`,`profile`,`lang`])&&Sl(e.accept)&&e.accept.every(e=>typeof e==`string`&&e!==``)&&yl(e.profile)&&typeof e.lang==`string`},isCorrect(e,t){let n=q(t,e.profile,e.lang);return e.accept.some(t=>q(t,e.profile,e.lang)===n)},solution(e){return e.accept[0]??``}},wl={kind:`number`,selection:!1,isKey(e){return xl(e,[`values`,`tolerance`,`lang`])&&Sl(e.values)&&e.values.every(e=>typeof e==`number`&&Number.isFinite(e))&&typeof e.tolerance==`number`&&Number.isFinite(e.tolerance)&&e.tolerance>=0&&typeof e.lang==`string`},isCorrect(e,t){let n=hl(t,e.lang);return n!==null&&e.values.some(t=>Math.abs(n-t)<=e.tolerance+1e-9)},solution(e){let t=e.values[0];return t===void 0?``:_l(t,e.lang)}},Tl={kind:`choice`,selection:!1,isKey(e){return xl(e,[`correct`])&&typeof e.correct==`string`&&e.correct!==``},isCorrect(e,t){return t===e.correct},solution(e){return e.correct}},El={kind:`flag`,selection:!0,isKey(e){return xl(e,[`correct`])&&typeof e.correct==`boolean`},isCorrect(e,t){return t===le===e.correct},solution(e){return e.correct?le:``}};function Dl(e,t){try{return e.toLocaleUpperCase(t)}catch{return e.toUpperCase()}}var Ol={kind:`letter`,selection:!1,isKey(e){return xl(e,[`letter`,`lang`])&&typeof e.letter==`string`&&[...e.letter].length===1&&typeof e.lang==`string`},isCorrect(e,t){return Dl(t.trim().normalize(`NFC`),e.lang).normalize(`NFC`)===e.letter},solution(e){return e.letter}},kl=[Cl,wl,Tl,El,Ol,{kind:we,selection:!1,graded:!1,isKey(e){return xl(e,[])},isCorrect:()=>!1,solution:()=>``}],Al=16,jl=/^[a-z][a-z0-9-]*$/,Ml=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Nl=new Set([x,E,xe,n,C]);function Pl(t,n){let i=t.tag,a=e=>{throw TypeError(`Component manifest ${i}: ${e}`)};if((!r.test(i)||Nl.has(i))&&a(`tag must be a lowercase custom element name`),(!Number.isInteger(t.version)||t.version<1)&&a(`version must be a positive integer`),t.display!==`inline`&&t.display!==`block`&&a(`display must be inline or block`),t.content!==void 0&&(t.content!==`flow`||t.display!==`block`)&&a(`content must be absent, or "flow" on a block`),t.graded!==(t.scoring!==null)&&a(`graded types need scoring, ungraded types none`),t.variants!==null){let{default:e,values:n}=t.variants;(n.length===0||new Set(n).size!==n.length||!n.every(e=>Ml.test(e)))&&a(`variants must be distinct kebab-case names`),n.includes(e)||a(`variant default "${e}" is not one of its values`)}if(t.scoring!==null){let e=t.scoring.modes;Object.hasOwn(e,t.scoring.default)||a(`scoring default "${t.scoring.default}" is not one of its modes`);for(let t of Object.values(e))c.includes(t)||a(`unknown scoring rule ${t}`)}let o=(e,t)=>{let n=new Set;for(let{name:r}of e)(!jl.test(r)||r.startsWith(`on`)||s.has(r)||Ce.includes(r)||r===`class`||n.has(r))&&a(`attribute "${r}" of ${t} is invalid, reserved or declared twice`),n.add(r)};o(e(t),i);let l=new Set;for(let e of t.children)(!r.test(e.tag)||l.has(e.tag)||e.tag===i||b.has(e.tag))&&a(`child tag "${e.tag}" is invalid, reserved or declared twice`),(!Number.isInteger(e.min)||e.min<0||e.max!==null&&e.max<e.min)&&a(`child ${e.tag} has an invalid min / max`),e.place!==void 0&&(e.place!==`lead`||t.content!==`flow`)&&a(`child ${e.tag}: place must be absent, or "lead" in a type with content "flow"`),l.add(e.tag),o(e.attributes,e.tag);for(let e of t.slotKinds){let r=n.get(e);r===void 0?a(`slot kind "${e}" is not registered`):r.graded!==!1!==t.graded&&a(t.graded?`slot kind "${e}" is never graded: only ungraded types (graded: false) produce it`:`slot kind "${e}" is graded: ungraded types produce only ungraded kinds such as open`)}}function Fl(e={}){let t={form:e.form??i.form,space:e.space??i.space,case:e.case??i.case,marks:e.marks??i.marks,punctuation:e.punctuation??i.punctuation,quotes:e.quotes??i.quotes};if(!yl(t))throw TypeError(`Engine profile has an unknown value`);return t}function Il(e){let t=new Map;for(let n of e){let e=String(n?.name);if(!ue.test(e))throw TypeError(`Style template "${e}": the name must be lowercase kebab-case`);if(!re(n))throw TypeError(`Style template "${e}" needs a version, scopes, messages and string values`);if(t.has(n.name))throw TypeError(`Style template "${n.name}" is registered twice`);t.set(n.name,n)}return t}function Ll(e){if(typeof e!=`string`&&!(e instanceof Uint8Array))throw TypeError(`Engine secret must be a string or a Uint8Array`);let t=Ls(e);if(t.length<Al)throw TypeError(`Engine secret must be at least ${Al} bytes`);return t}function Rl(e){let t=e.secret===void 0?null:Ll(e.secret),n=new Map;for(let t of[...kl,...e.slotKinds??[]]){if(n.has(t.kind))throw TypeError(`Slot kind "${t.kind}" is registered twice`);if(t.graded!==void 0&&typeof t.graded!=`boolean`)throw TypeError(`Slot kind "${t.kind}": graded must be a boolean`);n.set(t.kind,t)}let r=new Map;for(let t of e.components){let e=t.manifest.tag;if(r.has(e))throw TypeError(`Component ${e} is registered twice`);Pl(t.manifest,n),r.set(e,t)}for(let e of r.values())for(let t of e.manifest.children)if(r.has(t.tag))throw TypeError(`Component manifest ${e.manifest.tag}: child ${t.tag} is a component`);let i=ce([...r.values()].map(e=>e.manifest));if(i!==null){let[e,t]=i.components;throw TypeError(`Component manifests ${e} and ${t} declare the child ${i.tag} differently: a shared child tag needs the same attributes and visibility`)}let a=Fl(e.profile);if(e.urlPolicy!==void 0&&typeof e.urlPolicy!=`function`)throw TypeError(`urlPolicy must be a function`);let o=ge(e.urlPolicy??ne),s=t===null?null:Rs(t),c=[...r.values()],l=pe({catalogs:[...Gc,...c.flatMap(e=>e.messages??[]),...e.catalogs??[]]}),u=Il(e.styleTemplates??[]),{groundColors:d}=e;if(d!==void 0&&(Pe(d.surface)===null||Pe(d.ink)===null))throw TypeError(`groundColors must be colours written in hex or rgb()`);let f={definitions:r,urlPolicy:o,profile:a,styleTemplates:u,...d===void 0?{}:{groundColors:d}};return{manifests:c.map(e=>e.manifest),validate(e){let{ok:t,issues:n}=lc(e,f);return{ok:t,issues:n}},async compile(e,t={}){if(s===null)throw TypeError(`Engine secret is missing: compile needs createEngine({ secret }), at least 16 bytes`);let r=lc(e,f);if(!r.ok||r.doc===null)return{ok:!1,issues:r.issues};let i=t.salt??``,c=await Ec(r.doc,{hmac:s,salt:i,profile:a,slotKinds:n,urlPolicy:o});return{ok:!0,issues:r.issues,...c}},grade(e,t,r={}){return Uc(e,t,r,n)},solution(e,t={}){return Wc(e,t,n)},describe(e,t){return l.t(t,e.namespace,e.code,e.params)}}}var zl=Qt({boolAttr:()=>Y,children:()=>X,descendants:()=>Wl,enumAttr:()=>Ul,hasPicture:()=>Gl,intAttr:()=>Hl,label:()=>Q,numberAttr:()=>Vl,publicView:()=>$,stringAttr:()=>J,text:()=>Z,urlAttr:()=>Bl});function J(e,t){return Object.hasOwn(e.attrs,t)?e.attrs[t]??null:null}function Bl(e,t){let n=J(e,t);return n===null||n.trim()===``?null:n}function Y(e,t){return Object.hasOwn(e.attrs,t)}function Vl(e,t){let n=J(e,t);return n===null?null:nc(n)}function Hl(e,t){let n=J(e,t);return n===null?null:tc(n)}function Ul(e,t,n,r){let i=J(e,t);return i!==null&&n.includes(i)?i:r}function X(e,t){return Se(e,t)}function Wl(e,t){return e.children.flatMap(e=>e.type===`element`?e.tag===t?[e,...Wl(e,t)]:Wl(e,t):[])}function Z(e){return me(e)}function Q(e){let t=[],n=e=>{if(e.type===`text`)t.push(e.value);else if(e.tag===`img`)t.push(` ${e.attrs.alt??``} `);else for(let t of e.children)n(t)};return n(e),t.join(``).replace(/\s+/gu,` `).trim()}function Gl(e){return e.children.some(e=>e.type===`element`&&(e.tag===`img`||Gl(e)))}function $(t,n,r){let i=e(n),a={id:r.opaque(),v:String(n.version)};for(let[e,n]of Object.entries(t.attrs)){if(e===`id`||e===`v`)continue;if(s.has(e)){a[e]=n;continue}let t=i.find(t=>t.name===e);t?.visibility===`public`&&(a[e]=t.type===`id`?r.opaque(n):n)}let o=n.content===`flow`,c=e=>e.flatMap(e=>{if(e.type!==`element`)return o?[e]:[];let t=n.children.find(t=>t.tag===e.tag);return t===void 0?o?[w(e.tag,e.attrs,c(e.children))]:[]:t.visibility===`public`?[Kl(e,t,r)]:[]});return w(n.tag,a,c(t.children))}function Kl(e,t,n){let r={};for(let[i,a]of Object.entries(e.attrs)){if(s.has(i)){r[i]=a;continue}let e=t.attributes.find(e=>e.name===i);e?.visibility===`public`&&(r[i]=e.type===`id`?n.opaque(a):a)}return w(e.tag,r,e.children)}var ql={AUDIO_TRANSCRIPT_EMPTY:`Audio {id} has an empty transcript. Write what is said, or remove the transcript.`,"editor.label":`Audio`,"editor.title":`Title (optional)`,"editor.titleHelp":`Shown above the player. It also names the player for screen readers.`,"editor.src":`Sound file`,"editor.srcHelp":`An mp3 file plays in every browser.`,"editor.transcript":`Transcript`,"editor.transcriptHelp":`What is said, as plain text: each line stays a line. Students open it under the player.`,"template.label":`Title of the recording`,"template.transcript":`Type what is said in the recording.`},Jl={AUDIO_TRANSCRIPT_EMPTY:`Nagranie {id} ma pustą transkrypcję. Wpisz, co słychać w nagraniu, albo usuń transkrypcję.`,"editor.label":`Nagranie`,"editor.title":`Tytuł (opcjonalnie)`,"editor.titleHelp":`Widoczny nad odtwarzaczem. Nazywa też odtwarzacz dla czytników ekranu.`,"editor.src":`Plik dźwiękowy`,"editor.srcHelp":`Plik mp3 odtwarza się w każdej przeglądarce.`,"editor.transcript":`Transkrypcja`,"editor.transcriptHelp":`To, co słychać, jako zwykły tekst: każdy wiersz zostaje wierszem. Uczniowie otwierają ją pod odtwarzaczem.`,"template.label":`Tytuł nagrania`,"template.transcript":`Wpisz, co słychać w nagraniu.`},Yl=`astl.audio`,Xl=[{namespace:Yl,locale:`en`,messages:{...Fe,...ql}},{namespace:Yl,locale:`pl`,messages:{...Le,...Jl}}],Zl=`astl-transcript`;function Ql(e,t){let n=J(e,`id`)??``;for(let r of X(e,Zl))Z(r).trim()===``&&t.report(`AUDIO_TRANSCRIPT_EMPTY`,{id:n},{child:r})}var $l=e=>e.split(`
|
|
4
|
+
`).map(e=>e.trim()).join(`
|
|
5
|
+
`).trim(),eu={manifest:Ie,messages:Xl,validate:Ql,slots:()=>[],toView(e,t){let n=$(e,Ie,t),r=n.children.map(e=>e.type===`element`&&e.tag===Zl?w(e.tag,e.attrs,[ve($l(Z(e)))]):e);return w(n.tag,n.attrs,r)}},tu={CALLOUT_EMPTY:`Callout {id} is empty: write its text, or remove it.`,"editor.label":`Callout`,"editor.kind":`Kind`,"editor.value.kind.tip":`Tip`,"editor.value.kind.info":`Information`,"editor.value.kind.warning":`Warning`,"template.text":`Write a tip for the students here.`},nu={CALLOUT_EMPTY:`Ramka {id} jest pusta: wpisz jej tekst albo ją usuń.`,"editor.label":`Ramka`,"editor.kind":`Rodzaj`,"editor.value.kind.tip":`Wskazówka`,"editor.value.kind.info":`Informacja`,"editor.value.kind.warning":`Uwaga`,"template.text":`Tu wpisz wskazówkę dla uczniów.`},ru=`astl.callout`,iu=[{namespace:ru,locale:`en`,messages:{...Re,...tu}},{namespace:ru,locale:`pl`,messages:{...Be,...nu}}],au={manifest:ze,messages:iu,validate(e,t){Q(e)===``&&t.report(`CALLOUT_EMPTY`,{id:J(e,`id`)??``},{severity:`warning`})},slots:()=>[],toView:(e,t)=>$(e,ze,t)},ou={CATEGORISE_CATEGORY_EMPTY:`Sorting task {id}: group {category} has no name.`,CATEGORISE_CATEGORY_DUPLICATE:`Sorting task {id}: two groups are called “{text}”, so students cannot tell them apart.`,CATEGORISE_CATEGORY_UNUSED:`Sorting task {id}: no card belongs to the group “{category}”.`,CATEGORISE_CARD_CATEGORY_UNKNOWN:`Sorting task {id}: the card “{card}” belongs to “{category}”, but no group has that id.`,CATEGORISE_CARD_EMPTY:`Sorting task {id}: card {card} is empty.`,CATEGORISE_CARD_ALT_EMPTY:`Sorting task {id}: card {card} shows only a picture, and its alt text is empty. Describe the picture in its alt text, so every student can tell what the card shows.`,CATEGORISE_CARD_DUPLICATE:`Sorting task {id}: two cards say “{text}”.`,CATEGORISE_CARD_AMBIGUOUS:`Sorting task {id}: two cards say “{text}” but belong to different groups, so students cannot tell where each goes.`,CATEGORISE_CARD_LINK:`Sorting task {id}: the card “{card}” contains a link. Cards are buttons, so a link inside one cannot work. Remove the link.`,CATEGORISE_PROMPT_EMPTY:`Sorting task {id} has an empty task text.`,"editor.label":`Sort into groups`,"editor.cardCategories":`Group of each card`,"editor.cardCategoriesHelp":`Each card belongs to exactly one group.`,"editor.groups":`Groups`,"editor.groupsHelp":`The colour of each group is a number in the group palette, 1 to 8. Without one, a group takes the next free colour.`,"editor.palette":`Colour`,"editor.scoring":`Scoring`,"editor.scoringHelp":`With points for each card, every card in its group counts.`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-card":`Points for each card`,"editor.points":`Points`,"template.prompt":`Sort the cards into the groups.`,"template.categoryA":`Group A`,"template.categoryB":`Group B`,"template.cardA1":`First card for group A`,"template.cardA2":`Second card for group A`,"template.cardB1":`First card for group B`,"template.cardB2":`Second card for group B`,"template.sort.label":`Sort into groups`,"template.sort.heading":`Fruit and vegetables`,"template.sort.instruction":`Put each card in the group it belongs to.`,"template.sort.prompt":`Fruit or vegetable?`,"template.sort.groupA":`Fruit`,"template.sort.groupB":`Vegetables`,"template.sort.card1":`Apple`,"template.sort.card2":`Carrot`,"template.sort.card3":`Pear`,"template.sort.card4":`Potato`},su={CATEGORISE_CATEGORY_EMPTY:`Sortowanie {id}: grupa {category} nie ma nazwy.`,CATEGORISE_CATEGORY_DUPLICATE:`Sortowanie {id}: dwie grupy nazywają się „{text}”, więc uczniowie ich nie odróżnią.`,CATEGORISE_CATEGORY_UNUSED:`Sortowanie {id}: żadna karta nie należy do grupy „{category}”.`,CATEGORISE_CARD_CATEGORY_UNKNOWN:`Sortowanie {id}: karta „{card}” należy do „{category}”, ale żadna grupa nie ma takiego identyfikatora.`,CATEGORISE_CARD_EMPTY:`Sortowanie {id}: karta {card} jest pusta.`,CATEGORISE_CARD_ALT_EMPTY:`Sortowanie {id}: karta {card} to sam obrazek z pustym tekstem alternatywnym. Opisz obrazek w tekście alternatywnym, żeby każdy uczeń wiedział, co jest na karcie.`,CATEGORISE_CARD_DUPLICATE:`Sortowanie {id}: dwie karty brzmią „{text}”.`,CATEGORISE_CARD_AMBIGUOUS:`Sortowanie {id}: dwie karty brzmią „{text}”, ale należą do różnych grup, więc uczniowie nie wiedzą, gdzie położyć każdą z nich.`,CATEGORISE_CARD_LINK:`Sortowanie {id}: karta „{card}” zawiera link. Karty są przyciskami, więc link w karcie nie zadziała. Usuń link.`,CATEGORISE_PROMPT_EMPTY:`Sortowanie {id} ma pusty tekst polecenia.`,"editor.label":`Sortowanie do grup`,"editor.cardCategories":`Grupa każdej karty`,"editor.cardCategoriesHelp":`Każda karta należy do dokładnie jednej grupy.`,"editor.groups":`Grupy`,"editor.groupsHelp":`Kolor każdej grupy to numer w palecie grup, od 1 do 8. Bez numeru grupa dostaje następny wolny kolor.`,"editor.palette":`Kolor`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Przy punktach za każdą kartę liczy się każda karta we właściwej grupie.`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-card":`Punkty za każdą kartę`,"editor.points":`Punkty`,"template.prompt":`Przyporządkuj karty do grup.`,"template.categoryA":`Grupa A`,"template.categoryB":`Grupa B`,"template.cardA1":`Pierwsza karta do grupy A`,"template.cardA2":`Druga karta do grupy A`,"template.cardB1":`Pierwsza karta do grupy B`,"template.cardB2":`Druga karta do grupy B`,"template.sort.label":`Posortuj do grup`,"template.sort.heading":`Owoce i warzywa`,"template.sort.instruction":`Włóż każdą kartę do grupy, do której pasuje.`,"template.sort.prompt":`Owoc czy warzywo?`,"template.sort.groupA":`Owoce`,"template.sort.groupB":`Warzywa`,"template.sort.card1":`Jabłko`,"template.sort.card2":`Marchewka`,"template.sort.card3":`Gruszka`,"template.sort.card4":`Ziemniak`},cu=`astl.categorise`,lu=[{namespace:cu,locale:`en`,messages:{...Ve,...ou}},{namespace:cu,locale:`pl`,messages:{...Ue,...su}}],uu=`cards`,du=e=>J(e,`id`)??``,fu=e=>J(e,`category`)??``,pu=e=>e.children.some(e=>T(e)&&(e.tag===`a`||pu(e)));function mu(e,t){return t.permute(e,{salt:uu,avoidOriginal:!0})}function hu(e,t){let n=J(e,`id`)??``,r=X(e,`astl-category`),i=new Set(r.map(du)),a=e=>q(e,t.profile,t.lang),o=new Set;for(let e of r){let r=Q(e);r===``?t.report(`CATEGORISE_CATEGORY_EMPTY`,{id:n,category:du(e)},{child:e}):(o.has(a(r))&&t.report(`CATEGORISE_CATEGORY_DUPLICATE`,{id:n,text:r},{child:e}),o.add(a(r)))}let s=new Set,c=new Map;for(let r of X(e,`astl-card`)){let e=Q(r),o=fu(r);if(i.has(o))s.add(o);else{let i={id:n,card:e===``?du(r):e,category:o};t.report(`CATEGORISE_CARD_CATEGORY_UNKNOWN`,i,{child:r})}if(pu(r)&&t.report(`CATEGORISE_CARD_LINK`,{id:n,card:e||du(r)},{child:r}),e===``){Gl(r)?t.report(`CATEGORISE_CARD_ALT_EMPTY`,{id:n,card:du(r)},{child:r}):t.report(`CATEGORISE_CARD_EMPTY`,{id:n,card:du(r)},{child:r});continue}let l=c.get(a(e));l===void 0?c.set(a(e),o):l===o?t.report(`CATEGORISE_CARD_DUPLICATE`,{id:n,text:e},{severity:`warning`,child:r}):t.report(`CATEGORISE_CARD_AMBIGUOUS`,{id:n,text:e},{child:r})}for(let e of r){if(s.has(du(e)))continue;let r=Q(e)||du(e);t.report(`CATEGORISE_CATEGORY_UNUSED`,{id:n,category:r},{severity:`warning`,child:e})}for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`CATEGORISE_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function gu(e,t){return mu(X(e,`astl-card`),t).map(e=>({id:t.opaque(du(e)),kind:`choice`,key:{correct:t.opaque(fu(e))}}))}function _u(e,t){let n=$(e,He,t),r=e=>n.children.filter(t=>T(t,e));return{...n,children:[...r(`astl-prompt`),...r(`astl-category`),...mu(r(`astl-card`),t)]}}var vu={manifest:He,messages:lu,validate:hu,slots:gu,toView:_u},yu={CHOICE_CORRECT_MISSING:`Question {id} has no correct answer.`,CHOICE_SINGLE_MANY_CORRECT:`Question {id} takes one answer, but {count} options are marked correct. Mark one, or allow several answers.`,CHOICE_ALL_CORRECT:`Question {id}: every option is marked correct.`,CHOICE_OPTION_EMPTY:`Question {id}: option {option} is empty.`,CHOICE_OPTION_ALT_EMPTY:`Question {id}: option {option} shows only a picture, and its alt text is empty. Describe the picture in its alt text, so every student can tell the options apart.`,CHOICE_OPTION_DUPLICATE:`Question {id}: two options say “{text}”.`,CHOICE_PROMPT_EMPTY:`Question {id} has an empty question text.`,"editor.label":`Closed question`,"editor.correctOptions":`Correct answers`,"editor.multiple":`Several answers can be correct`,"editor.shuffle":`Shuffle the answers`,"editor.variant":`Layout`,"editor.value.variant.list":`List`,"editor.value.variant.cards":`Cards`,"editor.scoring":`Scoring`,"editor.scoringHelp":`Partial points only count with several correct answers.`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-option":`Points for each answer`,"editor.points":`Points`,"template.prompt":`Type the question`,"template.option1":`Correct answer`,"template.option2":`Wrong answer`,"template.option3":`Another wrong answer`,"template.choice.label":`Multiple choice`,"template.choice.heading":`The Solar System`,"template.choice.instruction":`Read the question and choose the right answer.`,"template.choice.prompt":`Which planet is closest to the Sun?`,"template.choice.option1":`Venus`,"template.choice.option2":`Mercury`,"template.choice.option3":`Mars`},bu={CHOICE_CORRECT_MISSING:`Pytanie {id} nie ma poprawnej odpowiedzi.`,CHOICE_SINGLE_MANY_CORRECT:`Pytanie {id} przyjmuje jedną odpowiedź, a poprawnych jest {count}. Zaznacz jedną albo pozwól na kilka odpowiedzi.`,CHOICE_ALL_CORRECT:`Pytanie {id}: wszystkie odpowiedzi są oznaczone jako poprawne.`,CHOICE_OPTION_EMPTY:`Pytanie {id}: odpowiedź {option} jest pusta.`,CHOICE_OPTION_ALT_EMPTY:`Pytanie {id}: odpowiedź {option} to sam obrazek z pustym tekstem alternatywnym. Opisz obrazek w tekście alternatywnym, żeby każdy uczeń odróżnił odpowiedzi.`,CHOICE_OPTION_DUPLICATE:`Pytanie {id}: dwie odpowiedzi brzmią „{text}”.`,CHOICE_PROMPT_EMPTY:`Pytanie {id} ma pustą treść.`,"editor.label":`Pytanie zamknięte`,"editor.correctOptions":`Poprawne odpowiedzi`,"editor.multiple":`Kilka odpowiedzi może być poprawnych`,"editor.shuffle":`Mieszaj kolejność odpowiedzi`,"editor.variant":`Układ`,"editor.value.variant.list":`Lista`,"editor.value.variant.cards":`Karty`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Punkty częściowe działają tylko przy kilku poprawnych odpowiedziach.`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-option":`Punkty za każdą odpowiedź`,"editor.points":`Punkty`,"template.prompt":`Wpisz pytanie`,"template.option1":`Poprawna odpowiedź`,"template.option2":`Błędna odpowiedź`,"template.option3":`Inna błędna odpowiedź`,"template.choice.label":`Test wyboru`,"template.choice.heading":`Układ Słoneczny`,"template.choice.instruction":`Przeczytaj pytanie i wybierz poprawną odpowiedź.`,"template.choice.prompt":`Która planeta jest najbliżej Słońca?`,"template.choice.option1":`Wenus`,"template.choice.option2":`Merkury`,"template.choice.option3":`Mars`},xu=`astl.choice`,Su=[{namespace:xu,locale:`en`,messages:{...We,...yu}},{namespace:xu,locale:`pl`,messages:{...Ke,...bu}}],Cu=`options`;function wu(e){return J(e,`id`)??``}function Tu(e){return Y(e,`correct`)}function Eu(e,t){let n=X(e,`astl-option`);return Y(e,`shuffle`)?t.permute(n,{salt:Cu}):n}function Du(e,t){let n=J(e,`id`)??``,r=X(e,`astl-option`),i=r.filter(Tu).length,a=Y(e,`multiple`);i===0?t.report(`CHOICE_CORRECT_MISSING`,{id:n}):!a&&i>1?t.report(`CHOICE_SINGLE_MANY_CORRECT`,{id:n,count:i}):a&&i===r.length&&t.report(`CHOICE_ALL_CORRECT`,{id:n},{severity:`warning`});let o=new Set;for(let e of r){let r=Q(e);if(r===``){Gl(e)?t.report(`CHOICE_OPTION_ALT_EMPTY`,{id:n,option:wu(e)},{child:e}):t.report(`CHOICE_OPTION_EMPTY`,{id:n,option:wu(e)},{child:e});continue}let i=q(r,t.profile,t.lang);o.has(i)&&t.report(`CHOICE_OPTION_DUPLICATE`,{id:n,text:r},{severity:`warning`,child:e}),o.add(i)}for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`CHOICE_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Ou(e,t){let n=Eu(e,t);if(Y(e,`multiple`))return n.map(e=>({id:t.opaque(wu(e)),kind:`flag`,key:{correct:Tu(e)}}));let r=n.find(Tu);if(r===void 0)throw Error(`astl-choice: slots() called without a correct option`);return[{id:t.opaque(),kind:`choice`,key:{correct:t.opaque(wu(r))}}]}function ku(e,t){let n=$(e,Ge,t);if(!Y(e,`shuffle`))return n;let r=e=>T(e,`astl-option`),i=t.permute(n.children.filter(r),{salt:Cu}),a=0;return{...n,children:n.children.map(e=>r(e)?i[a++]??e:e)}}var Au={manifest:Ge,messages:Su,validate:Du,slots:Ou,toView:ku},ju={CROSSWORD_ANSWER_LETTERS:`Crossword {id}: “{word}” may contain letters only.`,CROSSWORD_ANSWER_SHORT:`Crossword {id}: “{word}” needs at least 2 letters.`,CROSSWORD_OUTSIDE:`Crossword {id}: “{word}” runs out of the grid of {rows} rows and {columns} columns. Rows and columns count from 0.`,CROSSWORD_OVERLAP:`Crossword {id}: “{word}” runs over “{other}” in the same direction.`,CROSSWORD_CROSSING:`Crossword {id}: “{word}” and “{other}” cross where one has “{letter}” and the other “{otherLetter}”.`,CROSSWORD_CLUE_EMPTY:`Crossword {id}: “{word}” has no clue.`,CROSSWORD_CLUE_LINK:`Crossword {id}: remove the link from the clue “{clue}”, which students press.`,CROSSWORD_PROMPT_EMPTY:`Crossword {id} has an empty task text.`,"editor.label":`Crossword`,"editor.rows":`Rows`,"editor.columns":`Columns`,"editor.words":`Words`,"editor.wordsHelp":`Each word starts in a row and a column counted from 0 and runs across or down. Write its clue in the exercise.`,"editor.answer":`Answer`,"editor.row":`Row`,"editor.column":`Column`,"editor.direction":`Direction`,"editor.value.direction.across":`Across`,"editor.value.direction.down":`Down`,"editor.scoring":`Scoring`,"editor.value.scoring.word":`Points for each word`,"editor.value.scoring.letter":`Points for each letter`,"editor.value.scoring.whole":`All or nothing`,"editor.points":`Points`,"template.crossword":`Crossword`,"template.crossword.heading":`Pond animals`,"template.crossword.prompt":`Read the clues and write the answers in the squares.`,"template.crossword.across":`FROG`,"template.crossword.acrossClue":`It is green, jumps and croaks.`,"template.crossword.down":`FISH`,"template.crossword.downClue":`It swims and breathes under water.`},Mu={CROSSWORD_ANSWER_LETTERS:`Krzyżówka {id}: „{word}” może mieć tylko litery.`,CROSSWORD_ANSWER_SHORT:`Krzyżówka {id}: „{word}” musi mieć co najmniej 2 litery.`,CROSSWORD_OUTSIDE:`Krzyżówka {id}: „{word}” wychodzi poza siatkę (wiersze: {rows}, kolumny: {columns}). Wiersze i kolumny liczymy od 0.`,CROSSWORD_OVERLAP:`Krzyżówka {id}: „{word}” biegnie w tę samą stronę co „{other}” i na nie zachodzi.`,CROSSWORD_CROSSING:`Krzyżówka {id}: „{word}” i „{other}” krzyżują się w kratce, w której jedno ma „{letter}”, a drugie „{otherLetter}”.`,CROSSWORD_CLUE_EMPTY:`Krzyżówka {id}: „{word}” nie ma wskazówki.`,CROSSWORD_CLUE_LINK:`Krzyżówka {id}: usuń link ze wskazówki „{clue}”, którą uczniowie naciskają.`,CROSSWORD_PROMPT_EMPTY:`Krzyżówka {id} ma pusty tekst polecenia.`,"editor.label":`Krzyżówka`,"editor.rows":`Wiersze`,"editor.columns":`Kolumny`,"editor.words":`Hasła`,"editor.wordsHelp":`Każde hasło zaczyna się w wierszu i kolumnie liczonych od 0 i biegnie poziomo albo pionowo. Wskazówkę napisz w ćwiczeniu.`,"editor.answer":`Hasło`,"editor.row":`Wiersz`,"editor.column":`Kolumna`,"editor.direction":`Kierunek`,"editor.value.direction.across":`Poziomo`,"editor.value.direction.down":`Pionowo`,"editor.scoring":`Punktacja`,"editor.value.scoring.word":`Punkty za każde hasło`,"editor.value.scoring.letter":`Punkty za każdą literę`,"editor.value.scoring.whole":`Wszystko albo nic`,"editor.points":`Punkty`,"template.crossword":`Krzyżówka`,"template.crossword.heading":`Zwierzęta znad stawu`,"template.crossword.prompt":`Przeczytaj wskazówki i wpisz hasła w kratki.`,"template.crossword.across":`ŻABA`,"template.crossword.acrossClue":`Jest zielona, skacze i rechocze.`,"template.crossword.down":`ŻÓŁW`,"template.crossword.downClue":`Nosi swój dom na plecach.`},Nu=`astl.crossword`,Pu=[{namespace:Nu,locale:`en`,messages:{...Ye,...ju}},{namespace:Nu,locale:`pl`,messages:{...Ze,...Mu}}],Fu=`astl-crossword-word`,Iu=/^\p{L}$/u,Lu=e=>J(e,`id`)??``,Ru=e=>e.children.some(e=>T(e)&&(e.tag===`a`||Ru(e)));function zu(e,t){try{return e.toLocaleUpperCase(t)}catch{return e.toUpperCase()}}function Bu(e,t){return[...zu(e.normalize(`NFC`),t).normalize(`NFC`).replace(/\s+/gu,``)]}function Vu(e,t){return X(e,Fu).map(e=>{let n=Bu(J(e,`answer`)??``,t);return{child:e,id:Lu(e),letters:n,row:Hl(e,`row`)??0,column:Hl(e,`column`)??0,direction:Ul(e,`direction`,[`across`,`down`],`across`),length:n.length}})}var Hu=(e,t)=>e*30+t;function Uu(e,t){let n=Vu(e,t),r=[...new Set(n.map(e=>Hu(e.row,e.column)))].sort((e,t)=>e-t);return n.map(e=>({word:e,number:r.indexOf(Hu(e.row,e.column))+1})).sort((e,t)=>Number(e.word.direction===`down`)-Number(t.word.direction===`down`)||e.number-t.number)}function Wu(e,t){let n=new Map;for(let r of Vu(e,t))for(let[e,[t,i]]of qe(r).entries())n.set(Hu(t,i),{id:Je(t,i),letter:r.letters[e]??``});return[...n].sort(([e],[t])=>e-t).map(([,e])=>e)}function Gu(e,t){let n=Lu(e),r=Hl(e,`rows`)??0,i=Hl(e,`columns`)??0,a=e=>(J(e.child,`answer`)??``).trim()||Q(e.child)||e.id,o=[];for(let s of Vu(e,t.lang)){let e=Q(s.child),c=a(s);Ru(s.child)&&t.report(`CROSSWORD_CLUE_LINK`,{id:n,clue:e||s.id},{child:s.child}),e===``&&t.report(`CROSSWORD_CLUE_EMPTY`,{id:n,word:c},{child:s.child});let[l,u]=qe(s).at(-1)??[s.row,s.column];s.letters.every(e=>Iu.test(e))?s.length<2?t.report(`CROSSWORD_ANSWER_SHORT`,{id:n,word:c},{child:s.child}):l>=r||u>=i?t.report(`CROSSWORD_OUTSIDE`,{id:n,word:c,rows:r,columns:i},{child:s.child}):o.push(s):t.report(`CROSSWORD_ANSWER_LETTERS`,{id:n,word:c},{child:s.child})}let s=new Map,c=new Set;for(let e of o)qe(e).forEach(([r,i],o)=>{let l=e.letters[o]??``,u=s.get(Je(r,i));if(u===void 0){s.set(Je(r,i),{letter:l,first:e,[e.direction]:e});return}let d=u[e.direction];if(d!==void 0)c.has(e)||t.report(`CROSSWORD_OVERLAP`,{id:n,word:a(e),other:a(d)},{child:e.child}),c.add(e);else if(u.letter!==l){let r={id:n,word:a(u.first),letter:u.letter,other:a(e),otherLetter:l};t.report(`CROSSWORD_CROSSING`,r,{child:e.child})}u[e.direction]??=e});for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`CROSSWORD_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Ku(e){return Wu(e,``).map(e=>e.id)}function qu(e,t){return Wu(e,t.lang).map(({id:e,letter:n})=>({id:t.opaque(e),kind:`letter`,key:{letter:n,lang:t.lang}}))}function Ju(e,t){return(J(e,`scoring`)??Xe.scoring?.default)===`word`?Uu(e,t.lang).map(({word:e})=>({id:t.opaque(e.id),slots:qe(e).map(([e,n])=>t.opaque(Je(e,n)))})):null}function Yu(e,t){let n=$(e,Xe,t),r=X(e,Fu),i=n.children.filter(e=>T(e,Fu)),a=Uu(e,t.lang).map(({word:e,number:t})=>{let n=i[r.indexOf(e.child)];return{...n,attrs:{...n.attrs,number:String(t),length:String(e.length)}}}),o=Wu(e,t.lang).map(e=>t.opaque(e.id));return{...n,attrs:{...n.attrs,cells:o.join(` `)},children:[...n.children.filter(e=>T(e,`astl-prompt`)),...a]}}var Xu={manifest:Xe,messages:Pu,validate:Gu,localIds:Ku,slots:qu,groups:Ju,toView:Yu},Zu={DROP_BANK_UNKNOWN:`Gap {id} takes its words from the bank “{bank}”, but this page has no word bank with that id.`,DROP_ANSWER_UNKNOWN:`Gap {id} expects the word “{answer}”, but the word bank “{bank}” has no word with that id.`,DROP_ANSWER_DISTRACTOR:`Gap {id} expects “{word}”, which the word bank “{bank}” marks as a distractor.`,"editor.label":`Word gap`,"editor.answer":`Correct word`,"editor.answerHelp":`The word of its word bank that goes here. Without the bank: the id of the word, for example “a”.`,"editor.bank":`Word bank`,"editor.bankHelp":`The id of a word bank on the same page.`,"editor.points":`Points`},Qu={DROP_BANK_UNKNOWN:`Luka {id} bierze słowa z banku „{bank}”, ale na tej stronie nie ma banku słów o takim identyfikatorze.`,DROP_ANSWER_UNKNOWN:`Luka {id} oczekuje słowa „{answer}”, ale bank słów „{bank}” nie ma słowa o takim identyfikatorze.`,DROP_ANSWER_DISTRACTOR:`Luka {id} oczekuje słowa „{word}”, które bank słów „{bank}” oznacza jako dystraktor.`,"editor.label":`Luka na słowo`,"editor.answer":`Poprawne słowo`,"editor.answerHelp":`Słowo z banku słów, które pasuje w to miejsce. Bez banku: identyfikator słowa, na przykład „a”.`,"editor.bank":`Bank słów`,"editor.bankHelp":`Identyfikator banku słów na tej samej stronie.`,"editor.points":`Punkty`},$u=`astl.drop`,ed=[{namespace:$u,locale:`en`,messages:{...Qe,...Zu}},{namespace:$u,locale:`pl`,messages:{...et,...Qu}}],td=`astl-word-bank`,nd=`astl-word`,rd=(e,t)=>J(e,t)??``;function id(e,t){let n=rd(e,`id`),r=rd(e,`bank`),i=rd(e,`answer`),a=t.find(r);if(a?.tag!==td){t.report(`DROP_BANK_UNKNOWN`,{id:n,bank:r});return}let o=X(a,nd).find(e=>rd(e,`id`)===i);if(o===void 0)t.report(`DROP_ANSWER_UNKNOWN`,{id:n,bank:r,answer:i});else if(Y(o,`distractor`)){let e=Z(o).replace(/\s+/gu,` `).trim()||i;t.report(`DROP_ANSWER_DISTRACTOR`,{id:n,bank:r,word:e},{severity:`warning`})}}function ad(e,t){return[{id:t.opaque(),kind:`choice`,key:{correct:t.opaqueOf(rd(e,`bank`),rd(e,`answer`))}}]}function od(e,t){let n=$(e,$e,t);return{...n,attrs:{...n.attrs,bank:t.opaqueOf(rd(e,`bank`))}}}var sd={manifest:$e,messages:ed,validate:id,slots:ad,toView:od},cd={FLASH_CARDS_UNPAIRED:`Flash cards {id} have {fronts, plural, one {# front} other {# fronts}} and {backs, plural, one {# back} other {# backs}}: every card needs a front and a back.`,FLASH_CARDS_FRONT_EMPTY:`Flash cards {id}: the front of card {card} is empty. Write a text or add a picture with an alt text.`,FLASH_CARDS_FRONT_LINK:`Flash cards {id}: the front of card {card} contains a link. A card is a button, so a link inside it cannot work. Remove the link.`,FLASH_CARDS_BACK_EMPTY:`Flash cards {id}: the back of card {card} is empty.`,"editor.label":`Flash cards`,"editor.backs":`Back of card`,"editor.backsHelp":`In card order: the first back belongs to the first card.`,"editor.template.cards":`Flash cards`,"template.front":`Type the front of the card`,"template.back":`Type the back of the card`,"template.cards.title":`In the sky`,"template.cards.instruction":`What is on each card? Think of the answer, then turn the card over to check.`,"template.cards.sun":`A yellow sun with rays`,"template.cards.sunBack":`the Sun`,"template.cards.moon":`A thin crescent moon`,"template.cards.moonBack":`the Moon`,"template.cards.mars":`the red planet, fourth from the Sun`,"template.cards.marsBack":`Mars`,"template.cards.saturn":`the planet with the brightest rings`,"template.cards.saturnBack":`Saturn`},ld={FLASH_CARDS_UNPAIRED:`Fiszki {id} mają {fronts, plural, one {# przód} few {# przody} many {# przodów} other {# przodu}} i {backs, plural, one {# tył} few {# tyły} many {# tyłów} other {# tyłu}}, a każda karta potrzebuje przodu i tyłu.`,FLASH_CARDS_FRONT_EMPTY:`Fiszki {id}: przód karty {card} jest pusty. Wpisz tekst albo dodaj obrazek z tekstem alternatywnym.`,FLASH_CARDS_FRONT_LINK:`Fiszki {id}: przód karty {card} zawiera link. Karta jest przyciskiem, więc link w niej nie zadziała. Usuń link.`,FLASH_CARDS_BACK_EMPTY:`Fiszki {id}: tył karty {card} jest pusty.`,"editor.label":`Fiszki`,"editor.backs":`Tył karty`,"editor.backsHelp":`W kolejności kart: pierwszy tył należy do pierwszej karty.`,"editor.template.cards":`Fiszki`,"template.front":`Wpisz przód karty`,"template.back":`Wpisz tył karty`,"template.cards.title":`Na niebie`,"template.cards.instruction":`Co jest na każdej karcie? Pomyśl o odpowiedzi, a potem odwróć kartę i sprawdź.`,"template.cards.sun":`Żółte słońce z promieniami`,"template.cards.sunBack":`Słońce`,"template.cards.moon":`Wąski sierp Księżyca`,"template.cards.moonBack":`Księżyc`,"template.cards.mars":`czerwona planeta, czwarta od Słońca`,"template.cards.marsBack":`Mars`,"template.cards.saturn":`planeta z najjaśniejszymi pierścieniami`,"template.cards.saturnBack":`Saturn`},ud=`astl.flash-cards`,dd=[{namespace:ud,locale:`en`,messages:{...tt,...cd}},{namespace:ud,locale:`pl`,messages:{...rt,...ld}}],fd=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:e.tag===`img`?!!e.attrs.alt?.trim():fd(e.children)),pd=e=>e.some(e=>e.type===`element`&&(e.tag===`a`||pd(e.children)));function md(e,t){let n=J(e,`id`)??``,r=X(e,`astl-front`),i=X(e,`astl-back`);r.length!==i.length&&t.report(`FLASH_CARDS_UNPAIRED`,{id:n,fronts:r.length,backs:i.length}),r.forEach((e,r)=>{fd(e.children)||t.report(`FLASH_CARDS_FRONT_EMPTY`,{id:n,card:r+1},{child:e}),pd(e.children)&&t.report(`FLASH_CARDS_FRONT_LINK`,{id:n,card:r+1},{child:e})}),i.forEach((e,r)=>{Z(e).trim()===``&&t.report(`FLASH_CARDS_BACK_EMPTY`,{id:n,card:r+1},{child:e})})}var hd={manifest:nt,messages:dd,validate:md,slots:()=>[],toView:(e,t)=>$(e,nt,t)},gd={GAP_ANSWER_MISSING:`Gap {id} has no answer.`,GAP_ANSWER_TOO_LONG:`Gap {id} accepts an answer longer than {max, plural, one {# character} other {# characters}}, which students cannot type. Shorten it.`,GAP_NUMBER_INVALID:`Gap {id}: “{value}” is not a number.`,GAP_ALT_EMPTY:`Gap {id} has an empty alternative answer.`,GAP_ALT_DUPLICATE:`Gap {id} accepts “{value}” twice.`,GAP_TOLERANCE_TEXT:`Gap {id}: tolerance only works for number gaps.`,"editor.label":`Gap`,"editor.answer":`Answer`,"editor.alternatives":`Also accept`,"editor.alternativesHelp":`Other spellings or synonyms that count as correct.`,"editor.type":`Answer type`,"editor.value.type.text":`Text`,"editor.value.type.number":`Number`,"editor.case":`Capital letters`,"editor.value.case.insensitive":`Do not matter`,"editor.value.case.sensitive":`Must match`,"editor.marks":`Accents and diacritics`,"editor.marksHelp":`For example ą, é, ł, ü.`,"editor.value.marks.strict":`Must match`,"editor.value.marks.fold":`Do not matter`,"editor.tolerance":`Tolerance (±)`,"editor.width":`Width in characters`,"editor.variant":`Field`,"editor.value.variant.inline":`Word-sized, grows up to 40 characters`,"editor.value.variant.resizable":`Grows with the answer up to the whole line`,"editor.points":`Points`,"template.fill.label":`Fill the gaps`,"template.fill.heading":`Spiders and insects`,"template.fill.instruction":`Type the missing words.`,"template.fill.start":`A spider has`,"template.fill.answer1":`eight`,"template.fill.middle":`legs, and an insect has`,"template.fill.answer2":`six`,"template.fill.end":`.`},_d={GAP_ANSWER_MISSING:`Luka {id} nie ma odpowiedzi.`,GAP_ANSWER_TOO_LONG:`Luka {id} akceptuje odpowiedź dłuższą niż {max, plural, one {# znak} few {# znaki} many {# znaków} other {# znaku}}, a uczeń nie wpisze tak długiej odpowiedzi. Skróć ją.`,GAP_NUMBER_INVALID:`Luka {id}: „{value}” nie jest liczbą.`,GAP_ALT_EMPTY:`Luka {id} ma pustą odpowiedź alternatywną.`,GAP_ALT_DUPLICATE:`Luka {id} akceptuje „{value}” dwa razy.`,GAP_TOLERANCE_TEXT:`Luka {id}: tolerancja działa tylko w lukach liczbowych.`,"editor.label":`Luka`,"editor.answer":`Odpowiedź`,"editor.alternatives":`Akceptuj też`,"editor.alternativesHelp":`Inne zapisy lub synonimy, które też są poprawne.`,"editor.type":`Typ odpowiedzi`,"editor.value.type.text":`Tekst`,"editor.value.type.number":`Liczba`,"editor.case":`Wielkie litery`,"editor.value.case.insensitive":`Nie mają znaczenia`,"editor.value.case.sensitive":`Muszą się zgadzać`,"editor.marks":`Znaki diakrytyczne`,"editor.marksHelp":`Na przykład ą, ę, ł, ż.`,"editor.value.marks.strict":`Muszą się zgadzać`,"editor.value.marks.fold":`Nie mają znaczenia`,"editor.tolerance":`Tolerancja (±)`,"editor.width":`Szerokość w znakach`,"editor.variant":`Pole`,"editor.value.variant.inline":`Na słowo, rośnie do 40 znaków`,"editor.value.variant.resizable":`Rośnie z odpowiedzią do całej linii`,"editor.points":`Punkty`,"template.fill.label":`Uzupełnij luki`,"template.fill.heading":`Pająki i owady`,"template.fill.instruction":`Wpisz brakujące słowa.`,"template.fill.start":`Pająk ma`,"template.fill.answer1":`osiem`,"template.fill.middle":`nóg, a owad ma`,"template.fill.answer2":`sześć`,"template.fill.end":`.`},vd=`astl.gap`,yd=[{namespace:vd,locale:`en`,messages:{...it,...gd}},{namespace:vd,locale:`pl`,messages:{...ot,..._d}}],bd=[4,8,12,20,40];function xd(e){return Ul(e,`type`,[`text`,`number`],`text`)===`number`}function Sd(e){return[J(e,`answer`)??``,...X(e,`astl-alt`).map(Z)]}function Cd(e,t){return{...t,case:Ul(e,`case`,[`insensitive`,`sensitive`],t.case),marks:Ul(e,`marks`,[`strict`,`fold`],t.marks)}}function wd(e,t){let n=J(e,`id`)??``,r=xd(e),i=J(e,`answer`)??``,a=Cd(e,t.profile),o=e=>{if(!r)return q(e,a,t.lang);let n=hl(e,t.lang);return n===null?null:String(n)},s=new Set,c={id:n,max:500};if(i.trim()===``)t.report(`GAP_ANSWER_MISSING`,{id:n});else if(i.length>500)t.report(`GAP_ANSWER_TOO_LONG`,c);else{let e=o(i);e===null?t.report(`GAP_NUMBER_INVALID`,{id:n,value:i}):s.add(e)}for(let r of X(e,`astl-alt`)){let e=Z(r);if(e.length>500){t.report(`GAP_ANSWER_TOO_LONG`,c,{child:r});continue}let i=e.trim()===``?void 0:o(e);i===void 0?t.report(`GAP_ALT_EMPTY`,{id:n},{child:r}):i===null?t.report(`GAP_NUMBER_INVALID`,{id:n,value:e},{child:r}):s.has(i)?t.report(`GAP_ALT_DUPLICATE`,{id:n,value:e},{severity:`warning`,child:r}):s.add(i)}!r&&J(e,`tolerance`)!==null&&t.report(`GAP_TOLERANCE_TEXT`,{id:n},{severity:`warning`})}function Td(e,t){let n=t.opaque(),r=Sd(e);return xd(e)?[{id:n,kind:`number`,key:{values:r.map(e=>hl(e,t.lang)).filter(e=>e!==null),tolerance:Vl(e,`tolerance`)??0,lang:t.lang}}]:[{id:n,kind:`text`,key:{accept:r,profile:{...Cd(e,t.profile)},lang:t.lang}}]}function Ed(e,t){let n=$(e,at,t),r=Math.max(...Sd(e).map(e=>[...e.trim()].length)),i=Hl(e,`width`)??bd.find(e=>e>=r)??40;return{...n,attrs:{...n.attrs,size:String(i)}}}var Dd={manifest:at,messages:yd,validate:wd,slots:Td,toView:Ed},Od={HOTSPOT_ALT_EMPTY:`Find it in the picture {id}: the alt text is empty. Describe the picture: students who cannot see it hear the alt text, and it names the places to pick.`,HOTSPOT_REGION_INCOMPLETE:`Find it in the picture {id}: place {region} lacks a value of its shape ({shape, select, circle {the centre and the radius} other {the position, the width and the height}}).`,HOTSPOT_REGION_POINTS:`Find it in the picture {id}: the polygon {region} needs 3 to 64 points, written as x,y pairs.`,HOTSPOT_REGION_OUTSIDE:`Find it in the picture {id}: place {region} reaches outside the picture.`,HOTSPOT_REGION_EMPTY:`Find it in the picture {id}: place {region} has no size.`,HOTSPOT_CORRECT_MISSING:`Find it in the picture {id}: no place is marked as right.`,HOTSPOT_SINGLE_MANY_CORRECT:`Find it in the picture {id}: {count} places are right, but students pick only one. Mark one, or let students pick several.`,HOTSPOT_ALL_CORRECT:`Find it in the picture {id}: every place is right, so picking them all is the answer. Add places that are not right.`,HOTSPOT_PROMPT_EMPTY:`Find it in the picture {id} has an empty task text.`,"editor.label":`Find it in the picture`,"editor.regions":`Places to pick`,"editor.regionsHelp":`Draw every place students can pick, right and wrong ones. A place's label is its name for screen readers: say what it shows, never whether it is right.`,"editor.alt":`Alt text`,"editor.altHelp":`What the picture shows, for students who cannot see it. Do not give the answer away.`,"editor.correct":`Right places`,"editor.correctHelp":`Students pick these. Every other place is a wrong one.`,"editor.multiple":`Several places can be right`,"editor.outline":`Outline the places under the pointer`,"editor.scoring":`Scoring`,"editor.scoringHelp":`With points for each place, every place picked or left as it should be counts.`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-region":`Points for each place`,"editor.points":`Points`,"template.prompt":`Where is it? Pick the place.`,"template.place1":`The left half`,"template.place2":`The right half`,"template.find.label":`Find it in the picture`,"template.find.heading":`Corners and centre`,"template.find.instruction":`Look at the picture carefully.`,"template.find.prompt":`Pick every place that matches the task.`,"template.find.topLeft":`Top left corner`,"template.find.topRight":`Top right corner`,"template.find.centre":`Centre`,"template.find.bottomLeft":`Bottom left corner`,"template.find.bottomRight":`Bottom right corner`},kd={HOTSPOT_ALT_EMPTY:`Znajdź na obrazku {id}: tekst alternatywny jest pusty. Opisz obrazek: uczniowie, którzy go nie widzą, słyszą tekst alternatywny, a on nazywa miejsca do wskazania.`,HOTSPOT_REGION_INCOMPLETE:`Znajdź na obrazku {id}: miejscu {region} brakuje wartości jego kształtu ({shape, select, circle {środka i promienia} other {położenia, szerokości i wysokości}}).`,HOTSPOT_REGION_POINTS:`Znajdź na obrazku {id}: wielokąt {region} potrzebuje od 3 do 64 punktów zapisanych jako pary x,y.`,HOTSPOT_REGION_OUTSIDE:`Znajdź na obrazku {id}: miejsce {region} wychodzi poza obrazek.`,HOTSPOT_REGION_EMPTY:`Znajdź na obrazku {id}: miejsce {region} nie ma rozmiaru.`,HOTSPOT_CORRECT_MISSING:`Znajdź na obrazku {id}: żadne miejsce nie jest oznaczone jako właściwe.`,HOTSPOT_SINGLE_MANY_CORRECT:`Znajdź na obrazku {id}: właściwych miejsc jest {count}, a uczeń wskazuje tylko jedno. Oznacz jedno albo pozwól wskazać kilka.`,HOTSPOT_ALL_CORRECT:`Znajdź na obrazku {id}: wszystkie miejsca są właściwe, więc wystarczy wskazać wszystkie. Dodaj miejsca, które nie są właściwe.`,HOTSPOT_PROMPT_EMPTY:`Znajdź na obrazku {id} ma pustą treść zadania.`,"editor.label":`Znajdź na obrazku`,"editor.regions":`Miejsca do wskazania`,"editor.regionsHelp":`Narysuj wszystkie miejsca, które uczeń może wskazać, właściwe i niewłaściwe. Etykieta miejsca to jego nazwa dla czytników ekranu: powiedz, co pokazuje, nigdy czy jest właściwe.`,"editor.alt":`Tekst alternatywny`,"editor.altHelp":`Co pokazuje obrazek, dla uczniów, którzy go nie widzą. Nie zdradzaj odpowiedzi.`,"editor.correct":`Właściwe miejsca`,"editor.correctHelp":`Te miejsca uczeń ma wskazać. Każde inne jest niewłaściwe.`,"editor.multiple":`Kilka miejsc może być właściwych`,"editor.outline":`Obrysuj miejsce pod wskaźnikiem`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Przy punktach za każde miejsce liczy się każde miejsce wskazane albo pominięte tak, jak powinno.`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-region":`Punkty za każde miejsce`,"editor.points":`Punkty`,"template.prompt":`Gdzie to jest? Wskaż miejsce.`,"template.place1":`Lewa połowa`,"template.place2":`Prawa połowa`,"template.find.label":`Znajdź na obrazku`,"template.find.heading":`Rogi i środek`,"template.find.instruction":`Przyjrzyj się uważnie obrazkowi.`,"template.find.prompt":`Wskaż wszystkie miejsca, które pasują do zadania.`,"template.find.topLeft":`Lewy górny róg`,"template.find.topRight":`Prawy górny róg`,"template.find.centre":`Środek`,"template.find.bottomLeft":`Lewy dolny róg`,"template.find.bottomRight":`Prawy dolny róg`},Ad=`astl.hotspot`,jd=[{namespace:Ad,locale:`en`,messages:{...dt,...Od}},{namespace:Ad,locale:`pl`,messages:{...pt,...kd}}],Md=`astl-hotspot-region`,Nd=e=>J(e,`id`)??``,Pd=e=>t=>J(e,t),Fd=e=>Y(e,`correct`),Id=e=>st(e,e=>ut(ct(Pd(e))));function Ld(e,t){let n=Nd(e);(J(e,`alt`)??``).trim()===``&&t.report(`HOTSPOT_ALT_EMPTY`,{id:n});let r=X(e,Md);for(let e of r){let r={id:n,region:Nd(e)},i=lt(Pd(e));if(i===`incomplete`){let n=ct(Pd(e)).shape;t.report(`HOTSPOT_REGION_INCOMPLETE`,{...r,shape:n},{child:e})}else i===`points`?t.report(`HOTSPOT_REGION_POINTS`,r,{child:e}):i===`outside`?t.report(`HOTSPOT_REGION_OUTSIDE`,r,{child:e}):i===`empty`&&t.report(`HOTSPOT_REGION_EMPTY`,r,{child:e})}let i=r.filter(Fd).length,a=Y(e,`multiple`);i===0?t.report(`HOTSPOT_CORRECT_MISSING`,{id:n}):!a&&i>1?t.report(`HOTSPOT_SINGLE_MANY_CORRECT`,{id:n,count:i}):i===r.length&&t.report(`HOTSPOT_ALL_CORRECT`,{id:n},{severity:`warning`});for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`HOTSPOT_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Rd(e,t){return Id(X(e,Md)).map(e=>({id:t.opaque(Nd(e)),kind:`flag`,key:{correct:Fd(e)}}))}function zd(e,t){let n=$(e,ft,t),r=e=>n.children.filter(t=>T(t,e)),i=r(Md).map(e=>({...e,children:[]}));return{...n,children:[...r(`astl-prompt`),...Id(i)]}}var Bd={manifest:ft,messages:jd,validate:Ld,slots:Rd,toView:zd},Vd={IMAGE_DROP_ALT_EMPTY:`Labels on a picture {id}: the alt text is empty. Describe the picture: students who cannot see it hear the alt text, and it names the zones.`,IMAGE_DROP_ZONE_INCOMPLETE:`Labels on a picture {id}: zone {zone} lacks its position, width or height.`,IMAGE_DROP_ZONE_OUTSIDE:`Labels on a picture {id}: zone {zone} reaches outside the picture.`,IMAGE_DROP_ZONE_EMPTY:`Labels on a picture {id}: zone {zone} has no size.`,IMAGE_DROP_ANSWER_UNKNOWN:`Labels on a picture {id}: the right label of zone {zone} is “{answer}”, but no label has that id.`,IMAGE_DROP_LABEL_TWICE:`Labels on a picture {id}: the label “{label}” is the right one for two zones, but a label goes on one zone only.`,IMAGE_DROP_LABEL_EMPTY:`Labels on a picture {id}: label {label} is empty.`,IMAGE_DROP_LABEL_ALT_EMPTY:`Labels on a picture {id}: label {label} shows only a picture, and its alt text is empty. Describe the picture in its alt text, so every student can tell the labels apart.`,IMAGE_DROP_LABEL_DUPLICATE:`Labels on a picture {id}: two labels say “{text}”, so students cannot tell them apart.`,IMAGE_DROP_LABEL_LINK:`Labels on a picture {id}: the label “{label}” contains a link. Labels are buttons, so a link inside one cannot work. Remove the link.`,IMAGE_DROP_PROMPT_EMPTY:`Labels on a picture {id} has an empty task text.`,"editor.label":`Labels on a picture`,"editor.zones":`Zones`,"editor.zonesHelp":`Draw a zone for every label that belongs on the picture. A zone's label is its name for screen readers, never the answer.`,"editor.alt":`Alt text`,"editor.altHelp":`What the picture shows, for students who cannot see it. Do not give the answers away.`,"editor.answers":`Right label of each zone`,"editor.answersHelp":`A label goes on one zone only; labels no zone takes are extra ones.`,"editor.scoring":`Scoring`,"editor.scoringHelp":`With points for each zone, every zone with its right label counts.`,"editor.value.scoring.per-zone":`Points for each zone`,"editor.value.scoring.all":`All or nothing`,"editor.points":`Points`,"template.prompt":`Put each label on its place in the picture.`,"template.label1":`First label`,"template.label2":`Second label`,"template.drag.label":`Drag labels onto the picture`,"template.drag.heading":`Top, middle and bottom`,"template.drag.instruction":`Look at the picture and the labels below it.`,"template.drag.prompt":`Put each label on the right zone.`,"template.drag.label1":`Top`,"template.drag.label2":`Middle`,"template.drag.label3":`Bottom`,"template.drag.label4":`Extra label`},Hd={IMAGE_DROP_ALT_EMPTY:`Podpisy na obrazku {id}: tekst alternatywny jest pusty. Opisz obrazek: uczniowie, którzy go nie widzą, słyszą tekst alternatywny, a on nazywa strefy.`,IMAGE_DROP_ZONE_INCOMPLETE:`Podpisy na obrazku {id}: strefie {zone} brakuje położenia, szerokości albo wysokości.`,IMAGE_DROP_ZONE_OUTSIDE:`Podpisy na obrazku {id}: strefa {zone} wychodzi poza obrazek.`,IMAGE_DROP_ZONE_EMPTY:`Podpisy na obrazku {id}: strefa {zone} nie ma rozmiaru.`,IMAGE_DROP_ANSWER_UNKNOWN:`Podpisy na obrazku {id}: właściwy podpis strefy {zone} to „{answer}”, ale żaden podpis nie ma takiego identyfikatora.`,IMAGE_DROP_LABEL_TWICE:`Podpisy na obrazku {id}: podpis „{label}” jest właściwy dla dwóch stref, a podpis trafia tylko do jednej.`,IMAGE_DROP_LABEL_EMPTY:`Podpisy na obrazku {id}: podpis {label} jest pusty.`,IMAGE_DROP_LABEL_ALT_EMPTY:`Podpisy na obrazku {id}: podpis {label} to sam obrazek z pustym tekstem alternatywnym. Opisz obrazek w tekście alternatywnym, żeby każdy uczeń odróżnił podpisy.`,IMAGE_DROP_LABEL_DUPLICATE:`Podpisy na obrazku {id}: dwa podpisy brzmią „{text}”, więc uczniowie nie odróżnią ich od siebie.`,IMAGE_DROP_LABEL_LINK:`Podpisy na obrazku {id}: podpis „{label}” zawiera link. Podpisy są przyciskami, więc link w nich nie zadziała. Usuń link.`,IMAGE_DROP_PROMPT_EMPTY:`Podpisy na obrazku {id} mają pustą treść zadania.`,"editor.label":`Podpisy na obrazku`,"editor.zones":`Strefy`,"editor.zonesHelp":`Narysuj strefę dla każdego podpisu, który należy do obrazka. Etykieta strefy to jej nazwa dla czytników ekranu, nigdy odpowiedź.`,"editor.alt":`Tekst alternatywny`,"editor.altHelp":`Co pokazuje obrazek, dla uczniów, którzy go nie widzą. Nie zdradzaj odpowiedzi.`,"editor.answers":`Właściwy podpis każdej strefy`,"editor.answersHelp":`Podpis trafia tylko do jednej strefy; podpisy, których nie wybrała żadna strefa, są dodatkowe.`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Przy punktach za każdą strefę liczy się każda strefa z właściwym podpisem.`,"editor.value.scoring.per-zone":`Punkty za każdą strefę`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.points":`Punkty`,"template.prompt":`Umieść każdy podpis we właściwym miejscu obrazka.`,"template.label1":`Pierwszy podpis`,"template.label2":`Drugi podpis`,"template.drag.label":`Przeciągnij podpisy na obrazek`,"template.drag.heading":`Góra, środek i dół`,"template.drag.instruction":`Przyjrzyj się obrazkowi i podpisom pod nim.`,"template.drag.prompt":`Umieść każdy podpis we właściwej strefie.`,"template.drag.label1":`Góra`,"template.drag.label2":`Środek`,"template.drag.label3":`Dół`,"template.drag.label4":`Dodatkowy podpis`},Ud=`astl.image-drop`,Wd=[{namespace:Ud,locale:`en`,messages:{...mt,...Vd}},{namespace:Ud,locale:`pl`,messages:{...gt,...Hd}}],Gd=`astl-image-drop-zone`,Kd=`astl-image-drop-label`,qd=`labels`,Jd=e=>J(e,`id`)??``,Yd=e=>J(e,`answer`)??``,Xd=e=>e.children.some(e=>T(e)&&(e.tag===`a`||Xd(e)));function Zd(e,t){let n=Jd(e);(J(e,`alt`)??``).trim()===``&&t.report(`IMAGE_DROP_ALT_EMPTY`,{id:n});let r=X(e,Kd),i=new Set(r.map(Jd)),a=new Set;for(let o of X(e,Gd)){let e={id:n,zone:Jd(o)},s=lt(e=>J(o,e));s===`incomplete`?t.report(`IMAGE_DROP_ZONE_INCOMPLETE`,e,{child:o}):s===`outside`?t.report(`IMAGE_DROP_ZONE_OUTSIDE`,e,{child:o}):s===`empty`&&t.report(`IMAGE_DROP_ZONE_EMPTY`,e,{child:o});let c=Yd(o);if(!i.has(c))t.report(`IMAGE_DROP_ANSWER_UNKNOWN`,{...e,answer:c},{child:o});else if(a.has(c)){let e=r.find(e=>Jd(e)===c),i=(e===void 0?``:Q(e))||c;t.report(`IMAGE_DROP_LABEL_TWICE`,{id:n,label:i},{child:o})}a.add(c)}let o=new Set;for(let e of r){let r=Q(e);if(Xd(e)&&t.report(`IMAGE_DROP_LABEL_LINK`,{id:n,label:r||Jd(e)},{child:e}),r===``){Gl(e)?t.report(`IMAGE_DROP_LABEL_ALT_EMPTY`,{id:n,label:Jd(e)},{child:e}):t.report(`IMAGE_DROP_LABEL_EMPTY`,{id:n,label:Jd(e)},{child:e});continue}let i=q(r,t.profile,t.lang);o.has(i)&&t.report(`IMAGE_DROP_LABEL_DUPLICATE`,{id:n,text:r},{child:e}),o.add(i)}for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`IMAGE_DROP_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Qd(e,t){return X(e,Gd).map(e=>({id:t.opaque(Jd(e)),kind:`choice`,key:{correct:t.opaque(Yd(e))}}))}function $d(e,t){let n=$(e,ht,t),r=e=>n.children.filter(t=>T(t,e)),i=r(Gd).map(e=>({...e,children:[]})),a=t.permute(r(Kd),{salt:qd,avoidOriginal:!0});return{...n,children:[...r(`astl-prompt`),...i,...a]}}var ef={manifest:ht,messages:Wd,validate:Zd,slots:Qd,toView:$d},tf={IMAGE_LABEL_ALT_EMPTY:`Label the picture {id}: the alt text is empty. Describe the picture for students who cannot see it.`,IMAGE_LABEL_ANSWER_EMPTY:`Label the picture {id}: pin {pin} has no answer.`,IMAGE_LABEL_ANSWER_TOO_LONG:`Label the picture {id}: an answer of pin {pin} is longer than {max} characters, so no student's answer could match it.`,IMAGE_LABEL_ANSWER_DUPLICATE:`Label the picture {id}: pin {pin} accepts “{value}” twice.`,IMAGE_LABEL_PROMPT_EMPTY:`Label the picture {id} has an empty task text.`,"editor.label":`Label the picture`,"editor.pins":`Pins`,"editor.pinsHelp":`A pin's label is its answer: what students write next to its number.`,"editor.alt":`Alt text`,"editor.altHelp":`What the picture shows, for students who cannot see it. Do not give the answers away.`,"editor.alternatives":`Other accepted answers`,"editor.alternativesHelp":`Other ways to write a pin's answer, separated by |, for example Cracow|Krakow.`,"editor.case":`Capital letters`,"editor.value.case.insensitive":`Do not matter`,"editor.value.case.sensitive":`Matter`,"editor.scoring":`Scoring`,"editor.scoringHelp":`With points for each pin, every pin with a right answer counts.`,"editor.value.scoring.per-pin":`Points for each pin`,"editor.value.scoring.all":`All or nothing`,"editor.points":`Points`,"template.prompt":`Write the name of each numbered place.`,"template.answer1":`First name`,"template.answer2":`Second name`,"template.label.label":`Label the picture`,"template.label.heading":`Three parts of the picture`,"template.label.instruction":`Look at the numbered pins on the picture.`,"template.label.prompt":`Write what each pin shows.`,"template.label.top":`Top`,"template.label.centre":`Centre`,"template.label.centreAlternative":`Center`,"template.label.bottom":`Bottom`},nf={IMAGE_LABEL_ALT_EMPTY:`Podpisz obrazek {id}: tekst alternatywny jest pusty. Opisz obrazek dla uczniów, którzy go nie widzą.`,IMAGE_LABEL_ANSWER_EMPTY:`Podpisz obrazek {id}: pinezka {pin} nie ma odpowiedzi.`,IMAGE_LABEL_ANSWER_TOO_LONG:`Podpisz obrazek {id}: jedna z odpowiedzi pinezki {pin} ma ponad {max} znaków, więc żadna odpowiedź ucznia jej nie dopasuje.`,IMAGE_LABEL_ANSWER_DUPLICATE:`Podpisz obrazek {id}: pinezka {pin} dwa razy przyjmuje „{value}”.`,IMAGE_LABEL_PROMPT_EMPTY:`Podpisz obrazek {id} ma pustą treść zadania.`,"editor.label":`Podpisz obrazek`,"editor.pins":`Pinezki`,"editor.pinsHelp":`Etykieta pinezki to jej odpowiedź: to, co uczeń wpisuje przy jej numerze.`,"editor.alt":`Tekst alternatywny`,"editor.altHelp":`Co pokazuje obrazek, dla uczniów, którzy go nie widzą. Nie zdradzaj odpowiedzi.`,"editor.alternatives":`Inne przyjmowane odpowiedzi`,"editor.alternativesHelp":`Inne zapisy odpowiedzi pinezki, rozdzielone znakiem |, na przykład Krakow|Cracow.`,"editor.case":`Wielkie litery`,"editor.value.case.insensitive":`Nie mają znaczenia`,"editor.value.case.sensitive":`Mają znaczenie`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Przy punktach za każdą pinezkę liczy się każda pinezka z dobrą odpowiedzią.`,"editor.value.scoring.per-pin":`Punkty za każdą pinezkę`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.points":`Punkty`,"template.prompt":`Wpisz nazwę każdego ponumerowanego miejsca.`,"template.answer1":`Pierwsza nazwa`,"template.answer2":`Druga nazwa`,"template.label.label":`Podpisz obrazek`,"template.label.heading":`Trzy części obrazka`,"template.label.instruction":`Przyjrzyj się ponumerowanym pinezkom na obrazku.`,"template.label.prompt":`Wpisz, co pokazuje każda pinezka.`,"template.label.top":`Góra`,"template.label.centre":`Środek`,"template.label.centreAlternative":`Srodek`,"template.label.bottom":`Dół`},rf=`astl.image-label`,af=[{namespace:rf,locale:`en`,messages:{..._t,...tf}},{namespace:rf,locale:`pl`,messages:{...yt,...nf}}],of=`astl-image-label-pin`,sf=e=>J(e,`id`)??``;function cf(e){let t=(J(e,`alternatives`)??``).split(`|`).filter(e=>e.trim()!==``);return[J(e,`label`)??``,...t]}function lf(e,t){return{...t,case:Ul(e,`case`,[`insensitive`,`sensitive`],t.case)}}function uf(e,t){let n=sf(e);(J(e,`alt`)??``).trim()===``&&t.report(`IMAGE_LABEL_ALT_EMPTY`,{id:n});let r=lf(e,t.profile);for(let i of X(e,of)){let e={id:n,pin:sf(i)},[a=``,...o]=cf(i);a.trim()===``&&t.report(`IMAGE_LABEL_ANSWER_EMPTY`,e,{child:i});let s=new Set;for(let n of[a,...o]){if(n.trim()===``)continue;if(n.length>500){t.report(`IMAGE_LABEL_ANSWER_TOO_LONG`,{...e,max:500},{child:i});continue}let a=q(n,r,t.lang);s.has(a)&&t.report(`IMAGE_LABEL_ANSWER_DUPLICATE`,{...e,value:n.trim()},{severity:`warning`,child:i}),s.add(a)}}for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`IMAGE_LABEL_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function df(e,t){let n=lf(e,t.profile);return X(e,of).map(e=>({id:t.opaque(sf(e)),kind:`text`,key:{accept:cf(e),profile:{...n},lang:t.lang}}))}function ff(e,t){let n=$(e,vt,t);return{...n,children:n.children.flatMap(e=>T(e,of)?[{...e,children:[]}]:T(e,`astl-prompt`)?[e]:[])}}var pf={manifest:vt,messages:af,validate:uf,slots:df,toView:ff},mf={LONG_ANSWER_PROMPT_MISSING:`Long answer {id} has no question: the box needs one as its label.`,LONG_ANSWER_LIMITS:`Long answer {id} asks for at least {min} characters but takes at most {max}.`,"editor.label":`Long answer`,"editor.rows":`Lines in the box`,"editor.rowsHelp":`One line makes a single-line answer.`,"editor.minlength":`Fewest characters`,"editor.minlengthHelp":`The student sees how many more to write.`,"editor.maxlength":`Most characters`,"editor.maxlengthHelp":`The box takes no more. Without a number: 2000.`,"editor.placeholder":`Hint in the empty box`,"editor.template.write":`Write your answer`,"template.prompt":`Type the question`,"template.write.title":`My favourite book`,"template.write.instruction":`Answer in a few full sentences. Your teacher will read your answer.`,"template.write.question":`Which book did you enjoy most this year, and why?`,"template.write.placeholder":`The book I enjoyed most was`},hf={LONG_ANSWER_PROMPT_MISSING:`Długa odpowiedź {id} nie ma pytania, a pole potrzebuje go jako etykiety.`,LONG_ANSWER_LIMITS:`Długa odpowiedź {id} wymaga co najmniej {min} znaków, a przyjmuje najwyżej {max}.`,"editor.label":`Długa odpowiedź`,"editor.rows":`Wiersze pola`,"editor.rowsHelp":`Jeden wiersz daje odpowiedź w jednej linii.`,"editor.minlength":`Najmniej znaków`,"editor.minlengthHelp":`Uczeń widzi, ile jeszcze ma napisać.`,"editor.maxlength":`Najwięcej znaków`,"editor.maxlengthHelp":`Pole nie przyjmie więcej. Bez liczby: 2000.`,"editor.placeholder":`Podpowiedź w pustym polu`,"editor.template.write":`Napisz odpowiedź`,"template.prompt":`Wpisz pytanie`,"template.write.title":`Moja ulubiona książka`,"template.write.instruction":`Odpowiedz kilkoma pełnymi zdaniami. Twoją odpowiedź przeczyta nauczyciel.`,"template.write.question":`Która książka najbardziej Ci się podobała w tym roku i dlaczego?`,"template.write.placeholder":`Najbardziej podobała mi się książka`},gf=`astl.long-answer`,_f=[{namespace:gf,locale:`en`,messages:{...bt,...mf}},{namespace:gf,locale:`pl`,messages:{...St,...hf}}],vf=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:e.tag===`img`?!!e.attrs.alt?.trim():vf(e.children));function yf(e,t){let n=J(e,`id`)??``,r=X(e,`astl-prompt`)[0];r===void 0?t.report(`LONG_ANSWER_PROMPT_MISSING`,{id:n}):vf(r.children)||t.report(`LONG_ANSWER_PROMPT_MISSING`,{id:n},{child:r});let i=Hl(e,`minlength`),a=Hl(e,`maxlength`);i!==null&&a!==null&&i>a&&t.report(`LONG_ANSWER_LIMITS`,{id:n,min:i,max:a})}var bf={manifest:xt,messages:_f,validate:yf,slots:(e,t)=>[{id:t.opaque(),kind:we,key:{}}],toView:(e,t)=>$(e,xt,t)},xf={MARK_WORDS_WORD_EMPTY:`Passage {id}: word {word} has no text.`,MARK_WORDS_WORD_LINK:`Passage {id}: word {word} holds a link. A word to select cannot be a link too: take the link out of it.`,MARK_WORDS_CORRECT_MISSING:`Passage {id} has no word marked correct. Mark the words to select.`,MARK_WORDS_ALL_CORRECT:`Passage {id}: every word is marked correct, so selecting them all is the answer. Add words that are not to be selected.`,"editor.label":`Select words`,"editor.wrap":`Mark word`,"editor.correct":`Correct words: {checked} of {count}`,"editor.correctHelp":`Select words in the text and press Mark word to add them. A word that is not correct is a distractor.`,"editor.variant":`Mode`,"editor.value.variant.highlight":`Highlight`,"editor.value.variant.strike":`Cross out`,"editor.scoring":`Scoring`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-word":`Points for each word`,"editor.points":`Points`,"template.before":`Type your text here and mark the`,"template.word":`words`,"template.after":`to select.`,"template.select.label":`Select words`,"template.select.heading":`Life in the garden`,"template.select.instruction":`Read the text and answer the question.`,"template.select.prompt":`Which of them are animals?`,"template.select.before":`In the garden a`,"template.select.word1":`hedgehog`,"template.select.middle":`sleeps under a`,"template.select.word2":`bush`,"template.select.and":`and a`,"template.select.word3":`blackbird`,"template.select.after":`sings.`,"template.odd.label":`Cross out the odd word`,"template.odd.heading":`Fruit, colours and animals`,"template.odd.instruction":`Read each line carefully.`,"template.odd.prompt":`In each line, which word does not fit?`,"template.odd.a1":`apple`,"template.odd.a2":`pear`,"template.odd.a3":`carrot`,"template.odd.a4":`plum`,"template.odd.b1":`red`,"template.odd.b2":`blue`,"template.odd.b3":`green`,"template.odd.b4":`round`,"template.odd.c1":`dog`,"template.odd.c2":`table`,"template.odd.c3":`cat`,"template.odd.c4":`horse`},Sf={MARK_WORDS_WORD_EMPTY:`Tekst {id}: wyraz {word} jest pusty.`,MARK_WORDS_WORD_LINK:`Tekst {id}: wyraz {word} zawiera odnośnik. Wyraz do zaznaczenia nie może być też odnośnikiem: usuń z niego odnośnik.`,MARK_WORDS_CORRECT_MISSING:`Tekst {id} nie ma żadnego poprawnego wyrazu. Oznacz wyrazy, które uczeń ma zaznaczyć.`,MARK_WORDS_ALL_CORRECT:`Tekst {id}: wszystkie wyrazy są poprawne, więc wystarczy zaznaczyć wszystko. Dodaj wyrazy, których nie należy zaznaczać.`,"editor.label":`Zaznacz wyrazy`,"editor.wrap":`Oznacz wyraz`,"editor.correct":`Poprawne wyrazy: {checked} z {count}`,"editor.correctHelp":`Zaznacz wyrazy w tekście i naciśnij Oznacz wyraz, aby je dodać. Wyraz, który nie jest poprawny, to dystraktor.`,"editor.variant":`Tryb`,"editor.value.variant.highlight":`Podkreślanie`,"editor.value.variant.strike":`Skreślanie`,"editor.scoring":`Punktacja`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-word":`Punkty za każdy wyraz`,"editor.points":`Punkty`,"template.before":`Wpisz tu tekst i oznacz`,"template.word":`wyrazy`,"template.after":`do zaznaczenia.`,"template.select.label":`Zaznacz wyrazy`,"template.select.heading":`Życie w ogrodzie`,"template.select.instruction":`Przeczytaj tekst i odpowiedz na pytanie.`,"template.select.prompt":`Które z nich to zwierzęta?`,"template.select.before":`W ogrodzie`,"template.select.word1":`jeż`,"template.select.middle":`śpi pod`,"template.select.word2":`krzakiem`,"template.select.and":`i`,"template.select.word3":`kos`,"template.select.after":`śpiewa.`,"template.odd.label":`Skreśl niepasujący wyraz`,"template.odd.heading":`Owoce, kolory i zwierzęta`,"template.odd.instruction":`Przeczytaj uważnie każdy wiersz.`,"template.odd.prompt":`Który wyraz w każdym wierszu nie pasuje do pozostałych?`,"template.odd.a1":`jabłko`,"template.odd.a2":`gruszka`,"template.odd.a3":`marchewka`,"template.odd.a4":`śliwka`,"template.odd.b1":`czerwony`,"template.odd.b2":`niebieski`,"template.odd.b3":`zielony`,"template.odd.b4":`okrągły`,"template.odd.c1":`pies`,"template.odd.c2":`stół`,"template.odd.c3":`kot`,"template.odd.c4":`koń`},Cf=`astl.mark-words`,wf=[{namespace:Cf,locale:`en`,messages:{...Ct,...xf}},{namespace:Cf,locale:`pl`,messages:{...Tt,...Sf}}],Tf=`astl-mark-word`,Ef=e=>Wl(e,Tf),Df=e=>e.some(e=>e.type===`element`&&(e.tag===`a`||Df(e.children))),Of={manifest:wt,messages:wf,validate(e,t){let n=J(e,`id`)??``,r=Ef(e);for(let e of r){let r={id:n,word:J(e,`id`)??``};Z(e).trim()===``&&t.report(`MARK_WORDS_WORD_EMPTY`,r,{child:e}),Df(e.children)&&t.report(`MARK_WORDS_WORD_LINK`,r,{child:e})}let i=r.filter(e=>Y(e,`correct`)).length;i===0?t.report(`MARK_WORDS_CORRECT_MISSING`,{id:n}):i===r.length&&t.report(`MARK_WORDS_ALL_CORRECT`,{id:n},{severity:`warning`})},slots:(e,t)=>Ef(e).map(e=>({id:t.opaque(J(e,`id`)??``),kind:`flag`,key:{correct:Y(e,`correct`)}})),toView:(e,t)=>$(e,wt,t)},kf={MATCH_ROW_EMPTY:`Matching task {id}: row {row} is empty.`,MATCH_ROW_DUPLICATE:`Matching task {id}: two rows say “{text}”.`,MATCH_ROW_AMBIGUOUS:`Matching task {id}: two rows say “{text}” but match different columns, so students cannot tell which is which.`,MATCH_ROW_COLUMN_UNKNOWN:`Matching task {id}: the row “{row}” matches “{column}”, but no column has that id.`,MATCH_COLUMN_EMPTY:`Matching task {id}: column {column} is empty.`,MATCH_COLUMN_DUPLICATE:`Matching task {id}: two columns say “{text}”, so students cannot tell them apart.`,MATCH_LINK:`Matching task {id}: “{text}” contains a link. Students press rows and columns, so remove the link.`,MATCH_PROMPT_EMPTY:`Matching task {id} has an empty task text.`,"editor.label":`Matching`,"editor.answers":`Correct column of each row`,"editor.answersHelp":`Several rows may share a column.`,"editor.layout":`Layout`,"editor.value.variant.grid":`Grid`,"editor.value.variant.lines":`Join the lines`,"editor.scoring":`Scoring`,"editor.value.scoring.per-row":`Points for each row`,"editor.value.scoring.all":`All or nothing`,"editor.points":`Points`,"template.matching":`Matching`,"template.matching.heading":`Animal homes`,"template.matching.prompt":`Where does each animal live? Choose one home in each row.`,"template.matching.row1":`Bee`,"template.matching.row2":`Bird`,"template.matching.row3":`Fox`,"template.matching.columnA":`Hive`,"template.matching.columnB":`Nest`,"template.matching.columnC":`Den`,"template.lines":`Join the lines`,"template.lines.heading":`Opposites`,"template.lines.prompt":`Join each word with its opposite.`,"template.lines.row1":`day`,"template.lines.row2":`up`,"template.lines.row3":`full`,"template.lines.columnA":`night`,"template.lines.columnB":`down`,"template.lines.columnC":`empty`},Af={MATCH_ROW_EMPTY:`Dopasowywanie {id}: wiersz {row} jest pusty.`,MATCH_ROW_DUPLICATE:`Dopasowywanie {id}: dwa wiersze brzmią „{text}”.`,MATCH_ROW_AMBIGUOUS:`Dopasowywanie {id}: dwa wiersze brzmią „{text}”, ale pasują do różnych kolumn, więc uczniowie ich nie odróżnią.`,MATCH_ROW_COLUMN_UNKNOWN:`Dopasowywanie {id}: wiersz „{row}” pasuje do „{column}”, ale żadna kolumna nie ma takiego identyfikatora.`,MATCH_COLUMN_EMPTY:`Dopasowywanie {id}: kolumna {column} jest pusta.`,MATCH_COLUMN_DUPLICATE:`Dopasowywanie {id}: dwie kolumny brzmią „{text}”, więc uczniowie ich nie odróżnią.`,MATCH_LINK:`Dopasowywanie {id}: „{text}” zawiera link. Uczniowie naciskają wiersze i kolumny, więc usuń link.`,MATCH_PROMPT_EMPTY:`Dopasowywanie {id} ma pusty tekst polecenia.`,"editor.label":`Dopasowywanie`,"editor.answers":`Poprawna kolumna każdego wiersza`,"editor.answersHelp":`Kilka wierszy może pasować do tej samej kolumny.`,"editor.layout":`Układ`,"editor.value.variant.grid":`Tabela`,"editor.value.variant.lines":`Łączenie liniami`,"editor.scoring":`Punktacja`,"editor.value.scoring.per-row":`Punkty za każdy wiersz`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.points":`Punkty`,"template.matching":`Dopasowywanie`,"template.matching.heading":`Domy zwierząt`,"template.matching.prompt":`Gdzie mieszka każde zwierzę? Zaznacz jeden dom w każdym wierszu.`,"template.matching.row1":`Pszczoła`,"template.matching.row2":`Ptak`,"template.matching.row3":`Lis`,"template.matching.columnA":`Ul`,"template.matching.columnB":`Gniazdo`,"template.matching.columnC":`Nora`,"template.lines":`Łączenie w pary`,"template.lines.heading":`Przeciwieństwa`,"template.lines.prompt":`Połącz każde słowo z jego przeciwieństwem.`,"template.lines.row1":`dzień`,"template.lines.row2":`góra`,"template.lines.row3":`pełny`,"template.lines.columnA":`noc`,"template.lines.columnB":`dół`,"template.lines.columnC":`pusty`},jf=`astl.match`,Mf=[{namespace:jf,locale:`en`,messages:{...Et,...kf}},{namespace:jf,locale:`pl`,messages:{...Ot,...Af}}],Nf=`rows`,Pf=e=>J(e,`id`)??``,Ff=e=>J(e,`column`)??``,If=e=>Z(e).replace(/\s+/gu,` `).trim(),Lf=e=>e.children.some(e=>T(e)&&(e.tag===`a`||Lf(e)));function Rf(e,t){return t.permute(e,{salt:Nf,avoidOriginal:!0})}function zf(e,t){let n=J(e,`id`)??``,r=e=>q(e,t.profile,t.lang),i=X(e,`astl-row`),a=X(e,`astl-column`);for(let e of[...i,...a])Lf(e)&&t.report(`MATCH_LINK`,{id:n,text:If(e)||Pf(e)},{child:e});let o=new Set;for(let e of a){let i=If(e);i===``?t.report(`MATCH_COLUMN_EMPTY`,{id:n,column:Pf(e)},{child:e}):(o.has(r(i))&&t.report(`MATCH_COLUMN_DUPLICATE`,{id:n,text:i},{child:e}),o.add(r(i)))}let s=new Set(a.map(Pf)),c=new Map;for(let e of i){let i=If(e),a=Ff(e);if(s.has(a)||t.report(`MATCH_ROW_COLUMN_UNKNOWN`,{id:n,row:i||Pf(e),column:a},{child:e}),i===``){t.report(`MATCH_ROW_EMPTY`,{id:n,row:Pf(e)},{child:e});continue}let o=c.get(r(i));o===void 0?c.set(r(i),a):o===a?t.report(`MATCH_ROW_DUPLICATE`,{id:n,text:i},{severity:`warning`,child:e}):t.report(`MATCH_ROW_AMBIGUOUS`,{id:n,text:i},{child:e})}for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`MATCH_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Bf(e,t){return Rf(X(e,`astl-row`),t).map(e=>({id:t.opaque(Pf(e)),kind:`choice`,key:{correct:t.opaque(Ff(e))}}))}function Vf(e,t){let n=$(e,Dt,t),r=e=>n.children.filter(t=>T(t,e));return{...n,children:[...r(`astl-prompt`),...Rf(r(`astl-row`),t),...r(`astl-column`)]}}var Hf={manifest:Dt,messages:Mf,validate:zf,slots:Bf,toView:Vf},Uf={MEMORY_CARD_EMPTY:`Memory game {id}: card {card} is empty. Give it text, or a picture with alt text.`,MEMORY_CARD_DUPLICATE:`Memory game {id}: two cards of the same set say “{text}”, so students cannot tell them apart.`,MEMORY_CARD_LINK:`Memory game {id}: the card “{card}” contains a link. Cards are buttons, so remove the link.`,MEMORY_PAIR_UNKNOWN:`Memory game {id}: the card “{card}” belongs with “{pair}”, but no card of set A has that id.`,MEMORY_PAIR_TAKEN:`Memory game {id}: two cards of set B belong with “{card}”. Each pair has one card in each set.`,MEMORY_PAIR_MISSING:`Memory game {id}: no card of set B belongs with “{card}”.`,MEMORY_PROMPT_EMPTY:`Memory game {id} has an empty task text.`,"editor.label":`Memory`,"editor.pairs":`Pairs`,"editor.pairsHelp":`For each card of set B, choose the card of set A it belongs with.`,"editor.scoring":`Scoring`,"editor.value.scoring.per-pair":`Points for each pair`,"editor.value.scoring.all":`All or nothing`,"editor.points":`Points`,"template.memory":`Memory`,"template.memory.heading":`Animals and their young`,"template.memory.prompt":`Find each animal and its young.`,"template.memory.a1":`Cat`,"template.memory.b1":`Kitten`,"template.memory.a2":`Dog`,"template.memory.b2":`Puppy`,"template.memory.a3":`Cow`,"template.memory.b3":`Calf`},Wf={MEMORY_CARD_EMPTY:`Gra memory {id}: karta {card} jest pusta. Dodaj tekst albo obrazek z tekstem alternatywnym.`,MEMORY_CARD_DUPLICATE:`Gra memory {id}: dwie karty z tego samego zestawu brzmią „{text}”, więc uczniowie ich nie odróżnią.`,MEMORY_CARD_LINK:`Gra memory {id}: karta „{card}” zawiera link. Karty są przyciskami, więc usuń link.`,MEMORY_PAIR_UNKNOWN:`Gra memory {id}: karta „{card}” pasuje do „{pair}”, ale żadna karta z zestawu A nie ma takiego identyfikatora.`,MEMORY_PAIR_TAKEN:`Gra memory {id}: dwie karty z zestawu B pasują do „{card}”. Każda para ma jedną kartę w każdym zestawie.`,MEMORY_PAIR_MISSING:`Gra memory {id}: żadna karta z zestawu B nie pasuje do „{card}”.`,MEMORY_PROMPT_EMPTY:`Gra memory {id} ma pusty tekst polecenia.`,"editor.label":`Memory`,"editor.pairs":`Pary`,"editor.pairsHelp":`Dla każdej karty z zestawu B wybierz kartę z zestawu A, do której pasuje.`,"editor.scoring":`Punktacja`,"editor.value.scoring.per-pair":`Punkty za każdą parę`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.points":`Punkty`,"template.memory":`Memory`,"template.memory.heading":`Zwierzęta i ich młode`,"template.memory.prompt":`Znajdź każde zwierzę i jego młode.`,"template.memory.a1":`Kot`,"template.memory.b1":`Kocię`,"template.memory.a2":`Pies`,"template.memory.b2":`Szczenię`,"template.memory.a3":`Krowa`,"template.memory.b3":`Cielę`},Gf=`astl.memory`,Kf=[{namespace:Gf,locale:`en`,messages:{...kt,...Uf}},{namespace:Gf,locale:`pl`,messages:{...jt,...Wf}}],qf=`cards`,Jf=`astl-card-a`,Yf=`astl-card-b`,Xf=e=>J(e,`id`)??``,Zf=e=>J(e,`pair`)??``,Qf=e=>T(e,Jf)||T(e,Yf),$f=e=>e.children.some(e=>T(e)&&(e.tag===`a`||$f(e)));function ep(e,t){return t.permute(e,{salt:qf,avoidOriginal:!0})}function tp(e,t){let n=J(e,`id`)??``,r=e=>q(e,t.profile,t.lang),i=e=>Q(e)||Xf(e),a=new Map([[Jf,new Set],[Yf,new Set]]);for(let o of e.children.filter(Qf)){let e=Q(o);if($f(o)&&t.report(`MEMORY_CARD_LINK`,{id:n,card:i(o)},{child:o}),e===``){t.report(`MEMORY_CARD_EMPTY`,{id:n,card:Xf(o)},{child:o});continue}let s=a.get(o.tag);s.has(r(e))&&t.report(`MEMORY_CARD_DUPLICATE`,{id:n,text:e},{child:o}),s.add(r(e))}let o=new Map(X(e,Jf).map(e=>[Xf(e),e])),s=new Set;for(let r of X(e,Yf)){let e=Zf(r),a=o.get(e);a===void 0?t.report(`MEMORY_PAIR_UNKNOWN`,{id:n,card:i(r),pair:e},{child:r}):s.has(e)&&t.report(`MEMORY_PAIR_TAKEN`,{id:n,card:i(a)},{child:r}),s.add(e)}for(let[e,r]of o)s.has(e)||t.report(`MEMORY_PAIR_MISSING`,{id:n,card:i(r)},{child:r});for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`MEMORY_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function np(e,t){let n=new Map(X(e,Yf).map(e=>[Zf(e),Xf(e)]));return ep(e.children.filter(Qf),t).filter(e=>e.tag===Jf).map(e=>({id:t.opaque(Xf(e)),kind:`choice`,key:{correct:t.opaque(n.get(Xf(e)))}}))}function rp(e,t){let n=$(e,At,t);return{...n,children:[...n.children.filter(e=>T(e,`astl-prompt`)),...ep(n.children.filter(Qf),t)]}}var ip={manifest:At,messages:Kf,validate:tp,slots:np,toView:rp},ap={ORDER_ITEM_EMPTY:`Ordering task {id}: item {item} is empty.`,ORDER_ITEM_DUPLICATE:`Ordering task {id}: two items read “{text}”, so students cannot tell which one goes where. Reword one of them or join them into one item.`,ORDER_ITEM_LINK:`Ordering task {id}: item {item} contains a link. Students tap items to move them, so the link would open instead. Remove the link.`,"editor.label":`Put in order`,"editor.scoring":`Scoring`,"editor.scoringHelp":`The correct order is the order in which you write the items; students always see them shuffled. Points for each item in its place give partial points.`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-position":`Points for each item in its place`,"editor.variant":`Layout`,"editor.variantHelp":`A row suits the words of a sentence, a list suits steps and dates.`,"editor.value.variant.vertical":`List`,"editor.value.variant.horizontal":`Row`,"editor.points":`Points`,"template.prompt":`Put the steps in the right order.`,"template.item1":`First step`,"template.item2":`Second step`,"template.item3":`Third step`,"template.cycle.label":`Ordering`,"template.cycle.heading":`From egg to butterfly`,"template.cycle.instruction":`Put the stages in the order they happen.`,"template.cycle.prompt":`The life of a butterfly`,"template.cycle.item1":`An egg on a leaf`,"template.cycle.item2":`A caterpillar`,"template.cycle.item3":`A chrysalis`,"template.cycle.item4":`A butterfly`},op={ORDER_ITEM_EMPTY:`Zadanie na kolejność {id}: element {item} jest pusty.`,ORDER_ITEM_DUPLICATE:`Zadanie na kolejność {id}: dwa elementy brzmią „{text}”, więc uczeń nie odróżni, który gdzie pasuje. Zmień treść jednego z nich albo połącz je w jeden element.`,ORDER_ITEM_LINK:`Zadanie na kolejność {id}: element {item} zawiera link. Uczniowie przesuwają elementy, dotykając ich, więc zamiast tego otworzyłby się link. Usuń link.`,"editor.label":`Ułóż w kolejności`,"editor.scoring":`Punktacja`,"editor.scoringHelp":`Poprawna kolejność to kolejność, w jakiej wpisujesz elementy; uczniowie zawsze widzą je pomieszane. Punkty za każdy element na swoim miejscu dają punkty częściowe.`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-position":`Punkty za każdy element na swoim miejscu`,"editor.variant":`Układ`,"editor.variantHelp":`Wiersz pasuje do słów zdania, lista do kroków i dat.`,"editor.value.variant.vertical":`Lista`,"editor.value.variant.horizontal":`Wiersz`,"editor.points":`Punkty`,"template.prompt":`Ułóż kroki we właściwej kolejności.`,"template.item1":`Pierwszy krok`,"template.item2":`Drugi krok`,"template.item3":`Trzeci krok`,"template.cycle.label":`Ułóż po kolei`,"template.cycle.heading":`Od jaja do motyla`,"template.cycle.instruction":`Ułóż etapy w kolejności, w jakiej następują.`,"template.cycle.prompt":`Życie motyla`,"template.cycle.item1":`Jajo na liściu`,"template.cycle.item2":`Gąsienica`,"template.cycle.item3":`Poczwarka`,"template.cycle.item4":`Motyl`},sp=`astl.order`,cp=[{namespace:sp,locale:`en`,messages:{...Mt,...ap}},{namespace:sp,locale:`pl`,messages:{...Pt,...op}}],lp=`items`;function up(e){return J(e,`id`)??``}function dp(e){return Z(e).replace(/\s+/gu,` `).trim()}function fp(e){return e.some(e=>T(e)&&(e.tag===`a`&&J(e,`href`)!==null||fp(e.children)))}function pp(e,t){let n=J(e,`id`)??``,r=new Set;for(let i of X(e,`astl-item`)){let e=dp(i);if(e===``){t.report(`ORDER_ITEM_EMPTY`,{id:n,item:up(i)},{child:i});continue}fp(i.children)&&t.report(`ORDER_ITEM_LINK`,{id:n,item:up(i)},{child:i});let a=q(e,t.profile,t.lang);r.has(a)&&t.report(`ORDER_ITEM_DUPLICATE`,{id:n,text:e},{child:i}),r.add(a)}}function mp(e,t){return t.permute(e,{avoidOriginal:!0,salt:lp})}function hp(e,t){let n=X(e,`astl-item`);return mp(n,t).map(e=>({id:t.opaque(up(e)),kind:`number`,key:{values:[n.indexOf(e)+1],tolerance:0,lang:t.lang}}))}function gp(e,t){let n=$(e,Nt,t),r=e=>T(e,`astl-item`),i=mp(n.children.filter(r),t),a=0;return{...n,children:n.children.map(e=>r(e)?i[a++]??e:e)}}var _p={manifest:Nt,messages:cp,validate:pp,slots:hp,toView:gp},vp={SELECT_CORRECT_MISSING:`Choice {id} has no correct answer.`,SELECT_MANY_CORRECT:`Choice {id} takes one answer, but {count} options are marked correct. Mark one.`,SELECT_OPTION_EMPTY:`Choice {id}: option {option} is empty.`,SELECT_OPTION_DUPLICATE:`Choice {id}: two options say “{text}”, so students cannot tell them apart.`,"editor.label":`Choice in the text`,"editor.correctOption":`Correct answer`,"editor.correctOptionHelp":`Mark exactly one option.`,"editor.shuffle":`Shuffle the options`,"editor.points":`Points`,"editor.variant":`Variant`,"editor.native":`System list`,"editor.nativeHelp":`The browser's own drop-down list instead of the list in the exercise's style.`,"editor.value.variant.dropdown":`Drop-down list`,"editor.value.variant.search":`List with search`,"editor.value.variant.buttons":`Buttons in the text`,"template.option1":`correct answer`,"template.option2":`wrong answer`,"template.option3":`another wrong answer`,"template.list.label":`Choose from a list`,"template.list.heading":`The Moon`,"template.list.instruction":`Choose the word that completes the sentence.`,"template.list.start":`The Moon goes around`,"template.list.option1":`the Sun`,"template.list.option2":`the Earth`,"template.list.option3":`Mars`,"template.list.end":`.`,"template.click.label":`Click the right word`,"template.click.heading":`Cats and fish`,"template.click.instruction":`Click the word that fits each sentence.`,"template.click.start1":`The cat sat on the`,"template.click.option1a":`hat`,"template.click.option1b":`mat`,"template.click.option1c":`map`,"template.click.start2":`Fish live in`,"template.click.option2a":`trees`,"template.click.option2b":`water`,"template.click.end":`.`},yp={SELECT_CORRECT_MISSING:`Wybór {id} nie ma poprawnej odpowiedzi.`,SELECT_MANY_CORRECT:`Wybór {id} przyjmuje jedną odpowiedź, a poprawnych jest {count}. Zaznacz jedną.`,SELECT_OPTION_EMPTY:`Wybór {id}: odpowiedź {option} jest pusta.`,SELECT_OPTION_DUPLICATE:`Wybór {id}: dwie odpowiedzi brzmią „{text}”, więc uczeń ich nie odróżni.`,"editor.label":`Wybór w tekście`,"editor.correctOption":`Poprawna odpowiedź`,"editor.correctOptionHelp":`Zaznacz dokładnie jedną odpowiedź.`,"editor.shuffle":`Mieszaj kolejność odpowiedzi`,"editor.points":`Punkty`,"editor.variant":`Wariant`,"editor.native":`Lista systemowa`,"editor.nativeHelp":`Lista rozwijana przeglądarki zamiast listy w stylu ćwiczenia.`,"editor.value.variant.dropdown":`Lista rozwijana`,"editor.value.variant.search":`Lista z wyszukiwaniem`,"editor.value.variant.buttons":`Przyciski w tekście`,"template.option1":`poprawna odpowiedź`,"template.option2":`błędna odpowiedź`,"template.option3":`inna błędna odpowiedź`,"template.list.label":`Wybierz z listy`,"template.list.heading":`Księżyc`,"template.list.instruction":`Wybierz słowo, które pasuje do zdania.`,"template.list.start":`Księżyc krąży wokół`,"template.list.option1":`Słońca`,"template.list.option2":`Ziemi`,"template.list.option3":`Marsa`,"template.list.end":`.`,"template.click.label":`Kliknij właściwe słowo`,"template.click.heading":`Koty i ryby`,"template.click.instruction":`Kliknij słowo, które pasuje do zdania.`,"template.click.start1":`Kot siedzi na`,"template.click.option1a":`czapce`,"template.click.option1b":`macie`,"template.click.option1c":`mapie`,"template.click.start2":`Ryby żyją w`,"template.click.option2a":`drzewach`,"template.click.option2b":`wodzie`,"template.click.end":`.`},bp=`astl.select`,xp=[{namespace:bp,locale:`en`,messages:{...Ft,...vp}},{namespace:bp,locale:`pl`,messages:{...Lt,...yp}}],Sp=`options`;function Cp(e){return J(e,`id`)??``}function wp(e){return Y(e,`correct`)}function Tp(e){return Z(e).replace(/\s+/gu,` `).trim()}function Ep(e,t){let n=J(e,`id`)??``,r=X(e,`astl-option`),i=r.filter(wp).length;i===0?t.report(`SELECT_CORRECT_MISSING`,{id:n}):i>1&&t.report(`SELECT_MANY_CORRECT`,{id:n,count:i});let a=new Set;for(let e of r){let r=Tp(e);if(r===``){t.report(`SELECT_OPTION_EMPTY`,{id:n,option:Cp(e)},{child:e});continue}let i=q(r,t.profile,t.lang);a.has(i)&&t.report(`SELECT_OPTION_DUPLICATE`,{id:n,text:r},{child:e}),a.add(i)}}function Dp(e,t){let n=X(e,`astl-option`).find(wp);if(n===void 0)throw Error(`astl-select: slots() called without a correct option`);return[{id:t.opaque(),kind:`choice`,key:{correct:t.opaque(Cp(n))}}]}function Op(e,t){let n=$(e,It,t);if(!Y(e,`shuffle`))return n;let r=e=>T(e,`astl-option`),i=t.permute(n.children.filter(r),{salt:Sp}),a=0;return{...n,children:n.children.map(e=>r(e)?i[a++]??e:e)}}var kp={manifest:It,messages:xp,validate:Ep,slots:Dp,toView:Op},Ap={TRUE_FALSE_STATEMENT_EMPTY:`True or false {id}: statement {statement} is empty.`,TRUE_FALSE_STATEMENT_DUPLICATE:`True or false {id}: two statements say “{text}”.`,TRUE_FALSE_LABEL_ALONE:`True or false {id}: only one button has its own name. Name both buttons, or neither.`,TRUE_FALSE_LABEL_EMPTY:`True or false {id}: a button name is empty.`,TRUE_FALSE_LABEL_TOO_LONG:`True or false {id}: a button name is longer than {max, plural, one {# character} other {# characters}}. Shorten it.`,TRUE_FALSE_LABEL_SAME:`True or false {id}: both buttons are called “{text}”, so students cannot tell them apart.`,"editor.label":`True or false`,"editor.answers":`Correct answers`,"editor.trueLabel":`Name of the “true” button`,"editor.falseLabel":`Name of the “false” button`,"editor.labelsHelp":`For example Yes and No. Leave both empty for True and False.`,"editor.value.answer.true":`True`,"editor.value.answer.false":`False`,"editor.scoring":`Scoring`,"editor.value.scoring.all":`All or nothing`,"editor.value.scoring.per-statement":`Points for each statement`,"editor.points":`Points`,"template.prompt":`Type the instruction`,"template.statement1":`Type a true statement`,"template.statement2":`Type a false statement`,"template.tf.label":`True or false`,"template.tf.heading":`Nature around us`,"template.tf.instruction":`Decide whether each sentence is true.`,"template.tf.statement1":`The Sun is a star.`,"template.tf.statement2":`Whales are fish.`,"template.tf.statement3":`Ice is frozen water.`},jp={TRUE_FALSE_STATEMENT_EMPTY:`Prawda czy fałsz {id}: zdanie {statement} jest puste.`,TRUE_FALSE_STATEMENT_DUPLICATE:`Prawda czy fałsz {id}: dwa zdania brzmią „{text}”.`,TRUE_FALSE_LABEL_ALONE:`Prawda czy fałsz {id}: tylko jeden przycisk ma własną nazwę. Nazwij oba przyciski albo żaden.`,TRUE_FALSE_LABEL_EMPTY:`Prawda czy fałsz {id}: nazwa przycisku jest pusta.`,TRUE_FALSE_LABEL_TOO_LONG:`Prawda czy fałsz {id}: nazwa przycisku ma więcej niż {max, plural, one {# znak} few {# znaki} many {# znaków} other {# znaku}}. Skróć ją.`,TRUE_FALSE_LABEL_SAME:`Prawda czy fałsz {id}: oba przyciski nazywają się „{text}”, więc uczeń ich nie odróżni.`,"editor.label":`Prawda czy fałsz`,"editor.answers":`Poprawne odpowiedzi`,"editor.trueLabel":`Nazwa przycisku „prawda”`,"editor.falseLabel":`Nazwa przycisku „fałsz”`,"editor.labelsHelp":`Na przykład Tak i Nie. Zostaw oba puste, a przyciski będą brzmieć Prawda i Fałsz.`,"editor.value.answer.true":`Prawda`,"editor.value.answer.false":`Fałsz`,"editor.scoring":`Punktacja`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.value.scoring.per-statement":`Punkty za każde zdanie`,"editor.points":`Punkty`,"template.prompt":`Wpisz polecenie`,"template.statement1":`Wpisz prawdziwe zdanie`,"template.statement2":`Wpisz fałszywe zdanie`,"template.tf.label":`Prawda czy fałsz`,"template.tf.heading":`Przyroda wokół nas`,"template.tf.instruction":`Zdecyduj, czy każde zdanie jest prawdziwe.`,"template.tf.statement1":`Słońce jest gwiazdą.`,"template.tf.statement2":`Wieloryby są rybami.`,"template.tf.statement3":`Lód to zamarznięta woda.`},Mp=`astl.true-false`,Np=[{namespace:Mp,locale:`en`,messages:{...Rt,...Ap}},{namespace:Mp,locale:`pl`,messages:{...Bt,...jp}}],Pp=40;function Fp(e){return J(e,`id`)??``}function Ip(e,t,n){let r=[J(e,`true-label`),J(e,`false-label`)].filter(e=>e!==null);r.length===1&&t.report(`TRUE_FALSE_LABEL_ALONE`,{id:n});let i=r.map(e=>e.replace(/\s+/gu,` `).trim());for(let e of i)e===``?t.report(`TRUE_FALSE_LABEL_EMPTY`,{id:n}):[...e].length>Pp&&t.report(`TRUE_FALSE_LABEL_TOO_LONG`,{id:n,max:Pp});let[a,o]=i;a&&o&&q(a,t.profile,t.lang)===q(o,t.profile,t.lang)&&t.report(`TRUE_FALSE_LABEL_SAME`,{id:n,text:a})}function Lp(e,t){let n=J(e,`id`)??``;Ip(e,t,n);let r=new Set;for(let i of X(e,`astl-statement`)){let e=Z(i).replace(/\s+/gu,` `).trim();if(e===``){t.report(`TRUE_FALSE_STATEMENT_EMPTY`,{id:n,statement:Fp(i)},{child:i});continue}let a=q(e,t.profile,t.lang);r.has(a)&&t.report(`TRUE_FALSE_STATEMENT_DUPLICATE`,{id:n,text:e},{severity:`warning`,child:i}),r.add(a)}}function Rp(e,t){return X(e,`astl-statement`).map(e=>{let n=J(e,`answer`);if(n!==`true`&&n!==`false`)throw Error(`astl-true-false: slots() called with a statement without a valid answer`);return{id:t.opaque(Fp(e)),kind:`choice`,key:{correct:n}}})}var zp={manifest:zt,messages:Np,validate:Lp,slots:Rp,toView:(e,t)=>$(e,zt,t)},Bp={VIDEO_LABEL_MISSING:`Video {id} has no title. Give it one: it names the video for students who use a screen reader.`,VIDEO_SOURCE_MISSING:`Video {id} has no video. Paste a YouTube or Vimeo link, or give the address of an mp4 or webm file.`,VIDEO_SOURCE_BOTH:`Video {id}: {first, select, src {the file} poster {the poster} captions {the captions} youtube {the YouTube video} other {the Vimeo video}} and {second, select, src {the file} poster {the poster} captions {the captions} youtube {the YouTube video} other {the Vimeo video}} cannot go together. A video is a file (with its poster and captions) or one YouTube or Vimeo video.`,VIDEO_FILE_TYPE:`Video {id}: {url} is not an mp4 or webm file. For a YouTube or Vimeo video, paste its link as a YouTube or Vimeo video instead.`,VIDEO_LINK_INVALID:`Video {id}: “{value}” is neither a {provider, select, vimeo {Vimeo} other {YouTube}} link nor a video id. Paste the link of a video on {provider, select, vimeo {Vimeo} other {YouTube}}.`,VIDEO_CAPTIONS_LANG_INVALID:`Video {id}: “{value}” is not a language tag. Write the language of the captions as a BCP 47 tag, such as en or pl.`,VIDEO_CAPTIONS_MISSING:`Video {id} has no captions. Add a WebVTT file, so that students who cannot hear the video can follow it.`,"editor.label":`Video`,"editor.title":`Title`,"editor.titleHelp":`Shown above the video. It also names the player for screen readers.`,"editor.youtube":`YouTube link`,"editor.youtubeHelp":`Paste the link of a YouTube video, or its id; students get the id only. It plays from youtube-nocookie.com once the student presses Play.`,"editor.vimeo":`Vimeo link`,"editor.vimeoHelp":`Paste the link of a Vimeo video, or its id; students get the id only. It plays without tracking once the student presses Play.`,"editor.src":`Video file (mp4 or webm)`,"editor.srcHelp":`A video is a file or a YouTube or Vimeo link, never both.`,"editor.poster":`Poster (optional)`,"editor.posterHelp":`A picture shown before the file plays.`,"editor.captions":`Captions (WebVTT file)`,"editor.captionsHelp":`Shown by default, for students who cannot hear the video.`,"editor.captionsLang":`Language of the captions`,"editor.captionsLangHelp":`A language tag such as en or pl. Empty means English.`,"template.label":`Title of the video`,"editor.template.watch":`Watch, then answer`,"template.watch.title":`Honey bees`,"template.watch.instruction":`Watch the video, then complete the sentence below it.`,"template.watch.tip":`You can watch the video as many times as you like.`,"template.watch.label":`How bees make honey`,"template.watch.sentence":`Bees make honey from the nectar of`,"template.watch.gap":`flowers`},Vp={VIDEO_LABEL_MISSING:`Film {id} nie ma tytułu. Nadaj mu tytuł: nazywa on film dla uczniów, którzy korzystają z czytnika ekranu.`,VIDEO_SOURCE_MISSING:`Film {id} nie ma nagrania. Wklej link do filmu z YouTube lub Vimeo albo podaj adres pliku mp4 lub webm.`,VIDEO_SOURCE_BOTH:`Film {id}: {first, select, src {plik} poster {obraz zastępczy} captions {napisy} youtube {film z YouTube} other {film z Vimeo}} i {second, select, src {plik} poster {obraz zastępczy} captions {napisy} youtube {film z YouTube} other {film z Vimeo}} nie mogą być razem. Film to plik (z obrazem zastępczym i napisami) albo jeden film z YouTube lub Vimeo.`,VIDEO_FILE_TYPE:`Film {id}: {url} nie jest plikiem mp4 ani webm. Film z YouTube lub Vimeo wklej jako link do YouTube lub Vimeo.`,VIDEO_LINK_INVALID:`Film {id}: „{value}” nie jest linkiem do {provider, select, vimeo {Vimeo} other {YouTube}} ani identyfikatorem filmu. Wklej link do filmu z {provider, select, vimeo {Vimeo} other {YouTube}}.`,VIDEO_CAPTIONS_LANG_INVALID:`Film {id}: „{value}” nie jest kodem języka. Podaj język napisów jako kod BCP 47, na przykład pl lub en.`,VIDEO_CAPTIONS_MISSING:`Film {id} nie ma napisów. Dodaj plik WebVTT, aby uczniowie, którzy nie słyszą filmu, mogli go śledzić.`,"editor.label":`Film`,"editor.title":`Tytuł`,"editor.titleHelp":`Widoczny nad filmem. Nazywa też odtwarzacz dla czytników ekranu.`,"editor.youtube":`Link do YouTube`,"editor.youtubeHelp":`Wklej link do filmu z YouTube albo jego identyfikator; uczniowie dostają tylko identyfikator. Film odtwarza się z youtube-nocookie.com, gdy uczeń naciśnie Odtwórz.`,"editor.vimeo":`Link do Vimeo`,"editor.vimeoHelp":`Wklej link do filmu z Vimeo albo jego identyfikator; uczniowie dostają tylko identyfikator. Film odtwarza się bez śledzenia, gdy uczeń naciśnie Odtwórz.`,"editor.src":`Plik wideo (mp4 lub webm)`,"editor.srcHelp":`Film to plik albo link do YouTube lub Vimeo, nigdy jedno i drugie.`,"editor.poster":`Obraz zastępczy (opcjonalnie)`,"editor.posterHelp":`Obrazek widoczny, zanim plik zacznie się odtwarzać.`,"editor.captions":`Napisy (plik WebVTT)`,"editor.captionsHelp":`Widoczne domyślnie, dla uczniów, którzy nie słyszą filmu.`,"editor.captionsLang":`Język napisów`,"editor.captionsLangHelp":`Kod języka, na przykład pl lub en. Puste pole oznacza angielski.`,"template.label":`Tytuł filmu`,"editor.template.watch":`Obejrzyj i odpowiedz`,"template.watch.title":`Pszczoły miodne`,"template.watch.instruction":`Obejrzyj film, a potem uzupełnij zdanie pod nim.`,"template.watch.tip":`Możesz obejrzeć film tyle razy, ile chcesz.`,"template.watch.label":`Jak pszczoły robią miód`,"template.watch.sentence":`Pszczoły robią miód z nektaru`,"template.watch.gap":`kwiatów`},Hp=`astl.video`,Up=[{namespace:Hp,locale:`en`,messages:{...Vt,...Bp}},{namespace:Hp,locale:`pl`,messages:{...Ut,...Vp}}],Wp=[`youtube`,`vimeo`],Gp=[`src`,`poster`,`captions`],Kp={youtube:/^[\w-]{11}$/,vimeo:/^\d{1,12}$/},qp={youtube:new Set([`youtube.com`,`www.youtube.com`,`m.youtube.com`,`music.youtube.com`,`youtu.be`,`youtube-nocookie.com`,`www.youtube-nocookie.com`]),vimeo:new Set([`vimeo.com`,`www.vimeo.com`,`player.vimeo.com`])},Jp=e=>Wp.includes(e),Yp=e=>qp.youtube.has(e.hostname)||qp.vimeo.has(e.hostname);function Xp(e,t){return e.hostname===`youtu.be`?t[0]:t[0]===`watch`?e.searchParams.get(`v`)??void 0:[`shorts`,`embed`,`live`,`v`].includes(t[0]??``)?t[1]:void 0}function Zp(e){let t=e.findIndex(e=>e===`video`||e===`videos`);return t>=0?e[t+1]:e[0]===`channels`?e[2]:e[0]}function Qp(e,t){let n=t.trim(),r=Kp[e];if(r.test(n))return n;let i=URL.parse(/^[a-z][a-z\d+.-]*:/i.test(n)?n:`https://${n}`);if(i===null||!/^https?:$/.test(i.protocol)||!qp[e].has(i.hostname))return null;let a=i.pathname.split(`/`).filter(e=>e!==``),o=e===`youtube`?Xp(i,a):Zp(a);return o!==void 0&&r.test(o)?o:null}function $p(e){let t=URL.parse(e,`https://relative.invalid/`);if(t===null||Yp(t))return!1;let n=t.pathname.split(`/`).at(-1)??``;return!/\.[a-z\d]+$/i.test(n)||/\.(?:mp4|webm)$/i.test(n)}function em(e,t){let n=J(e,`id`)??``;(J(e,`label`)??``).trim()===``&&t.report(`VIDEO_LABEL_MISSING`,{id:n});let r=Gp.filter(t=>Bl(e,t)!==null),i=Wp.filter(t=>(J(e,t)??``).trim()!==``),[a]=i,o=i.length>1?i:a===void 0?[]:[...r,a];if(o.length>1)t.report(`VIDEO_SOURCE_BOTH`,{id:n,first:o[0]??``,second:o.at(-1)??``});else if(a!==void 0){let r=J(e,a)??``;Qp(a,r)===null&&t.report(`VIDEO_LINK_INVALID`,{id:n,provider:a,value:r})}else{let r=Bl(e,`src`);r===null?t.report(`VIDEO_SOURCE_MISSING`,{id:n}):$p(r)||t.report(`VIDEO_FILE_TYPE`,{id:n,url:r});let i=J(e,`captions-lang`);i!==null&&!_.test(i)&&t.report(`VIDEO_CAPTIONS_LANG_INVALID`,{id:n,value:i}),r!==null&&Bl(e,`captions`)===null&&t.report(`VIDEO_CAPTIONS_MISSING`,{id:n},{severity:`warning`})}}var tm={manifest:Ht,messages:Up,validate:em,slots:()=>[],toView(e,t){let n=$(e,Ht,t),r=Object.entries(n.attrs).flatMap(([e,t])=>{if(!Jp(e))return[[e,t]];let n=Qp(e,t);return n===null?[]:[[e,n]]});return w(n.tag,Object.fromEntries(r),n.children)}},nm={WORD_BANK_WORD_EMPTY:`Word bank {id}: word {word} is empty.`,WORD_BANK_WORD_DUPLICATE:`Word bank {id}: two words say “{text}”, so students cannot tell them apart. To let one word fill several gaps, turn on reuse instead.`,WORD_BANK_WORD_LINK:`Word bank {id}: the word “{word}” contains a link. Words are buttons, so a link inside one cannot work. Remove the link.`,"editor.label":`Word bank`,"editor.distractors":`Distractors`,"editor.distractorsHelp":`Words no gap expects. Students see them like the others.`,"editor.reuse":`One word for several gaps`,"editor.reuseHelp":`Without it, a word fills one gap at a time.`,"template.word1":`first word`,"template.word2":`second word`,"template.word3":`extra word`,"editor.template.dragWords":`Drag words into gaps`,"template.dragWords.heading":`The Sun and the Moon`,"template.dragWords.instruction":`Put the right word in each gap. One word is extra.`,"template.dragWords.answer1":`star`,"template.dragWords.answer2":`Earth`,"template.dragWords.distractor":`planet`,"template.dragWords.start":`The Sun is a`,"template.dragWords.middle":`, and the Moon goes round the`,"template.dragWords.end":`.`},rm={WORD_BANK_WORD_EMPTY:`Bank słów {id}: słowo {word} jest puste.`,WORD_BANK_WORD_DUPLICATE:`Bank słów {id}: dwa słowa brzmią „{text}”, więc uczniowie ich nie odróżnią. Jeśli jedno słowo ma wypełniać kilka luk, włącz ponowne użycie słów.`,WORD_BANK_WORD_LINK:`Bank słów {id}: słowo „{word}” zawiera link. Słowa są przyciskami, więc link w słowie nie zadziała. Usuń link.`,"editor.label":`Bank słów`,"editor.distractors":`Dystraktory`,"editor.distractorsHelp":`Słowa, których nie oczekuje żadna luka. Uczniowie widzą je tak jak pozostałe.`,"editor.reuse":`Jedno słowo do kilku luk`,"editor.reuseHelp":`Bez tego słowo wypełnia naraz tylko jedną lukę.`,"template.word1":`pierwsze słowo`,"template.word2":`drugie słowo`,"template.word3":`dodatkowe słowo`,"editor.template.dragWords":`Przeciągnij słowa do luk`,"template.dragWords.heading":`Słońce i Księżyc`,"template.dragWords.instruction":`Wstaw w każdą lukę właściwe słowo. Jedno słowo jest zbędne.`,"template.dragWords.answer1":`gwiazda`,"template.dragWords.answer2":`Ziemi`,"template.dragWords.distractor":`planeta`,"template.dragWords.start":`Słońce to`,"template.dragWords.middle":`, a Księżyc krąży wokół`,"template.dragWords.end":`.`},im=`astl.word-bank`,am=[{namespace:im,locale:`en`,messages:{...Wt,...nm}},{namespace:im,locale:`pl`,messages:{...Kt,...rm}}],om=`words`,sm=e=>J(e,`id`)??``,cm=e=>Z(e).replace(/\s+/gu,` `).trim(),lm=e=>e.children.some(e=>T(e)&&(e.tag===`a`||lm(e)));function um(e,t){let n=J(e,`id`)??``,r=new Set;for(let i of X(e,`astl-word`)){let e=cm(i);if(lm(i)&&t.report(`WORD_BANK_WORD_LINK`,{id:n,word:e||sm(i)},{child:i}),e===``){t.report(`WORD_BANK_WORD_EMPTY`,{id:n,word:sm(i)},{child:i});continue}let a=q(e,t.profile,t.lang);r.has(a)&&t.report(`WORD_BANK_WORD_DUPLICATE`,{id:n,text:e},{child:i}),r.add(a)}}function dm(e,t){let n=$(e,Gt,t);return{...n,children:t.permute(n.children,{salt:om,avoidOriginal:!0})}}var fm={manifest:Gt,messages:am,validate:um,slots:()=>[],toView:dm},pm={WORD_SEARCH_WORD_EMPTY:`Word search {id}: entry {word} has no word.`,WORD_SEARCH_WORD_LETTERS:`Word search {id}: “{word}” may contain letters only.`,WORD_SEARCH_WORD_LENGTH:`Word search {id}: “{word}” needs 2 to {max} letters.`,WORD_SEARCH_WORD_DUPLICATE:`Word search {id}: “{word}” is listed twice.`,WORD_SEARCH_WORD_INSIDE:`Word search {id}: “{word}” is inside “{other}” (or inside it backwards), so it would be found twice.`,WORD_SEARCH_CLUE_EMPTY:`Word search {id}: the clue for “{word}” is empty.`,WORD_SEARCH_LINK:`Word search {id}: remove the link from “{text}”, an entry students press.`,WORD_SEARCH_NO_FIT:`Word search {id}: the words do not fit in {size} by {size} letters. Make the grid larger or allow more directions.`,WORD_SEARCH_PROMPT_EMPTY:`Word search {id} has an empty task text.`,"editor.label":`Word search`,"editor.size":`Grid size`,"editor.sizeHelp":`5 to 20; empty: automatic. The grid is made when the exercise is compiled.`,"editor.right":`Left to right`,"editor.rightHelp":`None ticked: the first three.`,"editor.down":`Top to bottom`,"editor.down-right":`Down to the right`,"editor.left":`Right to left`,"editor.up":`Bottom to top`,"editor.up-left":`Up to the left`,"editor.down-left":`Down to the left`,"editor.up-right":`Up to the right`,"editor.words":`Hidden words of clues`,"editor.wordsHelp":`Empty: the line is the word. A word here makes the line its clue.`,"editor.scoring":`Scoring`,"editor.value.scoring.per-word":`Points for each word`,"editor.value.scoring.all":`All or nothing`,"editor.points":`Points`,"editor.template.wordSearch":`Word search`,"template.word1":`HORSE`,"template.word2":`GOAT`,"template.word3":`DUCK`,"template.title":`Hidden animals`,"template.instruction":`The letters hide three animals. Find them all.`},mm={WORD_SEARCH_WORD_EMPTY:`Wykreślanka {id}: pozycja {word} nie ma słowa.`,WORD_SEARCH_WORD_LETTERS:`Wykreślanka {id}: „{word}” może mieć tylko litery.`,WORD_SEARCH_WORD_LENGTH:`Wykreślanka {id}: „{word}” musi mieć od 2 do {max} liter.`,WORD_SEARCH_WORD_DUPLICATE:`Wykreślanka {id}: „{word}” jest na liście dwa razy.`,WORD_SEARCH_WORD_INSIDE:`Wykreślanka {id}: „{word}” jest w „{other}” (albo w nim wspak), więc znalazłoby się dwa razy.`,WORD_SEARCH_CLUE_EMPTY:`Wykreślanka {id}: wskazówka do „{word}” jest pusta.`,WORD_SEARCH_LINK:`Wykreślanka {id}: usuń link z „{text}”, pozycji naciskanej przez uczniów.`,WORD_SEARCH_NO_FIT:`Wykreślanka {id}: słowa nie mieszczą się w {size} na {size} liter. Powiększ siatkę albo pozwól na więcej kierunków.`,WORD_SEARCH_PROMPT_EMPTY:`Wykreślanka {id} ma pusty tekst polecenia.`,"editor.label":`Wykreślanka`,"editor.size":`Rozmiar siatki`,"editor.sizeHelp":`Od 5 do 20; puste: automatycznie. Siatka powstaje przy kompilacji ćwiczenia.`,"editor.right":`Od lewej do prawej`,"editor.rightHelp":`Nic nie zaznaczono: trzy pierwsze.`,"editor.down":`Z góry na dół`,"editor.down-right":`W dół w prawo`,"editor.left":`Od prawej do lewej`,"editor.up":`Z dołu do góry`,"editor.up-left":`W górę w lewo`,"editor.down-left":`W dół w lewo`,"editor.up-right":`W górę w prawo`,"editor.words":`Ukryte słowa wskazówek`,"editor.wordsHelp":`Puste: wiersz jest słowem. Wpisane tu słowo zmienia wiersz w jego wskazówkę.`,"editor.scoring":`Punktacja`,"editor.value.scoring.per-word":`Punkty za każde słowo`,"editor.value.scoring.all":`Wszystko albo nic`,"editor.points":`Punkty`,"editor.template.wordSearch":`Wykreślanka`,"template.word1":`KOŃ`,"template.word2":`KOZA`,"template.word3":`KACZKA`,"template.title":`Ukryte zwierzęta`,"template.instruction":`W literach ukryły się trzy zwierzęta. Znajdź je wszystkie.`},hm=`astl.word-search`,gm=[{namespace:hm,locale:`en`,messages:{...qt,...pm}},{namespace:hm,locale:`pl`,messages:{...Jt,...mm}}],_m={right:[0,1],down:[1,0],"down-right":[1,1],left:[0,-1],up:[-1,0],"up-left":[-1,-1],"down-left":[1,-1],"up-right":[-1,1]},vm=[`right`,`down`,`down-right`],ym=Object.values(_m),bm=20,xm=60,Sm=20,Cm=[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ`],wm=/^\p{L}$/u,Tm=e=>J(e,`id`)??``,Em=e=>Z(e).replace(/\s+/gu,` `).trim(),Dm=e=>e.children.some(e=>T(e)&&(e.tag===`a`||Dm(e))),Om=e=>e.children.some(e=>e.type===`text`?e.value.trim()!==``:e.tag===`img`?(e.attrs.alt??``).trim()!==``:Om(e)),km=e=>(J(e,`word`)??Em(e)).trim(),Am=e=>[...e].reverse().join(``);function jm(e,t){try{return e.toLocaleUpperCase(t)}catch{return e.toUpperCase()}}function Mm(e,t){return[...jm(e.normalize(`NFC`),t).normalize(`NFC`)]}function Nm(e,t){let n=X(e,`astl-search-word`).map(e=>Mm(km(e),t)),r=Object.keys(_m).filter(t=>Y(e,t)),i=r.length>0?r:vm,a=Math.max(...n.map(e=>e.length)),o=n.reduce((e,t)=>e+t.length,0),s=Hl(e,`size`)??Math.min(bm,Math.max(6,a+1,Math.ceil(Math.sqrt(2*o)))),c=[Tm(e),s,...i,...n.map(e=>e.join(``))].join(``);return{words:n,size:s,steps:i.map(e=>_m[e]),seed:c}}function Pm(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0}function Fm(e){let t=e;return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function Im(e,t,n,r,[i,a],o=!1){let s=t.length-1;return((...t)=>t.every(t=>t>=0&&t<e.length))(n,r,n+i*s,r+a*s)&&t.every((t,s)=>{let c=e[n+i*s]?.[r+a*s];return c===t||o&&c===null})}function Lm(e,t){return t.every(t=>{let n=0;return e.forEach((r,i)=>{r.forEach((r,a)=>{if(r===t[0])for(let r of ym)Im(e,t,i,a,r)&&n++})}),n===(Am(t)===t.join(``)?2:1)})}function Rm(e,t,n,r){let i=e.map(e=>[...e]),a=(e,n)=>t.some(t=>t.some((r,a)=>r===i[e]?.[n]&&ym.some(r=>Im(i,t,e-r[0]*a,n-r[1]*a,r))));for(let[e,t]of i.entries())for(let[i,o]of t.entries()){if(o!==null)continue;let s=Math.floor(r()*n.length),c=0;for(;c<n.length&&(t[i]=n[(s+c)%n.length],a(e,i));)c++;if(c===n.length)return null}return i}function zm({words:e,size:t,steps:n,seed:r}){let i=Fm(Pm(r)),a=[...new Set([...Cm,...e.flat()])].sort(),o=e.map((e,t)=>t).sort((t,n)=>(e[n]?.length??0)-(e[t]?.length??0)||t-n);for(let r=0;r<xm;r++){let r=Array.from({length:t},()=>Array(t).fill(null)),s=[];if(o.every(a=>{let o=e[a],c=[];for(let e=0;e<t;e++)for(let i=0;i<t;i++)for(let t of n)Im(r,o,e,i,t,!0)&&c.push([e,i,t]);let[l,u,[d,f]]=c[Math.floor(i()*c.length)]??[0,0,[0,0]];if(c.length===0)return!1;for(let[e,t]of o.entries())r[l+d*e][u+f*e]=t;let p=o.length-1;return s[a]=[[l,u],[l+d*p,u+f*p]],!0})&&Lm(r,e))for(let t=0;t<Sm;t++){let t=Rm(r,e,a,i);if(t!==null&&Lm(t,e))return{rows:t,spans:s}}}return null}var Bm=new WeakMap;function Vm(e,t){return Bm.has(e)||Bm.set(e,zm(Nm(e,t))),Bm.get(e)??null}function Hm(e,t){let n=Vm(e,t.lang);if(n===null)throw Error(`astl-word-search ${Tm(e)}: no grid`);return n}function Um(e,t){let n=Tm(e),r=Hl(e,`size`)??bm,i=X(e,`astl-search-word`),a=[],o=new Set;for(let e of i){let i=Em(e),s=km(e),c=Mm(s,t.lang);Dm(e)&&t.report(`WORD_SEARCH_LINK`,{id:n,text:i||Tm(e)},{child:e}),J(e,`word`)!==null&&!Om(e)&&t.report(`WORD_SEARCH_CLUE_EMPTY`,{id:n,word:s},{child:e}),s===``?t.report(`WORD_SEARCH_WORD_EMPTY`,{id:n,word:Tm(e)},{child:e}):c.every(e=>wm.test(e))?c.length<2||c.length>r?t.report(`WORD_SEARCH_WORD_LENGTH`,{id:n,word:s,max:r},{child:e}):o.has(c.join(``))?t.report(`WORD_SEARCH_WORD_DUPLICATE`,{id:n,word:s},{child:e}):(o.add(c.join(``)),a.push({letters:c,written:s,child:e})):t.report(`WORD_SEARCH_WORD_LETTERS`,{id:n,word:s},{child:e})}let s=!1;for(let[e,r]of a.entries()){let i=r.letters.join(``),o=a.find((t,n)=>t!==r&&(t.letters.length>r.letters.length||n<e)&&(t.letters.join(``).includes(i)||Am(t.letters).includes(i)));o!==void 0&&(t.report(`WORD_SEARCH_WORD_INSIDE`,{id:n,word:r.written,other:o.written},{child:r.child}),s=!0)}a.length===i.length&&!s&&Vm(e,t.lang)===null&&t.report(`WORD_SEARCH_NO_FIT`,{id:n,size:Nm(e,t.lang).size});for(let r of X(e,`astl-prompt`))Z(r).trim()===``&&t.report(`WORD_SEARCH_PROMPT_EMPTY`,{id:n},{severity:`warning`,child:r})}function Wm(e,t){let{spans:n}=Hm(e,t);return X(e,`astl-search-word`).map((e,r)=>{let[i,a]=n[r];return{id:t.opaque(Tm(e)),kind:`text`,key:{accept:[Xt(i,a),Xt(a,i)],profile:{...t.profile},lang:t.lang}}})}function Gm(e,t){let{rows:n}=Hm(e,t),r=$(e,Yt,t),i=X(e,`astl-search-word`),a=0,o=r.children.map(e=>{if(!T(e,`astl-search-word`))return e;let n=i[a++];return J(n,`word`)===null?{...e,children:[ve(Mm(km(n),t.lang).join(``))]}:{...e,attrs:{...e.attrs,clue:``}}});return{...r,attrs:{...r.attrs,grid:n.map(e=>e.join(``)).join(` `)},children:o}}var Km=[Dd,Au,kp,zp,_p,vu,Hf,fm,sd,{manifest:Yt,messages:gm,validate:Um,slots:Wm,toView:Gm},ip,Xu,hd,bf,Of,au,Bd,ef,pf,tm,eu];export{q as A,Ts as B,zl as C,Ol as D,El as E,Bs as F,$t as G,qo as H,Gs as I,un as J,ln as K,Ls as L,Gc as M,Rs as N,wl as O,Hs as P,Fs as R,Xl as S,Tl as T,ls as U,ks as V,mn as W,cn as Y,ed as _,Np as a,lu as b,Kf as c,_f as d,af as f,dd as g,yd as h,Up as i,hl as j,Cl as k,Mf as l,jd as m,gm as n,xp as o,Wd as p,an as q,am as r,cp as s,Km as t,wf as u,Pu as v,Rl as w,iu as x,Su as y,Os as z};
|
|
6
|
+
//# sourceMappingURL=definitions-CNX90WtL.js.map
|