@cimulate/copilot-widget 1.54.1 → 1.54.2

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.
@@ -34,7 +34,7 @@ Error generating stack: `+x.message+`
34
34
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
35
35
  `}),n}function Yb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Gb(e,t){const n=e6(e,t),r=n.one(e,void 0),i=V4(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
36
36
  `},i),s}function o6(e,t){return e&&"run"in e?function(n,r){return Oe(this,null,function*(){const i=Gb(n,U({file:r},t));yield e.run(i,r)})}:function(n,r){return Gb(n,U({file:r},e||t))}}function Xb(e){if(e)throw e}var uh,Kb;function s6(){if(Kb)return uh;Kb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!m)return!1;var E;for(E in f);return typeof E=="undefined"||e.call(f,E)},u=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},c=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(r)return r(f,h).value}else return;return f[h]};return uh=function d(){var f,h,m,E,b,T,v=arguments[0],I=1,_=arguments.length,N=!1;for(typeof v=="boolean"&&(N=v,v=arguments[1]||{},I=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});I<_;++I)if(f=arguments[I],f!=null)for(h in f)m=c(v,h),E=c(f,h),v!==E&&(N&&E&&(s(E)||(b=i(E)))?(b?(b=!1,T=m&&i(m)?m:[]):T=m&&s(m)?m:{},u(v,{name:h,newValue:d(N,T,E)})):typeof E!="undefined"&&u(v,{name:h,newValue:E}));return v},uh}var a6=s6();const ch=ft(a6);function lh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function u6(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const u=i.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...i);function c(d,...f){const h=e[++s];let m=-1;if(d){u(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,h?c6(h,c)(...f):u(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function c6(e,t){let n;return r;function r(...u){const c=e.length>u.length;let d;c&&u.push(i);try{d=e.apply(this,u)}catch(f){const h=f;if(c&&n)throw h;return i(h)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,i):d instanceof Error?i(d):s(d))}function i(u,...c){n||(n=!0,t(u,...c))}function s(u){i(null,u)}}const Gr={basename:l6,dirname:d6,extname:f6,join:p6,sep:"/"};function l6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');au(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else u<0&&(s=!0,u=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function d6(e){if(au(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function f6(e){au(e);let t=e.length,n=-1,r=0,i=-1,s=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),c===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function p6(...e){let t=-1,n;for(;++t<e.length;)au(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":h6(n)}function h6(e){au(e);const t=e.codePointAt(0)===47;let n=m6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function m6(e,t){let n="",r=0,i=-1,s=0,u=-1,c,d;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(i===u-1||s===1))if(i!==u-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=u,s=0;continue}}else if(n.length>0){n="",r=0,i=u,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,u):n=e.slice(i+1,u),r=u-i-1;i=u,s=0}else c===46&&s>-1?s++:s=-1}return n}function au(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const g6={cwd:y6};function y6(){return"/"}function dh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function E6(e){if(typeof e=="string")e=new URL(e);else if(!dh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return b6(e)}function b6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const fh=["history","path","basename","stem","extname","dirname"];class Qb{constructor(t){let n;t?dh(t)?n={path:t}:typeof t=="string"||w6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":g6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<fh.length;){const s=fh[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)fh.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){hh(t,"basename"),ph(t,"basename"),this.path=Gr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gr.dirname(this.path):void 0}set dirname(t){Jb(this.basename,"dirname"),this.path=Gr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gr.extname(this.path):void 0}set extname(t){if(ph(t,"extname"),Jb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dh(t)&&(t=E6(t)),hh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gr.basename(this.path,this.extname):void 0}set stem(t){hh(t,"stem"),ph(t,"stem"),this.path=Gr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Tn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ph(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function hh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Jb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function w6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const x6=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),T6={}.hasOwnProperty;class mh extends x6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=u6()}copy(){const t=new mh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ch(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Eh("data",this.frozen),this.namespace[t]=n,this):T6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Eh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=El(t),r=this.parser||this.Parser;return gh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),gh("process",this.parser||this.Parser),yh("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,u){const c=El(t),d=r.parse(c);r.run(d,c,function(h,m,E){if(h||!m||!E)return f(h);const b=m,T=r.stringify(b,E);S6(T)?E.value=T:E.result=T,f(h,E)});function f(h,m){h||!m?u(h):s?s(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),gh("processSync",this.parser||this.Parser),yh("processSync",this.compiler||this.Compiler),this.process(t,i),ew("processSync","process",n),r;function i(s,u){n=!0,Xb(s),r=u}}run(t,n,r){Zb(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(u,c){const d=El(n);i.run(t,d,f);function f(h,m,E){const b=m||t;h?c(h):u?u(b):r(void 0,b,E)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),ew("runSync","run",r),i;function s(u,c){Xb(u),i=c,r=!0}}stringify(t,n){this.freeze();const r=El(n),i=this.compiler||this.Compiler;return yh("stringify",i),Zb(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Eh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...m]=f;d(h,m)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=ch(!0,i.settings,f.settings))}function c(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const m=f[h];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,h){let m=-1,E=-1;for(;++m<r.length;)if(r[m][0]===f){E=m;break}if(E===-1)r.push([f,...h]);else if(h.length>0){let[b,...T]=h;const v=r[E][1];lh(v)&&lh(b)&&(b=ch(!0,v,b)),r[E]=[f,b,...T]}}}}const _6=new mh().freeze();function gh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Eh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zb(e){if(!lh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ew(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function El(e){return v6(e)?e:new Qb(e)}function v6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function S6(e){return typeof e=="string"||A6(e)}function A6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const k6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",tw=[],nw={allowDangerousHtml:!0},C6=/^(https?|ircs?|mailto|xmpp)$/i,N6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rw(e){const t=I6(e),n=O6(e);return P6(t.runSync(t.parse(n),n),e)}function I6(e){const t=e.rehypePlugins||tw,n=e.remarkPlugins||tw,r=e.remarkRehypeOptions?U(U({},e.remarkRehypeOptions),nw):nw;return _6().use(c4).use(n).use(o6,r).use(t)}function O6(e){const t=e.children||"",n=new Qb;return typeof t=="string"&&(n.value=t),n}function P6(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||iw;for(const h of N6)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+k6+h.id,void 0);return yl(e,f),tP(e,{Fragment:w.Fragment,components:i,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function f(h,m,E){if(h.type==="raw"&&E&&typeof m=="number")return u?E.children.splice(m,1):E.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let b;for(b in Gp)if(Object.hasOwn(Gp,b)&&Object.hasOwn(h.properties,b)){const T=h.properties[b],v=Gp[b];(v===null||v.includes(h.tagName))&&(h.properties[b]=d(String(T||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(h,m,E)),b&&E&&typeof m=="number")return c&&h.children?E.children.splice(m,1,...h.children):E.children.splice(m,1),m}}}function iw(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||C6.test(e.slice(0,t))?e:""}const ow=/[#.]/g;function R6(e,t){const n=e||"",r={};let i=0,s,u;for(;i<n.length;){ow.lastIndex=i;const c=ow.exec(n),d=n.slice(i,c?c.index:n.length);d&&(s?s==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:u=d,i+=d.length),c&&(s=c[0],i++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function sw(e,t,n){const r=n?F6(n):void 0;function i(s,u,...c){let d;if(s==null){d={type:"root",children:[]};const f=u;c.unshift(f)}else{d=R6(s,t);const f=d.tagName.toLowerCase(),h=r?r.get(f):void 0;if(d.tagName=h||f,L6(u))c.unshift(u);else for(const[m,E]of Object.entries(u))D6(e,d.properties,m,E)}for(const f of c)bh(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function L6(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const u of s)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function D6(e,t,n,r){const i=ol(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=GE(r):i.commaSeparated?s=DE(r):i.commaOrSpaceSeparated?s=GE(DE(r).join(" ")):s=aw(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?M6(r):String(r);if(Array.isArray(s)){const u=[];for(const c of s)u.push(aw(i,i.property,c));s=u}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function bh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)bh(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?bh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function aw(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Ka(n)===Ka(t)))return!0}return n}function M6(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function F6(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const B6=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],U6=sw(Qa,"div"),j6=sw(Ri,"g",B6);function H6(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let u=0;for(;;){let c=n[u];if(c===void 0){const d=uw(t,n[u-1]);c=d===-1?t.length+1:d+1,n[u]=c}if(c>s)return{line:u+1,column:s-(u>0?n[u-1]:0)+1,offset:s};u++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const c=n[n.length-1],d=uw(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const u=(s.line>1?n[s.line-2]:0)+s.column-1;if(u<n[s.line-1])return u}}}function uw(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
37
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Po={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cw={}.hasOwnProperty,$6=Object.prototype;function z6(e,t){const n=t||{};return wh({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ri:Qa,verbose:n.verbose||!1},e)}function wh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},bl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:lw(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),u=H6(s),c=u.toPoint(0),d=u.toPoint(s.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},bl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},bl(e,r,n),n}default:return n=V6(e,t),n}}function lw(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=wh(e,t[n]);r.push(i)}return r}function V6(e,t){const n=e.schema;e.schema=t.namespaceURI===Po.svg?Ri:Qa;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;cw.call($6,d)||(i[d]=c.value)}const u=(e.schema.space==="svg"?j6:U6)(t.tagName,i,lw(e,t.childNodes));if(bl(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Cs(d.startTag),h=d&&d.endTag&&Cs(d.endTag),m=wh(e,c.content);f&&h&&e.file&&(m.position={start:f.end,end:h.start}),u.content=m}return e.schema=n,u}function bl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=q6(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function q6(e,t,n){const r=Cs(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let u;if(n.attrs)for(u in n.attrs)cw.call(n.attrs,u)&&(s[ol(e.schema,u).property]=Cs(n.attrs[u]));n.startTag;const c=Cs(n.startTag),d=n.endTag?Cs(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=s,t.data={position:f}}}return r}function Cs(e){const t=dw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=dw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function dw(e){return e.line&&e.column?e:void 0}const fw={}.hasOwnProperty;function pw(e,t){const n=t||{};function r(i,...s){let u=r.invalid;const c=r.handlers;if(i&&fw.call(i,e)){const d=String(i[e]);u=fw.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const W6={},Y6={}.hasOwnProperty,hw=pw("type",{handlers:{root:X6,element:e5,text:J6,comment:Z6,doctype:Q6}});function G6(e,t){const r=(t||W6).space;return hw(e,r==="svg"?Ri:Qa)}function X6(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=xh(e.children,n,t),Ns(e,n),n}function K6(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=xh(e.children,n,t),Ns(e,n),n}function Q6(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ns(e,t),t}function J6(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ns(e,t),t}function Z6(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ns(e,t),t}function e5(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ri);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&Y6.call(e.properties,s)){const d=t5(r,s,e.properties[s]);d&&i.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Po[u],childNodes:[],parentNode:null};return c.childNodes=xh(e.children,c,r),Ns(e,c),e.tagName==="template"&&e.content&&(c.content=K6(e.content,r)),c}function t5(e,t,n){const r=ol(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ME(n):XE(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=Po[r.space]}return i}function xh(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=hw(e[r],n);s.parentNode=t,i.push(s)}return i}function Ns(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const n5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],r5=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]),Bt="�";var L;(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"})(L||(L={}));const $n={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function mw(e){return e>=55296&&e<=57343}function i5(e){return e>=56320&&e<=57343}function o5(e,t){return(e-55296)*1024+9216+t}function gw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function yw(e){return e>=64976&&e<=65007||r5.has(e)}var le;(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"})(le||(le={}));const s5=65536;class a5{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=s5,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,u=i+n,c=s+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(i5(n))return this.pos++,this._addGap(),o5(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,L.EOF;return this._err(le.surrogateInInputStream),t}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(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;const r=this.html.charCodeAt(n);return r===L.CARRIAGE_RETURN?L.LINE_FEED:r}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,L.EOF;let t=this.html.charCodeAt(this.pos);return t===L.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,L.LINE_FEED):t===L.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,mw(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===L.LINE_FEED||t===L.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gw(t)?this._err(le.controlCharacterInInputStream):yw(t)&&this._err(le.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var dt;(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"})(dt||(dt={}));function Ew(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}const u5=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),c5=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function l5(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=c5.get(e))!==null&&t!==void 0?t:e}var an;(function(e){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_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(an||(an={}));const d5=32;var Mi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Mi||(Mi={}));function Th(e){return e>=an.ZERO&&e<=an.NINE}function f5(e){return e>=an.UPPER_A&&e<=an.UPPER_F||e>=an.LOWER_A&&e<=an.LOWER_F}function p5(e){return e>=an.UPPER_A&&e<=an.UPPER_Z||e>=an.LOWER_A&&e<=an.LOWER_Z||Th(e)}function h5(e){return e===an.EQUALS||p5(e)}var un;(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"})(un||(un={}));var fi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fi||(fi={}));class m5{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=un.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fi.Strict}startEntity(t){this.decodeMode=t,this.state=un.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case un.EntityStart:return t.charCodeAt(n)===an.NUM?(this.state=un.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=un.NamedEntity,this.stateNamedEntity(t,n));case un.NumericStart:return this.stateNumericStart(t,n);case un.NumericDecimal:return this.stateNumericDecimal(t,n);case un.NumericHex:return this.stateNumericHex(t,n);case un.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|d5)===an.LOWER_X?(this.state=un.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=un.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Th(i)||f5(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Th(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===an.SEMI)this.consumed+=1;else if(this.decodeMode===fi.Strict)return 0;return this.emitCodePoint(l5(this.result),this.consumed),this.errors&&(t!==an.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Mi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=g5(r,i,this.treeIndex+Math.max(1,s),u),this.treeIndex<0)return this.result===0||this.decodeMode===fi.Attribute&&(s===0||h5(u))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Mi.VALUE_LENGTH)>>14,s!==0){if(u===an.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==fi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Mi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Mi.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case un.NamedEntity:return this.result!==0&&(this.decodeMode!==fi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case un.NumericDecimal:return this.emitNumericEntity(0,2);case un.NumericHex:return this.emitNumericEntity(0,3);case un.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case un.EntityStart:return 0}}}function g5(e,t,n,r){const i=(t&Mi.BRANCH_LENGTH)>>7,s=t&Mi.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const d=r-s;return d<0||d>=i?-1:e[n+d]-1}let u=n,c=u+i-1;for(;u<=c;){const d=u+c>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)c=d-1;else return e[d+i]}return-1}var Ee;(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/"})(Ee||(Ee={}));var Ro;(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"})(Ro||(Ro={}));var fr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(fr||(fr={}));var ne;(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"})(ne||(ne={}));var g;(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"})(g||(g={}));const y5=new Map([[ne.A,g.A],[ne.ADDRESS,g.ADDRESS],[ne.ANNOTATION_XML,g.ANNOTATION_XML],[ne.APPLET,g.APPLET],[ne.AREA,g.AREA],[ne.ARTICLE,g.ARTICLE],[ne.ASIDE,g.ASIDE],[ne.B,g.B],[ne.BASE,g.BASE],[ne.BASEFONT,g.BASEFONT],[ne.BGSOUND,g.BGSOUND],[ne.BIG,g.BIG],[ne.BLOCKQUOTE,g.BLOCKQUOTE],[ne.BODY,g.BODY],[ne.BR,g.BR],[ne.BUTTON,g.BUTTON],[ne.CAPTION,g.CAPTION],[ne.CENTER,g.CENTER],[ne.CODE,g.CODE],[ne.COL,g.COL],[ne.COLGROUP,g.COLGROUP],[ne.DD,g.DD],[ne.DESC,g.DESC],[ne.DETAILS,g.DETAILS],[ne.DIALOG,g.DIALOG],[ne.DIR,g.DIR],[ne.DIV,g.DIV],[ne.DL,g.DL],[ne.DT,g.DT],[ne.EM,g.EM],[ne.EMBED,g.EMBED],[ne.FIELDSET,g.FIELDSET],[ne.FIGCAPTION,g.FIGCAPTION],[ne.FIGURE,g.FIGURE],[ne.FONT,g.FONT],[ne.FOOTER,g.FOOTER],[ne.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[ne.FORM,g.FORM],[ne.FRAME,g.FRAME],[ne.FRAMESET,g.FRAMESET],[ne.H1,g.H1],[ne.H2,g.H2],[ne.H3,g.H3],[ne.H4,g.H4],[ne.H5,g.H5],[ne.H6,g.H6],[ne.HEAD,g.HEAD],[ne.HEADER,g.HEADER],[ne.HGROUP,g.HGROUP],[ne.HR,g.HR],[ne.HTML,g.HTML],[ne.I,g.I],[ne.IMG,g.IMG],[ne.IMAGE,g.IMAGE],[ne.INPUT,g.INPUT],[ne.IFRAME,g.IFRAME],[ne.KEYGEN,g.KEYGEN],[ne.LABEL,g.LABEL],[ne.LI,g.LI],[ne.LINK,g.LINK],[ne.LISTING,g.LISTING],[ne.MAIN,g.MAIN],[ne.MALIGNMARK,g.MALIGNMARK],[ne.MARQUEE,g.MARQUEE],[ne.MATH,g.MATH],[ne.MENU,g.MENU],[ne.META,g.META],[ne.MGLYPH,g.MGLYPH],[ne.MI,g.MI],[ne.MO,g.MO],[ne.MN,g.MN],[ne.MS,g.MS],[ne.MTEXT,g.MTEXT],[ne.NAV,g.NAV],[ne.NOBR,g.NOBR],[ne.NOFRAMES,g.NOFRAMES],[ne.NOEMBED,g.NOEMBED],[ne.NOSCRIPT,g.NOSCRIPT],[ne.OBJECT,g.OBJECT],[ne.OL,g.OL],[ne.OPTGROUP,g.OPTGROUP],[ne.OPTION,g.OPTION],[ne.P,g.P],[ne.PARAM,g.PARAM],[ne.PLAINTEXT,g.PLAINTEXT],[ne.PRE,g.PRE],[ne.RB,g.RB],[ne.RP,g.RP],[ne.RT,g.RT],[ne.RTC,g.RTC],[ne.RUBY,g.RUBY],[ne.S,g.S],[ne.SCRIPT,g.SCRIPT],[ne.SEARCH,g.SEARCH],[ne.SECTION,g.SECTION],[ne.SELECT,g.SELECT],[ne.SOURCE,g.SOURCE],[ne.SMALL,g.SMALL],[ne.SPAN,g.SPAN],[ne.STRIKE,g.STRIKE],[ne.STRONG,g.STRONG],[ne.STYLE,g.STYLE],[ne.SUB,g.SUB],[ne.SUMMARY,g.SUMMARY],[ne.SUP,g.SUP],[ne.TABLE,g.TABLE],[ne.TBODY,g.TBODY],[ne.TEMPLATE,g.TEMPLATE],[ne.TEXTAREA,g.TEXTAREA],[ne.TFOOT,g.TFOOT],[ne.TD,g.TD],[ne.TH,g.TH],[ne.THEAD,g.THEAD],[ne.TITLE,g.TITLE],[ne.TR,g.TR],[ne.TRACK,g.TRACK],[ne.TT,g.TT],[ne.U,g.U],[ne.UL,g.UL],[ne.SVG,g.SVG],[ne.VAR,g.VAR],[ne.WBR,g.WBR],[ne.XMP,g.XMP]]);function Is(e){var t;return(t=y5.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const xe=g,E5={[Ee.HTML]:new Set([xe.ADDRESS,xe.APPLET,xe.AREA,xe.ARTICLE,xe.ASIDE,xe.BASE,xe.BASEFONT,xe.BGSOUND,xe.BLOCKQUOTE,xe.BODY,xe.BR,xe.BUTTON,xe.CAPTION,xe.CENTER,xe.COL,xe.COLGROUP,xe.DD,xe.DETAILS,xe.DIR,xe.DIV,xe.DL,xe.DT,xe.EMBED,xe.FIELDSET,xe.FIGCAPTION,xe.FIGURE,xe.FOOTER,xe.FORM,xe.FRAME,xe.FRAMESET,xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6,xe.HEAD,xe.HEADER,xe.HGROUP,xe.HR,xe.HTML,xe.IFRAME,xe.IMG,xe.INPUT,xe.LI,xe.LINK,xe.LISTING,xe.MAIN,xe.MARQUEE,xe.MENU,xe.META,xe.NAV,xe.NOEMBED,xe.NOFRAMES,xe.NOSCRIPT,xe.OBJECT,xe.OL,xe.P,xe.PARAM,xe.PLAINTEXT,xe.PRE,xe.SCRIPT,xe.SECTION,xe.SELECT,xe.SOURCE,xe.STYLE,xe.SUMMARY,xe.TABLE,xe.TBODY,xe.TD,xe.TEMPLATE,xe.TEXTAREA,xe.TFOOT,xe.TH,xe.THEAD,xe.TITLE,xe.TR,xe.TRACK,xe.UL,xe.WBR,xe.XMP]),[Ee.MATHML]:new Set([xe.MI,xe.MO,xe.MN,xe.MS,xe.MTEXT,xe.ANNOTATION_XML]),[Ee.SVG]:new Set([xe.TITLE,xe.FOREIGN_OBJECT,xe.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set},_h=new Set([xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var j;(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"})(j||(j={}));const Gt={DATA:j.DATA,RCDATA:j.RCDATA,RAWTEXT:j.RAWTEXT,SCRIPT_DATA:j.SCRIPT_DATA,PLAINTEXT:j.PLAINTEXT,CDATA_SECTION:j.CDATA_SECTION};function b5(e){return e>=L.DIGIT_0&&e<=L.DIGIT_9}function uu(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_Z}function w5(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_Z}function Fi(e){return w5(e)||uu(e)}function bw(e){return Fi(e)||b5(e)}function wl(e){return e+32}function ww(e){return e===L.SPACE||e===L.LINE_FEED||e===L.TABULATION||e===L.FORM_FEED}function xw(e){return ww(e)||e===L.SOLIDUS||e===L.GREATER_THAN_SIGN}function x5(e){return e===L.NULL?le.nullCharacterReference:e>1114111?le.characterReferenceOutsideUnicodeRange:mw(e)?le.surrogateCharacterReference:yw(e)?le.noncharacterCharacterReference:gw(e)||e===L.CARRIAGE_RETURN?le.controlCharacterReference:null}class T5{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=j.DATA,this.returnState=j.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new a5(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new m5(u5,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(le.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(le.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=x5(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),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(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:dt.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:dt.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:dt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:dt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Ew(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(le.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Is(t.tagName),t.type===dt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(le.endTagWithAttributes),t.selfClosing&&this._err(le.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case dt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case dt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case dt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:dt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=ww(t)?dt.WHITESPACE_CHARACTER:t===L.NULL?dt.NULL_CHARACTER:dt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(dt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=j.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fi.Attribute:fi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===j.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case j.DATA:{this._stateData(t);break}case j.RCDATA:{this._stateRcdata(t);break}case j.RAWTEXT:{this._stateRawtext(t);break}case j.SCRIPT_DATA:{this._stateScriptData(t);break}case j.PLAINTEXT:{this._statePlaintext(t);break}case j.TAG_OPEN:{this._stateTagOpen(t);break}case j.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case j.TAG_NAME:{this._stateTagName(t);break}case j.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case j.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case j.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case j.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case j.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case j.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case j.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case j.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case j.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case j.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case j.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case j.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case j.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case j.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case j.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case j.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case j.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case j.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case j.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case j.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case j.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case j.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case j.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case j.BOGUS_COMMENT:{this._stateBogusComment(t);break}case j.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case j.COMMENT_START:{this._stateCommentStart(t);break}case j.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case j.COMMENT:{this._stateComment(t);break}case j.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case j.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case j.COMMENT_END:{this._stateCommentEnd(t);break}case j.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case j.DOCTYPE:{this._stateDoctype(t);break}case j.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case j.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case j.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case j.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case j.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case j.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case j.CDATA_SECTION:{this._stateCdataSection(t);break}case j.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case j.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case j.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case j.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.TAG_OPEN;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitCodePoint(t);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case L.AMPERSAND:{this._startCharacterReference();break}case L.LESS_THAN_SIGN:{this.state=j.RCDATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.RAWTEXT_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Fi(t))this._createStartTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case L.EXCLAMATION_MARK:{this.state=j.MARKUP_DECLARATION_OPEN;break}case L.SOLIDUS:{this.state=j.END_TAG_OPEN;break}case L.QUESTION_MARK:{this._err(le.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t);break}case L.EOF:{this._err(le.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=j.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Fi(t))this._createEndTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case L.GREATER_THAN_SIGN:{this._err(le.missingEndTagName),this.state=j.DATA;break}case L.EOF:{this._err(le.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.tagName+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateRcdataLessThanSign(t){t===L.SOLIDUS?this.state=j.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Fi(t)?(this.state=j.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=j.BEFORE_ATTRIBUTE_NAME,!1;case L.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=j.SELF_CLOSING_START_TAG,!1;case L.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=j.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===L.SOLIDUS?this.state=j.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Fi(t)?(this.state=j.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case L.SOLIDUS:{this.state=j.SCRIPT_DATA_END_TAG_OPEN;break}case L.EXCLAMATION_MARK:{this.state=j.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=j.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Fi(t)?(this.state=j.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===L.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===L.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===L.SOLIDUS?this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Fi(t)?(this._emitChars("<"),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Fi(t)?(this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith($n.SCRIPT,!1)&&xw(this.preprocessor.peek($n.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$n.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===L.SOLIDUS?(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith($n.SCRIPT,!1)&&xw(this.preprocessor.peek($n.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$n.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._err(le.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this._leaveAttrName(),this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._leaveAttrName(),this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:{this._err(le.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.name+=Bt;break}default:this.currentAttr.name+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateAfterAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case L.EQUALS_SIGN:{this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{this.state=j.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this.state=j.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingAttributeValue),this.state=j.DATA,this.emitCurrentTagToken();break}default:this.state=j.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case L.APOSTROPHE:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:case L.EQUALS_SIGN:case L.GRAVE_ACCENT:{this._err(le.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this._leaveAttrValue(),this.state=j.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBetweenAttributes),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case L.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.unexpectedSolidusInTag),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Bt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch($n.DASH_DASH,!0)?(this._createCommentToken($n.DASH_DASH.length+1),this.state=j.COMMENT_START):this._consumeSequenceIfMatch($n.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation($n.DOCTYPE.length+1),this.state=j.DOCTYPE):this._consumeSequenceIfMatch($n.CDATA_START,!0)?this.inForeignNode?this.state=j.CDATA_SECTION:(this._err(le.cdataInHtmlContent),this._createCommentToken($n.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=j.BOGUS_COMMENT):this._ensureHibernation()||(this._err(le.incorrectlyOpenedComment),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_START_DASH;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=j.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END_DASH;break}case L.LESS_THAN_SIGN:{n.data+="<",this.state=j.COMMENT_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Bt;break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case L.EXCLAMATION_MARK:{n.data+="!",this.state=j.COMMENT_LESS_THAN_SIGN_BANG;break}case L.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===L.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=j.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===L.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=j.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==L.GREATER_THAN_SIGN&&t!==L.EOF&&this._err(le.nestedComment),this.state=j.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case L.EXCLAMATION_MARK:{this.state=j.COMMENT_END_BANG;break}case L.HYPHEN_MINUS:{n.data+="-";break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{n.data+="--!",this.state=j.COMMENT_END_DASH;break}case L.GREATER_THAN_SIGN:{this._err(le.incorrectlyClosedComment),this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=j.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case L.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBeforeDoctypeName),this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(uu(t))this._createDoctypeToken(String.fromCharCode(wl(t))),this.state=j.DOCTYPE_NAME;else switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.NULL:{this._err(le.unexpectedNullCharacter),this._createDoctypeToken(Bt),this.state=j.DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=j.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.AFTER_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.name+=Bt;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch($n.PUBLIC,!1)?this.state=j.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch($n.SYSTEM,!1)?this.state=j.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(le.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.QUOTATION_MARK:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.NULL:{this._err(le.unexpectedNullCharacter);break}case L.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case L.RIGHT_SQUARE_BRACKET:{this.state=j.CDATA_SECTION_BRACKET;break}case L.EOF:{this._err(le.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===L.RIGHT_SQUARE_BRACKET?this.state=j.CDATA_SECTION_END:(this._emitChars("]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA;break}case L.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&bw(this.preprocessor.peek(1))?j.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){bw(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===L.SEMICOLON&&this._err(le.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Tw=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),_w=new Set([...Tw,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),xl=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),_5=new Set([...xl,g.OL,g.UL]),v5=new Set([...xl,g.BUTTON]),vw=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Sw=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),S5=new Set([g.TR,g.TEMPLATE,g.HTML]),A5=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),k5=new Set([g.TABLE,g.TEMPLATE,g.HTML]),C5=new Set([g.TD,g.TH]);class N5{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ee.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(_h,Ee.HTML)}popUntilTableCellPopped(){this.popUntilPopped(C5,Ee.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(k5,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo(A5,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(S5,Ee.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ee.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Ee.SVG:{if(Sw.has(i))return!1;break}case Ee.MATHML:{if(vw.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,xl)}hasInListItemScope(t){return this.hasInDynamicScope(t,_5)}hasInButtonScope(t){return this.hasInDynamicScope(t,v5)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ee.HTML:{if(_h.has(n))return!0;if(xl.has(n))return!1;break}case Ee.SVG:{if(Sw.has(n))return!1;break}case Ee.MATHML:{if(vw.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Tw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&_w.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&_w.has(this.currentTagId);)this.pop()}}const vh=3;var Xr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Xr||(Xr={}));const Aw={type:Xr.Marker};class I5{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Xr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===s&&this.treeAdapter.getNamespaceURI(f)===u){const h=this.treeAdapter.getAttrList(f);h.length===i&&r.push({idx:c,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<vh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<vh)return;const i=new Map(n.map(u=>[u.name,u.value]));let s=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>i.get(d.name)===d.value)&&(s+=1,s>=vh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Aw)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Xr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Xr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Aw);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Xr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Xr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Xr.Element&&n.element===t)}}const Bi={createDocument(){return{nodeName:"#document",mode:fr.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){const 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){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Bi.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Bi.isTextNode(n)){n.value+=t;return}}Bi.appendChild(e,Bi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Bi.isTextNode(r)?r.value+=t:Bi.insertBefore(e,Bi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.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=U(U({},e.sourceCodeLocation),t)}},kw="html",O5="about:legacy-compat",P5="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Cw=["+//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//"],R5=[...Cw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],L5=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Nw=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],D5=[...Nw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Iw(e,t){return t.some(n=>e.startsWith(n))}function M5(e){return e.name===kw&&e.publicId===null&&(e.systemId===null||e.systemId===O5)}function F5(e){if(e.name!==kw)return fr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===P5)return fr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),L5.has(n))return fr.QUIRKS;let r=t===null?R5:Cw;if(Iw(n,r))return fr.QUIRKS;if(r=t===null?Nw:D5,Iw(n,r))return fr.LIMITED_QUIRKS}return fr.NO_QUIRKS}const Ow={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},B5="definitionurl",U5="definitionURL",j5=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"].map(e=>[e.toLowerCase(),e])),H5=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),$5=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"].map(e=>[e.toLowerCase(),e])),z5=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function V5(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===Ro.COLOR||r===Ro.SIZE||r===Ro.FACE)||z5.has(t)}function Pw(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===B5){e.attrs[t].name=U5;break}}function Rw(e){for(let t=0;t<e.attrs.length;t++){const n=j5.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Sh(e){for(let t=0;t<e.attrs.length;t++){const n=H5.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 q5(e){const t=$5.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Is(e.tagName))}function W5(e,t){return t===Ee.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function Y5(e,t,n){if(t===Ee.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ro.ENCODING){const i=n[r].value.toLowerCase();return i===Ow.TEXT_HTML||i===Ow.APPLICATION_XML}}return t===Ee.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function G5(e,t,n,r){return(!r||r===Ee.HTML)&&Y5(e,t,n)||(!r||r===Ee.MATHML)&&W5(e,t)}const X5="hidden",K5=8,Q5=3;var z;(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"})(z||(z={}));const J5={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Lw=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Dw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Bi,onParseError:null};class Mw{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=z.INITIAL,this.originalInsertionMode=z.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=U(U({},Dw),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new T5(this.options,this),this.activeFormattingElements=new I5(this.treeAdapter),this.fragmentContextID=r?Is(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new N5(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=U(U({},Dw),n);t!=null||(t=r.treeAdapter.createElement(ne.TEMPLATE,Ee.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ee.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===g.TEMPLATE&&s.tmplInsertionModeStack.unshift(z.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:J5,u={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(u)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,u;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,u=this.fragmentContextID):{current:s,currentTagId:u}=this.openElements,this._setContextModes(s,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ee.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=Gt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Gt.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Gt.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Gt.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Gt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&ue(U({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,u=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===dt.END_TAG&&i===n.tagName?{endTag:U({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ee.HTML)}_processToken(t){switch(t.type){case dt.CHARACTER:{this.onCharacter(t);break}case dt.NULL_CHARACTER:{this.onNullCharacter(t);break}case dt.COMMENT:{this.onComment(t);break}case dt.DOCTYPE:{this.onDoctype(t);break}case dt.START_TAG:{this._processStartTag(t);break}case dt.END_TAG:{this.onEndTag(t);break}case dt.EOF:{this.onEof(t);break}case dt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return G5(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Xr.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=z.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=z.IN_TABLE;return}case g.BODY:{this.insertionMode=z.IN_BODY;return}case g.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return Lw.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return E5[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CD(this,t);return}switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{Bw(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_TABLE_TEXT:{Ww(this,t);break}case z.IN_COLUMN_GROUP:{vl(this,t);break}case z.AFTER_BODY:{kl(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kD(this,t);return}switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_COLUMN_GROUP:{vl(this,t);break}case z.AFTER_BODY:{kl(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){kh(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{kh(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.AFTER_BODY:{oL(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{sL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{aL(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,le.misplacedDoctype);break}case z.IN_TABLE_TEXT:{yu(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,le.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?ND(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{uL(this,t);break}case z.BEFORE_HEAD:{lL(this,t);break}case z.IN_HEAD:{kr(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pL(this,t);break}case z.AFTER_HEAD:{mL(this,t);break}case z.IN_BODY:{vn(this,t);break}case z.IN_TABLE:{Os(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_CAPTION:{dD(this,t);break}case z.IN_COLUMN_GROUP:{Ih(this,t);break}case z.IN_TABLE_BODY:{Sl(this,t);break}case z.IN_ROW:{Al(this,t);break}case z.IN_CELL:{hD(this,t);break}case z.IN_SELECT:{Xw(this,t);break}case z.IN_SELECT_IN_TABLE:{gD(this,t);break}case z.IN_TEMPLATE:{ED(this,t);break}case z.AFTER_BODY:{wD(this,t);break}case z.IN_FRAMESET:{xD(this,t);break}case z.AFTER_FRAMESET:{_D(this,t);break}case z.AFTER_AFTER_BODY:{SD(this,t);break}case z.AFTER_AFTER_FRAMESET:{AD(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?ID(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{cL(this,t);break}case z.BEFORE_HEAD:{dL(this,t);break}case z.IN_HEAD:{fL(this,t);break}case z.IN_HEAD_NO_SCRIPT:{hL(this,t);break}case z.AFTER_HEAD:{gL(this,t);break}case z.IN_BODY:{_l(this,t);break}case z.TEXT:{tD(this,t);break}case z.IN_TABLE:{mu(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_CAPTION:{fD(this,t);break}case z.IN_COLUMN_GROUP:{pD(this,t);break}case z.IN_TABLE_BODY:{Oh(this,t);break}case z.IN_ROW:{Gw(this,t);break}case z.IN_CELL:{mD(this,t);break}case z.IN_SELECT:{Kw(this,t);break}case z.IN_SELECT_IN_TABLE:{yD(this,t);break}case z.IN_TEMPLATE:{bD(this,t);break}case z.AFTER_BODY:{Jw(this,t);break}case z.IN_FRAMESET:{TD(this,t);break}case z.AFTER_FRAMESET:{vD(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{Vw(this,t);break}case z.TEXT:{nD(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_TEMPLATE:{Qw(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{Ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===L.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{Fw(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_TABLE_TEXT:{qw(this,t);break}}}}function Z5(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):zw(e,t),n}function eL(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const 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 tL(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,u=i;u!==n;s++,u=i){i=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&s>=Q5;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=nL(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function nL(e,t){const 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 rL(e,t,n){const r=e.treeAdapter.getTagName(t),i=Is(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===g.TEMPLATE&&s===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function iL(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Ah(e,t){for(let n=0;n<K5;n++){const r=Z5(e,t);if(!r)break;const i=eL(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=tL(e,i,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),u&&rL(e,u,s),iL(e,i,r)}}function kh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function oL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function sL(e,t){e._appendCommentNode(t,e.document)}function Ch(e,t){if(e.stopped=!0,t.location){const 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){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(s);u&&!u.endTag&&e._setEndLocation(s,t)}}}}function aL(e,t){e._setDocumentType(t);const n=t.forceQuirks?fr.QUIRKS:F5(t);M5(t)||e._err(t,le.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function cu(e,t){e._err(t,le.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,fr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function uL(e,t){t.tagID===g.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=z.BEFORE_HEAD):lu(e,t)}function cL(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&lu(e,t)}function lu(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function lL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:du(e,t)}}function dL(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?du(e,t):e._err(t,le.endTagWithoutMatchingOpenElement)}function du(e,t){e._insertFakeElement(ne.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function kr(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Gt.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Gt.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Gt.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Gt.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case g.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:fu(e,t)}}function fL(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{fu(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function Lo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,le.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,le.endTagWithoutMatchingOpenElement)}function fu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function pL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{kr(e,t);break}case g.NOSCRIPT:{e._err(t,le.nestedNoscriptInHead);break}default:pu(e,t)}}function hL(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case g.BR:{pu(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function pu(e,t){const n=t.type===dt.EOF?le.openElementsLeftAfterEof:le.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function mL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,le.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),kr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:hu(e,t)}}function gL(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{hu(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function hu(e,t){e._insertFakeElement(ne.BODY,g.BODY),e.insertionMode=z.IN_BODY,Tl(e,t)}function Tl(e,t){switch(t.type){case dt.CHARACTER:{Bw(e,t);break}case dt.WHITESPACE_CHARACTER:{Fw(e,t);break}case dt.COMMENT:{kh(e,t);break}case dt.START_TAG:{vn(e,t);break}case dt.END_TAG:{_l(e,t);break}case dt.EOF:{Vw(e,t);break}}}function Fw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Bw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function yL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function bL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_FRAMESET)}function wL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function xL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&_h.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function TL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _L(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),n||(e.formElement=e.openElements.current))}function vL(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===g.LI&&i===g.LI||(n===g.DD||n===g.DT)&&(i===g.DD||i===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==g.ADDRESS&&i!==g.DIV&&i!==g.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function SL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=Gt.PLAINTEXT}function AL(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function kL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(Ah(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function NL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(Ah(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OL(e,t){e.treeAdapter.getDocumentMode(e.document)!==fr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function Uw(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jw(e){const t=Ew(e,Ro.TYPE);return t!=null&&t.toLowerCase()===X5}function PL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),jw(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function RL(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function LL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function DL(e,t){t.tagName=ne.IMG,t.tagID=g.IMG,Uw(e,t)}function ML(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Gt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function FL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function BL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function Hw(e,t){e._switchToTextParsing(t,Gt.RAWTEXT)}function UL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function jL(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function HL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function $L(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,Ee.HTML)}function zL(e,t){e._reconstructActiveFormattingElements(),Pw(t),Sh(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function VL(e,t){e._reconstructActiveFormattingElements(),Rw(t),Sh(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function $w(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function vn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{CL(e,t);break}case g.A:{kL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{xL(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{wL(e,t);break}case g.LI:case g.DD:case g.DT:{vL(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{Uw(e,t);break}case g.HR:{LL(e,t);break}case g.RB:case g.RTC:{HL(e,t);break}case g.RT:case g.RP:{$L(e,t);break}case g.PRE:case g.LISTING:{TL(e,t);break}case g.XMP:{FL(e,t);break}case g.SVG:{VL(e,t);break}case g.HTML:{yL(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{kr(e,t);break}case g.BODY:{EL(e,t);break}case g.FORM:{_L(e,t);break}case g.NOBR:{NL(e,t);break}case g.MATH:{zL(e,t);break}case g.TABLE:{OL(e,t);break}case g.INPUT:{PL(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{RL(e,t);break}case g.IMAGE:{DL(e,t);break}case g.BUTTON:{AL(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{IL(e,t);break}case g.IFRAME:{BL(e,t);break}case g.SELECT:{UL(e,t);break}case g.OPTION:case g.OPTGROUP:{jL(e,t);break}case g.NOEMBED:case g.NOFRAMES:{Hw(e,t);break}case g.FRAMESET:{bL(e,t);break}case g.TEXTAREA:{ML(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?Hw(e,t):$w(e,t);break}case g.PLAINTEXT:{SL(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:$w(e,t)}}function qL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=z.AFTER_BODY,Jw(e,t))}function YL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function GL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function XL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(ne.P,g.P),e._closePElement()}function KL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function QL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ZL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function eD(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function zw(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],u=e.openElements.tagIDs[i];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,u))break}}function _l(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{Ah(e,t);break}case g.P:{XL(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{YL(e,t);break}case g.LI:{KL(e);break}case g.DD:case g.DT:{QL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{JL(e);break}case g.BR:{eD(e);break}case g.BODY:{qL(e,t);break}case g.HTML:{WL(e,t);break}case g.FORM:{GL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{ZL(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:zw(e,t)}}function Vw(e,t){e.tmplInsertionModeStack.length>0?Qw(e,t):Ch(e,t)}function tD(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function nD(e,t){e._err(t,le.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Nh(e,t){if(e.openElements.currentTagId!==void 0&&Lw.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case dt.CHARACTER:{Ww(e,t);break}case dt.WHITESPACE_CHARACTER:{qw(e,t);break}}else gu(e,t)}function rD(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_CAPTION}function iD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function oD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,g.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,Ih(e,t)}function sD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_TABLE_BODY}function aD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,g.TBODY),e.insertionMode=z.IN_TABLE_BODY,Sl(e,t)}function uD(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function cD(e,t){jw(t)?e._appendElement(t,Ee.HTML):gu(e,t),t.ackSelfClosing=!0}function lD(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Os(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{aD(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{kr(e,t);break}case g.COL:{oD(e,t);break}case g.FORM:{lD(e,t);break}case g.TABLE:{uD(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{sD(e,t);break}case g.INPUT:{cD(e,t);break}case g.CAPTION:{rD(e,t);break}case g.COLGROUP:{iD(e,t);break}default:gu(e,t)}}function mu(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{Lo(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:gu(e,t)}}function gu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Tl(e,t),e.fosterParentingEnabled=n}function qw(e,t){e.pendingCharacterTokens.push(t)}function Ww(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function yu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)gu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Yw=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function dD(e,t){const n=t.tagID;Yw.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,Os(e,t)):vn(e,t)}function fD(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,n===g.TABLE&&mu(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:_l(e,t)}}function Ih(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.COL:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{kr(e,t);break}default:vl(e,t)}}function pD(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case g.TEMPLATE:{Lo(e,t);break}case g.COL:break;default:vl(e,t)}}function vl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE,e._processToken(t))}function Sl(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,g.TR),e.insertionMode=z.IN_ROW,Al(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,Os(e,t));break}default:Os(e,t)}}function Oh(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,mu(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:mu(e,t)}}function Al(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Sl(e,t));break}default:Os(e,t)}}function Gw(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Oh(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Oh(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:mu(e,t)}}function hD(e,t){const n=t.tagID;Yw.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Al(e,t)):vn(e,t)}function mD(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Gw(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:_l(e,t)}}function Xw(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{kr(e,t);break}}}function Kw(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{Lo(e,t);break}}}function gD(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Xw(e,t)}function yD(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Kw(e,t)}function ED(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{kr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,Os(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,Ih(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,Sl(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,Al(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,vn(e,t)}}function bD(e,t){t.tagID===g.TEMPLATE&&Lo(e,t)}function Qw(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ch(e,t)}function wD(e,t){t.tagID===g.HTML?vn(e,t):kl(e,t)}function Jw(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else kl(e,t)}function kl(e,t){e.insertionMode=z.IN_BODY,Tl(e,t)}function xD(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.FRAMESET:{e._insertElement(t,Ee.HTML);break}case g.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{kr(e,t);break}}}function TD(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function _D(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.NOFRAMES:{kr(e,t);break}}}function vD(e,t){t.tagID===g.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function SD(e,t){t.tagID===g.HTML?vn(e,t):Cl(e,t)}function Cl(e,t){e.insertionMode=z.IN_BODY,Tl(e,t)}function AD(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.NOFRAMES:{kr(e,t);break}}}function kD(e,t){t.chars=Bt,e._insertCharacters(t)}function CD(e,t){e._insertCharacters(t),e.framesetOk=!1}function Zw(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function ND(e,t){if(V5(t))Zw(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ee.MATHML?Pw(t):r===Ee.SVG&&(q5(t),Rw(t)),Sh(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function ID(e,t){if(t.tagID===g.P||t.tagID===g.BR){Zw(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const OD=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,PD=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ex={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function tx(e,t){const n=$D(e),r=pw("type",{handlers:{root:RD,element:LD,text:DD,comment:rx,doctype:MD,raw:BD},unknown:UD}),i={parser:n?new Mw(ex):Mw.getFragmentParser(void 0,ex),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),Ps(i,Yr());const s=n?i.parser.document:i.parser.getFragment(),u=z6(s,{file:i.options.file});return i.stitches&&yl(u,"comment",function(c,d,f){const h=c;if(h.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=h.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function nx(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function RD(e,t){nx(e.children,t)}function LD(e,t){jD(e,t),nx(e.children,t),HD(e,t)}function DD(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:dt.CHARACTER,chars:e.value,location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function MD(e,t){const n={type:dt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FD(e,t){t.stitches=!0;const n=zD(e);if("children"in e&&"children"in n){const r=tx({type:"root",children:e.children},t.options);n.children=r.children}rx({type:"comment",value:{stitch:n}},t)}function rx(e,t){const n=e.value,r={type:dt.COMMENT,data:n,location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function BD(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,ix(t,Yr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OD,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function UD(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))FD(n,t);else{let r="";throw PD.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ps(e,t){ix(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Gt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function ix(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function jD(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ps(t,Yr(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Po.html;i===Po.html&&n==="svg"&&(i=Po.svg);const s=G6(ue(U({},e),{children:[]}),{space:i===Po.svg?"svg":"html"}),u={type:dt.START_TAG,tagName:n,tagID:Is(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Eu(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function HD(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&n5.includes(n)||t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ps(t,sl(e));const r={type:dt.END_TAG,tagName:n,tagID:Is(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Eu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Gt.RCDATA||t.parser.tokenizer.state===Gt.RAWTEXT||t.parser.tokenizer.state===Gt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Gt.DATA)}function $D(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Eu(e){const t=Yr(e)||{line:void 0,column:void 0,offset:void 0},n=sl(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function zD(e){return"children"in e?Oo(ue(U({},e),{children:[]})):Oo(e)}function ox(e){return function(t,n){return tx(t,ue(U({},e),{file:n}))}}const Do=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],sx={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Do,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Do],h2:[["className","sr-only"]],img:[...Do,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Do,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Do],table:[...Do],ul:[...Do,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Ui={}.hasOwnProperty;function VD(e,t){let n={type:"root",children:[]};const r={schema:t?U(U({},sx),t):sx,stack:[]},i=ax(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function ax(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return qD(e,n);case"doctype":return WD(e,n);case"element":return YD(e,n);case"root":return GD(e,n);case"text":return XD(e,n)}}}function qD(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return bu(s,t),s}}function WD(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return bu(n,t),n}}function YD(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=ux(e,t.children),i=KD(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Ui.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(s=!1;++d<c.length;)e.stack.includes(c[d])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:i,children:r};return bu(u,t),u}function GD(e,t){const r={type:"root",children:ux(e,t.children)};return bu(r,t),r}function XD(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return bu(r,t),r}function ux(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=ax(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function KD(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&Ui.call(r,n)?r[n]:void 0,u=r&&Ui.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Ui.call(c,f)){const h=c[f];let m=cx(e,dx(s,f),f,h);m==null&&(m=cx(e,dx(u,f),f,h)),m!=null&&(d[f]=m)}if(i&&Ui.call(i,n)){const h=i[n];for(f in h)Ui.call(h,f)&&!Ui.call(d,f)&&(d[f]=h[f])}return d}function cx(e,t,n,r){return t?Array.isArray(r)?QD(e,t,n,r):lx(e,t,n,r):void 0}function QD(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const u=lx(e,t,n,r[i]);(typeof u=="number"||typeof u=="string")&&s.push(u)}return s}function lx(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&JD(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const u=t[s];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){i=!0;break}}else if(u===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function JD(e,t,n){const r=e.schema.protocols&&Ui.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),u=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(s<0||d>-1&&s>d||u>-1&&s>u||c>-1&&s>c)return!0;let f=-1;for(;++f<r.length;){const h=r[f];if(s===h.length&&i.slice(0,h.length)===h)return!0}return!1}function bu(e,t){const n=tb(t);t.data&&(e.data=Oo(t.data)),n&&(e.position=n)}function dx(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function ZD(e){return function(t){return VD(t,e)}}const fx=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,onClick:i,children:s})=>{const u=/^tel:/i.test(n!=null?n:""),d=n?!!(n&&t&&!u)?"_blank":"_self":void 0;return w.jsx("a",ue(U(U({className:M(e,`${k}-link`)},n?{href:n,target:d,onClick:i}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},e8=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=at();return!e&&!t?null:w.jsx("div",{className:M(n,`${k}-disclaimer`),children:t?w.jsx(rw,{rehypePlugins:[ox,ZD],components:{ul:({children:r})=>w.jsx("ul",{className:M(n,`${k}-ul`),children:r}),ol:({children:r})=>w.jsx("ol",{className:M(n,`${k}-ol`),children:r}),li:({children:r})=>w.jsx("li",{className:M(n,`${k}-li`),children:r}),a:({href:r,title:i,children:s})=>w.jsx(fx,{globalClassName:n,openLinksInNewTab:!0,href:r,title:i,children:s}),img:({src:r,alt:i})=>w.jsx("img",{className:M(n,`${k}-disclaimer-image`),src:r,alt:i}),p:({children:r})=>w.jsx("p",{className:M(n,`${k}-disclaimer-text`),children:r}),span:({children:r})=>w.jsx("span",{className:M(n,`${k}-disclaimer-text-span`),children:r})},children:t}):w.jsx("p",{className:M(n,`${k}-disclaimer-text`),children:e})})},t8=Math.round(Hf/(1024*1024)),n8=e=>e==="oversize"?`File size exceeds the ${t8}MB limit. Please choose a smaller file.`:"That file type isn't supported. Please choose a PNG, JPG, or GIF image.",Ph=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{var ae;const{isConnected:i,sessionExpired:s,canInitialize:u,messages:c}=$t(),{globalClassName:d,searchConfig:f,enableEscalationToAgent:h,enableImageUpload:m,enablePageContext:E}=at(),[,b]=S.useReducer(C=>C+1,0),T=E?f1():null;S.useEffect(()=>{let C=!0;const F=()=>{queueMicrotask(()=>{C&&b()})};return J0(F),c1(F),F(),()=>{C=!1,Z0(F),l1(F)}},[]);const v=S.useRef(null),I=S.useRef(c);I.current=c;const[_,N]=S.useState(!1),[P,B]=S.useState(null),R=m,O=!Yy(i,s,u),q=t||O,K=(f==null?void 0:f.placeholder)||(T==null?void 0:T.placeholder)||"Ask us anything",re=S.useCallback(C=>B(n8(C)),[]),{file:H,attach:Z,clear:X}=kO({allowedMime:S1,maxBytes:Number.POSITIVE_INFINITY,onReject:re});S.useEffect(()=>{H&&B(null)},[H]);const he=S.useCallback(C=>Oe(null,null,function*(){var Y,D,fe;if(C.preventDefault(),q)return;B(null);const F=(((Y=v.current)==null?void 0:Y.value)||"").trim();if(F||H){const De=!i&&!s&&u===!0,Te=I.current.length;v.current.value="",(D=v.current)==null||D.focus({preventScroll:!0});const Ne={text:F};H&&(Ne.file=H),X();const be=yield r(Ne),We=!!be&&be.outcome!=="success",Ze=I.current.length===Te,Nt=((fe=v.current)==null?void 0:fe.value)==="";We&&(De&&Ze&&Nt)&&(v.current.value=F,Ne.file&&Z([Ne.file]),v.current.disabled||v.current.focus({preventScroll:!0}))}}),[H,i,s,u,q,X,r,Z]),V=S.useCallback(()=>{r({text:"Can you connect me to a human?"})},[r]),ce=S.useCallback(C=>{!R||q||(C.preventDefault(),N(!0))},[R,q]),me=S.useCallback(()=>N(!1),[]),se=S.useCallback(C=>{!R||q||(C.preventDefault(),N(!1),Z(C.dataTransfer.files))},[R,q,Z]),J=S.useCallback(C=>{!R||q||C.clipboardData.files.length>0&&Z(C.clipboardData.files)},[R,q,Z]);return w.jsxs("div",{className:M(d,e,`cim-${n}-component`,H&&"with-attachments",`${k}-search-bar-wrapper`),children:[R&&H&&w.jsx(CO,{file:H,componentType:n,globalClassName:d,onRemove:X}),R&&P&&w.jsx("div",{className:M(d,`${k}-attach-error`),role:"alert",children:P}),w.jsxs("form",{className:M(d,e,`cim-${n}-component`,_&&"drag-over",`${k}-search-bar`,T&&`${k}-search-bar-with-context`,h&&`${k}-search-bar-with-escalation`),name:`${k}-search-form`,onSubmit:he,onDragOver:ce,onDragLeave:me,onDrop:se,children:[T&&w.jsx("div",{className:`${k}-page-context-row`,role:"group","aria-label":"Current page context",children:w.jsxs("span",{className:`${k}-page-context-chip`,children:[T.type==="pdp"&&T.imageUrl&&w.jsx("img",{src:T.imageUrl,alt:"",className:`${k}-page-context-image`}),T.type==="srp"&&w.jsx(LE,{"aria-hidden":"true",className:`${k}-page-context-icon`}),w.jsx("span",{className:`${k}-page-context-name`,title:T.label,children:T.label}),w.jsx("button",{type:"button",className:`${k}-page-context-remove`,"aria-label":T.removeLabel,onClick:Mf,children:w.jsx(vO,{"aria-hidden":"true"})})]})}),w.jsxs("div",{className:M(d,e,`cim-${n}-component`,`${k}-messaging-input-group`,`${k}-messaging-composer-group`),children:[w.jsxs("div",{className:M(d,e,`cim-${n}-component`,`${k}-messaging-input-group`),children:[R&&w.jsx(NO,{componentType:n,accept:Vk,disabled:q,globalClassName:d,className:e,icon:w.jsx(wO,{}),onFiles:Z}),w.jsx("input",{className:M(d,e,`cim-${n}-component`,`${k}-search-input`),type:"text",ref:v,placeholder:K,"aria-label":(f==null?void 0:f.inputAriaLabel)||K,name:`${k}-user-input`,disabled:O,readOnly:t,onPaste:J})]}),w.jsx(OO,{className:e,globalClassName:d,searchConfig:ue(U({},f),{buttonIcon:(ae=f==null?void 0:f.buttonIcon)!=null?ae:"arrow"}),componentType:n,isLoading:q})]}),h&&w.jsx(Sr,{className:d,ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:q,onClick:V,icon:w.jsx(cO,{})})]}),w.jsx(e8,{})]})};function r8(e){return ct({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function i8(e){return ct({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const px=S.createContext({isOpen:!1}),Rh=S.createContext(null),hx=S.createContext(null),Mo=()=>{var n,r;const e=S.useContext(Rh),t=S.useContext(hx);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},mx=({onClearChat:e,componentType:t})=>{const n=Mo(),r=()=>{e(),n()};return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[w.jsx(i8,{}),"Clear chat"]})},gx=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=at(),r=Mo(),[i,s]=S.useState(!1),u=()=>Oe(null,null,function*(){if(!i){s(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{s(!1)}}});return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:i,children:[w.jsx(r8,{}),"Download transcript"]})},yx=({onEndConversation:e,componentType:t})=>{const n=Mo(),r=()=>{e(),n()};return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"end-conversation-button",`cim-${t}-component`),onClick:r,children:[w.jsx(bO,{}),"End conversation"]})};function o8(e){return e==null?[]:Array.isArray(e)?e:[e]}var s8=(e,...t)=>e.concat(t),a8=(e,...t)=>e.filter(n=>!t.includes(n)),u8=e=>Array.from(new Set(e));function Ex(e,t,n={}){const{step:r=1,loop:i=!0}=n,s=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:s<0?i?c:0:s>=u?i?0:t>u?u:t:s}function c8(e,t,n={}){const{step:r=1,loop:i=!0}=n;return Ex(e,t,{step:-r,loop:i})}var l8=e=>Array.isArray(e),bx=e=>e!=null&&typeof e=="object",d8=e=>bx(e)&&!l8(e),Nl=e=>typeof e=="string",Rs=e=>typeof e=="function",f8=e=>e==null,p8=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h8=e=>Object.prototype.toString.call(e),wx=Function.prototype.toString,m8=wx.call(Object),g8=e=>{if(!bx(e)||h8(e)!="[object Object]"||b8(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=p8(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&wx.call(n)==m8},y8=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,E8=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,b8=e=>y8(e)||E8(e),w8=e=>e(),x8=()=>{},Lh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function T8(e,t=0){let n=0,r=null;return((...i)=>{const s=Date.now(),u=s-n;u>=t?(r&&(clearTimeout(r),r=null),e(...i),n=s):r||(r=setTimeout(()=>{e(...i),n=Date.now(),r=null},t-u))})}var{min:_8,max:v8}=Math,S8=e=>Number.isNaN(e),A8=e=>S8(e)?0:e,xx=(e,t,n)=>_8(v8(A8(e),t),n);function Dh(e){if(!g8(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const i=e[r];i!==void 0&&(n[r]=Dh(i))}return n}function Mh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function k8(e,t){if(e==null)throw new Error(t())}function C8(e,t,n){let r=[];for(const i of t)e[i]==null&&r.push(i);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var N8=Object.defineProperty,I8=(e,t,n)=>t in e?N8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fh=(e,t,n)=>I8(e,typeof t!="symbol"?t+"":t,n),Tx=()=>{},Il=e=>typeof e=="object"&&e!==null,Ls=e=>e?"":void 0,_x=e=>e?"true":void 0,O8=1,P8=9,R8=11,cn=e=>Il(e)&&e.nodeType===O8&&typeof e.nodeName=="string",Ol=e=>Il(e)&&e.nodeType===P8,L8=e=>Il(e)&&e===e.window,vx=e=>cn(e)?e.localName||"":"#document";function D8(e){return["html","body","#document"].includes(vx(e))}var M8=e=>Il(e)&&e.nodeType!==void 0,Fo=e=>M8(e)&&e.nodeType===R8&&"host"in e,F8=e=>cn(e)&&e.localName==="input",B8=e=>cn(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function wu(e){if(!e)return!1;const t=e.getRootNode();return Fs(t)===e}var U8=/(textarea|select)/;function j8(e){if(e==null||!cn(e))return!1;try{return F8(e)&&e.selectionStart!=null||U8.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function Ds(e,t){var r;if(!e||!t||!cn(e)||!cn(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&Fo(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Kr(e){var t;return Ol(e)?e:L8(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function H8(e){return Kr(e).documentElement}function Ms(e){var t,n,r;return Fo(e)?Ms(e.host):Ol(e)?(t=e.defaultView)!=null?t:window:cn(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function Fs(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function $8(e){if(vx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fo(e)&&e.host||H8(e);return Fo(t)?t.host:t}function Bh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Ol(t)||Fo(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var Uh=new WeakMap;function Bs(e){return Uh.has(e)||Uh.set(e,Ms(e).getComputedStyle(e)),Uh.get(e)}var jh=new Set(["menu","listbox","dialog","grid","tree","region"]),z8=e=>jh.has(e),Sx=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Ax(e,t){const n=new Set,r=Bh(e),i=s=>{const u=s.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Sx(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const h=r.getElementById(f);if(h){const m=h.getAttribute("role"),E=h.getAttribute("aria-modal")==="true";if(m&&z8(m)&&!E&&(h===t||h.contains(t)||i(h)))return!0}}}return!1};return i(e)}function kx(e,t){const n=Bh(e),r=new Set,i=s=>{const u=s.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Sx(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const h=n.getElementById(f);if(h){const m=h.getAttribute("role"),E=h.getAttribute("aria-modal")==="true";m&&jh.has(m)&&!E&&(t(h),i(h))}}}};i(e)}function V8(e){const t=new Set;return kx(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function q8(e){const t=e.getAttribute("role");return!!(t&&jh.has(t))}function W8(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function Y8(e){var t;return W8(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function G8(e){if(!e.id)return!1;const t=Bh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&q8(e))}var Hh=()=>typeof document!="undefined";function X8(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var $h=e=>Hh()&&e.test(X8()),K8=e=>Hh()&&e.test(navigator.vendor),Cx=()=>Hh()&&!!navigator.maxTouchPoints,Q8=()=>$h(/^iPhone/i),J8=()=>$h(/^iPad/i)||zh()&&navigator.maxTouchPoints>1,Pl=()=>Q8()||J8(),Z8=()=>zh()||Pl(),zh=()=>$h(/^Mac/i),eM=()=>Z8()&&K8(/apple/i);function tM(e){var t,n,r,i;return(i=(t=e.composedPath)==null?void 0:t.call(e))!=null?i:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function Cr(e){var n;const t=tM(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var Nx=e=>e.button===0,nM=e=>e.button===2||zh()&&e.ctrlKey&&e.button===0,rM=e=>"touches"in e&&e.touches.length>0,iM={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Ix={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function oM(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let i=e.key;return i=(u=iM[i])!=null?u:i,n==="rtl"&&r==="horizontal"&&i in Ix&&(i=Ix[i]),i}function Ox(e,t="client"){const n=rM(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var ln=(e,t,n,r)=>{const i=typeof e=="function"?e():e;return i==null||i.addEventListener(t,n,r),()=>{i==null||i.removeEventListener(t,n,r)}},Px=e=>cn(e)&&e.tagName==="IFRAME",sM=/^(audio|video|details)$/;function Rx(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var aM=e=>!Number.isNaN(Rx(e)),uM=e=>Rx(e)<0;function cM(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function Lx(e,t,n){const r=[...e],i=[...e],s=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<i.length;){const d=i[c++];if(!d||s.has(d))continue;s.add(d);const f=cM(d,t);if(f){const h=Array.from(f.querySelectorAll(Rl)).filter(n),m=u.get(d);if(m!==void 0){const E=m+1;r.splice(E,0,...h),h.forEach((b,T)=>{u.set(b,E+T)});for(let b=E+h.length;b<r.length;b++)u.set(r[b],b)}else{const E=r.length;r.push(...h),h.forEach((b,T)=>{u.set(b,E+T)})}i.push(...h)}}return r}var Rl="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Dx=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(Rl));(n==!0||n=="if-empty"&&i.length===0)&&cn(e)&&Qr(e)&&i.unshift(e);const u=[];for(const c of i)if(Qr(c)){if(Px(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...Dx(d,{getShadowRoot:r}));continue}u.push(c)}return r?Lx(u,r,Qr):u};function Qr(e){return!cn(e)||e.closest("[inert]")?!1:e.matches(Rl)&&B8(e)}function Us(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(Rl));n&&Bo(e)&&i.unshift(e);const s=[];for(const u of i)if(Bo(u)){if(Px(u)&&u.contentDocument){const c=u.contentDocument.body;s.push(...Us(c,{getShadowRoot:r}));continue}s.push(u)}if(r){const u=Lx(s,r,Bo);return!u.length&&n?i:u}return!s.length&&n?i:s}function Bo(e){return cn(e)&&e.tabIndex>0?!0:Qr(e)&&!uM(e)}function lM(e,t={}){const n=Us(e,t),r=n[0]||null,i=n[n.length-1]||null;return[r,i]}function dM(e,t={}){const{current:n,getShadowRoot:r}=t,i=Us(e,{getShadowRoot:r}),s=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:Fs(s);if(!u)return null;const c=i.indexOf(u);return i[c+1]||null}function xu(e){return e.tabIndex<0&&(sM.test(e.localName)||j8(e))&&!aM(e)?0:e.tabIndex}function Mx(e){const{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let s=null;if(s||(s=typeof n=="function"?n():n),s||(s=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!s){const u=Us(t);s=r?u.filter(r)[0]:u[0]}return s||t||void 0}var fM=class GS{constructor(){Fh(this,"id",null),Fh(this,"fn_cleanup"),Fh(this,"cleanup",()=>{this.cancel()})}static create(){return new GS}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function en(e){const t=fM.create();return t.request(e),t.cleanup}function Fx(e){const t=new Set;function n(r){const i=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(e)),function(){t.forEach(i=>i())}}function Vh(e){const t=$8(e);return D8(t)?Kr(t).body:cn(t)&&mM(t)?t:Vh(t)}var pM=/auto|scroll|overlay|hidden|clip/,hM=new Set(["inline","contents"]);function mM(e){const t=Ms(e),{overflow:n,overflowX:r,overflowY:i,display:s}=t.getComputedStyle(e);return pM.test(n+i+r)&&!hM.has(s)}var js="default",qh="",Ll=new WeakMap;function gM(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,i=r.documentElement;return Pl()?(js==="default"&&(qh=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),js="disabled"):t&&(Ll.set(t,t.style.userSelect),t.style.userSelect="none"),()=>yM({target:t,doc:r})}function yM(e={}){const{target:t,doc:n}=e,i=(n!=null?n:document).documentElement;if(Pl()){if(js!=="disabled")return;js="restoring",setTimeout(()=>{Fx(()=>{js==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=qh||""),qh="",js="default")})},300)}else if(t&&Ll.has(t)){const s=Ll.get(t);t.style.userSelect==="none"&&(t.style.userSelect=s!=null?s:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ll.delete(t)}}function EM(e={}){const u=e,{defer:t,target:n}=u,r=bn(u,["defer","target"]),i=t?en:c=>c(),s=[];return s.push(i(()=>{const c=typeof n=="function"?n():n;s.push(gM(ue(U({},r),{target:c})))})),()=>{s.forEach(c=>c==null?void 0:c())}}function bM(e,t){const{onPointerMove:n,onPointerUp:r}=t,i=c=>{const d=Ox(c),f=Math.sqrt(yf(d.x,2)+yf(d.y,2)),h=c.pointerType==="touch"?10:5;if(!(f<h)){if(c.pointerType==="mouse"&&c.button===0){s(c);return}n({point:d,event:c})}},s=c=>{const d=Ox(c);r({point:d,event:c})},u=[ln(e,"pointermove",i,!1),ln(e,"pointerup",s,!1),ln(e,"pointercancel",s,!1),ln(e,"contextmenu",s,!1),EM({doc:e})];return()=>{u.forEach(c=>c())}}function wM(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:i,getShadowRoot:s}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let h=null;const[m,E]=lM(e,{includeContainer:!0,getShadowRoot:s}),b=dM(c,{current:n,getShadowRoot:s}),T=!m&&!E;f.shiftKey&&wu(b)?(i==null||i(),h=E):f.shiftKey&&(wu(m)||T)?h=n:!f.shiftKey&&wu(n)?(i==null||i(),h=m):!f.shiftKey&&(wu(E)||T)&&(h=b),h&&(f.preventDefault(),typeof r=="function"?r(h):h.focus())}return ln(u,"keydown",d,!0)}function xM(e,t){const c=t,{defer:n,triggerElement:r}=c,i=bn(c,["defer","triggerElement"]),s=n?en:d=>d(),u=[];return u.push(s(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(wM(d,U({triggerElement:f},i)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function TM(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Dl(e,t){if(!e)return Tx;const n=Object.keys(t).reduce((r,i)=>(r[i]=e.style.getPropertyValue(i),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function _M(e,t,n){if(!e)return Tx;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function vM(e,t,n){const{signal:r}=t;return[new Promise((u,c)=>{const d=setTimeout(()=>{c(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),c(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),c(f))})}),()=>t.abort()]}function SM(e,t){const{timeout:n,rootNode:r}=t,i=Ms(r),s=Kr(r),u=new i.AbortController;return vM(new Promise(c=>{const d=e();if(d){c(d);return}const f=new i.MutationObserver(()=>{const h=e();h&&h.isConnected&&(f.disconnect(),c(h))});f.observe(s.body,{childList:!0,subtree:!0})}),u,n)}var AM=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),kM=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Bx=e=>{const t={};let n;for(;n=kM.exec(e);)t[n[1]]=n[2];return t},CM=(e,t)=>{if(Nl(e)){if(Nl(t))return`${e};${t}`;e=Bx(e)}else Nl(t)&&(t=Bx(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function tn(...e){let t={};for(let n of e){if(!n)continue;for(let i in t){if(i.startsWith("on")&&typeof t[i]=="function"&&typeof n[i]=="function"){t[i]=Lh(n[i],t[i]);continue}if(i==="className"||i==="class"){t[i]=AM(t[i],n[i]);continue}if(i==="style"){t[i]=CM(t[i],n[i]);continue}t[i]=n[i]!==void 0?n[i]:t[i]}for(let i in n)t[i]===void 0&&(t[i]=n[i]);const r=Object.getOwnPropertySymbols(n);for(let i of r)t[i]=n[i]}return t}function TV(e){return e}var Hs=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Hs||{}),Wh="__init__";function NM(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>Kr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},i=()=>Fs(t()),s=u=>t().getElementById(u);return ue(U({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:wu,getById:s})}function IM(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var $s=()=>e=>Array.from(new Set(e)),Ux=typeof globalThis.document!="undefined"?S.useLayoutEffect:S.useEffect;function Ml(e){var m,E;const t=(m=e().value)!=null?m:e().defaultValue,n=(E=e().isEqual)!=null?E:Object.is,[r]=S.useState(t),[i,s]=S.useState(r),u=e().value!==void 0,c=S.useRef(i);c.current=u?e().value:i;const d=S.useRef(c.current);Ux(()=>{d.current=c.current},[i,e().value]);const f=b=>{var I,_;const T=d.current,v=Rs(b)?b(T):b;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:v,prev:T}),u||s(v),n(v,T)||(_=(I=e()).onChange)==null||_.call(I,v,T)};function h(){return u?e().value:i}return{initial:r,ref:c,get:h,set(b){(e().sync?_s.flushSync:w8)(()=>f(b))},invoke(b,T){var v,I;(I=(v=e()).onChange)==null||I.call(v,b,T)},hash(b){var T,v,I;return(I=(v=(T=e()).hash)==null?void 0:v.call(T,b))!=null?I:String(b)}}}Ml.cleanup=e=>{S.useEffect(()=>e,[])},Ml.ref=e=>{const t=S.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function OM(e){const t=S.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var PM=(e,t)=>{const n=S.useRef(!1),r=S.useRef(!1);S.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(i=>typeof i=="function"?i():i)]),S.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Fl(e,t={}){var Z,X,he,V,ce,me;const n=S.useMemo(()=>{const{id:se,ids:J,getRootNode:ae}=t;return NM({id:se,ids:J,getRootNode:ae})},[t]),r=(...se)=>{e.debug&&console.log(...se)},i=(X=(Z=e.props)==null?void 0:Z.call(e,{props:Dh(t),scope:n}))!=null?X:t,s=RM(i),u=(he=e.context)==null?void 0:he.call(e,{prop:s,bindable:Ml,scope:n,flush:Hx,getContext(){return d},getComputed(){return R},getRefs(){return v},getEvent(){return b()}}),c=jx(u),d={get(se){var J;return(J=c.current)==null?void 0:J[se].ref.current},set(se,J){var ae;(ae=c.current)==null||ae[se].set(J)},initial(se){var J;return(J=c.current)==null?void 0:J[se].initial},hash(se){var ae,C;const J=(ae=c.current)==null?void 0:ae[se].get();return(C=c.current)==null?void 0:C[se].hash(J)}},f=S.useRef(new Map),h=S.useRef(null),m=S.useRef(null),E=S.useRef({type:""}),b=()=>ue(U({},E.current),{current(){return E.current},previous(){return m.current}}),T=()=>ue(U({},O),{matches(...se){return se.includes(O.ref.current)},hasTag(se){var J,ae;return!!((ae=(J=e.states[O.ref.current])==null?void 0:J.tags)!=null&&ae.includes(se))}}),v=OM((ce=(V=e.refs)==null?void 0:V.call(e,{prop:s,context:d}))!=null?ce:{}),I=()=>({state:T(),context:d,event:b(),prop:s,send:H,action:_,guard:N,track:PM,refs:v,computed:R,flush:Hx,scope:n,choose:B}),_=se=>{const J=Rs(se)?se(I()):se;if(!J)return;const ae=J.map(C=>{var Y,D;const F=(D=(Y=e.implementations)==null?void 0:Y.actions)==null?void 0:D[C];return F||Mh(`[zag-js] No implementation found for action "${JSON.stringify(C)}"`),F});for(const C of ae)C==null||C(I())},N=se=>{var J,ae;return Rs(se)?se(I()):(ae=(J=e.implementations)==null?void 0:J.guards)==null?void 0:ae[se](I())},P=se=>{const J=Rs(se)?se(I()):se;if(!J)return;const ae=J.map(F=>{var D,fe;const Y=(fe=(D=e.implementations)==null?void 0:D.effects)==null?void 0:fe[F];return Y||Mh(`[zag-js] No implementation found for effect "${JSON.stringify(F)}"`),Y}),C=[];for(const F of ae){const Y=F==null?void 0:F(I());Y&&C.push(Y)}return()=>C.forEach(F=>F==null?void 0:F())},B=se=>o8(se).find(J=>{let ae=!J.guard;return Nl(J.guard)?ae=!!N(J.guard):Rs(J.guard)&&(ae=J.guard(I())),ae}),R=se=>{k8(e.computed,()=>"[zag-js] No computed object found on machine");const J=e.computed[se];return J({context:d,event:b(),prop:s,refs:v,scope:n,computed:R})},O=Ml(()=>({defaultValue:e.initialState({prop:s}),onChange(se,J){var C,F,Y,D;if(J){const fe=f.current.get(J);fe==null||fe(),f.current.delete(J)}J&&_((C=e.states[J])==null?void 0:C.exit),_((F=h.current)==null?void 0:F.actions);const ae=P((Y=e.states[se])==null?void 0:Y.effects);if(ae&&f.current.set(se,ae),J===Wh){_(e.entry);const fe=P(e.effects);fe&&f.current.set(Wh,fe)}_((D=e.states[se])==null?void 0:D.entry)}})),q=S.useRef(void 0),K=S.useRef(Hs.NotStarted);Ux(()=>{queueMicrotask(()=>{var F;const ae=K.current===Hs.Started;K.current=Hs.Started,r(ae?"rehydrating...":"initializing...");const C=(F=q.current)!=null?F:O.initial;O.invoke(C,ae?O.get():Wh)});const se=f.current,J=O.ref.current;return()=>{r("unmounting..."),q.current=J,K.current=Hs.Stopped,se.forEach(ae=>ae==null?void 0:ae()),f.current=new Map,h.current=null,queueMicrotask(()=>{_(e.exit)})}},[]);const re=()=>"ref"in O?O.ref.current:O.get(),H=se=>{queueMicrotask(()=>{var D,fe,De,Te,Ne;if(K.current!==Hs.Started)return;m.current=E.current,E.current=se;let J=re();const ae=(De=(D=e.states[J].on)==null?void 0:D[se.type])!=null?De:(fe=e.on)==null?void 0:fe[se.type],C=B(ae);if(!C)return;h.current=C;const F=(Te=C.target)!=null?Te:J;r("transition",se.type,C.target||J,`(${C.actions})`);const Y=F!==J;Y?_s.flushSync(()=>O.set(F)):C.reenter&&!Y?O.invoke(J,J):_((Ne=C.actions)!=null?Ne:[])})};return(me=e.watch)==null||me.call(e,I()),{state:T(),send:H,context:d,prop:s,scope:n,refs:v,computed:R,event:b(),getStatus:()=>K.current}}function jx(e){const t=S.useRef(e);return t.current=e,t}function RM(e){const t=jx(e);return function(r){return t.current[r]}}function Hx(e){queueMicrotask(()=>{_s.flushSync(()=>e())})}var Yh=IM(e=>e);function Bl(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const i=r(t);typeof i=="function"&&n.push(i)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function LM(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Gh=e=>{const t=S.memo(S.forwardRef((n,r)=>{const f=n,{asChild:i,children:s}=f,u=bn(f,["asChild","children"]);if(!i)return S.createElement(e,ue(U({},u),{ref:r}),s);if(!S.isValidElement(s))return null;const c=S.Children.only(s),d=LM(c);return S.cloneElement(c,ue(U({},tn(u,c.props)),{ref:r?Bl(r,d):d}))}));return t.displayName=e.displayName||e.name,t},Sn=(()=>{const e=new Map;return new Proxy(Gh,{apply(t,n,r){return Gh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Gh(r)),e.get(r)}})})();function DM(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Uo(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:s,defaultValue:u}=e,c=S.createContext(u);c.displayName=t;function d(){var h;const f=S.useContext(c);if(!f&&n){const m=new Error(s!=null?s:DM(r,i));throw m.name="ContextError",(h=Error.captureStackTrace)==null||h.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[MM,Xh]=Uo({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[$x,Tu]=Uo({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),zx=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:Bl(r.ref,t)}))});zx.displayName="PopoverContent";const Vx=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(n.getPositionerProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:t}))});Vx.displayName="PopoverPositioner";const _u=()=>(e,t)=>t.reduce((n,r)=>{const[i,s]=n,u=r;return s[u]!==void 0&&(i[u]=s[u]),delete s[u],[i,s]},[{},U({},e)]),qx=e=>_u()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function FM(e,t){const{state:n,send:r,context:i}=e,s=n.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:s,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var BM={props({props:e}){return ue(U({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Bs(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const i=r("present");if(i)return n({type:"MOUNT",src:"presence.changed"});const s=t.get("node");if(!i&&(s==null?void 0:s.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});en(()=>{var c,d;const u=Ul(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((c=t.get("styles"))==null?void 0:c.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{en(()=>{e.set("prevAnimationName",Ul(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const i=t.get("node");if(!i)return;const s=d=>{var h,m,E;((E=(m=(h=d.composedPath)==null?void 0:h.call(d))==null?void 0:m[0])!=null?E:d.target)===i&&e.set("prevAnimationName",Ul(t.get("styles")))},u=d=>{const f=Ul(t.get("styles"));Cr(d)===i&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",s),i.addEventListener("animationcancel",u),i.addEventListener("animationend",u);const c=Dl(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",s),i.removeEventListener("animationcancel",u),i.removeEventListener("animationend",u),Fx(()=>c())}}}}};function Ul(e){return(e==null?void 0:e.animationName)||"none"}$s()(["onExitComplete","present","immediate"]);function UM(e,t={}){const{sync:n=!1}=t,r=jM(e);return S.useCallback((...i)=>{var s;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...i)}):(s=r.current)==null?void 0:s.call(r,...i)},[n,r])}function jM(e){const t=S.useRef(e);return t.current=e,t}const Kh=(e={})=>{const E=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:i=!1}=E,s=bn(E,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=S.useRef(!1),c=ue(U({},s),{present:r,onExitComplete:UM(e.onExitComplete)}),d=Fl(BM,c),f=FM(d);f.present&&(u.current=!0);const h=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&i?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:h}};var jo=(e,t=[])=>({parts:(...n)=>{if(HM(t))return jo(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>jo(e,[...t,...n]),omit:(...n)=>jo(e,t.filter(r=>!n.includes(r))),rename:n=>jo(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${zs(e)}"][data-part="${zs(r)}"]`,`& [data-scope="${zs(e)}"][data-part="${zs(r)}"]`].join(", "),attrs:{"data-scope":zs(e),"data-part":zs(r)}}}),{})}),zs=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),HM=e=>e.length===0;const $M=["top","right","bottom","left"],ji=Math.min,pi=Math.max,jl=Math.round,Hl=Math.floor,Jr=e=>({x:e,y:e}),zM={left:"right",right:"left",bottom:"top",top:"bottom"};function Wx(e,t,n){return pi(e,ji(t,n))}function hi(e,t){return typeof e=="function"?e(t):e}function Hi(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function Qh(e){return e==="x"?"y":"x"}function Jh(e){return e==="y"?"height":"width"}function Zr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Zh(e){return Qh(Zr(e))}function VM(e,t,n){n===void 0&&(n=!1);const r=Vs(e),i=Zh(e),s=Jh(i);let u=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=$l(u)),[u,$l(u)]}function qM(e){const t=$l(e);return[em(e),t,em(t)]}function em(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yx=["left","right"],Gx=["right","left"],WM=["top","bottom"],YM=["bottom","top"];function GM(e,t,n){switch(e){case"top":case"bottom":return n?t?Gx:Yx:t?Yx:Gx;case"left":case"right":return t?WM:YM;default:return[]}}function XM(e,t,n,r){const i=Vs(e);let s=GM(Hi(e),n==="start",r);return i&&(s=s.map(u=>u+"-"+i),t&&(s=s.concat(s.map(em)))),s}function $l(e){const t=Hi(e);return zM[t]+e.slice(t.length)}function KM(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function Xx(e){return typeof e!="number"?KM(e):{top:e,right:e,bottom:e,left:e}}function zl(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Kx(e,t,n){let{reference:r,floating:i}=e;const s=Zr(t),u=Zh(t),c=Jh(u),d=Hi(t),f=s==="y",h=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,E=r[c]/2-i[c]/2;let b;switch(d){case"top":b={x:h,y:r.y-i.height};break;case"bottom":b={x:h,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}const T=Vs(t);return T&&(b[u]+=E*(T==="end"?1:-1)*(n&&f?-1:1)),b}function QM(e,t){return Oe(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:E=!1,padding:b=0}=hi(t,e),T=Xx(b),I=c[E?m==="floating"?"reference":"floating":m],_=zl(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(I))==null||n?I:I.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=m==="floating"?{x:r,y:i,width:u.floating.width,height:u.floating.height}:u.reference,P=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),B=(yield s.isElement==null?void 0:s.isElement(P))&&(yield s.getScale==null?void 0:s.getScale(P))||{x:1,y:1},R=zl(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:P,strategy:d}):N);return{top:(_.top-R.top+T.top)/B.y,bottom:(R.bottom-_.bottom+T.bottom)/B.y,left:(_.left-R.left+T.left)/B.x,right:(R.right-_.right+T.right)/B.x}})}const JM=50,ZM=(e,t,n)=>Oe(null,null,function*(){const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:u}=n,c=u.detectOverflow?u:ue(U({},u),{detectOverflow:QM}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:m}=Kx(f,r,d),E=r,b=0;const T={};for(let v=0;v<s.length;v++){const I=s[v];if(!I)continue;const{name:_,fn:N}=I,{x:P,y:B,data:R,reset:O}=yield N({x:h,y:m,initialPlacement:r,placement:E,strategy:i,middlewareData:T,rects:f,platform:c,elements:{reference:e,floating:t}});h=P!=null?P:h,m=B!=null?B:m,T[_]=U(U({},T[_]),R),O&&b<JM&&(b++,typeof O=="object"&&(O.placement&&(E=O.placement),O.rects&&(f=O.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:h,y:m}=Kx(f,E,d)),v=-1)}return{x:h,y:m,placement:E,strategy:i,middlewareData:T}}),e9=e=>({name:"arrow",options:e,fn(n){return Oe(this,null,function*(){const{x:r,y:i,placement:s,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:h,padding:m=0}=hi(e,n)||{};if(h==null)return{};const E=Xx(m),b={x:r,y:i},T=Zh(s),v=Jh(T),I=yield c.getDimensions(h),_=T==="y",N=_?"top":"left",P=_?"bottom":"right",B=_?"clientHeight":"clientWidth",R=u.reference[v]+u.reference[T]-b[T]-u.floating[v],O=b[T]-u.reference[T],q=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let K=q?q[B]:0;(!K||!(yield c.isElement==null?void 0:c.isElement(q)))&&(K=d.floating[B]||u.floating[v]);const re=R/2-O/2,H=K/2-I[v]/2-1,Z=ji(E[N],H),X=ji(E[P],H),he=K-I[v]-X,V=K/2-I[v]/2+re,ce=Wx(Z,V,he),me=!f.arrow&&Vs(s)!=null&&V!==ce&&u.reference[v]/2-(V<Z?Z:X)-I[v]/2<0,se=me?V<Z?V-Z:V-he:0;return{[T]:b[T]+se,data:U({[T]:ce,centerOffset:V-ce-se},me&&{alignmentOffset:se}),reset:me}})}}),t9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Oe(this,null,function*(){var r,i;const{placement:s,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:h}=n,ce=hi(e,n),{mainAxis:m=!0,crossAxis:E=!0,fallbackPlacements:b,fallbackStrategy:T="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:I=!0}=ce,_=bn(ce,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const N=Hi(s),P=Zr(d),B=Hi(d)===d,R=yield f.isRTL==null?void 0:f.isRTL(h.floating),O=b||(B||!I?[$l(d)]:qM(d)),q=v!=="none";!b&&q&&O.push(...XM(d,I,v,R));const K=[d,...O],re=yield f.detectOverflow(n,_),H=[];let Z=((i=u.flip)==null?void 0:i.overflows)||[];if(m&&H.push(re[N]),E){const me=VM(s,c,R);H.push(re[me[0]],re[me[1]])}if(Z=[...Z,{placement:s,overflows:H}],!H.every(me=>me<=0)){var X,he;const me=(((X=u.flip)==null?void 0:X.index)||0)+1,se=K[me];if(se&&(!(E==="alignment"?P!==Zr(se):!1)||Z.every(C=>Zr(C.placement)===P?C.overflows[0]>0:!0)))return{data:{index:me,overflows:Z},reset:{placement:se}};let J=(he=Z.filter(ae=>ae.overflows[0]<=0).sort((ae,C)=>ae.overflows[1]-C.overflows[1])[0])==null?void 0:he.placement;if(!J)switch(T){case"bestFit":{var V;const ae=(V=Z.filter(C=>{if(q){const F=Zr(C.placement);return F===P||F==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((C,F)=>C[1]-F[1])[0])==null?void 0:V[0];ae&&(J=ae);break}case"initialPlacement":J=d;break}if(s!==J)return{reset:{placement:J}}}return{}})}}};function Qx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jx(e){return $M.some(t=>e[t]>=0)}const n9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Oe(this,null,function*(){const{rects:r,platform:i}=n,c=hi(e,n),{strategy:s="referenceHidden"}=c,u=bn(c,["strategy"]);switch(s){case"referenceHidden":{const d=yield i.detectOverflow(n,ue(U({},u),{elementContext:"reference"})),f=Qx(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Jx(f)}}}case"escaped":{const d=yield i.detectOverflow(n,ue(U({},u),{altBoundary:!0})),f=Qx(d,r.floating);return{data:{escapedOffsets:f,escaped:Jx(f)}}}default:return{}}})}}},Zx=new Set(["left","top"]);function r9(e,t){return Oe(this,null,function*(){const{placement:n,platform:r,elements:i}=e,s=yield r.isRTL==null?void 0:r.isRTL(i.floating),u=Hi(n),c=Vs(n),d=Zr(n)==="y",f=Zx.has(u)?-1:1,h=s&&d?-1:1,m=hi(t,e);let{mainAxis:E,crossAxis:b,alignmentAxis:T}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof T=="number"&&(b=c==="end"?T*-1:T),d?{x:b*h,y:E*f}:{x:E*f,y:b*h}})}const i9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Oe(this,null,function*(){var r,i;const{x:s,y:u,placement:c,middlewareData:d}=n,f=yield r9(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:s+f.x,y:u+f.y,data:ue(U({},f),{placement:c})}})}}},o9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Oe(this,null,function*(){const{x:r,y:i,placement:s,platform:u}=n,P=hi(e,n),{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:B=>{let{x:R,y:O}=B;return{x:R,y:O}}}}=P,h=bn(P,["mainAxis","crossAxis","limiter"]),m={x:r,y:i},E=yield u.detectOverflow(n,h),b=Zr(s),T=Qh(b);let v=m[T],I=m[b];const _=(B,R)=>Wx(R+E[B==="y"?"top":"left"],R,R-E[B==="y"?"bottom":"right"]);c&&(v=_(T,v)),d&&(I=_(b,I));const N=f.fn(ue(U({},n),{[T]:v,[b]:I}));return ue(U({},N),{data:{x:N.x-r,y:N.y-i,enabled:{[T]:c,[b]:d}}})})}}},s9=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:s,placement:u,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:h=!0,crossAxis:m=!0}=hi(e,t),E={x:i,y:s},b=Zr(u),T=Qh(b);let v=E[T],I=E[b];const _=hi(f,t),N=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)!=null?n:0,crossAxis:(r=_.crossAxis)!=null?r:0};if(h){const R=T==="y"?"height":"width",O=c.reference[T]-c.floating[R]+N.mainAxis,q=c.reference[T]+c.reference[R]-N.mainAxis;v<O?v=O:v>q&&(v=q)}if(m){var P,B;const R=T==="y"?"width":"height",O=Zx.has(Hi(u)),q=c.reference[b]-c.floating[R]+(O&&((P=d.offset)==null?void 0:P[b])||0)+(O?0:N.crossAxis),K=c.reference[b]+c.reference[R]+(O?0:((B=d.offset)==null?void 0:B[b])||0)-(O?N.crossAxis:0);I<q?I=q:I>K&&(I=K)}return{[T]:v,[b]:I}}}},a9=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Oe(this,null,function*(){const{placement:r,rects:i,platform:s,elements:u}=n,H=hi(e,n),{apply:c=()=>{}}=H,d=bn(H,["apply"]),f=yield s.detectOverflow(n,d),h=Hi(r),m=Vs(r),E=Zr(r)==="y",{width:b,height:T}=i.floating;let v,I;h==="top"||h==="bottom"?(v=h,I=m===((yield s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(I=h,v=m==="end"?"top":"bottom");const _=T-f.top-f.bottom,N=b-f.left-f.right,P=ji(T-f[v],_),B=ji(b-f[I],N),R=n.middlewareData.shift,O=!R;let q=P,K=B;R!=null&&R.enabled.x&&(K=N),R!=null&&R.enabled.y&&(q=_),O&&!m&&(E?K=b-2*pi(f.left,f.right):q=T-2*pi(f.top,f.bottom)),yield c(ue(U({},n),{availableWidth:K,availableHeight:q}));const re=yield s.getDimensions(u.floating);return b!==re.width||T!==re.height?{reset:{rects:!0}}:{}})}}};function Vl(){return typeof window!="undefined"}function qs(e){return eT(e)?(e.nodeName||"").toLowerCase():"#document"}function rr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ei(e){var t;return(t=(eT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eT(e){return Vl()?e instanceof Node||e instanceof rr(e).Node:!1}function Nr(e){return Vl()?e instanceof Element||e instanceof rr(e).Element:!1}function ti(e){return Vl()?e instanceof HTMLElement||e instanceof rr(e).HTMLElement:!1}function tT(e){return!Vl()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof rr(e).ShadowRoot}function vu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function u9(e){return/^(table|td|th)$/.test(qs(e))}function ql(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const c9=/transform|translate|scale|rotate|perspective|filter/,l9=/paint|layout|strict|content/,Ho=e=>!!e&&e!=="none";let tm;function nm(e){const t=Nr(e)?Ir(e):e;return Ho(t.transform)||Ho(t.translate)||Ho(t.scale)||Ho(t.rotate)||Ho(t.perspective)||!rm()&&(Ho(t.backdropFilter)||Ho(t.filter))||c9.test(t.willChange||"")||l9.test(t.contain||"")}function d9(e){let t=$i(e);for(;ti(t)&&!Ws(t);){if(nm(t))return t;if(ql(t))return null;t=$i(t)}return null}function rm(){return tm==null&&(tm=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tm}function Ws(e){return/^(html|body|#document)$/.test(qs(e))}function Ir(e){return rr(e).getComputedStyle(e)}function Wl(e){return Nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tT(e)&&e.host||ei(e);return tT(t)?t.host:t}function nT(e){const t=$i(e);return Ws(t)?(e.ownerDocument||e).body:ti(t)&&vu(t)?t:nT(t)}function Su(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=nT(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),u=rr(i);if(s){const c=im(u);return t.concat(u,u.visualViewport||[],vu(i)?i:[],c&&n?Su(c):[])}else return t.concat(i,Su(i,[],n))}function im(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rT(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ti(e),s=i?e.offsetWidth:n,u=i?e.offsetHeight:r,c=jl(n)!==s||jl(r)!==u;return c&&(n=s,r=u),{width:n,height:r,$:c}}function om(e){return Nr(e)?e:e.contextElement}function Ys(e){const t=om(e);if(!ti(t))return Jr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=rT(t);let u=(s?jl(n.width):n.width)/r,c=(s?jl(n.height):n.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const f9=Jr(0);function iT(e){const t=rr(e);return!rm()||!t.visualViewport?f9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rr(e)?!1:t}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=om(e);let u=Jr(1);t&&(r?Nr(r)&&(u=Ys(r)):u=Ys(e));const c=p9(s,n,r)?iT(s):Jr(0);let d=(i.left+c.x)/u.x,f=(i.top+c.y)/u.y,h=i.width/u.x,m=i.height/u.y;if(s){const E=rr(s),b=r&&Nr(r)?rr(r):r;let T=E,v=im(T);for(;v&&r&&b!==T;){const I=Ys(v),_=v.getBoundingClientRect(),N=Ir(v),P=_.left+(v.clientLeft+parseFloat(N.paddingLeft))*I.x,B=_.top+(v.clientTop+parseFloat(N.paddingTop))*I.y;d*=I.x,f*=I.y,h*=I.x,m*=I.y,d+=P,f+=B,T=rr(v),v=im(T)}}return zl({width:h,height:m,x:d,y:f})}function Yl(e,t){const n=Wl(e).scrollLeft;return t?t.left+n:$o(ei(e)).left+n}function oT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yl(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function h9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",u=ei(r),c=t?ql(t.floating):!1;if(r===u||c&&s)return n;let d={scrollLeft:0,scrollTop:0},f=Jr(1);const h=Jr(0),m=ti(r);if((m||!m&&!s)&&((qs(r)!=="body"||vu(u))&&(d=Wl(r)),ti(r))){const b=$o(r);f=Ys(r),h.x=b.x+r.clientLeft,h.y=b.y+r.clientTop}const E=u&&!m&&!s?oT(u,d):Jr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+E.x,y:n.y*f.y-d.scrollTop*f.y+h.y+E.y}}function m9(e){return Array.from(e.getClientRects())}function g9(e){const t=ei(e),n=Wl(e),r=e.ownerDocument.body,i=pi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Yl(e);const c=-n.scrollTop;return Ir(r).direction==="rtl"&&(u+=pi(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:u,y:c}}const sT=25;function y9(e,t){const n=rr(e),r=ei(e),i=n.visualViewport;let s=r.clientWidth,u=r.clientHeight,c=0,d=0;if(i){s=i.width,u=i.height;const h=rm();(!h||h&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=Yl(r);if(f<=0){const h=r.ownerDocument,m=h.body,E=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,T=Math.abs(r.clientWidth-m.clientWidth-b);T<=sT&&(s-=T)}else f<=sT&&(s+=f);return{width:s,height:u,x:c,y:d}}const E9=new Set(["absolute","fixed"]);function b9(e,t){const n=$o(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=ti(e)?Ys(e):Jr(1),u=e.clientWidth*s.x,c=e.clientHeight*s.y,d=i*s.x,f=r*s.y;return{width:u,height:c,x:d,y:f}}function aT(e,t,n){let r;if(t==="viewport")r=y9(e,n);else if(t==="document")r=g9(ei(e));else if(Nr(t))r=b9(t,n);else{const i=iT(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zl(r)}function uT(e,t){const n=$i(e);return n===t||!Nr(n)||Ws(n)?!1:Ir(n).position==="fixed"||uT(n,t)}function w9(e,t){const n=t.get(e);if(n)return n;let r=Su(e,[],!1).filter(c=>Nr(c)&&qs(c)!=="body"),i=null;const s=Ir(e).position==="fixed";let u=s?$i(e):e;for(;Nr(u)&&!Ws(u);){const c=Ir(u),d=nm(u);!d&&c.position==="fixed"&&(i=null),(s?!d&&!i:!d&&c.position==="static"&&!!i&&E9.has(i.position)||vu(u)&&!d&&uT(e,u))?r=r.filter(h=>h!==u):i=c,u=$i(u)}return t.set(e,r),r}function x9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const u=[...n==="clippingAncestors"?ql(t)?[]:w9(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,h)=>{const m=aT(t,h,i);return f.top=pi(m.top,f.top),f.right=ji(m.right,f.right),f.bottom=ji(m.bottom,f.bottom),f.left=pi(m.left,f.left),f},aT(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function T9(e){const{width:t,height:n}=rT(e);return{width:t,height:n}}function _9(e,t,n){const r=ti(t),i=ei(t),s=n==="fixed",u=$o(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=Jr(0);function f(){d.x=Yl(i)}if(r||!r&&!s)if((qs(t)!=="body"||vu(i))&&(c=Wl(t)),r){const b=$o(t,!0,s,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}else i&&f();s&&!r&&i&&f();const h=i&&!r&&!s?oT(i,c):Jr(0),m=u.left+c.scrollLeft-d.x-h.x,E=u.top+c.scrollTop-d.y-h.y;return{x:m,y:E,width:u.width,height:u.height}}function sm(e){return Ir(e).position==="static"}function cT(e,t){if(!ti(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ei(e)===n&&(n=n.ownerDocument.body),n}function lT(e,t){const n=rr(e);if(ql(e))return n;if(!ti(e)){let i=$i(e);for(;i&&!Ws(i);){if(Nr(i)&&!sm(i))return i;i=$i(i)}return n}let r=cT(e,t);for(;r&&u9(r)&&sm(r);)r=cT(r,t);return r&&Ws(r)&&sm(r)&&!nm(r)?n:r||d9(e)||n}const v9=function(e){return Oe(this,null,function*(){const t=this.getOffsetParent||lT,n=this.getDimensions,r=yield n(e.floating);return{reference:_9(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function S9(e){return Ir(e).direction==="rtl"}const A9={convertOffsetParentRelativeRectToViewportRelativeRect:h9,getDocumentElement:ei,getClippingRect:x9,getOffsetParent:lT,getElementRects:v9,getClientRects:m9,getDimensions:T9,getScale:Ys,isElement:Nr,isRTL:S9};function dT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k9(e,t){let n=null,r;const i=ei(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function u(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const f=e.getBoundingClientRect(),{left:h,top:m,width:E,height:b}=f;if(c||t(),!E||!b)return;const T=Hl(m),v=Hl(i.clientWidth-(h+E)),I=Hl(i.clientHeight-(m+b)),_=Hl(h),P={rootMargin:-T+"px "+-v+"px "+-I+"px "+-_+"px",threshold:pi(0,ji(1,d))||1};let B=!0;function R(O){const q=O[0].intersectionRatio;if(q!==d){if(!B)return u();q?u(!1,q):r=setTimeout(()=>{u(!1,1e-7)},1e3)}q===1&&!dT(f,e.getBoundingClientRect())&&u(),B=!1}try{n=new IntersectionObserver(R,ue(U({},P),{root:i.ownerDocument}))}catch(O){n=new IntersectionObserver(R,P)}n.observe(e)}return u(!0),s}function C9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=om(e),h=i||s?[...f?Su(f):[],...Su(t)]:[];h.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),s&&_.addEventListener("resize",n)});const m=f&&c?k9(f,n):null;let E=-1,b=null;u&&(b=new ResizeObserver(_=>{let[N]=_;N&&N.target===f&&b&&(b.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var P;(P=b)==null||P.observe(t)})),n()}),f&&!d&&b.observe(f),b.observe(t));let T,v=d?$o(e):null;d&&I();function I(){const _=$o(e);v&&!dT(v,_)&&n(),v=_,T=requestAnimationFrame(I)}return n(),()=>{var _;h.forEach(N=>{i&&N.removeEventListener("scroll",n),s&&N.removeEventListener("resize",n)}),m==null||m(),(_=b)==null||_.disconnect(),b=null,d&&cancelAnimationFrame(T)}}const N9=i9,I9=o9,O9=t9,P9=a9,R9=n9,L9=e9,D9=s9,M9=(e,t,n)=>{const r=new Map,i=U({platform:A9},n),s=ue(U({},i.platform),{_c:r});return ZM(e,t,ue(U({},i),{platform:s}))};function fT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return ue(U({},i),{toJSON:()=>i})}function F9(e){if(!e)return fT();const{x:t,y:n,width:r,height:i}=e;return fT(t,n,r,i)}function B9(e,t){return{contextElement:cn(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?F9(r):n.getBoundingClientRect()}}}var Au=e=>({variable:e,reference:`var(${e})`}),mi={arrowSize:Au("--arrow-size"),arrowSizeHalf:Au("--arrow-size-half"),arrowBg:Au("--arrow-background"),transformOrigin:Au("--transform-origin"),arrowOffset:Au("--arrow-offset")},U9=e=>e==="top"||e==="bottom"?"y":"x";function j9(e,t){return{name:"transformOrigin",fn(n){var re,H,Z,X,he;const{elements:r,middlewareData:i,placement:s,rects:u,y:c}=n,d=s.split("-")[0],f=U9(d),h=((re=i.arrow)==null?void 0:re.x)||0,m=((H=i.arrow)==null?void 0:H.y)||0,E=(t==null?void 0:t.clientWidth)||0,b=(t==null?void 0:t.clientHeight)||0,T=h+E/2,v=m+b/2,I=Math.abs(((Z=i.shift)==null?void 0:Z.y)||0),_=u.reference.height/2,N=b/2,P=(he=(X=e.offset)==null?void 0:X.mainAxis)!=null?he:e.gutter,B=typeof P=="number"?P+N:P!=null?P:N,R=I>B,O={top:`${T}px calc(100% + ${B}px)`,bottom:`${T}px ${-B}px`,left:`calc(100% + ${B}px) ${v}px`,right:`${-B}px ${v}px`}[d],q=`${T}px ${u.reference.y+_-c}px`,K=!!e.overlap&&f==="y"&&R;return r.floating.style.setProperty(mi.transformOrigin.variable,K?q:O),{data:{transformOrigin:K?q:O}}}}}var H9={name:"rects",fn({rects:e}){return{data:e}}},$9=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:i}=n.arrow,s=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:i!=null?`${i}px`:"",[s]:`calc(100% + ${mi.arrowOffset.reference})`}),{}}}};function z9(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var V9={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function pT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function am(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function q9(e,t,n){const r=e||t.createElement("div");return L9({element:r,padding:n.arrowPadding})}function W9(e,t){var n;if(!f8((n=t.offset)!=null?n:t.gutter))return N9(({placement:r})=>{var h,m,E,b;const i=((e==null?void 0:e.clientHeight)||0)/2,s=(m=(h=t.offset)==null?void 0:h.mainAxis)!=null?m:t.gutter,u=typeof s=="number"?s+i:s!=null?s:i,{hasAlign:c}=z9(r),d=c?void 0:t.shift,f=(b=(E=t.offset)==null?void 0:E.crossAxis)!=null?b:d;return Dh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function Y9(e){if(!e.flip)return;const t=am(e.boundary);return O9(ue(U({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function G9(e){if(!e.slide&&!e.overlap)return;const t=am(e.boundary);return I9(ue(U({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:D9()}))}function X9(e){return P9({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:i}){const s=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);i=Math.floor(i),r=Math.floor(r),s.style.setProperty("--reference-width",`${u}px`),s.style.setProperty("--reference-height",`${c}px`),s.style.setProperty("--available-width",`${i}px`),s.style.setProperty("--available-height",`${r}px`)}})}function K9(e){var t;if(e.hideWhenDetached)return R9({strategy:"referenceHidden",boundary:(t=am(e.boundary))!=null?t:"clippingAncestors"})}function Q9(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function J9(e,t,n={}){const r=B9(e,n.getAnchorRect);if(!t||!r)return;const i=Object.assign({},V9,n),s=t.querySelector("[data-part=arrow]"),u=[W9(s,i),Y9(i),G9(i),q9(s,t.ownerDocument,i),$9(s),j9({gutter:i.gutter,offset:i.offset,overlap:i.overlap},s),X9(i),K9(i),H9],{placement:c,strategy:d,onComplete:f,onPositioned:h}=i,m=()=>Oe(null,null,function*(){var B;if(!r||!t)return;const v=yield M9(r,t,{placement:c,middleware:u,strategy:d});f==null||f(v),h==null||h({placed:!0});const I=Ms(t),_=pT(I,v.x),N=pT(I,v.y);t.style.setProperty("--x",`${_}px`),t.style.setProperty("--y",`${N}px`),i.hideWhenDetached&&(((B=v.middlewareData.hide)==null?void 0:B.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const P=t.firstElementChild;if(P){const R=Bs(P);t.style.setProperty("--z-index",R.zIndex)}}),E=()=>Oe(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),h==null||h({placed:!0})):yield m()}),b=Q9(i.listeners),T=i.listeners?C9(r,t,E,b):x8;return E(),()=>{T==null||T(),h==null||h({placed:!1})}}function hT(e,t,n={}){const c=n,{defer:r}=c,i=bn(c,["defer"]),s=r?en:d=>d(),u=[];return u.push(s(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(J9(d,f,i))})),()=>{u.forEach(d=>d==null?void 0:d())}}var Z9={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function e7(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:i="absolute"}=e;return{arrow:{position:"absolute",width:mi.arrowSize.reference,height:mi.arrowSize.reference,[mi.arrowSizeHalf.variable]:`calc(${mi.arrowSize.reference} / 2)`,[mi.arrowOffset.variable]:`calc(${mi.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?Z9[t.split("-")[0]]:void 0,background:mi.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var Gs=new WeakMap,Gl=new WeakMap,Xl={},um=0,mT=e=>e&&(e.host||mT(e.parentNode)),t7=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=mT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),n7=new Set(["script","output","status","next-route-announcer"]),r7=e=>n7.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),i7=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:i,followControlledElements:s=!0}=t,u=t7(n,Array.isArray(e)?e:[e]);Xl[r]||(Xl[r]=new WeakMap);const c=Xl[r],d=[],f=new Set,h=new Set(u),m=b=>{!b||f.has(b)||(f.add(b),m(b.parentNode))};u.forEach(b=>{m(b),s&&cn(b)&&kx(b,T=>{m(T)})});const E=b=>{!b||h.has(b)||Array.prototype.forEach.call(b.children,T=>{if(f.has(T))E(T);else try{if(r7(T))return;const I=T.getAttribute(i)==="true",_=(Gs.get(T)||0)+1,N=(c.get(T)||0)+1;Gs.set(T,_),c.set(T,N),d.push(T),_===1&&I&&Gl.set(T,!0),N===1&&T.setAttribute(r,""),I||T.setAttribute(i,"true")}catch(v){console.error("[zag-js > ariaHidden] cannot operate on ",T,v)}})};return E(n),f.clear(),um++,()=>{d.forEach(b=>{const T=Gs.get(b)-1,v=c.get(b)-1;Gs.set(b,T),c.set(b,v),T||(Gl.has(b)||b.removeAttribute(i),Gl.delete(b)),v||b.removeAttribute(r)}),um--,um||(Gs=new WeakMap,Gs=new WeakMap,Gl=new WeakMap,Xl={})}},o7=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,s7=(e,t=o7(e),n="data-aria-hidden",r=!0)=>{if(t)return i7(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},a7=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function gT(e,t={}){const{defer:n=!0}=t,r=n?a7:s=>s(),i=[];return i.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&i.push(s7(u))})),()=>{i.forEach(s=>s==null?void 0:s())}}function u7(e){const t={each(n){var r;for(let i=0;i<((r=e.frames)==null?void 0:r.length);i+=1){const s=e.frames[i];s&&n(s)}},addEventListener(n,r,i){return t.each(s=>{try{s.document.addEventListener(n,r,i)}catch(u){}}),()=>{try{t.removeEventListener(n,r,i)}catch(s){}}},removeEventListener(n,r,i){t.each(s=>{try{s.document.removeEventListener(n,r,i)}catch(u){}})}};return t}function c7(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,i)=>{try{t==null||t.addEventListener(n,r,i)}catch(s){}return()=>{try{t==null||t.removeEventListener(n,r,i)}catch(s){}}},removeEventListener:(n,r,i)=>{try{t==null||t.removeEventListener(n,r,i)}catch(s){}}}}var yT="pointerdown.outside",ET="focus.outside";function l7(e){for(const t of e)if(cn(t)&&Qr(t))return!0;return!1}var bT=e=>"clientY"in e;function d7(e,t){if(!bT(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function f7(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function wT(e,t){if(!t||!bT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,s=i&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},c={x:e.clientX,y:e.clientY};return f7(u,c)?r||s:!1}function p7(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:s,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=Kr(e),f=Ms(e),h=u7(f),m=c7(f);function E(P,B){if(!cn(B)||!B.isConnected||Ds(e,B)||d7(e,P)||c&&Ax(e,B))return!1;const R=d.querySelector(`[aria-controls="${e.id}"]`);if(R){const q=Vh(R);if(wT(P,q))return!1}const O=Vh(e);return wT(P,O)?!1:!(n!=null&&n(B))}const b=new Set,T=Fo(e==null?void 0:e.getRootNode());function v(P){function B(R){var re,H;const O=u&&!Cx()?en:Z=>Z(),q=R!=null?R:P,K=(H=(re=q==null?void 0:q.composedPath)==null?void 0:re.call(q))!=null?H:[q==null?void 0:q.target];O(()=>{const Z=T?K[0]:Cr(P);if(!(!e||!E(P,Z))){if(i||s){const X=Lh(i,s);e.addEventListener(yT,X,{once:!0})}xT(e,yT,{bubbles:!1,cancelable:!0,detail:{originalEvent:q,contextmenu:nM(q),focusable:l7(K),target:Z}})}})}P.pointerType==="touch"?(b.forEach(R=>R()),b.add(ln(d,"click",B,{once:!0})),b.add(m.addEventListener("click",B,{once:!0})),b.add(h.addEventListener("click",B,{once:!0}))):B()}const I=new Set,_=setTimeout(()=>{I.add(ln(d,"pointerdown",v,!0)),I.add(m.addEventListener("pointerdown",v,!0)),I.add(h.addEventListener("pointerdown",v,!0))},0);function N(P){(u?en:R=>R())(()=>{var q,K;const R=(K=(q=P==null?void 0:P.composedPath)==null?void 0:q.call(P))!=null?K:[P==null?void 0:P.target],O=T?R[0]:Cr(P);if(!(!e||!E(P,O))){if(r||s){const re=Lh(r,s);e.addEventListener(ET,re,{once:!0})}xT(e,ET,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:!1,focusable:Qr(O),target:O}})}})}return Cx()||(I.add(ln(d,"focusin",N,!0)),I.add(m.addEventListener("focusin",N,!0)),I.add(h.addEventListener("focusin",N,!0))),()=>{clearTimeout(_),b.forEach(P=>P()),I.forEach(P=>P())}}function h7(e,t){const{defer:n}=t,r=n?en:s=>s(),i=[];return i.push(r(()=>{const s=typeof e=="function"?e():e;i.push(p7(s,t))})),()=>{i.forEach(s=>s==null?void 0:s())}}function xT(e,t,n){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,n);return e.dispatchEvent(i)}function m7(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return ln(Kr(e),"keydown",n,{capture:!0})}var TT="layer:request-dismiss",pr={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Ds(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Ds(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>pr.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];y7(e,TT,i=>{var s;(s=r.requestDismiss)==null||s.call(r,i),i.defaultPrevented||r==null||r.dismiss()}),g7(e,TT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function g7(e,t,n){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(i)}function y7(e,t,n){e.addEventListener(t,n,{once:!0})}var _T;function vT(){pr.layers.forEach(({node:e})=>{e.style.pointerEvents=pr.isBelowPointerBlockingLayer(e)?"none":"auto"})}function E7(e){e.style.pointerEvents=""}function b7(e,t){const n=Kr(e),r=[];return pr.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(_T=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(i=>{const[s,u]=SM(()=>{const c=i();return cn(c)?c:null},{timeout:1e3});s.then(c=>r.push(Dl(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{pr.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=_T,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(i=>i()))}}function w7(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Mh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:i,pointerBlocking:s,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:s,requestDismiss:i};pr.add(f),vT();function h(v){var _,N;const I=Cr(v.detail.originalEvent);pr.isBelowPointerBlockingLayer(e)||pr.isInBranch(I)||((_=t.onPointerDownOutside)==null||_.call(t,v),(N=t.onInteractOutside)==null||N.call(t,v),!v.defaultPrevented&&(c&&console.log("onPointerDownOutside:",v.detail.originalEvent),r==null||r()))}function m(v){var _,N;const I=Cr(v.detail.originalEvent);pr.isInBranch(I)||((_=t.onFocusOutside)==null||_.call(t,v),(N=t.onInteractOutside)==null||N.call(t,v),!v.defaultPrevented&&(c&&console.log("onFocusOutside:",v.detail.originalEvent),r==null||r()))}function E(v){var I;pr.isTopMost(e)&&((I=t.onEscapeKeyDown)==null||I.call(t,v),!v.defaultPrevented&&r&&(v.preventDefault(),r()))}function b(v){var P;if(!e)return!1;const I=typeof u=="function"?u():u,_=Array.isArray(I)?I:[I],N=(P=t.persistentElements)==null?void 0:P.map(B=>B()).filter(cn);return N&&_.push(...N),_.some(B=>Ds(B,v))||pr.isInNestedLayer(e,v)}const T=[s?b7(e,t.persistentElements):void 0,m7(e,E),h7(e,{exclude:b,onFocusOutside:m,onPointerDownOutside:h,defer:t.defer})];return()=>{pr.remove(e),vT(),E7(e),T.forEach(v=>v==null?void 0:v())}}function ST(e,t){const{defer:n}=t,r=n?en:s=>s(),i=[];return i.push(r(()=>{const s=Rs(e)?e():e;i.push(w7(s,t))})),()=>{i.forEach(s=>s==null?void 0:s())}}var x7=Object.defineProperty,T7=(e,t,n)=>t in e?x7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t,n)=>T7(e,typeof t!="symbol"?t+"":t,n),AT={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},_7=[],v7=class{constructor(e,t){Ut(this,"trapStack"),Ut(this,"config"),Ut(this,"doc"),Ut(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ut(this,"portalContainers",new Set),Ut(this,"listenerCleanups",[]),Ut(this,"handleFocus",r=>{const i=Cr(r),s=this.findContainerIndex(i,r)>=0;if(s||Ol(i))s&&(this.state.mostRecentlyFocusedNode=i);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(xu(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const h=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);h>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?h+1<f.length&&(u=f[h+1],c=!1):h-1>=0&&(u=f[h-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>xu(f)>0))||(c=!1);else c=!1;c&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ut(this,"handlePointerDown",r=>{const i=Cr(r);if(!(this.findContainerIndex(i,r)>=0)){if(Cu(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Cu(this.config.allowOutsideClick,r)||r.preventDefault()}}),Ut(this,"handleClick",r=>{const i=Cr(r);this.findContainerIndex(i,r)>=0||Cu(this.config.clickOutsideDeactivates,r)||Cu(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Ut(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const i=this.config.isKeyBackward(r),s=this.findNextNavNode({event:r,isBackward:i});if(!s)return;ku(r)&&r.preventDefault(),this.tryFocus(s)}}),Ut(this,"handleEscapeKey",r=>{S7(r)&&Cu(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Ut(this,"_mutationObserver"),Ut(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(i=>{i.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),i.some(c=>c.type==="attributes"&&(c.attributeName==="aria-controls"||c.attributeName==="aria-expanded")?!0:c.type==="childList"&&c.addedNodes.length>0?Array.from(c.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return Y8(f)?!0:f.id&&!this.state.containers.some(h=>h.contains(f))?G8(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ut(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(i=>{var s;(s=this._mutationObserver)==null||s.observe(i,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(i=>{this.observePortalContainer(i)}))}),Ut(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Qr(r)){const i=Fs(this.doc);if(i&&this.findContainerIndex(i)>=0)r=i;else{const s=this.state.tabbableGroups[0];r=s&&s.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Ut(this,"tryFocus",r=>{if(r!==!1&&r!==Fs(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,A7(r)&&r.select()}}),Ut(this,"deactivate",r=>{if(!this.state.active)return this;const i=U({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),AT.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const s=this.getOption(i,"onDeactivate"),u=this.getOption(i,"onPostDeactivate"),c=this.getOption(i,"checkCanReturnFocus"),d=this.getOption(i,"returnFocus","returnFocusOnDeactivate");s==null||s();const f=()=>{kT(()=>{if(d){const h=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(h)}u==null||u()})};if(d&&c){const h=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(h).then(f,f),this}return f(),this}),Ut(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onPause"),s=this.getOption(r,"onPostPause");return this.state.paused=!0,i==null||i(),this.removeListeners(),this.updateObservedNodes(),s==null||s(),this}),Ut(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onUnpause"),s=this.getOption(r,"onPostUnpause");return this.state.paused=!1,i==null||i(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),s==null||s(),this}),Ut(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ut(this,"getReturnFocusNode",r=>{const i=this.getNodeForOption("setReturnFocus",{params:[r]});return i||(i===!1?!1:r)}),Ut(this,"getOption",(r,i,s)=>r&&r[i]!==void 0?r[i]:this.config[s||i]),Ut(this,"getNodeForOption",(r,{hasFallback:i=!1,params:s=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...s)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let c=u;if(typeof u=="string"){try{c=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!c&&!i)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),Ut(this,"findNextNavNode",r=>{const{event:i,isBackward:s=!1}=r,u=r.target||Cr(i);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,i),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)s?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(s){let h=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(h<0&&((f==null?void 0:f.container)===u||Qr(u)&&!Bo(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(h=d),h>=0){const m=h===0?this.state.tabbableGroups.length-1:h-1,E=this.state.tabbableGroups[m];c=xu(u)>=0?E.lastTabbableNode:E.lastDomTabbableNode}else ku(i)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let h=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(h<0&&((f==null?void 0:f.container)===u||Qr(u)&&!Bo(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(h=d),h>=0){const m=h===this.state.tabbableGroups.length-1?0:h+1,E=this.state.tabbableGroups[m];c=xu(u)>=0?E.firstTabbableNode:E.firstDomTabbableNode}else ku(i)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||_7;const n=U({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return ku(r)&&!r.shiftKey},isKeyBackward(r){return ku(r)&&r.shiftKey}},t);this.doc=n.document||Kr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{V8(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||(n==null?void 0:n.includes(r))||i.find(s=>s===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?Ax(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Us(e,{getShadowRoot:this.config.getShadowRoot}),n=Dx(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],i=t[t.length-1],s=r,u=i;let c=!1;for(let f=0;f<t.length;f++)if(xu(t[f])>0){c=!0;break}function d(f,h=!0){const m=t.indexOf(f);if(m>=0)return t[m+(h?1:-1)];const E=n.indexOf(f);if(!(E<0)){if(h){for(let b=E+1;b<n.length;b++)if(Bo(n[b]))return n[b]}else for(let b=E-1;b>=0;b--)if(Bo(n[b]))return n[b]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:s,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return AT.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?kT(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(ln(this.doc,"focusin",this.handleFocus,!0),ln(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),ln(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),ln(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),ln(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),ln(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Fs(this.doc),t==null||t();const i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},ku=e=>e.key==="Tab",Cu=(e,...t)=>typeof e=="function"?e(...t):e,S7=e=>!e.isComposing&&e.key==="Escape",kT=e=>setTimeout(e,0),A7=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function CT(e,t={}){let n;const r=en(()=>{const i=typeof e=="function"?e():e;if(i){n=new v7(i,ue(U({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i},t),{document:Kr(i)}));try{n.activate()}catch(s){}}});return function(){n==null||n.deactivate(),r()}}var cm="data-scroll-lock";function k7(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function NT(e){const t=Bs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function IT(e){var b;const t=e!=null?e:document,n=(b=t.defaultView)!=null?b:window,{documentElement:r,body:i}=t;if(i.hasAttribute(cm))return;const u=NT(r)||NT(i),c=n.innerWidth-r.clientWidth;i.setAttribute(cm,"");const d=()=>_M(r,"--scrollbar-width",`${c}px`),f=k7(r),h=()=>{const T={overflow:"hidden"};return!u&&c>0&&(T[f]=`${c}px`),Dl(i,T)},m=()=>{var R,O;const{scrollX:T,scrollY:v,visualViewport:I}=n,_=(R=I==null?void 0:I.offsetLeft)!=null?R:0,N=(O=I==null?void 0:I.offsetTop)!=null?O:0,P={position:"fixed",overflow:"hidden",top:`${-(v-Math.floor(N))}px`,left:`${-(T-Math.floor(_))}px`,right:"0"};!u&&c>0&&(P[f]=`${c}px`);const B=Dl(i,P);return()=>{B==null||B(),n.scrollTo({left:T,top:v,behavior:"instant"})}},E=[d(),Pl()?m():h()];return()=>{E.forEach(T=>T==null?void 0:T()),i.removeAttribute(cm)}}var C7=jo("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),ni=C7.build(),OT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},PT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},lm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},RT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},N7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},dm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},fm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},I7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},LT=e=>e.getById(OT(e)),Xs=e=>e.getById(PT(e)),Ks=e=>e.getById(lm(e)),DT=e=>e.getById(RT(e)),O7=e=>e.getById(dm(e)),P7=e=>e.getById(fm(e));function R7(e,t){const{state:n,context:r,send:i,computed:s,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),h=s("currentPortalled"),m=r.get("renderedElements"),E=e7(ue(U({},u("positioning")),{placement:f}));return{portalled:h,open:d,setOpen(b){n.matches("open")!==b&&i({type:b?"OPEN":"CLOSE"})},reposition(b={}){i({type:"POSITIONING.SET",options:b})},getArrowProps(){return t.element(ue(U({id:N7(c)},ni.arrow.attrs),{dir:u("dir"),style:E.arrow}))},getArrowTipProps(){return t.element(ue(U({},ni.arrowTip.attrs),{dir:u("dir"),style:E.arrowTip}))},getAnchorProps(){return t.element(ue(U({},ni.anchor.attrs),{dir:u("dir"),id:OT(c)}))},getTriggerProps(){return t.button(ue(U({},ni.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:PT(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":lm(c),onPointerDown(b){Nx(b)&&eM()&&b.currentTarget.focus()},onClick(b){b.defaultPrevented||i({type:"TOGGLE"})},onBlur(b){i({type:"TRIGGER_BLUR",target:b.relatedTarget})}}))},getIndicatorProps(){return t.element(ue(U({},ni.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ue(U({id:RT(c)},ni.positioner.attrs),{dir:u("dir"),style:E.floating}))},getContentProps(){return t.element(ue(U({},ni.content.attrs),{dir:u("dir"),id:lm(c),tabIndex:-1,role:"dialog","aria-modal":_x(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":Ls(d),"aria-labelledby":m.title?dm(c):void 0,"aria-describedby":m.description?fm(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(ue(U({},ni.title.attrs),{id:dm(c),dir:u("dir")}))},getDescriptionProps(){return t.element(ue(U({},ni.description.attrs),{id:fm(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(ue(U({},ni.closeTrigger.attrs),{dir:u("dir"),id:I7(c),type:"button","aria-label":"close",onClick(b){b.defaultPrevented||(b.stopPropagation(),i({type:"CLOSE"}))}}))}}}var L7={props({props:e}){return ue(U({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:U({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var s;e.set("currentPlacement",t("positioning").placement);const r=(s=LT(n))!=null?s:Xs(n);return hT(r,()=>DT(n),ue(U({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>Ks(n);let i=!0;return ST(r,{type:"popover",pointerBlocking:t("modal"),exclude:Xs(n),defer:!0,onEscapeKeyDown(s){var u;(u=t("onEscapeKeyDown"))==null||u(s),!t("closeOnEscape")&&s.preventDefault()},onInteractOutside(s){var u;(u=t("onInteractOutside"))==null||u(s),!s.defaultPrevented&&(i=!(s.detail.focusable||s.detail.contextmenu),t("closeOnInteractOutside")||s.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:i})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:xM(()=>Ks(t),{triggerElement:Xs(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?gT(()=>[Ks(t),Xs(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return IT(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?CT(()=>Ks(t),{initialFocus:()=>Mx({root:Ks(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const i=(u=LT(n))!=null?u:Xs(n);hT(i,()=>DT(n),ue(U(U({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){en(()=>{Object.assign(e.get("renderedElements"),{title:!!O7(t),description:!!P7(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||en(()=>{const n=Mx({root:Ks(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,i;const n=(i=e.restoreFocus)!=null?i:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||en(()=>{const s=Xs(t);s==null||s.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};$s()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[vV,Kl]=Uo({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[SV,pm]=Uo({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),D7=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,dir:r,getRootNode:n},e),s=Fl(L7,i);return R7(s,Yh)},M7=e=>{const[t,u]=qx(e),c=u,{children:n}=c,r=bn(c,["children"]),i=D7(r),s=Kh(tn({present:i.open},t));return w.jsx(MM,{value:i,children:w.jsx($x,{value:s,children:n})})},MT=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(ue(U({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return w.jsx(Sn.button,ue(U({},i),{ref:t}))});MT.displayName="PopoverTrigger";function F7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function B7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function U7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function j7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function H7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function $7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function hm(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function FT(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const z7=({className:e,componentType:t,children:n})=>{const[r,i]=S.useState(!1),{globalClassName:s}=at(),u=f=>{i(f.open)},c=S.useCallback(()=>{i(!1)},[]),d=S.useMemo(()=>({closeMenu:c}),[c]);return w.jsxs(M7,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[w.jsx(MT,{"aria-label":`Overflow menu for ${t}`,className:M(`${k}-overflow-menu-button-trigger`,`${k}-icon-button`,s,e,`cim-${t}-component`),children:w.jsx(FT,{})}),w.jsx(Vx,{children:w.jsx(zx,{className:M(`${k}-overflow-menu-list`,s,`cim-${t}-component`),children:w.jsx(hx.Provider,{value:d,children:n})})})]})};function BT(e){return ct({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function UT(e){return ct({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[V7,zo]=Uo({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),mm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getControlProps(),e);return w.jsx(Sn.div,ue(U(U({},r),e),{ref:t}))});mm.displayName="CarouselControl";const gm=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["readOnly","index"]),i=zo(),s=tn(i.getIndicatorProps(n),r);return w.jsx(Sn.button,ue(U({},s),{ref:t}))});gm.displayName="CarouselIndicator";const ym=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getIndicatorGroupProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});ym.displayName="CarouselIndicatorGroup";const Em=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["index","snapAlign"]),i=zo(),s=tn(i.getItemProps(n),r);return w.jsx(Sn.div,ue(U({},s),{ref:t}))});Em.displayName="CarouselItem";const bm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getItemGroupProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});bm.displayName="CarouselItemGroup";const wm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getNextTriggerProps(),e);return w.jsx(Sn.button,ue(U({},r),{ref:t}))});wm.displayName="CarouselNextTrigger";const xm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getPrevTriggerProps(),e);return w.jsx(Sn.button,ue(U({},r),{ref:t}))});xm.displayName="CarouselPrevTrigger";function q7(e){const t=Bs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),i=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(E,b){let T=parseFloat(E);return/%/.test(E)&&(T/=100,T*=b),Number.isNaN(T)?0:T}let d=c(r,n.width),f=c(i,n.height),h=c(s,n.width),m=c(u,n.height);return{x:{before:d,after:h},y:{before:f,after:m}}}function W7(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function jT(e){let t=[];for(const n of e.children)t=t.concat(n,jT(n));return t}function HT(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},i=t?jT(e):e.children;for(const s of["x","y"]){const u=s==="x"?"y":"x",c=s==="x"?"left":"top",d=s==="x"?"width":"height",f=s==="x"?"scrollLeft":"scrollTop";for(const h of i){const m=h.getBoundingClientRect();if(!W7(n,m,u))continue;const E=Bs(h);let[b,T]=E.getPropertyValue("scroll-snap-align").split(" ");typeof T=="undefined"&&(T=b);const v=s==="x"?T:b,I=m[c]-n[c]+e[f];switch(v){case"none":break;case"start":r[s].start.push({node:h,position:I});break;case"center":r[s].center.push({node:h,position:I+m[d]/2});break;case"end":r[s].end.push({node:h,position:I+m[d]});break}}}return r}function $T(e){const t=e.getBoundingClientRect(),n=q7(e),r=HT(e),i={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:zT([...r.x.start.map(s=>s.position-n.x.before),...r.x.center.map(s=>s.position-t.width/2),...r.x.end.map(s=>s.position-t.width+n.x.after)].map(VT(0,i.x))),y:zT([...r.y.start.map(s=>s.position-n.y.before),...r.y.center.map(s=>s.position-t.height/2),...r.y.end.map(s=>s.position-t.height+n.y.after)].map(VT(0,i.y)))}}function Y7(e,t,n){const r=HT(e),i=[...r[t].start,...r[t].center,...r[t].end];for(const s of i)if(n(s.node))return s.position}var zT=e=>[...new Set(e)],VT=(e,t)=>n=>Math.max(e,Math.min(t,n)),G7=jo("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),gi=G7.build(),X7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},K7=(e,t)=>{var n,r,i;return(i=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?i:`carousel:${e.id}:item:${t}`},Ql=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},Q7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},J7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},Z7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},qT=(e,t)=>{var n,r,i;return(i=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?i:`carousel:${e.id}:indicator:${t}`},zn=e=>e.getById(Ql(e)),WT=e=>TM(zn(e),"[data-part=item]"),eF=(e,t)=>e.getById(qT(e,t)),YT=e=>{const t=zn(e);if(!t)return;const n=Us(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function tF(e,t){const{state:n,context:r,computed:i,send:s,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),h=i("canScrollNext"),m=i("canScrollPrev"),E=i("isHorizontal"),b=Array.from(r.get("pageSnapPoints")),T=r.get("page"),v=c("slidesPerPage"),I=c("padding"),_=c("translations");return{isPlaying:d,isDragging:f,page:T,pageSnapPoints:b,canScrollNext:h,canScrollPrev:m,getProgress(){return T/b.length},scrollToIndex(N,P){s({type:"INDEX.SET",index:N,instant:P})},scrollTo(N,P){s({type:"PAGE.SET",index:N,instant:P})},scrollNext(N){s({type:"PAGE.NEXT",instant:N})},scrollPrev(N){s({type:"PAGE.PREV",instant:N})},play(){s({type:"AUTOPLAY.START"})},pause(){s({type:"AUTOPLAY.PAUSE"})},isInView(N){return Array.from(r.get("slidesInView")).includes(N)},refresh(){s({type:"SNAP.REFRESH"})},getRootProps(){return t.element(ue(U({},gi.root.attrs),{id:X7(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":v,"--slide-spacing":c("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(ue(U({},gi.itemGroup.attrs),{id:Ql(u),"data-orientation":c("orientation"),"data-dragging":Ls(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(N){Ds(N.currentTarget,Cr(N))&&s({type:"VIEWPORT.FOCUS"})},onBlur(N){Ds(N.currentTarget,N.relatedTarget)||s({type:"VIEWPORT.BLUR"})},onMouseDown(N){if(N.defaultPrevented||!c("allowMouseDrag")||!Nx(N))return;const P=Cr(N);Qr(P)&&P!==N.currentTarget||(N.preventDefault(),s({type:"DRAGGING.START"}))},onWheel:T8(N=>{const P=c("orientation")==="horizontal"?"deltaX":"deltaY";N[P]<0&&!i("canScrollPrev")||N[P]>0&&!i("canScrollNext")||s({type:"USER.SCROLL"})},150),onTouchStart(){s({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[E?"x":"y",c("snapType")].join(" "),gridAutoFlow:E?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[E?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[E?"scrollPaddingInline":"scrollPaddingBlock"]:I,[E?"paddingInline":"paddingBlock"]:I,[E?"overflowX":"overflowY"]:"auto"}}))},getItemProps(N){const P=r.get("slidesInView").includes(N.index);return t.element(ue(U({},gi.item.attrs),{id:K7(u,N.index),dir:c("dir"),role:"group","data-index":N.index,"data-inview":Ls(P),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":_.item(N.index,c("slideCount")),"aria-hidden":_x(!P),style:{scrollSnapAlign:(()=>{var K;const B=(K=N.snapAlign)!=null?K:"start",R=c("slidesPerMove"),O=R==="auto"?Math.floor(c("slidesPerPage")):R;return(N.index+O)%O===0?B:void 0})()}}))},getControlProps(){return t.element(ue(U({},gi.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(ue(U({},gi.prevTrigger.attrs),{id:J7(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":_.prevTrigger,"data-orientation":c("orientation"),"aria-controls":Ql(u),onClick(N){N.defaultPrevented||s({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(ue(U({},gi.nextTrigger.attrs),{dir:c("dir"),id:Q7(u),type:"button","aria-label":_.nextTrigger,"data-orientation":c("orientation"),"aria-controls":Ql(u),disabled:!h,onClick(N){N.defaultPrevented||s({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(ue(U({},gi.indicatorGroup.attrs),{dir:c("dir"),id:Z7(u),"data-orientation":c("orientation"),onKeyDown(N){if(N.defaultPrevented)return;const P="indicator",B={ArrowDown(q){E||(s({type:"PAGE.NEXT",src:P}),q.preventDefault())},ArrowUp(q){E||(s({type:"PAGE.PREV",src:P}),q.preventDefault())},ArrowRight(q){E&&(s({type:"PAGE.NEXT",src:P}),q.preventDefault())},ArrowLeft(q){E&&(s({type:"PAGE.PREV",src:P}),q.preventDefault())},Home(q){s({type:"PAGE.SET",index:0,src:P}),q.preventDefault()},End(q){s({type:"PAGE.SET",index:b.length-1,src:P}),q.preventDefault()}},R=oM(N,{dir:c("dir"),orientation:c("orientation")}),O=B[R];O==null||O(N)}}))},getIndicatorProps(N){return t.button(ue(U({},gi.indicator.attrs),{dir:c("dir"),id:qT(u,N.index),type:"button","data-orientation":c("orientation"),"data-index":N.index,"data-readonly":Ls(N.readOnly),"data-current":Ls(N.index===T),"aria-label":_.indicator(N.index),onClick(P){P.defaultPrevented||N.readOnly||s({type:"PAGE.SET",index:N.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(ue(U({},gi.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":Ls(d),"aria-label":d?_.autoplayStop:_.autoplayStart,onClick(N){N.defaultPrevented||s({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var nF={props({props:e}){return C8(e,["slideCount"],"carousel"),ue(U({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:U({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const s=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:s[r]})}})),pageSnapPoints:t(()=>({defaultValue:rF(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return d8(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:i}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{i({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{i({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(zn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=zn(e);if(!n)return;const r=e.getWin(),i=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),YT(e)});return YT(e),i.observe(n,{childList:!0,subtree:!0}),()=>i.disconnect()},trackSlideResize({scope:e,send:t}){if(!zn(e))return;const r=e.getWin(),i=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};en(()=>{i(),en(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const s=new r.ResizeObserver(i);return WT(e).forEach(u=>s.observe(u)),()=>s.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=zn(e),i=e.getWin(),s=new i.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var E;const h=f.target,m=Number((E=h.dataset.index)!=null?E:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?s8(d,m):a8(d,m)},n.get("slidesInView"));n.set("slidesInView",u8(c))},{root:r,threshold:t("inViewThreshold")});return WT(e).forEach(u=>s.observe(u)),()=>s.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=zn(n);return r?ln(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return ln(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return bM(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return ln(r,"keydown",s=>{switch(s.key){case"ArrowRight":s.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":s.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":s.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":s.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:i}){var f;const s=t.instant?"instant":"smooth",u=xx((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=zn(n);if(!c)return;const d=r("isHorizontal")?"left":"top";i(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:s})})},setClosestPage({context:e,scope:t,computed:n}){const r=zn(t);if(!r)return;const i=n("isHorizontal")?r.scrollLeft:r.scrollTop,s=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-i)<1);s!==-1&&e.set("page",s)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),i=Ex(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",i)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),i=c8(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",i)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const i=zn(r);if(!i)return;const s=Y7(i,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(s==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-s)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=xx(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=zn(n);if(!r)return;const i=$T(r);e.set("pageSnapPoints",t("isHorizontal")?i.x:i.y)},disableScrollSnap({scope:e}){const t=zn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=zn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=zn(e);if(!r)return;const i=r.scrollLeft,s=r.scrollTop,u=$T(r),c=u.x.reduce((f,h)=>Math.abs(h-i)<Math.abs(f-i)?h:f,u.x[0]),d=u.y.reduce((f,h)=>Math.abs(h-s)<Math.abs(f-s)?h:f,u.y[0]);en(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const h=r.dataset.scrollSnapType;h&&(r.style.setProperty("scroll-snap-type",h),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=eF(n,e.get("page"));r&&en(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function rF(e,t,n){if(e==null||n<=0)return[];const r=[],i=t==="auto"?Math.floor(n):t;if(i<=0)return[];for(let s=0;s<e&&!(s+n>e);s+=i)r.push(s);return r}$s()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),$s()(["index","readOnly"]),$s()(["index","snapAlign"]);const iF=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,dir:r,getRootNode:n},e),s=Fl(nF,i);return tF(s,Yh)},Tm=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),i=iF(n),s=tn(i.getRootProps(),r);return w.jsx(V7,{value:i,children:w.jsx(Sn.div,ue(U({},s),{ref:t}))})});Tm.displayName="CarouselRoot";const oF=180,sF=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},aF=({globalClassName:e,className:t,itemMinWidth:n=oF,spacing:r="0.5rem",loop:i=!1,allowMouseDrag:s=!0,showIndicators:u=!0,showNavigation:c=!0,navigationVariant:d="chevron",onPageChange:f,ariaLabel:h="Product carousel",children:m})=>{const E=Array.from(m).map((H,Z)=>({node:H,key:S.isValidElement(H)&&H.key!=null?H.key:`carousel-item-${Z}`})),b=E.length,T=S.useRef(null),[v,I]=S.useState(0),{width:_}=$k();S.useLayoutEffect(()=>{T.current&&I(T.current.getBoundingClientRect().width)},[_,b]);const N=sF(r),P=n+N,B=v>0?(v+N)/P:1,R=Math.max(1,Math.floor(B));if(b===0)return null;const O=b>R,q=Math.ceil(b/R),K=O?Math.max(1,B):R,re=d==="circle-arrow";return w.jsxs(Tm,{ref:T,className:M(e,t,`${k}-carousel`,{[`${k}-carousel--circle-arrow-navigation`]:re}),slidesPerPage:K,slidesPerMove:R,spacing:r,loop:i,allowMouseDrag:s,slideCount:b,onPageChange:f,"aria-label":h,children:[w.jsx(bm,{className:M(e,`${k}-carousel__item-group`,{"carousel-row-container":!O}),children:E.map(({node:H,key:Z},X)=>w.jsx(Em,{index:X,className:M(e,`${k}-carousel__item`),children:H},Z))}),c&&O&&w.jsxs(mm,{className:M(e,`${k}-carousel__control`),children:[w.jsx(xm,{className:M(e,`${k}-carousel__prev-trigger`),"aria-label":"Previous slide",children:re?w.jsx(PE,{size:"16px"}):w.jsx(U7,{size:"16px"})}),w.jsx(wm,{className:M(e,`${k}-carousel__next-trigger`),"aria-label":"Next slide",children:re?w.jsx(RE,{size:"16px"}):w.jsx(j7,{size:"16px"})})]}),u&&O&&w.jsx(ym,{className:M(e,`${k}-carousel__indicator-group`),children:Array.from({length:q},(H,Z)=>w.jsx(gm,{index:Z,className:M(e,`${k}-carousel__indicator`),"aria-label":`Go to slide group ${Z+1}`},Z))})]})},[uF,cF]=Uo({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),lF=e=>_u()(e,["lazyMount","unmountOnExit"]),[dF,Nu]=Uo({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),GT=S.forwardRef((e,t)=>{const n=Nu(),r=cF(),i=Kh(ue(U({},r),{present:n.open})),s=tn(n.getBackdropProps(),i.getPresenceProps(),e);return i.unmounted?null:w.jsx(Sn.div,ue(U({},s),{ref:Bl(i.ref,t)}))});GT.displayName="DialogBackdrop";const _m=S.forwardRef((e,t)=>{const n=Nu(),r=Tu(),i=tn(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:Bl(r.ref,t)}))});_m.displayName="DialogContent";const vm=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getDescriptionProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});vm.displayName="DialogDescription";const Sm=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getPositionerProps(),e);return Tu().unmounted?null:w.jsx(Sn.div,ue(U({},r),{ref:t}))});Sm.displayName="DialogPositioner";var fF=jo("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Vo=fF.build(),XT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},KT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Am=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},QT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},km=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},Cm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},JT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Jl=e=>e.getById(Am(e)),pF=e=>e.getById(XT(e)),hF=e=>e.getById(KT(e)),mF=e=>e.getById(QT(e)),gF=e=>e.getById(km(e)),yF=e=>e.getById(Cm(e)),EF=e=>e.getById(JT(e));function bF(e,t){const{state:n,send:r,context:i,prop:s,scope:u}=e,c=s("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(ue(U({},Vo.trigger.attrs),{dir:s("dir"),id:QT(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Am(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(ue(U({},Vo.backdrop.attrs),{dir:s("dir"),hidden:!d,id:KT(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ue(U({},Vo.positioner.attrs),{dir:s("dir"),id:XT(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=i.get("rendered");return t.element(ue(U({},Vo.content.attrs),{dir:s("dir"),role:s("role"),hidden:!d,id:Am(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:km(u),"aria-describedby":f.description?Cm(u):void 0}))},getTitleProps(){return t.element(ue(U({},Vo.title.attrs),{dir:s("dir"),id:km(u)}))},getDescriptionProps(){return t.element(ue(U({},Vo.description.attrs),{dir:s("dir"),id:Cm(u)}))},getCloseTriggerProps(){return t.button(ue(U({},Vo.closeTrigger.attrs),{dir:s("dir"),id:JT(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var wF={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>EF(t):void 0,i=typeof e.modal=="boolean"?e.modal:!0;return U({role:"dialog",modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ST(()=>Jl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[mF(e)],onInteractOutside(i){var s;(s=n("onInteractOutside"))==null||s(i),n("closeOnInteractOutside")||i.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(i){var s;(s=n("onEscapeKeyDown"))==null||s(i),n("closeOnEscape")||i.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return IT(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?CT(()=>Jl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var i,s;return(s=(i=t("finalFocusEl"))==null?void 0:i())!=null?s:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?gT(()=>[Jl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){en(()=>{e.set("rendered",{title:!!gF(t),description:!!yF(t)})})},syncZIndex({scope:e}){en(()=>{const t=Jl(e);if(!t)return;const n=Bs(t);[pF(e),hF(e)].forEach(i=>{i==null||i.style.setProperty("--z-index",n.zIndex),i==null||i.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};$s()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const xF=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,getRootNode:n,dir:r},e),s=Fl(wF,i);return bF(s,Yh)},ZT=e=>{const[t,c]=qx(e),d=c,{children:n}=d,r=bn(d,["children"]),[i]=lF(t),s=xF(r),u=Kh(tn({present:s.open},t));return w.jsx(dF,{value:s,children:w.jsx(uF,{value:i,children:w.jsx($x,{value:u,children:n})})})},e_=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getTitleProps(),e);return w.jsx(Sn.h2,ue(U({},r),{ref:t}))});e_.displayName="DialogTitle";const TF=({children:e})=>{const[t,n]=S.useState(!1),r=S.useMemo(()=>({toggleMenu:()=>n(s=>!s),closeMenu:()=>n(!1)}),[]),i=S.useMemo(()=>({isOpen:t}),[t]);return w.jsx(Rh.Provider,{value:r,children:w.jsx(px.Provider,{value:i,children:e})})},t_=()=>S.useContext(px),n_=()=>{const e=S.useContext(Rh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},_F=`${k}-overflow-menu-button-trigger`,vF=({componentType:e,children:t})=>{const{isOpen:n}=t_(),{closeMenu:r}=n_(),{globalClassName:i}=at(),s=S.useRef(null);return S.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${_F}`)||s.current&&!s.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?w.jsx("div",{ref:s,className:M(`${k}-overflow-panel`,i,`cim-${e}-component`),children:t}):null},SF=({componentType:e,className:t})=>{const{toggleMenu:n}=n_(),{isOpen:r}=t_(),{globalClassName:i}=at();return w.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,className:M(`${k}-overflow-menu-button-trigger`,`${k}-icon-button`,i,t,`cim-${e}-component`),onClick:n,children:w.jsx(FT,{})})};class AF{constructor(){Ye(this,"initialState",C1);Ye(this,"promptsStateProxy");Ye(this,"promptsParamsProxy");Ye(this,"_fullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return NF(n,r),Reflect.set(t,n,r)});Ye(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Ye(this,"updatePromptsParamsProxy",t=>new Proxy(U({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const zi=new AF,kF=e=>{window.addEventListener(Lf,e)},CF=e=>{window.removeEventListener(Lf,e)},NF=(e,t)=>{const n=new CustomEvent(Lf,{detail:{property:e,value:t}});window.dispatchEvent(n)},r_=e=>{const t=zi.isOpen,n=typeof e=="boolean"?e:!t;zi.promptsStateProxy.isOpen=n},IF=e=>{const t=zi.isInline,n=typeof e=="boolean"?e:!t;zi.promptsStateProxy.isInline=n},OF=({elementId:e,entryType:t,params:n,isInline:r})=>{zi.promptsStateProxy.elementId=e,t&&(zi.promptsStateProxy.entryType=t),typeof r=="boolean"&&IF(r),n&&zi.updatePromptsParamsProxy(n),zi.isOpen||r_(!0)},PF=()=>{r1("resetConversation",!0,kc.RESET_CONVERSATION)},RF=()=>{r1("endConversation",!0,kc.END_CONVERSATION)},Nm=()=>{const e=S.useContext(mE);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},LF=()=>{const e=S.useContext(hE);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},Zl=()=>{const e=S.useContext(pE);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},DF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{previousComponentType:r}=Zn(),i=Mo(),s=()=>{fs(r||"dialog"),i()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:s,icon:w.jsx(BT,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-dialog-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(BT,{}),"Show ",r||"dialog"]})},MF=({componentType:e,globalClassName:t,controls:n,showClose:r,closeButtonAriaLabel:i,onClose:s,showOverflowMenu:u,showPrimaryToggle:c})=>{const d=e==="modal"?DF:s_;return w.jsx("div",{className:M(t,`${k}-${e}-controls`),children:n!=null?w.jsxs(w.Fragment,{children:[n,r&&w.jsx(Fp,{className:M(t,`cim-${e}-component`),label:i,onClick:s})]}):w.jsxs(w.Fragment,{children:[u&&w.jsx(SF,{componentType:e}),c&&w.jsx(d,{componentType:e,isIcon:!0}),r&&w.jsx(Fp,{className:M(t,`cim-${e}-component`),label:i,onClick:s})]})})},FF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{isModalFullscreen:r}=Zn(),i=Mo(),s=()=>{Ic(!r),i()},u=r?mO:gO,c="Toggle Fullscreen";return t?w.jsx(Sr,{ariaLabel:c,title:c,className:M(n,`${k}-modal-fullscreen-button`,`cim-${e}-component`),icon:w.jsx(u,{}),onClick:s}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-modal-fullscreen-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(u,{}),c]})},BF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{dialogPosition:r}=Zn(),i=Mo(),s=r==="bottom-left",u=()=>{Oc(s?"bottom-right":"bottom-left"),i()},c=s?B7:F7,d=s?"Move right":"Move left";return t?w.jsx(Sr,{className:M(n,`${k}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:w.jsx(c,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[w.jsx(c,{}),d]})},UF=({componentType:e,controls:t,showOverflowMenu:n,showSecondaryToggle:r,showMinimize:i,showClearChat:s,showEndConversation:u,showDownloadTranscript:c,onClearChat:d,onEndConversation:f,onDownloadTranscript:h})=>{if(t!=null||!n)return null;const m=e==="modal"?FF:BF;return w.jsxs(vF,{componentType:e,children:[r&&w.jsx(m,{componentType:e}),i&&w.jsx(WF,{componentType:e}),s&&w.jsx(mx,{componentType:e,onClearChat:d}),u&&f&&w.jsx(yx,{componentType:e,onEndConversation:f}),c&&h&&w.jsx(gx,{componentType:e,onDownloadTranscript:h})]})},jF=({componentType:e,overflowActions:t,availableActions:n,controls:r,onClearChat:i,onEndConversation:s,onClose:u,onDownloadTranscript:c})=>{const{headerConfig:d,globalClassName:f,layoutPreset:h}=at(),{mode:m}=Zn(),E=m==="standalone",b=e==="modal",T=re=>n===void 0||n[re],v=(re,H=!0)=>t.includes(re)&&T(re)&&H,I=T("toggleExpanded"),_=v(b?"toggleFullscreen":"toggleDialogPosition"),N=v("minimize"),P=v("clearChat"),B=T("close"),R=v("endConversation",!!s),O=v("downloadTranscript",!!c),q=_||N||P||R||O,K=S.useMemo(()=>d?SO(d):{},[d]);return w.jsx(TF,{children:w.jsxs("div",{className:M(f,`${k}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[w.jsxs("div",{className:M(f,`${k}-${e}-header`,{standalone:E,embedded:!E}),style:K,children:[d!=null&&d.logoUrl?w.jsx("img",{alt:"",className:M(f,`${k}-${e}-logo`,{standalone:E,embedded:!E}),src:d.logoUrl}):h==="commerce"?w.jsx("svg",{className:M(f,`${k}-${e}-logo`,{standalone:E,embedded:!E}),viewBox:"0 0 16 16",width:"24",height:"24",fill:"none",children:w.jsx("path",{d:"M6.62479 10.3342C6.56527 10.1034 6.44502 9.89289 6.27653 9.72441C6.10805 9.55592 5.8975 9.43567 5.66679 9.37615L1.57679 8.32148C1.50701 8.30168 1.4456 8.25965 1.40186 8.20178C1.35813 8.14391 1.33447 8.07335 1.33447 8.00082C1.33447 7.92828 1.35813 7.85772 1.40186 7.79985C1.4456 7.74198 1.50701 7.69996 1.57679 7.68015L5.66679 6.62482C5.89742 6.56535 6.10792 6.4452 6.27639 6.27684C6.44486 6.10849 6.56517 5.89808 6.62479 5.66748L7.67946 1.57748C7.69906 1.50743 7.74105 1.44571 7.799 1.40175C7.85696 1.35778 7.92771 1.33398 8.00046 1.33398C8.0732 1.33398 8.14395 1.35778 8.20191 1.40175C8.25987 1.44571 8.30185 1.50743 8.32146 1.57748L9.37546 5.66748C9.43497 5.8982 9.55523 6.10875 9.72371 6.27723C9.89219 6.44571 10.1027 6.56597 10.3335 6.62548L14.4235 7.67948C14.4938 7.69888 14.5558 7.74082 14.6 7.79887C14.6442 7.85691 14.6682 7.92786 14.6682 8.00082C14.6682 8.07378 14.6442 8.14472 14.6 8.20277C14.5558 8.26081 14.4938 8.30275 14.4235 8.32215L10.3335 9.37615C10.1027 9.43567 9.89219 9.55592 9.72371 9.72441C9.55523 9.89289 9.43497 10.1034 9.37546 10.3342L8.32079 14.4242C8.30118 14.4942 8.2592 14.5559 8.20124 14.5999C8.14328 14.6439 8.07254 14.6677 7.99979 14.6677C7.92704 14.6677 7.85629 14.6439 7.79834 14.5999C7.74038 14.5559 7.69839 14.4942 7.67879 14.4242L6.62479 10.3342Z",stroke:"#ffffff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null,w.jsx(e_,{className:M(f,`${k}-${e}-title`,{standalone:E,embedded:!E}),children:d==null?void 0:d.headerText}),w.jsx(MF,{componentType:e,globalClassName:f,controls:r,showClose:B,closeButtonAriaLabel:d==null?void 0:d.closeButtonAriaLabel,onClose:u,showOverflowMenu:q,showPrimaryToggle:I})]}),w.jsx(UF,{componentType:e,controls:r,showOverflowMenu:q,showSecondaryToggle:_,showMinimize:N,showClearChat:P,showEndConversation:R,showDownloadTranscript:O,onClearChat:i,onEndConversation:s,onDownloadTranscript:c})]})})},Qs="USD",Im=(...e)=>e.flatMap(t=>t!=null?t:[]).reduce((t,n)=>{const r=n.promotionalPrice;return typeof r!="number"||!Number.isFinite(r)?t:t===void 0||r<t?r:t},void 0),yi=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},HF=({retailPrice:e,discountPrice:t,currencyCode:n=Qs})=>{const r=n||Qs,i=typeof t=="number"&&typeof e=="number"&&t<e,s=i?t:e||t||null,u=i?e:null;return{price:yi(s,r),comparePrice:yi(u,r),hasDiscount:i}},ed=e=>typeof e=="number"&&Number.isFinite(e),Om=e=>ed(e==null?void 0:e.min)&&ed(e==null?void 0:e.max),i_=e=>{const t=e==null?void 0:e.type;return typeof t=="string"&&t.length>0?t:void 0},$F=({min:e,max:t,currencyCode:n=Qs})=>{if(!ed(e)||!ed(t))return null;const r=n||Qs,i=yi(e,r),s=yi(t,r);if(i===null||s===null)return null;const u=e!==t;return{value:u?`${i} – ${s}`:i,low:i,high:s,isRange:u}},zF=({priceBreakdown:e,currencyCode:t=Qs})=>{if(!e)return null;const n=t||Qs,r=Om(e.promotional)?e.promotional:null,i=Om(e.sales)?e.sales:null,s=Om(e.original)?e.original:null;if(!r&&!i&&!s)return null;const u=m=>$F({min:m.min,max:m.max,currencyCode:n});if(r){const m=u(r);return m?{active:m,compare:i?u(i):null}:null}const c=i_(e.sales),d=i_(e.original);if(i&&s&&c&&d&&c!==d){const m=u(i);return m?{active:m,compare:u(s)}:null}const f=i!=null?i:s;if(!f)return null;const h=u(f);return h?{active:h,compare:null}:null},Pm=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:i,className:s})=>{const{price:u,comparePrice:c,hasDiscount:d}=HF({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return w.jsxs("div",{className:M(i,s,`${k}-price`),style:f,children:[w.jsx("span",{className:`${k}-visually-hidden`,children:"Current price: "}),w.jsx("span",{className:M(i,`${k}-price__amount`),children:u}),d&&c&&w.jsxs("span",{className:M(i,`${k}-price__compare`),children:[w.jsx("span",{className:`${k}-visually-hidden`,children:"Original price: "}),c]})]})},VF={sparkle:hm,plus:H7,"paper-plane":$7},o_=({icon:e,className:t})=>{const n=VF[e];return n?w.jsx(n,{className:t,"aria-hidden":"true"}):null},qF=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:i,onSuggestionClick:s})=>{var b;const{suggestionButtonConfig:u}=at(),c=u==null?void 0:u.icon,d=(b=u==null?void 0:u.iconPosition)!=null?b:"left",f=i?"standalone":"embedded",h=T=>()=>{s(T)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},E=T=>w.jsxs(w.Fragment,{children:[c&&w.jsx(o_,{icon:c,className:`${k}-suggestion-button-icon`}),w.jsx("span",{children:T})]});return w.jsx("div",{className:M(t,`${k}-suggestion-container ${f}`,e),children:n.map(T=>i?w.jsx(Bp,{disabled:r,className:M(t,`${k}-suggestion-button standalone`,m),onClick:h(T),children:E(T)},T):w.jsx("button",{disabled:r,className:M(t,`${k}-suggestion-button embedded`,m),onClick:h(T),children:E(T)},T))})},WF=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=at();if(!r)return null;const i=()=>{zr(!1),yo(!0),nl()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:i,icon:w.jsx(CE,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-minimize-button`,`cim-${e}-component`),onClick:i,children:[w.jsx(CE,{}),"Minimize"]})},s_=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),r=Mo(),i=()=>{fs("modal"),r()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:i,icon:w.jsx(UT,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-modal-button`,`cim-${e}-component`),onClick:i,children:[w.jsx(UT,{}),"Show modal"]})};function YF(e){return e.includes("-")&&e===e.toLowerCase()}function ri({tagName:e,props:t,label:n,onError:r}){const i=S.useRef(null),s=S.useRef(null),u=S.useRef(e),c=S.useRef(null),d=S.useRef(null),f=S.useRef(r);return f.current=r,S.useEffect(()=>{const h=i.current;if(!h)return;const m=()=>{var b;d.current!==e&&(d.current=e,(b=f.current)==null||b.call(f))};if(u.current!==e&&(u.current=e,s.current=null,d.current=null),!YF(e)){c.current!==e&&(c.current=e,At(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`),m()),s.current=null,h.replaceChildren();return}const E=s.current;if(E&&E.isConnected)try{E.props=t;return}catch(b){At(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,b),m(),s.current=null,h.replaceChildren();return}try{const b=document.createElement(e);b.props=t,h.replaceChildren(b);const T=b.localName;s.current=typeof customElements!="undefined"&&customElements.get(T)?b:null}catch(b){At(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,b),m(),s.current=null,h.replaceChildren()}},[e,t,n]),S.useEffect(()=>{const h=i.current;return()=>{s.current=null,h==null||h.replaceChildren()}},[]),w.jsx("div",{ref:i,"data-override":n||"custom"})}class td extends S.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){var r,i,s;At(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack),(r=this.context)==null||r.failure("override_render_error",{context:{override:this.props.overrideName}}),(s=(i=this.props).onError)==null||s.call(i)}render(){return this.state.hasError?null:this.props.children}}Ye(td,"contextType",Rc);const Or=()=>S.useContext(y1),a_=e=>{try{e()}catch(t){}},u_=()=>{const e=S.useContext(Rc);return S.useMemo(()=>({reportFailure:(t,...[n,r])=>a_(()=>e==null?void 0:e.overrideFailure(t,n,r)),reportEvent:(t,...[n,r])=>a_(()=>e==null?void 0:e.overrideEvent(t,n,r))}),[e])},c_=e=>{const t=u_();return S.useMemo(()=>({reportFailure:(n,r)=>t.reportFailure(e,n,r),reportEvent:(n,r)=>t.reportEvent(e,n,r)}),[t,e])},Ei=e=>{const{sendMessage:t,loading:n,isConnected:r}=$t(),{mode:i,status:s}=Zn(),{reportFailure:u,reportEvent:c}=c_(e);return S.useMemo(()=>({sendMessage:t,isLoading:n,isConnected:r,componentType:s.type,mode:i,reportFailure:u,reportEvent:c}),[t,n,r,s.type,i,u,c])},GF=({componentType:e,availableActions:t,onClose:n,onClearChat:r,onEndConversation:i,onDownloadTranscript:s})=>{const{isModalFullscreen:u,dialogPosition:c,previousComponentType:d}=Zn(),{logger:f}=at(),[h,m]=S.useState(!1),E=S.useRef(t);E.current=t;const b=S.useRef(e);b.current=e;const T=S.useRef(n);T.current=n;const v=S.useRef(r);v.current=r;const I=S.useRef(i);I.current=i;const _=S.useRef(s);_.current=s;const N=S.useRef(u);N.current=u;const P=S.useRef(c);P.current=c;const B=S.useRef(d);B.current=d;const R=S.useRef(f);R.current=f;const O=S.useRef(null),q=S.useMemo(()=>{const re=H=>E.current[H];return{close:()=>{var H;re("close")&&((H=T.current)==null||H.call(T))},toggleExpanded:()=>{if(re("toggleExpanded")){if(b.current==="modal"){fs(B.current||"dialog");return}fs("modal")}},toggleFullscreen:H=>{re("toggleFullscreen")&&Ic(typeof H=="boolean"?H:!N.current)},toggleDialogPosition:H=>{if(!re("toggleDialogPosition"))return;let Z;switch(H){case"left":case"bottom-left":Z="bottom-left";break;case"right":case"bottom-right":Z="bottom-right";break;default:Z=P.current==="bottom-left"?"bottom-right":"bottom-left";break}Oc(Z)},minimize:()=>{re("minimize")&&(zr(!1),yo(!0),nl())},clearChat:()=>Oe(null,null,function*(){var H;re("clearChat")&&(yield(H=v.current)==null?void 0:H.call(v))}),endConversation:()=>Oe(null,null,function*(){var H;re("endConversation")&&(yield(H=I.current)==null?void 0:H.call(I))}),downloadTranscript:()=>{if(!re("downloadTranscript"))return Promise.resolve();const H=O.current;if(H)return H;let Z=()=>{};const X=new Promise(he=>{Z=he});return O.current=X,Oe(null,null,function*(){var he,V;m(!0);try{yield(he=_.current)==null?void 0:he.call(_)}catch(ce){(V=R.current)==null||V.error("Error downloading transcript:",ce)}finally{m(!1),O.current===X&&(O.current=null),Z()}}),X}}},[]),K=S.useMemo(()=>({available:t,isDownloadingTranscript:h,isFullscreen:u,dialogPosition:c}),[t,h,u,c]);return{actions:q,state:K}},l_=()=>{const{overrides:e,isInitialized:t}=Or(),[n,r]=S.useState(null),i=e.HeaderActions,s=t&&typeof i=="string"&&i.length>0&&i!==n,u=S.useCallback(()=>{typeof i=="string"&&i.length>0&&r(i)},[i]);return{active:s,onError:u}},d_=n=>{var r=n,{onError:e}=r,t=bn(r,["onError"]);const{overrides:i,isInitialized:s}=Or(),u=i.HeaderActions,{actions:c,state:d}=GF(t),f=Ei("HeaderActions"),h=S.useMemo(()=>({name:"HeaderActions",payload:{actions:d},api:ue(U({},f),{actions:c})}),[d,f,c]);return!s||typeof u!="string"||u.length===0?null:w.jsx(td,{overrideName:"HeaderActions",onError:e,children:w.jsx(ri,{tagName:u,props:h,label:"HeaderActions",onError:e})})};function qo(){const{sendMessage:e}=$t(),{productId:t}=Nm(),{enablePageContext:n}=at();return S.useCallback((r,i)=>{var f,h,m;if(n)return e(r,i);const u=((h=(f=r.match(/\[SKU:\s*([^\]]+)\]/i))==null?void 0:f[1])==null?void 0:h.trim())||t,{prompt:c,display:d}=bp(r,u);return e(c,ue(U({},i),{displayContent:(m=i==null?void 0:i.displayContent)!=null?m:d}))},[e,t,n])}function Rm(){const{sendFile:e}=$t(),{productId:t}=Nm();return S.useCallback(n=>{if(!n.file||!t)return e(n);const{prompt:r}=bp(n.text,t);return e(ue(U({},n),{text:r,displayContent:n.text}))},[e,t])}const XF=["Hey there! 👋 Getting things ready for you…","Connecting you to our shopping assistant…","Just a moment…"],KF=3e3,QF=400,Lm=({className:e})=>{const t=S.useId();return w.jsxs("svg",{className:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[w.jsx("defs",{children:w.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"1",children:[w.jsx("stop",{offset:"0",stopColor:"#4f7fce"}),w.jsx("stop",{offset:"1",stopColor:"#c85d94"})]})}),w.jsx("path",{d:"M6.62479 10.3342C6.56527 10.1034 6.44502 9.89289 6.27653 9.72441C6.10805 9.55592 5.8975 9.43567 5.66679 9.37615L1.57679 8.32148C1.50701 8.30168 1.4456 8.25965 1.40186 8.20178C1.35813 8.14391 1.33447 8.07335 1.33447 8.00082C1.33447 7.92828 1.35813 7.85772 1.40186 7.79985C1.4456 7.74198 1.50701 7.69996 1.57679 7.68015L5.66679 6.62482C5.89742 6.56535 6.10792 6.4452 6.27639 6.27684C6.44486 6.10849 6.56517 5.89808 6.62479 5.66748L7.67946 1.57748C7.69906 1.50743 7.74105 1.44571 7.799 1.40175C7.85696 1.35778 7.92771 1.33398 8.00046 1.33398C8.0732 1.33398 8.14395 1.35778 8.20191 1.40175C8.25987 1.44571 8.30185 1.50743 8.32146 1.57748L9.37546 5.66748C9.43497 5.8982 9.55523 6.10875 9.72371 6.27723C9.89219 6.44571 10.1027 6.56597 10.3335 6.62548L14.4235 7.67948C14.4938 7.69888 14.5558 7.74082 14.6 7.79887C14.6442 7.85691 14.6682 7.92786 14.6682 8.00082C14.6682 8.07378 14.6442 8.14472 14.6 8.20277C14.5558 8.26081 14.4938 8.30275 14.4235 8.32215L10.3335 9.37615C10.1027 9.43567 9.89219 9.55592 9.72371 9.72441C9.55523 9.89289 9.43497 10.1034 9.37546 10.3342L8.32079 14.4242C8.30118 14.4942 8.2592 14.5559 8.20124 14.5999C8.14328 14.6439 8.07254 14.6677 7.99979 14.6677C7.92704 14.6677 7.85629 14.6439 7.79834 14.5999C7.74038 14.5559 7.69839 14.4942 7.67879 14.4242L6.62479 10.3342Z",fill:`url(#${t})`,stroke:`url(#${t})`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},JF=e=>e===null?[]:Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim()!==""):XF,ZF=({globalClassName:e,isWidgetStandalone:t,messages:n,variant:r="default"})=>{const[i,s]=S.useState(0),[u,c]=S.useState(!0),d=S.useMemo(()=>JF(n),[n]),f=d.length,h=n!==null;return S.useEffect(()=>{if(f<2||!h)return;let m;const E=setInterval(()=>{c(!1),m=setTimeout(()=>{s(b=>(b+1)%f),c(!0)},QF)},KF);return()=>{clearInterval(E),clearTimeout(m),c(!0)}},[f,h]),h?r==="sparkles"?w.jsxs("div",{className:M(e,`${k}-connecting-indicator`,`${k}-connecting-indicator--sparkles`,t?"standalone":"embedded"),role:"status","aria-label":"Loading shopping assistant",children:[w.jsxs("div",{className:`${k}-connecting-sparkles`,"aria-hidden":"true",children:[w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-left`}),w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-main`}),w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-right`})]}),w.jsx("span",{className:`${k}-connecting-heading`,"aria-hidden":"true",children:"Loading your shopping assistant"}),f>0&&w.jsx("span",{className:M(`${k}-connecting-text`,`${k}-connecting-text--feature`,u&&`${k}-connecting-text--visible`),"aria-hidden":"true",children:d[i%f]})]}):w.jsxs("div",{className:M(e,`${k}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[w.jsxs("div",{className:`${k}-connecting-pulse-wrapper`,"aria-hidden":"true",children:[w.jsx("div",{className:`${k}-connecting-pulse`}),w.jsx("div",{className:`${k}-connecting-ring`})]}),f>0&&w.jsx("span",{className:M(`${k}-connecting-text`,u&&`${k}-connecting-text--visible`),"aria-hidden":"true",children:d[i%f]})]}):null},eB=({shouldShow:e,loadingText:t})=>e?w.jsx("span",{className:`${k}-processing-text`,"aria-hidden":"true",children:t}):null,tB=({shouldShow:e})=>e?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"}),w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"}),w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"})]}):null,Dm=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>w.jsxs("div",{className:M(e,`${k}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[w.jsx(eB,{shouldShow:!!n,loadingText:n}),w.jsx(tB,{shouldShow:!n})]}),nB="(max-width: 576px)";function rB(e){return e?!e.defaultPrevented&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:!0}function iB({event:e,openLinksInNewTab:t,isCartMgmtSupported:n=!1}={}){n||t||rB(e)&&typeof window!="undefined"&&window.matchMedia(nB).matches&&(yo(!0),GA())}function oB(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function sB(e){if(typeof window=="undefined")return!1;try{return new URL(e,window.location.href).origin===window.location.origin}catch(t){return!1}}function Vi({event:e,href:t,openLinksInNewTab:n,onNavigate:r}){if(!r||n||!oB(e)||e.defaultPrevented)return;const i=t||e.currentTarget.href;!i||!sB(i)||r(i,e)}function Iu(n){var r=n,{isCartMgmtSupported:e}=r,t=bn(r,["isCartMgmtSupported"]);iB({event:t.event.nativeEvent,openLinksInNewTab:t.openLinksInNewTab,isCartMgmtSupported:e}),Vi(t)}function f_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function aB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uB(e,t,n){const i=ml((n||{}).ignore||[]),s=cB(t);let u=-1;for(;++u<s.length;)Wb(e,"text",c);function c(f,h){let m=-1,E;for(;++m<h.length;){const b=h[m],T=E?E.children:void 0;if(i(b,T?T.indexOf(b):void 0,E))return;E=b}if(E)return d(f,h)}function d(f,h){const m=h[h.length-1],E=s[u][0],b=s[u][1];let T=0;const I=m.children.indexOf(f);let _=!1,N=[];E.lastIndex=0;let P=E.exec(f.value);for(;P;){const B=P.index,R={index:P.index,input:P.input,stack:[...h,f]};let O=b(...P,R);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?E.lastIndex=B+1:(T!==B&&N.push({type:"text",value:f.value.slice(T,B)}),Array.isArray(O)?N.push(...O):O&&N.push(O),T=B+P[0].length,_=!0),!E.global)break;P=E.exec(f.value)}return _?(T<f.value.length&&N.push({type:"text",value:f.value.slice(T)}),m.children.splice(I,1,...N)):N=[f],I+N.length}}function cB(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([lB(i[0]),dB(i[1])])}return t}function lB(e){return typeof e=="string"?new RegExp(aB(e),"g"):e}function dB(e){return typeof e=="function"?e:function(){return e}}const Mm="phrasing",Fm=["autolink","link","image","label"];function fB(){return{transforms:[bB],enter:{literalAutolink:hB,literalAutolinkEmail:Bm,literalAutolinkHttp:Bm,literalAutolinkWww:Bm},exit:{literalAutolink:EB,literalAutolinkEmail:yB,literalAutolinkHttp:mB,literalAutolinkWww:gB}}}function pB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Fm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Fm},{character:":",before:"[ps]",after:"\\/",inConstruct:Mm,notInConstruct:Fm}]}}function hB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bm(e){this.config.enter.autolinkProtocol.call(this,e)}function mB(e){this.config.exit.autolinkProtocol.call(this,e)}function gB(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yB(e){this.config.exit.autolinkEmail.call(this,e)}function EB(e){this.exit(e)}function bB(e){uB(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xB]],{ignore:["link","linkReference"]})}function wB(e,t,n,r,i){let s="";if(!p_(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!TB(n)))return!1;const u=_B(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:s+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function xB(e,t,n,r){return!p_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function TB(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _B(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=f_(e,"(");let s=f_(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function p_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||No(n)||ul(n))&&(!t||n!==47)}h_.peek=PB;function vB(){this.buffer()}function SB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function AB(){this.buffer()}function kB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NB(e){this.exit(e)}function IB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function OB(e){this.exit(e)}function PB(){return"["}function h_(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),u(),s+=i.move("]"),s}function RB(){return{enter:{gfmFootnoteCallString:vB,gfmFootnoteCall:SB,gfmFootnoteDefinitionLabelString:AB,gfmFootnoteDefinition:kB},exit:{gfmFootnoteCallString:CB,gfmFootnoteCall:NB,gfmFootnoteDefinitionLabelString:IB,gfmFootnoteDefinition:OB}}}function LB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:h_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,u){const c=s.createTracker(u);let d=c.move("[^");const f=s.enter("footnoteDefinition"),h=s.enter("label");return d+=c.move(s.safe(s.associationId(r),{before:d,after:"]"})),h(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
37
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Po={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cw={}.hasOwnProperty,$6=Object.prototype;function z6(e,t){const n=t||{};return wh({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ri:Qa,verbose:n.verbose||!1},e)}function wh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},bl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:lw(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),u=H6(s),c=u.toPoint(0),d=u.toPoint(s.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},bl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},bl(e,r,n),n}default:return n=V6(e,t),n}}function lw(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=wh(e,t[n]);r.push(i)}return r}function V6(e,t){const n=e.schema;e.schema=t.namespaceURI===Po.svg?Ri:Qa;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;cw.call($6,d)||(i[d]=c.value)}const u=(e.schema.space==="svg"?j6:U6)(t.tagName,i,lw(e,t.childNodes));if(bl(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Cs(d.startTag),h=d&&d.endTag&&Cs(d.endTag),m=wh(e,c.content);f&&h&&e.file&&(m.position={start:f.end,end:h.start}),u.content=m}return e.schema=n,u}function bl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=q6(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function q6(e,t,n){const r=Cs(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let u;if(n.attrs)for(u in n.attrs)cw.call(n.attrs,u)&&(s[ol(e.schema,u).property]=Cs(n.attrs[u]));n.startTag;const c=Cs(n.startTag),d=n.endTag?Cs(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=s,t.data={position:f}}}return r}function Cs(e){const t=dw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=dw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function dw(e){return e.line&&e.column?e:void 0}const fw={}.hasOwnProperty;function pw(e,t){const n=t||{};function r(i,...s){let u=r.invalid;const c=r.handlers;if(i&&fw.call(i,e)){const d=String(i[e]);u=fw.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const W6={},Y6={}.hasOwnProperty,hw=pw("type",{handlers:{root:X6,element:e5,text:J6,comment:Z6,doctype:Q6}});function G6(e,t){const r=(t||W6).space;return hw(e,r==="svg"?Ri:Qa)}function X6(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=xh(e.children,n,t),Ns(e,n),n}function K6(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=xh(e.children,n,t),Ns(e,n),n}function Q6(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ns(e,t),t}function J6(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ns(e,t),t}function Z6(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ns(e,t),t}function e5(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ri);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&Y6.call(e.properties,s)){const d=t5(r,s,e.properties[s]);d&&i.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Po[u],childNodes:[],parentNode:null};return c.childNodes=xh(e.children,c,r),Ns(e,c),e.tagName==="template"&&e.content&&(c.content=K6(e.content,r)),c}function t5(e,t,n){const r=ol(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ME(n):XE(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=Po[r.space]}return i}function xh(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=hw(e[r],n);s.parentNode=t,i.push(s)}return i}function Ns(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const n5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],r5=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]),Bt="�";var L;(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"})(L||(L={}));const $n={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function mw(e){return e>=55296&&e<=57343}function i5(e){return e>=56320&&e<=57343}function o5(e,t){return(e-55296)*1024+9216+t}function gw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function yw(e){return e>=64976&&e<=65007||r5.has(e)}var le;(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"})(le||(le={}));const s5=65536;class a5{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=s5,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,u=i+n,c=s+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(i5(n))return this.pos++,this._addGap(),o5(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,L.EOF;return this._err(le.surrogateInInputStream),t}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(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,L.EOF;const r=this.html.charCodeAt(n);return r===L.CARRIAGE_RETURN?L.LINE_FEED:r}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,L.EOF;let t=this.html.charCodeAt(this.pos);return t===L.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,L.LINE_FEED):t===L.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,mw(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===L.LINE_FEED||t===L.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gw(t)?this._err(le.controlCharacterInInputStream):yw(t)&&this._err(le.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var dt;(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"})(dt||(dt={}));function Ew(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}const u5=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),c5=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function l5(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=c5.get(e))!==null&&t!==void 0?t:e}var an;(function(e){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_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(an||(an={}));const d5=32;var Mi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Mi||(Mi={}));function Th(e){return e>=an.ZERO&&e<=an.NINE}function f5(e){return e>=an.UPPER_A&&e<=an.UPPER_F||e>=an.LOWER_A&&e<=an.LOWER_F}function p5(e){return e>=an.UPPER_A&&e<=an.UPPER_Z||e>=an.LOWER_A&&e<=an.LOWER_Z||Th(e)}function h5(e){return e===an.EQUALS||p5(e)}var un;(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"})(un||(un={}));var fi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fi||(fi={}));class m5{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=un.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fi.Strict}startEntity(t){this.decodeMode=t,this.state=un.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case un.EntityStart:return t.charCodeAt(n)===an.NUM?(this.state=un.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=un.NamedEntity,this.stateNamedEntity(t,n));case un.NumericStart:return this.stateNumericStart(t,n);case un.NumericDecimal:return this.stateNumericDecimal(t,n);case un.NumericHex:return this.stateNumericHex(t,n);case un.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|d5)===an.LOWER_X?(this.state=un.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=un.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Th(i)||f5(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Th(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===an.SEMI)this.consumed+=1;else if(this.decodeMode===fi.Strict)return 0;return this.emitCodePoint(l5(this.result),this.consumed),this.errors&&(t!==an.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Mi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=g5(r,i,this.treeIndex+Math.max(1,s),u),this.treeIndex<0)return this.result===0||this.decodeMode===fi.Attribute&&(s===0||h5(u))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Mi.VALUE_LENGTH)>>14,s!==0){if(u===an.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==fi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Mi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Mi.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case un.NamedEntity:return this.result!==0&&(this.decodeMode!==fi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case un.NumericDecimal:return this.emitNumericEntity(0,2);case un.NumericHex:return this.emitNumericEntity(0,3);case un.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case un.EntityStart:return 0}}}function g5(e,t,n,r){const i=(t&Mi.BRANCH_LENGTH)>>7,s=t&Mi.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const d=r-s;return d<0||d>=i?-1:e[n+d]-1}let u=n,c=u+i-1;for(;u<=c;){const d=u+c>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)c=d-1;else return e[d+i]}return-1}var Ee;(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/"})(Ee||(Ee={}));var Ro;(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"})(Ro||(Ro={}));var fr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(fr||(fr={}));var ne;(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"})(ne||(ne={}));var g;(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"})(g||(g={}));const y5=new Map([[ne.A,g.A],[ne.ADDRESS,g.ADDRESS],[ne.ANNOTATION_XML,g.ANNOTATION_XML],[ne.APPLET,g.APPLET],[ne.AREA,g.AREA],[ne.ARTICLE,g.ARTICLE],[ne.ASIDE,g.ASIDE],[ne.B,g.B],[ne.BASE,g.BASE],[ne.BASEFONT,g.BASEFONT],[ne.BGSOUND,g.BGSOUND],[ne.BIG,g.BIG],[ne.BLOCKQUOTE,g.BLOCKQUOTE],[ne.BODY,g.BODY],[ne.BR,g.BR],[ne.BUTTON,g.BUTTON],[ne.CAPTION,g.CAPTION],[ne.CENTER,g.CENTER],[ne.CODE,g.CODE],[ne.COL,g.COL],[ne.COLGROUP,g.COLGROUP],[ne.DD,g.DD],[ne.DESC,g.DESC],[ne.DETAILS,g.DETAILS],[ne.DIALOG,g.DIALOG],[ne.DIR,g.DIR],[ne.DIV,g.DIV],[ne.DL,g.DL],[ne.DT,g.DT],[ne.EM,g.EM],[ne.EMBED,g.EMBED],[ne.FIELDSET,g.FIELDSET],[ne.FIGCAPTION,g.FIGCAPTION],[ne.FIGURE,g.FIGURE],[ne.FONT,g.FONT],[ne.FOOTER,g.FOOTER],[ne.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[ne.FORM,g.FORM],[ne.FRAME,g.FRAME],[ne.FRAMESET,g.FRAMESET],[ne.H1,g.H1],[ne.H2,g.H2],[ne.H3,g.H3],[ne.H4,g.H4],[ne.H5,g.H5],[ne.H6,g.H6],[ne.HEAD,g.HEAD],[ne.HEADER,g.HEADER],[ne.HGROUP,g.HGROUP],[ne.HR,g.HR],[ne.HTML,g.HTML],[ne.I,g.I],[ne.IMG,g.IMG],[ne.IMAGE,g.IMAGE],[ne.INPUT,g.INPUT],[ne.IFRAME,g.IFRAME],[ne.KEYGEN,g.KEYGEN],[ne.LABEL,g.LABEL],[ne.LI,g.LI],[ne.LINK,g.LINK],[ne.LISTING,g.LISTING],[ne.MAIN,g.MAIN],[ne.MALIGNMARK,g.MALIGNMARK],[ne.MARQUEE,g.MARQUEE],[ne.MATH,g.MATH],[ne.MENU,g.MENU],[ne.META,g.META],[ne.MGLYPH,g.MGLYPH],[ne.MI,g.MI],[ne.MO,g.MO],[ne.MN,g.MN],[ne.MS,g.MS],[ne.MTEXT,g.MTEXT],[ne.NAV,g.NAV],[ne.NOBR,g.NOBR],[ne.NOFRAMES,g.NOFRAMES],[ne.NOEMBED,g.NOEMBED],[ne.NOSCRIPT,g.NOSCRIPT],[ne.OBJECT,g.OBJECT],[ne.OL,g.OL],[ne.OPTGROUP,g.OPTGROUP],[ne.OPTION,g.OPTION],[ne.P,g.P],[ne.PARAM,g.PARAM],[ne.PLAINTEXT,g.PLAINTEXT],[ne.PRE,g.PRE],[ne.RB,g.RB],[ne.RP,g.RP],[ne.RT,g.RT],[ne.RTC,g.RTC],[ne.RUBY,g.RUBY],[ne.S,g.S],[ne.SCRIPT,g.SCRIPT],[ne.SEARCH,g.SEARCH],[ne.SECTION,g.SECTION],[ne.SELECT,g.SELECT],[ne.SOURCE,g.SOURCE],[ne.SMALL,g.SMALL],[ne.SPAN,g.SPAN],[ne.STRIKE,g.STRIKE],[ne.STRONG,g.STRONG],[ne.STYLE,g.STYLE],[ne.SUB,g.SUB],[ne.SUMMARY,g.SUMMARY],[ne.SUP,g.SUP],[ne.TABLE,g.TABLE],[ne.TBODY,g.TBODY],[ne.TEMPLATE,g.TEMPLATE],[ne.TEXTAREA,g.TEXTAREA],[ne.TFOOT,g.TFOOT],[ne.TD,g.TD],[ne.TH,g.TH],[ne.THEAD,g.THEAD],[ne.TITLE,g.TITLE],[ne.TR,g.TR],[ne.TRACK,g.TRACK],[ne.TT,g.TT],[ne.U,g.U],[ne.UL,g.UL],[ne.SVG,g.SVG],[ne.VAR,g.VAR],[ne.WBR,g.WBR],[ne.XMP,g.XMP]]);function Is(e){var t;return(t=y5.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const xe=g,E5={[Ee.HTML]:new Set([xe.ADDRESS,xe.APPLET,xe.AREA,xe.ARTICLE,xe.ASIDE,xe.BASE,xe.BASEFONT,xe.BGSOUND,xe.BLOCKQUOTE,xe.BODY,xe.BR,xe.BUTTON,xe.CAPTION,xe.CENTER,xe.COL,xe.COLGROUP,xe.DD,xe.DETAILS,xe.DIR,xe.DIV,xe.DL,xe.DT,xe.EMBED,xe.FIELDSET,xe.FIGCAPTION,xe.FIGURE,xe.FOOTER,xe.FORM,xe.FRAME,xe.FRAMESET,xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6,xe.HEAD,xe.HEADER,xe.HGROUP,xe.HR,xe.HTML,xe.IFRAME,xe.IMG,xe.INPUT,xe.LI,xe.LINK,xe.LISTING,xe.MAIN,xe.MARQUEE,xe.MENU,xe.META,xe.NAV,xe.NOEMBED,xe.NOFRAMES,xe.NOSCRIPT,xe.OBJECT,xe.OL,xe.P,xe.PARAM,xe.PLAINTEXT,xe.PRE,xe.SCRIPT,xe.SECTION,xe.SELECT,xe.SOURCE,xe.STYLE,xe.SUMMARY,xe.TABLE,xe.TBODY,xe.TD,xe.TEMPLATE,xe.TEXTAREA,xe.TFOOT,xe.TH,xe.THEAD,xe.TITLE,xe.TR,xe.TRACK,xe.UL,xe.WBR,xe.XMP]),[Ee.MATHML]:new Set([xe.MI,xe.MO,xe.MN,xe.MS,xe.MTEXT,xe.ANNOTATION_XML]),[Ee.SVG]:new Set([xe.TITLE,xe.FOREIGN_OBJECT,xe.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set},_h=new Set([xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var j;(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"})(j||(j={}));const Gt={DATA:j.DATA,RCDATA:j.RCDATA,RAWTEXT:j.RAWTEXT,SCRIPT_DATA:j.SCRIPT_DATA,PLAINTEXT:j.PLAINTEXT,CDATA_SECTION:j.CDATA_SECTION};function b5(e){return e>=L.DIGIT_0&&e<=L.DIGIT_9}function uu(e){return e>=L.LATIN_CAPITAL_A&&e<=L.LATIN_CAPITAL_Z}function w5(e){return e>=L.LATIN_SMALL_A&&e<=L.LATIN_SMALL_Z}function Fi(e){return w5(e)||uu(e)}function bw(e){return Fi(e)||b5(e)}function wl(e){return e+32}function ww(e){return e===L.SPACE||e===L.LINE_FEED||e===L.TABULATION||e===L.FORM_FEED}function xw(e){return ww(e)||e===L.SOLIDUS||e===L.GREATER_THAN_SIGN}function x5(e){return e===L.NULL?le.nullCharacterReference:e>1114111?le.characterReferenceOutsideUnicodeRange:mw(e)?le.surrogateCharacterReference:yw(e)?le.noncharacterCharacterReference:gw(e)||e===L.CARRIAGE_RETURN?le.controlCharacterReference:null}class T5{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=j.DATA,this.returnState=j.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new a5(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new m5(u5,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(le.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(le.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=x5(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),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(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:dt.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:dt.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:dt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:dt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Ew(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(le.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Is(t.tagName),t.type===dt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(le.endTagWithAttributes),t.selfClosing&&this._err(le.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case dt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case dt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case dt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:dt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=ww(t)?dt.WHITESPACE_CHARACTER:t===L.NULL?dt.NULL_CHARACTER:dt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(dt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=j.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fi.Attribute:fi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===j.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case j.DATA:{this._stateData(t);break}case j.RCDATA:{this._stateRcdata(t);break}case j.RAWTEXT:{this._stateRawtext(t);break}case j.SCRIPT_DATA:{this._stateScriptData(t);break}case j.PLAINTEXT:{this._statePlaintext(t);break}case j.TAG_OPEN:{this._stateTagOpen(t);break}case j.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case j.TAG_NAME:{this._stateTagName(t);break}case j.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case j.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case j.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case j.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case j.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case j.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case j.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case j.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case j.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case j.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case j.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case j.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case j.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case j.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case j.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case j.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case j.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case j.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case j.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case j.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case j.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case j.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case j.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case j.BOGUS_COMMENT:{this._stateBogusComment(t);break}case j.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case j.COMMENT_START:{this._stateCommentStart(t);break}case j.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case j.COMMENT:{this._stateComment(t);break}case j.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case j.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case j.COMMENT_END:{this._stateCommentEnd(t);break}case j.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case j.DOCTYPE:{this._stateDoctype(t);break}case j.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case j.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case j.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case j.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case j.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case j.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case j.CDATA_SECTION:{this._stateCdataSection(t);break}case j.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case j.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case j.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case j.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.TAG_OPEN;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitCodePoint(t);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case L.AMPERSAND:{this._startCharacterReference();break}case L.LESS_THAN_SIGN:{this.state=j.RCDATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.RAWTEXT_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Fi(t))this._createStartTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case L.EXCLAMATION_MARK:{this.state=j.MARKUP_DECLARATION_OPEN;break}case L.SOLIDUS:{this.state=j.END_TAG_OPEN;break}case L.QUESTION_MARK:{this._err(le.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t);break}case L.EOF:{this._err(le.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=j.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Fi(t))this._createEndTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case L.GREATER_THAN_SIGN:{this._err(le.missingEndTagName),this.state=j.DATA;break}case L.EOF:{this._err(le.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(le.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.tagName+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateRcdataLessThanSign(t){t===L.SOLIDUS?this.state=j.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Fi(t)?(this.state=j.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=j.BEFORE_ATTRIBUTE_NAME,!1;case L.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=j.SELF_CLOSING_START_TAG,!1;case L.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=j.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===L.SOLIDUS?this.state=j.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Fi(t)?(this.state=j.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case L.SOLIDUS:{this.state=j.SCRIPT_DATA_END_TAG_OPEN;break}case L.EXCLAMATION_MARK:{this.state=j.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=j.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Fi(t)?(this.state=j.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===L.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===L.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case L.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===L.SOLIDUS?this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Fi(t)?(this._emitChars("<"),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Fi(t)?(this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith($n.SCRIPT,!1)&&xw(this.preprocessor.peek($n.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$n.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case L.HYPHEN_MINUS:{this._emitChars("-");break}case L.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case L.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case L.EOF:{this._err(le.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===L.SOLIDUS?(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith($n.SCRIPT,!1)&&xw(this.preprocessor.peek($n.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$n.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._err(le.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:case L.SOLIDUS:case L.GREATER_THAN_SIGN:case L.EOF:{this._leaveAttrName(),this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case L.EQUALS_SIGN:{this._leaveAttrName(),this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:{this._err(le.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.name+=Bt;break}default:this.currentAttr.name+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateAfterAttributeName(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case L.EQUALS_SIGN:{this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{this.state=j.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this.state=j.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingAttributeValue),this.state=j.DATA,this.emitCurrentTagToken();break}default:this.state=j.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case L.APOSTROPHE:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.AMPERSAND:{this._startCharacterReference();break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case L.QUOTATION_MARK:case L.APOSTROPHE:case L.LESS_THAN_SIGN:case L.EQUALS_SIGN:case L.GRAVE_ACCENT:{this._err(le.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case L.SOLIDUS:{this._leaveAttrValue(),this.state=j.SELF_CLOSING_START_TAG;break}case L.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBetweenAttributes),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case L.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=j.DATA,this.emitCurrentTagToken();break}case L.EOF:{this._err(le.eofInTag),this._emitEOFToken();break}default:this._err(le.unexpectedSolidusInTag),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Bt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch($n.DASH_DASH,!0)?(this._createCommentToken($n.DASH_DASH.length+1),this.state=j.COMMENT_START):this._consumeSequenceIfMatch($n.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation($n.DOCTYPE.length+1),this.state=j.DOCTYPE):this._consumeSequenceIfMatch($n.CDATA_START,!0)?this.inForeignNode?this.state=j.CDATA_SECTION:(this._err(le.cdataInHtmlContent),this._createCommentToken($n.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=j.BOGUS_COMMENT):this._ensureHibernation()||(this._err(le.incorrectlyOpenedComment),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_START_DASH;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=j.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptClosingOfEmptyComment),this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END_DASH;break}case L.LESS_THAN_SIGN:{n.data+="<",this.state=j.COMMENT_LESS_THAN_SIGN;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.data+=Bt;break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case L.EXCLAMATION_MARK:{n.data+="!",this.state=j.COMMENT_LESS_THAN_SIGN_BANG;break}case L.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===L.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=j.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===L.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=j.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==L.GREATER_THAN_SIGN&&t!==L.EOF&&this._err(le.nestedComment),this.state=j.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(n);break}case L.EXCLAMATION_MARK:{this.state=j.COMMENT_END_BANG;break}case L.HYPHEN_MINUS:{n.data+="-";break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case L.HYPHEN_MINUS:{n.data+="--!",this.state=j.COMMENT_END_DASH;break}case L.GREATER_THAN_SIGN:{this._err(le.incorrectlyClosedComment),this.state=j.DATA,this.emitCurrentComment(n);break}case L.EOF:{this._err(le.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=j.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case L.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingWhitespaceBeforeDoctypeName),this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(uu(t))this._createDoctypeToken(String.fromCharCode(wl(t))),this.state=j.DOCTYPE_NAME;else switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.NULL:{this._err(le.unexpectedNullCharacter),this._createDoctypeToken(Bt),this.state=j.DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=j.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.AFTER_DOCTYPE_NAME;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.name+=Bt;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(uu(t)?wl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch($n.PUBLIC,!1)?this.state=j.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch($n.SYSTEM,!1)?this.state=j.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(le.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.publicId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case L.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.QUOTATION_MARK:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.QUOTATION_MARK:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{this._err(le.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.QUOTATION_MARK:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case L.APOSTROPHE:{n.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case L.GREATER_THAN_SIGN:{this._err(le.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(n);break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case L.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case L.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case L.NULL:{this._err(le.unexpectedNullCharacter),n.systemId+=Bt;break}case L.GREATER_THAN_SIGN:{this._err(le.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case L.SPACE:case L.LINE_FEED:case L.TABULATION:case L.FORM_FEED:break;case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.EOF:{this._err(le.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(le.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case L.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=j.DATA;break}case L.NULL:{this._err(le.unexpectedNullCharacter);break}case L.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case L.RIGHT_SQUARE_BRACKET:{this.state=j.CDATA_SECTION_BRACKET;break}case L.EOF:{this._err(le.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===L.RIGHT_SQUARE_BRACKET?this.state=j.CDATA_SECTION_END:(this._emitChars("]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case L.GREATER_THAN_SIGN:{this.state=j.DATA;break}case L.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(L.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&bw(this.preprocessor.peek(1))?j.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){bw(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===L.SEMICOLON&&this._err(le.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Tw=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),_w=new Set([...Tw,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),xl=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),_5=new Set([...xl,g.OL,g.UL]),v5=new Set([...xl,g.BUTTON]),vw=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Sw=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),S5=new Set([g.TR,g.TEMPLATE,g.HTML]),A5=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),k5=new Set([g.TABLE,g.TEMPLATE,g.HTML]),C5=new Set([g.TD,g.TH]);class N5{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ee.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(_h,Ee.HTML)}popUntilTableCellPopped(){this.popUntilPopped(C5,Ee.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(k5,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo(A5,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(S5,Ee.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ee.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Ee.SVG:{if(Sw.has(i))return!1;break}case Ee.MATHML:{if(vw.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,xl)}hasInListItemScope(t){return this.hasInDynamicScope(t,_5)}hasInButtonScope(t){return this.hasInDynamicScope(t,v5)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ee.HTML:{if(_h.has(n))return!0;if(xl.has(n))return!1;break}case Ee.SVG:{if(Sw.has(n))return!1;break}case Ee.MATHML:{if(vw.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Tw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&_w.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&_w.has(this.currentTagId);)this.pop()}}const vh=3;var Xr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Xr||(Xr={}));const Aw={type:Xr.Marker};class I5{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Xr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===s&&this.treeAdapter.getNamespaceURI(f)===u){const h=this.treeAdapter.getAttrList(f);h.length===i&&r.push({idx:c,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<vh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<vh)return;const i=new Map(n.map(u=>[u.name,u.value]));let s=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>i.get(d.name)===d.value)&&(s+=1,s>=vh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Aw)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Xr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Xr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Aw);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Xr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Xr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Xr.Element&&n.element===t)}}const Bi={createDocument(){return{nodeName:"#document",mode:fr.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){const 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){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Bi.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Bi.isTextNode(n)){n.value+=t;return}}Bi.appendChild(e,Bi.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Bi.isTextNode(r)?r.value+=t:Bi.insertBefore(e,Bi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.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=U(U({},e.sourceCodeLocation),t)}},kw="html",O5="about:legacy-compat",P5="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Cw=["+//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//"],R5=[...Cw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],L5=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Nw=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],D5=[...Nw,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Iw(e,t){return t.some(n=>e.startsWith(n))}function M5(e){return e.name===kw&&e.publicId===null&&(e.systemId===null||e.systemId===O5)}function F5(e){if(e.name!==kw)return fr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===P5)return fr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),L5.has(n))return fr.QUIRKS;let r=t===null?R5:Cw;if(Iw(n,r))return fr.QUIRKS;if(r=t===null?Nw:D5,Iw(n,r))return fr.LIMITED_QUIRKS}return fr.NO_QUIRKS}const Ow={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},B5="definitionurl",U5="definitionURL",j5=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"].map(e=>[e.toLowerCase(),e])),H5=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),$5=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"].map(e=>[e.toLowerCase(),e])),z5=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function V5(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===Ro.COLOR||r===Ro.SIZE||r===Ro.FACE)||z5.has(t)}function Pw(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===B5){e.attrs[t].name=U5;break}}function Rw(e){for(let t=0;t<e.attrs.length;t++){const n=j5.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Sh(e){for(let t=0;t<e.attrs.length;t++){const n=H5.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 q5(e){const t=$5.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Is(e.tagName))}function W5(e,t){return t===Ee.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function Y5(e,t,n){if(t===Ee.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ro.ENCODING){const i=n[r].value.toLowerCase();return i===Ow.TEXT_HTML||i===Ow.APPLICATION_XML}}return t===Ee.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function G5(e,t,n,r){return(!r||r===Ee.HTML)&&Y5(e,t,n)||(!r||r===Ee.MATHML)&&W5(e,t)}const X5="hidden",K5=8,Q5=3;var z;(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"})(z||(z={}));const J5={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Lw=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Dw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Bi,onParseError:null};class Mw{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=z.INITIAL,this.originalInsertionMode=z.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=U(U({},Dw),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new T5(this.options,this),this.activeFormattingElements=new I5(this.treeAdapter),this.fragmentContextID=r?Is(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new N5(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=U(U({},Dw),n);t!=null||(t=r.treeAdapter.createElement(ne.TEMPLATE,Ee.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ee.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===g.TEMPLATE&&s.tmplInsertionModeStack.unshift(z.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:J5,u={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(u)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,u;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,u=this.fragmentContextID):{current:s,currentTagId:u}=this.openElements,this._setContextModes(s,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ee.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=z.TEXT}switchToPlaintextParsing(){this.insertionMode=z.TEXT,this.originalInsertionMode=z.IN_BODY,this.tokenizer.state=Gt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Gt.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Gt.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Gt.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Gt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&ue(U({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,u=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===dt.END_TAG&&i===n.tagName?{endTag:U({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ee.HTML)}_processToken(t){switch(t.type){case dt.CHARACTER:{this.onCharacter(t);break}case dt.NULL_CHARACTER:{this.onNullCharacter(t);break}case dt.COMMENT:{this.onComment(t);break}case dt.DOCTYPE:{this.onDoctype(t);break}case dt.START_TAG:{this._processStartTag(t);break}case dt.END_TAG:{this.onEndTag(t);break}case dt.EOF:{this.onEof(t);break}case dt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return G5(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Xr.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=z.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=z.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=z.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=z.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=z.IN_TABLE;return}case g.BODY:{this.insertionMode=z.IN_BODY;return}case g.FRAMESET:{this.insertionMode=z.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?z.AFTER_HEAD:z.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=z.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=z.IN_HEAD;return}break}}this.insertionMode=z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=z.IN_SELECT_IN_TABLE;return}}this.insertionMode=z.IN_SELECT}_isElementCausesFosterParenting(t){return Lw.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return E5[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CD(this,t);return}switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:{Bw(this,t);break}case z.TEXT:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_TABLE_TEXT:{Ww(this,t);break}case z.IN_COLUMN_GROUP:{vl(this,t);break}case z.AFTER_BODY:{kl(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kD(this,t);return}switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.TEXT:{this._insertCharacters(t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_COLUMN_GROUP:{vl(this,t);break}case z.AFTER_BODY:{kl(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){kh(this,t);return}switch(this.insertionMode){case z.INITIAL:case z.BEFORE_HTML:case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_TEMPLATE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{kh(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.AFTER_BODY:{oL(this,t);break}case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{sL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case z.INITIAL:{aL(this,t);break}case z.BEFORE_HEAD:case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:{this._err(t,le.misplacedDoctype);break}case z.IN_TABLE_TEXT:{yu(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,le.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?ND(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{uL(this,t);break}case z.BEFORE_HEAD:{lL(this,t);break}case z.IN_HEAD:{kr(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pL(this,t);break}case z.AFTER_HEAD:{mL(this,t);break}case z.IN_BODY:{vn(this,t);break}case z.IN_TABLE:{Os(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_CAPTION:{dD(this,t);break}case z.IN_COLUMN_GROUP:{Ih(this,t);break}case z.IN_TABLE_BODY:{Sl(this,t);break}case z.IN_ROW:{Al(this,t);break}case z.IN_CELL:{hD(this,t);break}case z.IN_SELECT:{Xw(this,t);break}case z.IN_SELECT_IN_TABLE:{gD(this,t);break}case z.IN_TEMPLATE:{ED(this,t);break}case z.AFTER_BODY:{wD(this,t);break}case z.IN_FRAMESET:{xD(this,t);break}case z.AFTER_FRAMESET:{_D(this,t);break}case z.AFTER_AFTER_BODY:{SD(this,t);break}case z.AFTER_AFTER_FRAMESET:{AD(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?ID(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{cL(this,t);break}case z.BEFORE_HEAD:{dL(this,t);break}case z.IN_HEAD:{fL(this,t);break}case z.IN_HEAD_NO_SCRIPT:{hL(this,t);break}case z.AFTER_HEAD:{gL(this,t);break}case z.IN_BODY:{_l(this,t);break}case z.TEXT:{tD(this,t);break}case z.IN_TABLE:{mu(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_CAPTION:{fD(this,t);break}case z.IN_COLUMN_GROUP:{pD(this,t);break}case z.IN_TABLE_BODY:{Oh(this,t);break}case z.IN_ROW:{Gw(this,t);break}case z.IN_CELL:{mD(this,t);break}case z.IN_SELECT:{Kw(this,t);break}case z.IN_SELECT_IN_TABLE:{yD(this,t);break}case z.IN_TEMPLATE:{bD(this,t);break}case z.AFTER_BODY:{Jw(this,t);break}case z.IN_FRAMESET:{TD(this,t);break}case z.AFTER_FRAMESET:{vD(this,t);break}case z.AFTER_AFTER_BODY:{Cl(this,t);break}}}onEof(t){switch(this.insertionMode){case z.INITIAL:{cu(this,t);break}case z.BEFORE_HTML:{lu(this,t);break}case z.BEFORE_HEAD:{du(this,t);break}case z.IN_HEAD:{fu(this,t);break}case z.IN_HEAD_NO_SCRIPT:{pu(this,t);break}case z.AFTER_HEAD:{hu(this,t);break}case z.IN_BODY:case z.IN_TABLE:case z.IN_CAPTION:case z.IN_COLUMN_GROUP:case z.IN_TABLE_BODY:case z.IN_ROW:case z.IN_CELL:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:{Vw(this,t);break}case z.TEXT:{nD(this,t);break}case z.IN_TABLE_TEXT:{yu(this,t);break}case z.IN_TEMPLATE:{Qw(this,t);break}case z.AFTER_BODY:case z.IN_FRAMESET:case z.AFTER_FRAMESET:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{Ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===L.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case z.IN_HEAD:case z.IN_HEAD_NO_SCRIPT:case z.AFTER_HEAD:case z.TEXT:case z.IN_COLUMN_GROUP:case z.IN_SELECT:case z.IN_SELECT_IN_TABLE:case z.IN_FRAMESET:case z.AFTER_FRAMESET:{this._insertCharacters(t);break}case z.IN_BODY:case z.IN_CAPTION:case z.IN_CELL:case z.IN_TEMPLATE:case z.AFTER_BODY:case z.AFTER_AFTER_BODY:case z.AFTER_AFTER_FRAMESET:{Fw(this,t);break}case z.IN_TABLE:case z.IN_TABLE_BODY:case z.IN_ROW:{Nh(this,t);break}case z.IN_TABLE_TEXT:{qw(this,t);break}}}}function Z5(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):zw(e,t),n}function eL(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const 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 tL(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,u=i;u!==n;s++,u=i){i=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&s>=Q5;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=nL(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function nL(e,t){const 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 rL(e,t,n){const r=e.treeAdapter.getTagName(t),i=Is(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===g.TEMPLATE&&s===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function iL(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Ah(e,t){for(let n=0;n<K5;n++){const r=Z5(e,t);if(!r)break;const i=eL(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=tL(e,i,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),u&&rL(e,u,s),iL(e,i,r)}}function kh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function oL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function sL(e,t){e._appendCommentNode(t,e.document)}function Ch(e,t){if(e.stopped=!0,t.location){const 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){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(s);u&&!u.endTag&&e._setEndLocation(s,t)}}}}function aL(e,t){e._setDocumentType(t);const n=t.forceQuirks?fr.QUIRKS:F5(t);M5(t)||e._err(t,le.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=z.BEFORE_HTML}function cu(e,t){e._err(t,le.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,fr.QUIRKS),e.insertionMode=z.BEFORE_HTML,e._processToken(t)}function uL(e,t){t.tagID===g.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=z.BEFORE_HEAD):lu(e,t)}function cL(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&lu(e,t)}function lu(e,t){e._insertFakeRootElement(),e.insertionMode=z.BEFORE_HEAD,e._processToken(t)}function lL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD;break}default:du(e,t)}}function dL(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?du(e,t):e._err(t,le.endTagWithoutMatchingOpenElement)}function du(e,t){e._insertFakeElement(ne.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=z.IN_HEAD,e._processToken(t)}function kr(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Gt.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Gt.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Gt.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Gt.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(z.IN_TEMPLATE);break}case g.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:fu(e,t)}}function fL(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=z.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{fu(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function Lo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,le.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,le.endTagWithoutMatchingOpenElement)}function fu(e,t){e.openElements.pop(),e.insertionMode=z.AFTER_HEAD,e._processToken(t)}function pL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{kr(e,t);break}case g.NOSCRIPT:{e._err(t,le.nestedNoscriptInHead);break}default:pu(e,t)}}function hL(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=z.IN_HEAD;break}case g.BR:{pu(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function pu(e,t){const n=t.type===dt.EOF?le.openElementsLeftAfterEof:le.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=z.IN_HEAD,e._processToken(t)}function mL(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=z.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,le.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),kr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,le.misplacedStartTagForHeadElement);break}default:hu(e,t)}}function gL(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{hu(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:e._err(t,le.endTagWithoutMatchingOpenElement)}}function hu(e,t){e._insertFakeElement(ne.BODY,g.BODY),e.insertionMode=z.IN_BODY,Tl(e,t)}function Tl(e,t){switch(t.type){case dt.CHARACTER:{Bw(e,t);break}case dt.WHITESPACE_CHARACTER:{Fw(e,t);break}case dt.COMMENT:{kh(e,t);break}case dt.START_TAG:{vn(e,t);break}case dt.END_TAG:{_l(e,t);break}case dt.EOF:{Vw(e,t);break}}}function Fw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Bw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function yL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function EL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function bL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_FRAMESET)}function wL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function xL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&_h.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function TL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _L(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),n||(e.formElement=e.openElements.current))}function vL(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===g.LI&&i===g.LI||(n===g.DD||n===g.DT)&&(i===g.DD||i===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==g.ADDRESS&&i!==g.DIV&&i!==g.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function SL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=Gt.PLAINTEXT}function AL(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function kL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(Ah(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function CL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function NL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(Ah(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OL(e,t){e.treeAdapter.getDocumentMode(e.document)!==fr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=z.IN_TABLE}function Uw(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jw(e){const t=Ew(e,Ro.TYPE);return t!=null&&t.toLowerCase()===X5}function PL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),jw(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function RL(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function LL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function DL(e,t){t.tagName=ne.IMG,t.tagID=g.IMG,Uw(e,t)}function ML(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Gt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=z.TEXT}function FL(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function BL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Gt.RAWTEXT)}function Hw(e,t){e._switchToTextParsing(t,Gt.RAWTEXT)}function UL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===z.IN_TABLE||e.insertionMode===z.IN_CAPTION||e.insertionMode===z.IN_TABLE_BODY||e.insertionMode===z.IN_ROW||e.insertionMode===z.IN_CELL?z.IN_SELECT_IN_TABLE:z.IN_SELECT}function jL(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function HL(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function $L(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,Ee.HTML)}function zL(e,t){e._reconstructActiveFormattingElements(),Pw(t),Sh(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function VL(e,t){e._reconstructActiveFormattingElements(),Rw(t),Sh(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function $w(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function vn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{CL(e,t);break}case g.A:{kL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{xL(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{wL(e,t);break}case g.LI:case g.DD:case g.DT:{vL(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{Uw(e,t);break}case g.HR:{LL(e,t);break}case g.RB:case g.RTC:{HL(e,t);break}case g.RT:case g.RP:{$L(e,t);break}case g.PRE:case g.LISTING:{TL(e,t);break}case g.XMP:{FL(e,t);break}case g.SVG:{VL(e,t);break}case g.HTML:{yL(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{kr(e,t);break}case g.BODY:{EL(e,t);break}case g.FORM:{_L(e,t);break}case g.NOBR:{NL(e,t);break}case g.MATH:{zL(e,t);break}case g.TABLE:{OL(e,t);break}case g.INPUT:{PL(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{RL(e,t);break}case g.IMAGE:{DL(e,t);break}case g.BUTTON:{AL(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{IL(e,t);break}case g.IFRAME:{BL(e,t);break}case g.SELECT:{UL(e,t);break}case g.OPTION:case g.OPTGROUP:{jL(e,t);break}case g.NOEMBED:case g.NOFRAMES:{Hw(e,t);break}case g.FRAMESET:{bL(e,t);break}case g.TEXTAREA:{ML(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?Hw(e,t):$w(e,t);break}case g.PLAINTEXT:{SL(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:$w(e,t)}}function qL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=z.AFTER_BODY,Jw(e,t))}function YL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function GL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function XL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(ne.P,g.P),e._closePElement()}function KL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function QL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function JL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ZL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function eD(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function zw(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],u=e.openElements.tagIDs[i];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,u))break}}function _l(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{Ah(e,t);break}case g.P:{XL(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{YL(e,t);break}case g.LI:{KL(e);break}case g.DD:case g.DT:{QL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{JL(e);break}case g.BR:{eD(e);break}case g.BODY:{qL(e,t);break}case g.HTML:{WL(e,t);break}case g.FORM:{GL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{ZL(e,t);break}case g.TEMPLATE:{Lo(e,t);break}default:zw(e,t)}}function Vw(e,t){e.tmplInsertionModeStack.length>0?Qw(e,t):Ch(e,t)}function tD(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function nD(e,t){e._err(t,le.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Nh(e,t){if(e.openElements.currentTagId!==void 0&&Lw.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=z.IN_TABLE_TEXT,t.type){case dt.CHARACTER:{Ww(e,t);break}case dt.WHITESPACE_CHARACTER:{qw(e,t);break}}else gu(e,t)}function rD(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_CAPTION}function iD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_COLUMN_GROUP}function oD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,g.COLGROUP),e.insertionMode=z.IN_COLUMN_GROUP,Ih(e,t)}function sD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_TABLE_BODY}function aD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,g.TBODY),e.insertionMode=z.IN_TABLE_BODY,Sl(e,t)}function uD(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function cD(e,t){jw(t)?e._appendElement(t,Ee.HTML):gu(e,t),t.ackSelfClosing=!0}function lD(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Os(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{aD(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{kr(e,t);break}case g.COL:{oD(e,t);break}case g.FORM:{lD(e,t);break}case g.TABLE:{uD(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{sD(e,t);break}case g.INPUT:{cD(e,t);break}case g.CAPTION:{rD(e,t);break}case g.COLGROUP:{iD(e,t);break}default:gu(e,t)}}function mu(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{Lo(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:gu(e,t)}}function gu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Tl(e,t),e.fosterParentingEnabled=n}function qw(e,t){e.pendingCharacterTokens.push(t)}function Ww(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function yu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)gu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Yw=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function dD(e,t){const n=t.tagID;Yw.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,Os(e,t)):vn(e,t)}function fD(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_TABLE,n===g.TABLE&&mu(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:_l(e,t)}}function Ih(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.COL:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{kr(e,t);break}default:vl(e,t)}}function pD(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case g.TEMPLATE:{Lo(e,t);break}case g.COL:break;default:vl(e,t)}}function vl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=z.IN_TABLE,e._processToken(t))}function Sl(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,g.TR),e.insertionMode=z.IN_ROW,Al(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,Os(e,t));break}default:Os(e,t)}}function Oh(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE,mu(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:mu(e,t)}}function Al(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ee.HTML),e.insertionMode=z.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Sl(e,t));break}default:Os(e,t)}}function Gw(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Oh(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=z.IN_TABLE_BODY,Oh(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:mu(e,t)}}function hD(e,t){const n=t.tagID;Yw.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Al(e,t)):vn(e,t)}function mD(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=z.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Gw(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:_l(e,t)}}function Xw(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{kr(e,t);break}}}function Kw(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{Lo(e,t);break}}}function gD(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Xw(e,t)}function yD(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Kw(e,t)}function ED(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{kr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=z.IN_TABLE,e.insertionMode=z.IN_TABLE,Os(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=z.IN_COLUMN_GROUP,e.insertionMode=z.IN_COLUMN_GROUP,Ih(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=z.IN_TABLE_BODY,e.insertionMode=z.IN_TABLE_BODY,Sl(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=z.IN_ROW,e.insertionMode=z.IN_ROW,Al(e,t);break}default:e.tmplInsertionModeStack[0]=z.IN_BODY,e.insertionMode=z.IN_BODY,vn(e,t)}}function bD(e,t){t.tagID===g.TEMPLATE&&Lo(e,t)}function Qw(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ch(e,t)}function wD(e,t){t.tagID===g.HTML?vn(e,t):kl(e,t)}function Jw(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else kl(e,t)}function kl(e,t){e.insertionMode=z.IN_BODY,Tl(e,t)}function xD(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.FRAMESET:{e._insertElement(t,Ee.HTML);break}case g.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{kr(e,t);break}}}function TD(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=z.AFTER_FRAMESET))}function _D(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.NOFRAMES:{kr(e,t);break}}}function vD(e,t){t.tagID===g.HTML&&(e.insertionMode=z.AFTER_AFTER_FRAMESET)}function SD(e,t){t.tagID===g.HTML?vn(e,t):Cl(e,t)}function Cl(e,t){e.insertionMode=z.IN_BODY,Tl(e,t)}function AD(e,t){switch(t.tagID){case g.HTML:{vn(e,t);break}case g.NOFRAMES:{kr(e,t);break}}}function kD(e,t){t.chars=Bt,e._insertCharacters(t)}function CD(e,t){e._insertCharacters(t),e.framesetOk=!1}function Zw(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function ND(e,t){if(V5(t))Zw(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ee.MATHML?Pw(t):r===Ee.SVG&&(q5(t),Rw(t)),Sh(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function ID(e,t){if(t.tagID===g.P||t.tagID===g.BR){Zw(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const OD=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,PD=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ex={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function tx(e,t){const n=$D(e),r=pw("type",{handlers:{root:RD,element:LD,text:DD,comment:rx,doctype:MD,raw:BD},unknown:UD}),i={parser:n?new Mw(ex):Mw.getFragmentParser(void 0,ex),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),Ps(i,Yr());const s=n?i.parser.document:i.parser.getFragment(),u=z6(s,{file:i.options.file});return i.stitches&&yl(u,"comment",function(c,d,f){const h=c;if(h.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=h.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function nx(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function RD(e,t){nx(e.children,t)}function LD(e,t){jD(e,t),nx(e.children,t),HD(e,t)}function DD(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:dt.CHARACTER,chars:e.value,location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function MD(e,t){const n={type:dt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FD(e,t){t.stitches=!0;const n=zD(e);if("children"in e&&"children"in n){const r=tx({type:"root",children:e.children},t.options);n.children=r.children}rx({type:"comment",value:{stitch:n}},t)}function rx(e,t){const n=e.value,r={type:dt.COMMENT,data:n,location:Eu(e)};Ps(t,Yr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function BD(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,ix(t,Yr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OD,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function UD(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))FD(n,t);else{let r="";throw PD.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ps(e,t){ix(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Gt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function ix(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function jD(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ps(t,Yr(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Po.html;i===Po.html&&n==="svg"&&(i=Po.svg);const s=G6(ue(U({},e),{children:[]}),{space:i===Po.svg?"svg":"html"}),u={type:dt.START_TAG,tagName:n,tagID:Is(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Eu(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function HD(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&n5.includes(n)||t.parser.tokenizer.state===Gt.PLAINTEXT)return;Ps(t,sl(e));const r={type:dt.END_TAG,tagName:n,tagID:Is(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Eu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Gt.RCDATA||t.parser.tokenizer.state===Gt.RAWTEXT||t.parser.tokenizer.state===Gt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Gt.DATA)}function $D(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Eu(e){const t=Yr(e)||{line:void 0,column:void 0,offset:void 0},n=sl(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function zD(e){return"children"in e?Oo(ue(U({},e),{children:[]})):Oo(e)}function ox(e){return function(t,n){return tx(t,ue(U({},e),{file:n}))}}const Do=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],sx={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Do,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Do],h2:[["className","sr-only"]],img:[...Do,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Do,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Do],table:[...Do],ul:[...Do,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Ui={}.hasOwnProperty;function VD(e,t){let n={type:"root",children:[]};const r={schema:t?U(U({},sx),t):sx,stack:[]},i=ax(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function ax(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return qD(e,n);case"doctype":return WD(e,n);case"element":return YD(e,n);case"root":return GD(e,n);case"text":return XD(e,n)}}}function qD(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return bu(s,t),s}}function WD(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return bu(n,t),n}}function YD(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=ux(e,t.children),i=KD(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Ui.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(s=!1;++d<c.length;)e.stack.includes(c[d])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:i,children:r};return bu(u,t),u}function GD(e,t){const r={type:"root",children:ux(e,t.children)};return bu(r,t),r}function XD(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return bu(r,t),r}function ux(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=ax(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function KD(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&Ui.call(r,n)?r[n]:void 0,u=r&&Ui.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Ui.call(c,f)){const h=c[f];let m=cx(e,dx(s,f),f,h);m==null&&(m=cx(e,dx(u,f),f,h)),m!=null&&(d[f]=m)}if(i&&Ui.call(i,n)){const h=i[n];for(f in h)Ui.call(h,f)&&!Ui.call(d,f)&&(d[f]=h[f])}return d}function cx(e,t,n,r){return t?Array.isArray(r)?QD(e,t,n,r):lx(e,t,n,r):void 0}function QD(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const u=lx(e,t,n,r[i]);(typeof u=="number"||typeof u=="string")&&s.push(u)}return s}function lx(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&JD(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const u=t[s];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){i=!0;break}}else if(u===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function JD(e,t,n){const r=e.schema.protocols&&Ui.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),u=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(s<0||d>-1&&s>d||u>-1&&s>u||c>-1&&s>c)return!0;let f=-1;for(;++f<r.length;){const h=r[f];if(s===h.length&&i.slice(0,h.length)===h)return!0}return!1}function bu(e,t){const n=tb(t);t.data&&(e.data=Oo(t.data)),n&&(e.position=n)}function dx(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function ZD(e){return function(t){return VD(t,e)}}const fx=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,onClick:i,children:s})=>{const u=/^tel:/i.test(n!=null?n:""),d=n?!!(n&&t&&!u)?"_blank":"_self":void 0;return w.jsx("a",ue(U(U({className:M(e,`${k}-link`)},n?{href:n,target:d,onClick:i}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},e8=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=at();return!e&&!t?null:w.jsx("div",{className:M(n,`${k}-disclaimer`),children:t?w.jsx(rw,{rehypePlugins:[ox,ZD],components:{ul:({children:r})=>w.jsx("ul",{className:M(n,`${k}-ul`),children:r}),ol:({children:r})=>w.jsx("ol",{className:M(n,`${k}-ol`),children:r}),li:({children:r})=>w.jsx("li",{className:M(n,`${k}-li`),children:r}),a:({href:r,title:i,children:s})=>w.jsx(fx,{globalClassName:n,openLinksInNewTab:!0,href:r,title:i,children:s}),img:({src:r,alt:i})=>w.jsx("img",{className:M(n,`${k}-disclaimer-image`),src:r,alt:i}),p:({children:r})=>w.jsx("p",{className:M(n,`${k}-disclaimer-text`),children:r}),span:({children:r})=>w.jsx("span",{className:M(n,`${k}-disclaimer-text-span`),children:r})},children:t}):w.jsx("p",{className:M(n,`${k}-disclaimer-text`),children:e})})},t8=Math.round(Hf/(1024*1024)),n8=e=>e==="oversize"?`File size exceeds the ${t8}MB limit. Please choose a smaller file.`:"That file type isn't supported. Please choose a PNG, JPG, or GIF image.",Ph=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{var ae;const{isConnected:i,sessionExpired:s,canInitialize:u,messages:c}=$t(),{globalClassName:d,searchConfig:f,enableEscalationToAgent:h,enableImageUpload:m,enablePageContext:E}=at(),[,b]=S.useReducer(C=>C+1,0),T=E?f1():null;S.useEffect(()=>{let C=!0;const F=()=>{queueMicrotask(()=>{C&&b()})};return J0(F),c1(F),F(),()=>{C=!1,Z0(F),l1(F)}},[]);const v=S.useRef(null),I=S.useRef(c);I.current=c;const[_,N]=S.useState(!1),[P,B]=S.useState(null),R=m,O=!Yy(i,s,u),q=t||O,K=(f==null?void 0:f.placeholder)||(T==null?void 0:T.placeholder)||"Ask us anything",re=S.useCallback(C=>B(n8(C)),[]),{file:H,attach:Z,clear:X}=kO({allowedMime:S1,maxBytes:Number.POSITIVE_INFINITY,onReject:re});S.useEffect(()=>{H&&B(null)},[H]);const he=S.useCallback(C=>Oe(null,null,function*(){var Y,D,fe;if(C.preventDefault(),q)return;B(null);const F=(((Y=v.current)==null?void 0:Y.value)||"").trim();if(F||H){const De=!i&&!s&&u===!0,Te=I.current.length;v.current.value="",(D=v.current)==null||D.focus({preventScroll:!0});const Ne={text:F};H&&(Ne.file=H),X();const be=yield r(Ne),We=!!be&&be.outcome!=="success",Ze=I.current.length===Te,Nt=((fe=v.current)==null?void 0:fe.value)==="";We&&(De&&Ze&&Nt)&&(v.current.value=F,Ne.file&&Z([Ne.file]),v.current.disabled||v.current.focus({preventScroll:!0}))}}),[H,i,s,u,q,X,r,Z]),V=S.useCallback(()=>{r({text:"Can you connect me to a human?"})},[r]),ce=S.useCallback(C=>{!R||q||(C.preventDefault(),N(!0))},[R,q]),me=S.useCallback(()=>N(!1),[]),se=S.useCallback(C=>{!R||q||(C.preventDefault(),N(!1),Z(C.dataTransfer.files))},[R,q,Z]),J=S.useCallback(C=>{!R||q||C.clipboardData.files.length>0&&Z(C.clipboardData.files)},[R,q,Z]);return w.jsxs("div",{className:M(d,e,`cim-${n}-component`,H&&"with-attachments",`${k}-search-bar-wrapper`),children:[R&&H&&w.jsx(CO,{file:H,componentType:n,globalClassName:d,onRemove:X}),R&&P&&w.jsx("div",{className:M(d,`${k}-attach-error`),role:"alert",children:P}),w.jsxs("form",{className:M(d,e,`cim-${n}-component`,_&&"drag-over",`${k}-search-bar`,T&&`${k}-search-bar-with-context`,h&&`${k}-search-bar-with-escalation`),name:`${k}-search-form`,onSubmit:he,onDragOver:ce,onDragLeave:me,onDrop:se,children:[T&&w.jsx("div",{className:`${k}-page-context-row`,role:"group","aria-label":"Current page context",children:w.jsxs("span",{className:`${k}-page-context-chip`,children:[T.type==="pdp"&&T.imageUrl&&w.jsx("img",{src:T.imageUrl,alt:"",className:`${k}-page-context-image`}),T.type==="srp"&&w.jsx(LE,{"aria-hidden":"true",className:`${k}-page-context-icon`}),w.jsx("span",{className:`${k}-page-context-name`,title:T.label,children:T.label}),w.jsx("button",{type:"button",className:`${k}-page-context-remove`,"aria-label":T.removeLabel,onClick:Mf,children:w.jsx(vO,{"aria-hidden":"true"})})]})}),w.jsxs("div",{className:M(d,e,`cim-${n}-component`,`${k}-messaging-input-group`,`${k}-messaging-composer-group`),children:[w.jsxs("div",{className:M(d,e,`cim-${n}-component`,`${k}-messaging-input-group`),children:[R&&w.jsx(NO,{componentType:n,accept:Vk,disabled:q,globalClassName:d,className:e,icon:w.jsx(wO,{}),onFiles:Z}),w.jsx("input",{className:M(d,e,`cim-${n}-component`,`${k}-search-input`),type:"text",ref:v,placeholder:K,"aria-label":(f==null?void 0:f.inputAriaLabel)||K,name:`${k}-user-input`,disabled:O,readOnly:t,onPaste:J})]}),w.jsx(OO,{className:e,globalClassName:d,searchConfig:ue(U({},f),{buttonIcon:(ae=f==null?void 0:f.buttonIcon)!=null?ae:"arrow"}),componentType:n,isLoading:q})]}),h&&w.jsx(Sr,{className:d,ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:q,onClick:V,icon:w.jsx(cO,{})})]}),w.jsx(e8,{})]})};function r8(e){return ct({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function i8(e){return ct({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const px=S.createContext({isOpen:!1}),Rh=S.createContext(null),hx=S.createContext(null),Mo=()=>{var n,r;const e=S.useContext(Rh),t=S.useContext(hx);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},mx=({onClearChat:e,componentType:t})=>{const n=Mo(),r=()=>{e(),n()};return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[w.jsx(i8,{}),"Clear chat"]})},gx=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=at(),r=Mo(),[i,s]=S.useState(!1),u=()=>Oe(null,null,function*(){if(!i){s(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{s(!1)}}});return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:i,children:[w.jsx(r8,{}),"Download transcript"]})},yx=({onEndConversation:e,componentType:t})=>{const n=Mo(),r=()=>{e(),n()};return w.jsxs("button",{className:M(`${k}-overflow-menu-button`,"end-conversation-button",`cim-${t}-component`),onClick:r,children:[w.jsx(bO,{}),"End conversation"]})};function o8(e){return e==null?[]:Array.isArray(e)?e:[e]}var s8=(e,...t)=>e.concat(t),a8=(e,...t)=>e.filter(n=>!t.includes(n)),u8=e=>Array.from(new Set(e));function Ex(e,t,n={}){const{step:r=1,loop:i=!0}=n,s=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:s<0?i?c:0:s>=u?i?0:t>u?u:t:s}function c8(e,t,n={}){const{step:r=1,loop:i=!0}=n;return Ex(e,t,{step:-r,loop:i})}var l8=e=>Array.isArray(e),bx=e=>e!=null&&typeof e=="object",d8=e=>bx(e)&&!l8(e),Nl=e=>typeof e=="string",Rs=e=>typeof e=="function",f8=e=>e==null,p8=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h8=e=>Object.prototype.toString.call(e),wx=Function.prototype.toString,m8=wx.call(Object),g8=e=>{if(!bx(e)||h8(e)!="[object Object]"||b8(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=p8(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&wx.call(n)==m8},y8=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,E8=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,b8=e=>y8(e)||E8(e),w8=e=>e(),x8=()=>{},Lh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function T8(e,t=0){let n=0,r=null;return((...i)=>{const s=Date.now(),u=s-n;u>=t?(r&&(clearTimeout(r),r=null),e(...i),n=s):r||(r=setTimeout(()=>{e(...i),n=Date.now(),r=null},t-u))})}var{min:_8,max:v8}=Math,S8=e=>Number.isNaN(e),A8=e=>S8(e)?0:e,xx=(e,t,n)=>_8(v8(A8(e),t),n);function Dh(e){if(!g8(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const i=e[r];i!==void 0&&(n[r]=Dh(i))}return n}function Mh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function k8(e,t){if(e==null)throw new Error(t())}function C8(e,t,n){let r=[];for(const i of t)e[i]==null&&r.push(i);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var N8=Object.defineProperty,I8=(e,t,n)=>t in e?N8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fh=(e,t,n)=>I8(e,typeof t!="symbol"?t+"":t,n),Tx=()=>{},Il=e=>typeof e=="object"&&e!==null,Ls=e=>e?"":void 0,_x=e=>e?"true":void 0,O8=1,P8=9,R8=11,cn=e=>Il(e)&&e.nodeType===O8&&typeof e.nodeName=="string",Ol=e=>Il(e)&&e.nodeType===P8,L8=e=>Il(e)&&e===e.window,vx=e=>cn(e)?e.localName||"":"#document";function D8(e){return["html","body","#document"].includes(vx(e))}var M8=e=>Il(e)&&e.nodeType!==void 0,Fo=e=>M8(e)&&e.nodeType===R8&&"host"in e,F8=e=>cn(e)&&e.localName==="input",B8=e=>cn(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function wu(e){if(!e)return!1;const t=e.getRootNode();return Fs(t)===e}var U8=/(textarea|select)/;function j8(e){if(e==null||!cn(e))return!1;try{return F8(e)&&e.selectionStart!=null||U8.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function Ds(e,t){var r;if(!e||!t||!cn(e)||!cn(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&Fo(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Kr(e){var t;return Ol(e)?e:L8(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function H8(e){return Kr(e).documentElement}function Ms(e){var t,n,r;return Fo(e)?Ms(e.host):Ol(e)?(t=e.defaultView)!=null?t:window:cn(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function Fs(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function $8(e){if(vx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fo(e)&&e.host||H8(e);return Fo(t)?t.host:t}function Bh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Ol(t)||Fo(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var Uh=new WeakMap;function Bs(e){return Uh.has(e)||Uh.set(e,Ms(e).getComputedStyle(e)),Uh.get(e)}var jh=new Set(["menu","listbox","dialog","grid","tree","region"]),z8=e=>jh.has(e),Sx=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function Ax(e,t){const n=new Set,r=Bh(e),i=s=>{const u=s.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Sx(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const h=r.getElementById(f);if(h){const m=h.getAttribute("role"),E=h.getAttribute("aria-modal")==="true";if(m&&z8(m)&&!E&&(h===t||h.contains(t)||i(h)))return!0}}}return!1};return i(e)}function kx(e,t){const n=Bh(e),r=new Set,i=s=>{const u=s.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Sx(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const h=n.getElementById(f);if(h){const m=h.getAttribute("role"),E=h.getAttribute("aria-modal")==="true";m&&jh.has(m)&&!E&&(t(h),i(h))}}}};i(e)}function V8(e){const t=new Set;return kx(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function q8(e){const t=e.getAttribute("role");return!!(t&&jh.has(t))}function W8(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function Y8(e){var t;return W8(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function G8(e){if(!e.id)return!1;const t=Bh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&q8(e))}var Hh=()=>typeof document!="undefined";function X8(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var $h=e=>Hh()&&e.test(X8()),K8=e=>Hh()&&e.test(navigator.vendor),Cx=()=>Hh()&&!!navigator.maxTouchPoints,Q8=()=>$h(/^iPhone/i),J8=()=>$h(/^iPad/i)||zh()&&navigator.maxTouchPoints>1,Pl=()=>Q8()||J8(),Z8=()=>zh()||Pl(),zh=()=>$h(/^Mac/i),eM=()=>Z8()&&K8(/apple/i);function tM(e){var t,n,r,i;return(i=(t=e.composedPath)==null?void 0:t.call(e))!=null?i:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function Cr(e){var n;const t=tM(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var Nx=e=>e.button===0,nM=e=>e.button===2||zh()&&e.ctrlKey&&e.button===0,rM=e=>"touches"in e&&e.touches.length>0,iM={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Ix={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function oM(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let i=e.key;return i=(u=iM[i])!=null?u:i,n==="rtl"&&r==="horizontal"&&i in Ix&&(i=Ix[i]),i}function Ox(e,t="client"){const n=rM(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var ln=(e,t,n,r)=>{const i=typeof e=="function"?e():e;return i==null||i.addEventListener(t,n,r),()=>{i==null||i.removeEventListener(t,n,r)}},Px=e=>cn(e)&&e.tagName==="IFRAME",sM=/^(audio|video|details)$/;function Rx(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var aM=e=>!Number.isNaN(Rx(e)),uM=e=>Rx(e)<0;function cM(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function Lx(e,t,n){const r=[...e],i=[...e],s=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<i.length;){const d=i[c++];if(!d||s.has(d))continue;s.add(d);const f=cM(d,t);if(f){const h=Array.from(f.querySelectorAll(Rl)).filter(n),m=u.get(d);if(m!==void 0){const E=m+1;r.splice(E,0,...h),h.forEach((b,T)=>{u.set(b,E+T)});for(let b=E+h.length;b<r.length;b++)u.set(r[b],b)}else{const E=r.length;r.push(...h),h.forEach((b,T)=>{u.set(b,E+T)})}i.push(...h)}}return r}var Rl="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Dx=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(Rl));(n==!0||n=="if-empty"&&i.length===0)&&cn(e)&&Qr(e)&&i.unshift(e);const u=[];for(const c of i)if(Qr(c)){if(Px(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...Dx(d,{getShadowRoot:r}));continue}u.push(c)}return r?Lx(u,r,Qr):u};function Qr(e){return!cn(e)||e.closest("[inert]")?!1:e.matches(Rl)&&B8(e)}function Us(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(Rl));n&&Bo(e)&&i.unshift(e);const s=[];for(const u of i)if(Bo(u)){if(Px(u)&&u.contentDocument){const c=u.contentDocument.body;s.push(...Us(c,{getShadowRoot:r}));continue}s.push(u)}if(r){const u=Lx(s,r,Bo);return!u.length&&n?i:u}return!s.length&&n?i:s}function Bo(e){return cn(e)&&e.tabIndex>0?!0:Qr(e)&&!uM(e)}function lM(e,t={}){const n=Us(e,t),r=n[0]||null,i=n[n.length-1]||null;return[r,i]}function dM(e,t={}){const{current:n,getShadowRoot:r}=t,i=Us(e,{getShadowRoot:r}),s=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:Fs(s);if(!u)return null;const c=i.indexOf(u);return i[c+1]||null}function xu(e){return e.tabIndex<0&&(sM.test(e.localName)||j8(e))&&!aM(e)?0:e.tabIndex}function Mx(e){const{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let s=null;if(s||(s=typeof n=="function"?n():n),s||(s=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!s){const u=Us(t);s=r?u.filter(r)[0]:u[0]}return s||t||void 0}var fM=class GS{constructor(){Fh(this,"id",null),Fh(this,"fn_cleanup"),Fh(this,"cleanup",()=>{this.cancel()})}static create(){return new GS}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function en(e){const t=fM.create();return t.request(e),t.cleanup}function Fx(e){const t=new Set;function n(r){const i=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(e)),function(){t.forEach(i=>i())}}function Vh(e){const t=$8(e);return D8(t)?Kr(t).body:cn(t)&&mM(t)?t:Vh(t)}var pM=/auto|scroll|overlay|hidden|clip/,hM=new Set(["inline","contents"]);function mM(e){const t=Ms(e),{overflow:n,overflowX:r,overflowY:i,display:s}=t.getComputedStyle(e);return pM.test(n+i+r)&&!hM.has(s)}var js="default",qh="",Ll=new WeakMap;function gM(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,i=r.documentElement;return Pl()?(js==="default"&&(qh=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),js="disabled"):t&&(Ll.set(t,t.style.userSelect),t.style.userSelect="none"),()=>yM({target:t,doc:r})}function yM(e={}){const{target:t,doc:n}=e,i=(n!=null?n:document).documentElement;if(Pl()){if(js!=="disabled")return;js="restoring",setTimeout(()=>{Fx(()=>{js==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=qh||""),qh="",js="default")})},300)}else if(t&&Ll.has(t)){const s=Ll.get(t);t.style.userSelect==="none"&&(t.style.userSelect=s!=null?s:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ll.delete(t)}}function EM(e={}){const u=e,{defer:t,target:n}=u,r=bn(u,["defer","target"]),i=t?en:c=>c(),s=[];return s.push(i(()=>{const c=typeof n=="function"?n():n;s.push(gM(ue(U({},r),{target:c})))})),()=>{s.forEach(c=>c==null?void 0:c())}}function bM(e,t){const{onPointerMove:n,onPointerUp:r}=t,i=c=>{const d=Ox(c),f=Math.sqrt(yf(d.x,2)+yf(d.y,2)),h=c.pointerType==="touch"?10:5;if(!(f<h)){if(c.pointerType==="mouse"&&c.button===0){s(c);return}n({point:d,event:c})}},s=c=>{const d=Ox(c);r({point:d,event:c})},u=[ln(e,"pointermove",i,!1),ln(e,"pointerup",s,!1),ln(e,"pointercancel",s,!1),ln(e,"contextmenu",s,!1),EM({doc:e})];return()=>{u.forEach(c=>c())}}function wM(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:i,getShadowRoot:s}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let h=null;const[m,E]=lM(e,{includeContainer:!0,getShadowRoot:s}),b=dM(c,{current:n,getShadowRoot:s}),T=!m&&!E;f.shiftKey&&wu(b)?(i==null||i(),h=E):f.shiftKey&&(wu(m)||T)?h=n:!f.shiftKey&&wu(n)?(i==null||i(),h=m):!f.shiftKey&&(wu(E)||T)&&(h=b),h&&(f.preventDefault(),typeof r=="function"?r(h):h.focus())}return ln(u,"keydown",d,!0)}function xM(e,t){const c=t,{defer:n,triggerElement:r}=c,i=bn(c,["defer","triggerElement"]),s=n?en:d=>d(),u=[];return u.push(s(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(wM(d,U({triggerElement:f},i)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function TM(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Dl(e,t){if(!e)return Tx;const n=Object.keys(t).reduce((r,i)=>(r[i]=e.style.getPropertyValue(i),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function _M(e,t,n){if(!e)return Tx;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function vM(e,t,n){const{signal:r}=t;return[new Promise((u,c)=>{const d=setTimeout(()=>{c(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),c(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),c(f))})}),()=>t.abort()]}function SM(e,t){const{timeout:n,rootNode:r}=t,i=Ms(r),s=Kr(r),u=new i.AbortController;return vM(new Promise(c=>{const d=e();if(d){c(d);return}const f=new i.MutationObserver(()=>{const h=e();h&&h.isConnected&&(f.disconnect(),c(h))});f.observe(s.body,{childList:!0,subtree:!0})}),u,n)}var AM=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),kM=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Bx=e=>{const t={};let n;for(;n=kM.exec(e);)t[n[1]]=n[2];return t},CM=(e,t)=>{if(Nl(e)){if(Nl(t))return`${e};${t}`;e=Bx(e)}else Nl(t)&&(t=Bx(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function tn(...e){let t={};for(let n of e){if(!n)continue;for(let i in t){if(i.startsWith("on")&&typeof t[i]=="function"&&typeof n[i]=="function"){t[i]=Lh(n[i],t[i]);continue}if(i==="className"||i==="class"){t[i]=AM(t[i],n[i]);continue}if(i==="style"){t[i]=CM(t[i],n[i]);continue}t[i]=n[i]!==void 0?n[i]:t[i]}for(let i in n)t[i]===void 0&&(t[i]=n[i]);const r=Object.getOwnPropertySymbols(n);for(let i of r)t[i]=n[i]}return t}function TV(e){return e}var Hs=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Hs||{}),Wh="__init__";function NM(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>Kr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},i=()=>Fs(t()),s=u=>t().getElementById(u);return ue(U({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:wu,getById:s})}function IM(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var $s=()=>e=>Array.from(new Set(e)),Ux=typeof globalThis.document!="undefined"?S.useLayoutEffect:S.useEffect;function Ml(e){var m,E;const t=(m=e().value)!=null?m:e().defaultValue,n=(E=e().isEqual)!=null?E:Object.is,[r]=S.useState(t),[i,s]=S.useState(r),u=e().value!==void 0,c=S.useRef(i);c.current=u?e().value:i;const d=S.useRef(c.current);Ux(()=>{d.current=c.current},[i,e().value]);const f=b=>{var I,_;const T=d.current,v=Rs(b)?b(T):b;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:v,prev:T}),u||s(v),n(v,T)||(_=(I=e()).onChange)==null||_.call(I,v,T)};function h(){return u?e().value:i}return{initial:r,ref:c,get:h,set(b){(e().sync?_s.flushSync:w8)(()=>f(b))},invoke(b,T){var v,I;(I=(v=e()).onChange)==null||I.call(v,b,T)},hash(b){var T,v,I;return(I=(v=(T=e()).hash)==null?void 0:v.call(T,b))!=null?I:String(b)}}}Ml.cleanup=e=>{S.useEffect(()=>e,[])},Ml.ref=e=>{const t=S.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function OM(e){const t=S.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var PM=(e,t)=>{const n=S.useRef(!1),r=S.useRef(!1);S.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(i=>typeof i=="function"?i():i)]),S.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Fl(e,t={}){var Z,X,he,V,ce,me;const n=S.useMemo(()=>{const{id:se,ids:J,getRootNode:ae}=t;return NM({id:se,ids:J,getRootNode:ae})},[t]),r=(...se)=>{e.debug&&console.log(...se)},i=(X=(Z=e.props)==null?void 0:Z.call(e,{props:Dh(t),scope:n}))!=null?X:t,s=RM(i),u=(he=e.context)==null?void 0:he.call(e,{prop:s,bindable:Ml,scope:n,flush:Hx,getContext(){return d},getComputed(){return R},getRefs(){return v},getEvent(){return b()}}),c=jx(u),d={get(se){var J;return(J=c.current)==null?void 0:J[se].ref.current},set(se,J){var ae;(ae=c.current)==null||ae[se].set(J)},initial(se){var J;return(J=c.current)==null?void 0:J[se].initial},hash(se){var ae,C;const J=(ae=c.current)==null?void 0:ae[se].get();return(C=c.current)==null?void 0:C[se].hash(J)}},f=S.useRef(new Map),h=S.useRef(null),m=S.useRef(null),E=S.useRef({type:""}),b=()=>ue(U({},E.current),{current(){return E.current},previous(){return m.current}}),T=()=>ue(U({},O),{matches(...se){return se.includes(O.ref.current)},hasTag(se){var J,ae;return!!((ae=(J=e.states[O.ref.current])==null?void 0:J.tags)!=null&&ae.includes(se))}}),v=OM((ce=(V=e.refs)==null?void 0:V.call(e,{prop:s,context:d}))!=null?ce:{}),I=()=>({state:T(),context:d,event:b(),prop:s,send:H,action:_,guard:N,track:PM,refs:v,computed:R,flush:Hx,scope:n,choose:B}),_=se=>{const J=Rs(se)?se(I()):se;if(!J)return;const ae=J.map(C=>{var Y,D;const F=(D=(Y=e.implementations)==null?void 0:Y.actions)==null?void 0:D[C];return F||Mh(`[zag-js] No implementation found for action "${JSON.stringify(C)}"`),F});for(const C of ae)C==null||C(I())},N=se=>{var J,ae;return Rs(se)?se(I()):(ae=(J=e.implementations)==null?void 0:J.guards)==null?void 0:ae[se](I())},P=se=>{const J=Rs(se)?se(I()):se;if(!J)return;const ae=J.map(F=>{var D,fe;const Y=(fe=(D=e.implementations)==null?void 0:D.effects)==null?void 0:fe[F];return Y||Mh(`[zag-js] No implementation found for effect "${JSON.stringify(F)}"`),Y}),C=[];for(const F of ae){const Y=F==null?void 0:F(I());Y&&C.push(Y)}return()=>C.forEach(F=>F==null?void 0:F())},B=se=>o8(se).find(J=>{let ae=!J.guard;return Nl(J.guard)?ae=!!N(J.guard):Rs(J.guard)&&(ae=J.guard(I())),ae}),R=se=>{k8(e.computed,()=>"[zag-js] No computed object found on machine");const J=e.computed[se];return J({context:d,event:b(),prop:s,refs:v,scope:n,computed:R})},O=Ml(()=>({defaultValue:e.initialState({prop:s}),onChange(se,J){var C,F,Y,D;if(J){const fe=f.current.get(J);fe==null||fe(),f.current.delete(J)}J&&_((C=e.states[J])==null?void 0:C.exit),_((F=h.current)==null?void 0:F.actions);const ae=P((Y=e.states[se])==null?void 0:Y.effects);if(ae&&f.current.set(se,ae),J===Wh){_(e.entry);const fe=P(e.effects);fe&&f.current.set(Wh,fe)}_((D=e.states[se])==null?void 0:D.entry)}})),q=S.useRef(void 0),K=S.useRef(Hs.NotStarted);Ux(()=>{queueMicrotask(()=>{var F;const ae=K.current===Hs.Started;K.current=Hs.Started,r(ae?"rehydrating...":"initializing...");const C=(F=q.current)!=null?F:O.initial;O.invoke(C,ae?O.get():Wh)});const se=f.current,J=O.ref.current;return()=>{r("unmounting..."),q.current=J,K.current=Hs.Stopped,se.forEach(ae=>ae==null?void 0:ae()),f.current=new Map,h.current=null,queueMicrotask(()=>{_(e.exit)})}},[]);const re=()=>"ref"in O?O.ref.current:O.get(),H=se=>{queueMicrotask(()=>{var D,fe,De,Te,Ne;if(K.current!==Hs.Started)return;m.current=E.current,E.current=se;let J=re();const ae=(De=(D=e.states[J].on)==null?void 0:D[se.type])!=null?De:(fe=e.on)==null?void 0:fe[se.type],C=B(ae);if(!C)return;h.current=C;const F=(Te=C.target)!=null?Te:J;r("transition",se.type,C.target||J,`(${C.actions})`);const Y=F!==J;Y?_s.flushSync(()=>O.set(F)):C.reenter&&!Y?O.invoke(J,J):_((Ne=C.actions)!=null?Ne:[])})};return(me=e.watch)==null||me.call(e,I()),{state:T(),send:H,context:d,prop:s,scope:n,refs:v,computed:R,event:b(),getStatus:()=>K.current}}function jx(e){const t=S.useRef(e);return t.current=e,t}function RM(e){const t=jx(e);return function(r){return t.current[r]}}function Hx(e){queueMicrotask(()=>{_s.flushSync(()=>e())})}var Yh=IM(e=>e);function Bl(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const i=r(t);typeof i=="function"&&n.push(i)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function LM(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Gh=e=>{const t=S.memo(S.forwardRef((n,r)=>{const f=n,{asChild:i,children:s}=f,u=bn(f,["asChild","children"]);if(!i)return S.createElement(e,ue(U({},u),{ref:r}),s);if(!S.isValidElement(s))return null;const c=S.Children.only(s),d=LM(c);return S.cloneElement(c,ue(U({},tn(u,c.props)),{ref:r?Bl(r,d):d}))}));return t.displayName=e.displayName||e.name,t},Sn=(()=>{const e=new Map;return new Proxy(Gh,{apply(t,n,r){return Gh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Gh(r)),e.get(r)}})})();function DM(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Uo(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:s,defaultValue:u}=e,c=S.createContext(u);c.displayName=t;function d(){var h;const f=S.useContext(c);if(!f&&n){const m=new Error(s!=null?s:DM(r,i));throw m.name="ContextError",(h=Error.captureStackTrace)==null||h.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[MM,Xh]=Uo({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[$x,Tu]=Uo({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),zx=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:Bl(r.ref,t)}))});zx.displayName="PopoverContent";const Vx=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(n.getPositionerProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:t}))});Vx.displayName="PopoverPositioner";const _u=()=>(e,t)=>t.reduce((n,r)=>{const[i,s]=n,u=r;return s[u]!==void 0&&(i[u]=s[u]),delete s[u],[i,s]},[{},U({},e)]),qx=e=>_u()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function FM(e,t){const{state:n,send:r,context:i}=e,s=n.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:s,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var BM={props({props:e}){return ue(U({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Bs(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const i=r("present");if(i)return n({type:"MOUNT",src:"presence.changed"});const s=t.get("node");if(!i&&(s==null?void 0:s.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});en(()=>{var c,d;const u=Ul(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((c=t.get("styles"))==null?void 0:c.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{en(()=>{e.set("prevAnimationName",Ul(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const i=t.get("node");if(!i)return;const s=d=>{var h,m,E;((E=(m=(h=d.composedPath)==null?void 0:h.call(d))==null?void 0:m[0])!=null?E:d.target)===i&&e.set("prevAnimationName",Ul(t.get("styles")))},u=d=>{const f=Ul(t.get("styles"));Cr(d)===i&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",s),i.addEventListener("animationcancel",u),i.addEventListener("animationend",u);const c=Dl(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",s),i.removeEventListener("animationcancel",u),i.removeEventListener("animationend",u),Fx(()=>c())}}}}};function Ul(e){return(e==null?void 0:e.animationName)||"none"}$s()(["onExitComplete","present","immediate"]);function UM(e,t={}){const{sync:n=!1}=t,r=jM(e);return S.useCallback((...i)=>{var s;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...i)}):(s=r.current)==null?void 0:s.call(r,...i)},[n,r])}function jM(e){const t=S.useRef(e);return t.current=e,t}const Kh=(e={})=>{const E=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:i=!1}=E,s=bn(E,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=S.useRef(!1),c=ue(U({},s),{present:r,onExitComplete:UM(e.onExitComplete)}),d=Fl(BM,c),f=FM(d);f.present&&(u.current=!0);const h=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&i?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:h}};var jo=(e,t=[])=>({parts:(...n)=>{if(HM(t))return jo(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>jo(e,[...t,...n]),omit:(...n)=>jo(e,t.filter(r=>!n.includes(r))),rename:n=>jo(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${zs(e)}"][data-part="${zs(r)}"]`,`& [data-scope="${zs(e)}"][data-part="${zs(r)}"]`].join(", "),attrs:{"data-scope":zs(e),"data-part":zs(r)}}}),{})}),zs=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),HM=e=>e.length===0;const $M=["top","right","bottom","left"],ji=Math.min,pi=Math.max,jl=Math.round,Hl=Math.floor,Jr=e=>({x:e,y:e}),zM={left:"right",right:"left",bottom:"top",top:"bottom"};function Wx(e,t,n){return pi(e,ji(t,n))}function hi(e,t){return typeof e=="function"?e(t):e}function Hi(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function Qh(e){return e==="x"?"y":"x"}function Jh(e){return e==="y"?"height":"width"}function Zr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Zh(e){return Qh(Zr(e))}function VM(e,t,n){n===void 0&&(n=!1);const r=Vs(e),i=Zh(e),s=Jh(i);let u=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=$l(u)),[u,$l(u)]}function qM(e){const t=$l(e);return[em(e),t,em(t)]}function em(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yx=["left","right"],Gx=["right","left"],WM=["top","bottom"],YM=["bottom","top"];function GM(e,t,n){switch(e){case"top":case"bottom":return n?t?Gx:Yx:t?Yx:Gx;case"left":case"right":return t?WM:YM;default:return[]}}function XM(e,t,n,r){const i=Vs(e);let s=GM(Hi(e),n==="start",r);return i&&(s=s.map(u=>u+"-"+i),t&&(s=s.concat(s.map(em)))),s}function $l(e){const t=Hi(e);return zM[t]+e.slice(t.length)}function KM(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function Xx(e){return typeof e!="number"?KM(e):{top:e,right:e,bottom:e,left:e}}function zl(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Kx(e,t,n){let{reference:r,floating:i}=e;const s=Zr(t),u=Zh(t),c=Jh(u),d=Hi(t),f=s==="y",h=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,E=r[c]/2-i[c]/2;let b;switch(d){case"top":b={x:h,y:r.y-i.height};break;case"bottom":b={x:h,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}const T=Vs(t);return T&&(b[u]+=E*(T==="end"?1:-1)*(n&&f?-1:1)),b}function QM(e,t){return Oe(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:E=!1,padding:b=0}=hi(t,e),T=Xx(b),I=c[E?m==="floating"?"reference":"floating":m],_=zl(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(I))==null||n?I:I.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=m==="floating"?{x:r,y:i,width:u.floating.width,height:u.floating.height}:u.reference,P=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),B=(yield s.isElement==null?void 0:s.isElement(P))&&(yield s.getScale==null?void 0:s.getScale(P))||{x:1,y:1},R=zl(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:P,strategy:d}):N);return{top:(_.top-R.top+T.top)/B.y,bottom:(R.bottom-_.bottom+T.bottom)/B.y,left:(_.left-R.left+T.left)/B.x,right:(R.right-_.right+T.right)/B.x}})}const JM=50,ZM=(e,t,n)=>Oe(null,null,function*(){const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:u}=n,c=u.detectOverflow?u:ue(U({},u),{detectOverflow:QM}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:m}=Kx(f,r,d),E=r,b=0;const T={};for(let v=0;v<s.length;v++){const I=s[v];if(!I)continue;const{name:_,fn:N}=I,{x:P,y:B,data:R,reset:O}=yield N({x:h,y:m,initialPlacement:r,placement:E,strategy:i,middlewareData:T,rects:f,platform:c,elements:{reference:e,floating:t}});h=P!=null?P:h,m=B!=null?B:m,T[_]=U(U({},T[_]),R),O&&b<JM&&(b++,typeof O=="object"&&(O.placement&&(E=O.placement),O.rects&&(f=O.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:h,y:m}=Kx(f,E,d)),v=-1)}return{x:h,y:m,placement:E,strategy:i,middlewareData:T}}),e9=e=>({name:"arrow",options:e,fn(n){return Oe(this,null,function*(){const{x:r,y:i,placement:s,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:h,padding:m=0}=hi(e,n)||{};if(h==null)return{};const E=Xx(m),b={x:r,y:i},T=Zh(s),v=Jh(T),I=yield c.getDimensions(h),_=T==="y",N=_?"top":"left",P=_?"bottom":"right",B=_?"clientHeight":"clientWidth",R=u.reference[v]+u.reference[T]-b[T]-u.floating[v],O=b[T]-u.reference[T],q=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let K=q?q[B]:0;(!K||!(yield c.isElement==null?void 0:c.isElement(q)))&&(K=d.floating[B]||u.floating[v]);const re=R/2-O/2,H=K/2-I[v]/2-1,Z=ji(E[N],H),X=ji(E[P],H),he=K-I[v]-X,V=K/2-I[v]/2+re,ce=Wx(Z,V,he),me=!f.arrow&&Vs(s)!=null&&V!==ce&&u.reference[v]/2-(V<Z?Z:X)-I[v]/2<0,se=me?V<Z?V-Z:V-he:0;return{[T]:b[T]+se,data:U({[T]:ce,centerOffset:V-ce-se},me&&{alignmentOffset:se}),reset:me}})}}),t9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Oe(this,null,function*(){var r,i;const{placement:s,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:h}=n,ce=hi(e,n),{mainAxis:m=!0,crossAxis:E=!0,fallbackPlacements:b,fallbackStrategy:T="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:I=!0}=ce,_=bn(ce,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const N=Hi(s),P=Zr(d),B=Hi(d)===d,R=yield f.isRTL==null?void 0:f.isRTL(h.floating),O=b||(B||!I?[$l(d)]:qM(d)),q=v!=="none";!b&&q&&O.push(...XM(d,I,v,R));const K=[d,...O],re=yield f.detectOverflow(n,_),H=[];let Z=((i=u.flip)==null?void 0:i.overflows)||[];if(m&&H.push(re[N]),E){const me=VM(s,c,R);H.push(re[me[0]],re[me[1]])}if(Z=[...Z,{placement:s,overflows:H}],!H.every(me=>me<=0)){var X,he;const me=(((X=u.flip)==null?void 0:X.index)||0)+1,se=K[me];if(se&&(!(E==="alignment"?P!==Zr(se):!1)||Z.every(C=>Zr(C.placement)===P?C.overflows[0]>0:!0)))return{data:{index:me,overflows:Z},reset:{placement:se}};let J=(he=Z.filter(ae=>ae.overflows[0]<=0).sort((ae,C)=>ae.overflows[1]-C.overflows[1])[0])==null?void 0:he.placement;if(!J)switch(T){case"bestFit":{var V;const ae=(V=Z.filter(C=>{if(q){const F=Zr(C.placement);return F===P||F==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((C,F)=>C[1]-F[1])[0])==null?void 0:V[0];ae&&(J=ae);break}case"initialPlacement":J=d;break}if(s!==J)return{reset:{placement:J}}}return{}})}}};function Qx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jx(e){return $M.some(t=>e[t]>=0)}const n9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Oe(this,null,function*(){const{rects:r,platform:i}=n,c=hi(e,n),{strategy:s="referenceHidden"}=c,u=bn(c,["strategy"]);switch(s){case"referenceHidden":{const d=yield i.detectOverflow(n,ue(U({},u),{elementContext:"reference"})),f=Qx(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Jx(f)}}}case"escaped":{const d=yield i.detectOverflow(n,ue(U({},u),{altBoundary:!0})),f=Qx(d,r.floating);return{data:{escapedOffsets:f,escaped:Jx(f)}}}default:return{}}})}}},Zx=new Set(["left","top"]);function r9(e,t){return Oe(this,null,function*(){const{placement:n,platform:r,elements:i}=e,s=yield r.isRTL==null?void 0:r.isRTL(i.floating),u=Hi(n),c=Vs(n),d=Zr(n)==="y",f=Zx.has(u)?-1:1,h=s&&d?-1:1,m=hi(t,e);let{mainAxis:E,crossAxis:b,alignmentAxis:T}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof T=="number"&&(b=c==="end"?T*-1:T),d?{x:b*h,y:E*f}:{x:E*f,y:b*h}})}const i9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Oe(this,null,function*(){var r,i;const{x:s,y:u,placement:c,middlewareData:d}=n,f=yield r9(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:s+f.x,y:u+f.y,data:ue(U({},f),{placement:c})}})}}},o9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Oe(this,null,function*(){const{x:r,y:i,placement:s,platform:u}=n,P=hi(e,n),{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:B=>{let{x:R,y:O}=B;return{x:R,y:O}}}}=P,h=bn(P,["mainAxis","crossAxis","limiter"]),m={x:r,y:i},E=yield u.detectOverflow(n,h),b=Zr(s),T=Qh(b);let v=m[T],I=m[b];const _=(B,R)=>Wx(R+E[B==="y"?"top":"left"],R,R-E[B==="y"?"bottom":"right"]);c&&(v=_(T,v)),d&&(I=_(b,I));const N=f.fn(ue(U({},n),{[T]:v,[b]:I}));return ue(U({},N),{data:{x:N.x-r,y:N.y-i,enabled:{[T]:c,[b]:d}}})})}}},s9=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:s,placement:u,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:h=!0,crossAxis:m=!0}=hi(e,t),E={x:i,y:s},b=Zr(u),T=Qh(b);let v=E[T],I=E[b];const _=hi(f,t),N=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)!=null?n:0,crossAxis:(r=_.crossAxis)!=null?r:0};if(h){const R=T==="y"?"height":"width",O=c.reference[T]-c.floating[R]+N.mainAxis,q=c.reference[T]+c.reference[R]-N.mainAxis;v<O?v=O:v>q&&(v=q)}if(m){var P,B;const R=T==="y"?"width":"height",O=Zx.has(Hi(u)),q=c.reference[b]-c.floating[R]+(O&&((P=d.offset)==null?void 0:P[b])||0)+(O?0:N.crossAxis),K=c.reference[b]+c.reference[R]+(O?0:((B=d.offset)==null?void 0:B[b])||0)-(O?N.crossAxis:0);I<q?I=q:I>K&&(I=K)}return{[T]:v,[b]:I}}}},a9=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Oe(this,null,function*(){const{placement:r,rects:i,platform:s,elements:u}=n,H=hi(e,n),{apply:c=()=>{}}=H,d=bn(H,["apply"]),f=yield s.detectOverflow(n,d),h=Hi(r),m=Vs(r),E=Zr(r)==="y",{width:b,height:T}=i.floating;let v,I;h==="top"||h==="bottom"?(v=h,I=m===((yield s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(I=h,v=m==="end"?"top":"bottom");const _=T-f.top-f.bottom,N=b-f.left-f.right,P=ji(T-f[v],_),B=ji(b-f[I],N),R=n.middlewareData.shift,O=!R;let q=P,K=B;R!=null&&R.enabled.x&&(K=N),R!=null&&R.enabled.y&&(q=_),O&&!m&&(E?K=b-2*pi(f.left,f.right):q=T-2*pi(f.top,f.bottom)),yield c(ue(U({},n),{availableWidth:K,availableHeight:q}));const re=yield s.getDimensions(u.floating);return b!==re.width||T!==re.height?{reset:{rects:!0}}:{}})}}};function Vl(){return typeof window!="undefined"}function qs(e){return eT(e)?(e.nodeName||"").toLowerCase():"#document"}function rr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ei(e){var t;return(t=(eT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eT(e){return Vl()?e instanceof Node||e instanceof rr(e).Node:!1}function Nr(e){return Vl()?e instanceof Element||e instanceof rr(e).Element:!1}function ti(e){return Vl()?e instanceof HTMLElement||e instanceof rr(e).HTMLElement:!1}function tT(e){return!Vl()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof rr(e).ShadowRoot}function vu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function u9(e){return/^(table|td|th)$/.test(qs(e))}function ql(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const c9=/transform|translate|scale|rotate|perspective|filter/,l9=/paint|layout|strict|content/,Ho=e=>!!e&&e!=="none";let tm;function nm(e){const t=Nr(e)?Ir(e):e;return Ho(t.transform)||Ho(t.translate)||Ho(t.scale)||Ho(t.rotate)||Ho(t.perspective)||!rm()&&(Ho(t.backdropFilter)||Ho(t.filter))||c9.test(t.willChange||"")||l9.test(t.contain||"")}function d9(e){let t=$i(e);for(;ti(t)&&!Ws(t);){if(nm(t))return t;if(ql(t))return null;t=$i(t)}return null}function rm(){return tm==null&&(tm=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tm}function Ws(e){return/^(html|body|#document)$/.test(qs(e))}function Ir(e){return rr(e).getComputedStyle(e)}function Wl(e){return Nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tT(e)&&e.host||ei(e);return tT(t)?t.host:t}function nT(e){const t=$i(e);return Ws(t)?(e.ownerDocument||e).body:ti(t)&&vu(t)?t:nT(t)}function Su(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=nT(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),u=rr(i);if(s){const c=im(u);return t.concat(u,u.visualViewport||[],vu(i)?i:[],c&&n?Su(c):[])}else return t.concat(i,Su(i,[],n))}function im(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rT(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ti(e),s=i?e.offsetWidth:n,u=i?e.offsetHeight:r,c=jl(n)!==s||jl(r)!==u;return c&&(n=s,r=u),{width:n,height:r,$:c}}function om(e){return Nr(e)?e:e.contextElement}function Ys(e){const t=om(e);if(!ti(t))return Jr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=rT(t);let u=(s?jl(n.width):n.width)/r,c=(s?jl(n.height):n.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const f9=Jr(0);function iT(e){const t=rr(e);return!rm()||!t.visualViewport?f9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==rr(e)?!1:t}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=om(e);let u=Jr(1);t&&(r?Nr(r)&&(u=Ys(r)):u=Ys(e));const c=p9(s,n,r)?iT(s):Jr(0);let d=(i.left+c.x)/u.x,f=(i.top+c.y)/u.y,h=i.width/u.x,m=i.height/u.y;if(s){const E=rr(s),b=r&&Nr(r)?rr(r):r;let T=E,v=im(T);for(;v&&r&&b!==T;){const I=Ys(v),_=v.getBoundingClientRect(),N=Ir(v),P=_.left+(v.clientLeft+parseFloat(N.paddingLeft))*I.x,B=_.top+(v.clientTop+parseFloat(N.paddingTop))*I.y;d*=I.x,f*=I.y,h*=I.x,m*=I.y,d+=P,f+=B,T=rr(v),v=im(T)}}return zl({width:h,height:m,x:d,y:f})}function Yl(e,t){const n=Wl(e).scrollLeft;return t?t.left+n:$o(ei(e)).left+n}function oT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yl(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function h9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",u=ei(r),c=t?ql(t.floating):!1;if(r===u||c&&s)return n;let d={scrollLeft:0,scrollTop:0},f=Jr(1);const h=Jr(0),m=ti(r);if((m||!m&&!s)&&((qs(r)!=="body"||vu(u))&&(d=Wl(r)),ti(r))){const b=$o(r);f=Ys(r),h.x=b.x+r.clientLeft,h.y=b.y+r.clientTop}const E=u&&!m&&!s?oT(u,d):Jr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+E.x,y:n.y*f.y-d.scrollTop*f.y+h.y+E.y}}function m9(e){return Array.from(e.getClientRects())}function g9(e){const t=ei(e),n=Wl(e),r=e.ownerDocument.body,i=pi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Yl(e);const c=-n.scrollTop;return Ir(r).direction==="rtl"&&(u+=pi(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:u,y:c}}const sT=25;function y9(e,t){const n=rr(e),r=ei(e),i=n.visualViewport;let s=r.clientWidth,u=r.clientHeight,c=0,d=0;if(i){s=i.width,u=i.height;const h=rm();(!h||h&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=Yl(r);if(f<=0){const h=r.ownerDocument,m=h.body,E=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,T=Math.abs(r.clientWidth-m.clientWidth-b);T<=sT&&(s-=T)}else f<=sT&&(s+=f);return{width:s,height:u,x:c,y:d}}const E9=new Set(["absolute","fixed"]);function b9(e,t){const n=$o(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=ti(e)?Ys(e):Jr(1),u=e.clientWidth*s.x,c=e.clientHeight*s.y,d=i*s.x,f=r*s.y;return{width:u,height:c,x:d,y:f}}function aT(e,t,n){let r;if(t==="viewport")r=y9(e,n);else if(t==="document")r=g9(ei(e));else if(Nr(t))r=b9(t,n);else{const i=iT(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zl(r)}function uT(e,t){const n=$i(e);return n===t||!Nr(n)||Ws(n)?!1:Ir(n).position==="fixed"||uT(n,t)}function w9(e,t){const n=t.get(e);if(n)return n;let r=Su(e,[],!1).filter(c=>Nr(c)&&qs(c)!=="body"),i=null;const s=Ir(e).position==="fixed";let u=s?$i(e):e;for(;Nr(u)&&!Ws(u);){const c=Ir(u),d=nm(u);!d&&c.position==="fixed"&&(i=null),(s?!d&&!i:!d&&c.position==="static"&&!!i&&E9.has(i.position)||vu(u)&&!d&&uT(e,u))?r=r.filter(h=>h!==u):i=c,u=$i(u)}return t.set(e,r),r}function x9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const u=[...n==="clippingAncestors"?ql(t)?[]:w9(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,h)=>{const m=aT(t,h,i);return f.top=pi(m.top,f.top),f.right=ji(m.right,f.right),f.bottom=ji(m.bottom,f.bottom),f.left=pi(m.left,f.left),f},aT(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function T9(e){const{width:t,height:n}=rT(e);return{width:t,height:n}}function _9(e,t,n){const r=ti(t),i=ei(t),s=n==="fixed",u=$o(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=Jr(0);function f(){d.x=Yl(i)}if(r||!r&&!s)if((qs(t)!=="body"||vu(i))&&(c=Wl(t)),r){const b=$o(t,!0,s,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}else i&&f();s&&!r&&i&&f();const h=i&&!r&&!s?oT(i,c):Jr(0),m=u.left+c.scrollLeft-d.x-h.x,E=u.top+c.scrollTop-d.y-h.y;return{x:m,y:E,width:u.width,height:u.height}}function sm(e){return Ir(e).position==="static"}function cT(e,t){if(!ti(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ei(e)===n&&(n=n.ownerDocument.body),n}function lT(e,t){const n=rr(e);if(ql(e))return n;if(!ti(e)){let i=$i(e);for(;i&&!Ws(i);){if(Nr(i)&&!sm(i))return i;i=$i(i)}return n}let r=cT(e,t);for(;r&&u9(r)&&sm(r);)r=cT(r,t);return r&&Ws(r)&&sm(r)&&!nm(r)?n:r||d9(e)||n}const v9=function(e){return Oe(this,null,function*(){const t=this.getOffsetParent||lT,n=this.getDimensions,r=yield n(e.floating);return{reference:_9(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function S9(e){return Ir(e).direction==="rtl"}const A9={convertOffsetParentRelativeRectToViewportRelativeRect:h9,getDocumentElement:ei,getClippingRect:x9,getOffsetParent:lT,getElementRects:v9,getClientRects:m9,getDimensions:T9,getScale:Ys,isElement:Nr,isRTL:S9};function dT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k9(e,t){let n=null,r;const i=ei(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function u(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const f=e.getBoundingClientRect(),{left:h,top:m,width:E,height:b}=f;if(c||t(),!E||!b)return;const T=Hl(m),v=Hl(i.clientWidth-(h+E)),I=Hl(i.clientHeight-(m+b)),_=Hl(h),P={rootMargin:-T+"px "+-v+"px "+-I+"px "+-_+"px",threshold:pi(0,ji(1,d))||1};let B=!0;function R(O){const q=O[0].intersectionRatio;if(q!==d){if(!B)return u();q?u(!1,q):r=setTimeout(()=>{u(!1,1e-7)},1e3)}q===1&&!dT(f,e.getBoundingClientRect())&&u(),B=!1}try{n=new IntersectionObserver(R,ue(U({},P),{root:i.ownerDocument}))}catch(O){n=new IntersectionObserver(R,P)}n.observe(e)}return u(!0),s}function C9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=om(e),h=i||s?[...f?Su(f):[],...Su(t)]:[];h.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),s&&_.addEventListener("resize",n)});const m=f&&c?k9(f,n):null;let E=-1,b=null;u&&(b=new ResizeObserver(_=>{let[N]=_;N&&N.target===f&&b&&(b.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var P;(P=b)==null||P.observe(t)})),n()}),f&&!d&&b.observe(f),b.observe(t));let T,v=d?$o(e):null;d&&I();function I(){const _=$o(e);v&&!dT(v,_)&&n(),v=_,T=requestAnimationFrame(I)}return n(),()=>{var _;h.forEach(N=>{i&&N.removeEventListener("scroll",n),s&&N.removeEventListener("resize",n)}),m==null||m(),(_=b)==null||_.disconnect(),b=null,d&&cancelAnimationFrame(T)}}const N9=i9,I9=o9,O9=t9,P9=a9,R9=n9,L9=e9,D9=s9,M9=(e,t,n)=>{const r=new Map,i=U({platform:A9},n),s=ue(U({},i.platform),{_c:r});return ZM(e,t,ue(U({},i),{platform:s}))};function fT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return ue(U({},i),{toJSON:()=>i})}function F9(e){if(!e)return fT();const{x:t,y:n,width:r,height:i}=e;return fT(t,n,r,i)}function B9(e,t){return{contextElement:cn(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?F9(r):n.getBoundingClientRect()}}}var Au=e=>({variable:e,reference:`var(${e})`}),mi={arrowSize:Au("--arrow-size"),arrowSizeHalf:Au("--arrow-size-half"),arrowBg:Au("--arrow-background"),transformOrigin:Au("--transform-origin"),arrowOffset:Au("--arrow-offset")},U9=e=>e==="top"||e==="bottom"?"y":"x";function j9(e,t){return{name:"transformOrigin",fn(n){var re,H,Z,X,he;const{elements:r,middlewareData:i,placement:s,rects:u,y:c}=n,d=s.split("-")[0],f=U9(d),h=((re=i.arrow)==null?void 0:re.x)||0,m=((H=i.arrow)==null?void 0:H.y)||0,E=(t==null?void 0:t.clientWidth)||0,b=(t==null?void 0:t.clientHeight)||0,T=h+E/2,v=m+b/2,I=Math.abs(((Z=i.shift)==null?void 0:Z.y)||0),_=u.reference.height/2,N=b/2,P=(he=(X=e.offset)==null?void 0:X.mainAxis)!=null?he:e.gutter,B=typeof P=="number"?P+N:P!=null?P:N,R=I>B,O={top:`${T}px calc(100% + ${B}px)`,bottom:`${T}px ${-B}px`,left:`calc(100% + ${B}px) ${v}px`,right:`${-B}px ${v}px`}[d],q=`${T}px ${u.reference.y+_-c}px`,K=!!e.overlap&&f==="y"&&R;return r.floating.style.setProperty(mi.transformOrigin.variable,K?q:O),{data:{transformOrigin:K?q:O}}}}}var H9={name:"rects",fn({rects:e}){return{data:e}}},$9=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:i}=n.arrow,s=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:i!=null?`${i}px`:"",[s]:`calc(100% + ${mi.arrowOffset.reference})`}),{}}}};function z9(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var V9={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function pT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function am(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function q9(e,t,n){const r=e||t.createElement("div");return L9({element:r,padding:n.arrowPadding})}function W9(e,t){var n;if(!f8((n=t.offset)!=null?n:t.gutter))return N9(({placement:r})=>{var h,m,E,b;const i=((e==null?void 0:e.clientHeight)||0)/2,s=(m=(h=t.offset)==null?void 0:h.mainAxis)!=null?m:t.gutter,u=typeof s=="number"?s+i:s!=null?s:i,{hasAlign:c}=z9(r),d=c?void 0:t.shift,f=(b=(E=t.offset)==null?void 0:E.crossAxis)!=null?b:d;return Dh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function Y9(e){if(!e.flip)return;const t=am(e.boundary);return O9(ue(U({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function G9(e){if(!e.slide&&!e.overlap)return;const t=am(e.boundary);return I9(ue(U({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:D9()}))}function X9(e){return P9({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:i}){const s=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);i=Math.floor(i),r=Math.floor(r),s.style.setProperty("--reference-width",`${u}px`),s.style.setProperty("--reference-height",`${c}px`),s.style.setProperty("--available-width",`${i}px`),s.style.setProperty("--available-height",`${r}px`)}})}function K9(e){var t;if(e.hideWhenDetached)return R9({strategy:"referenceHidden",boundary:(t=am(e.boundary))!=null?t:"clippingAncestors"})}function Q9(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function J9(e,t,n={}){const r=B9(e,n.getAnchorRect);if(!t||!r)return;const i=Object.assign({},V9,n),s=t.querySelector("[data-part=arrow]"),u=[W9(s,i),Y9(i),G9(i),q9(s,t.ownerDocument,i),$9(s),j9({gutter:i.gutter,offset:i.offset,overlap:i.overlap},s),X9(i),K9(i),H9],{placement:c,strategy:d,onComplete:f,onPositioned:h}=i,m=()=>Oe(null,null,function*(){var B;if(!r||!t)return;const v=yield M9(r,t,{placement:c,middleware:u,strategy:d});f==null||f(v),h==null||h({placed:!0});const I=Ms(t),_=pT(I,v.x),N=pT(I,v.y);t.style.setProperty("--x",`${_}px`),t.style.setProperty("--y",`${N}px`),i.hideWhenDetached&&(((B=v.middlewareData.hide)==null?void 0:B.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const P=t.firstElementChild;if(P){const R=Bs(P);t.style.setProperty("--z-index",R.zIndex)}}),E=()=>Oe(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),h==null||h({placed:!0})):yield m()}),b=Q9(i.listeners),T=i.listeners?C9(r,t,E,b):x8;return E(),()=>{T==null||T(),h==null||h({placed:!1})}}function hT(e,t,n={}){const c=n,{defer:r}=c,i=bn(c,["defer"]),s=r?en:d=>d(),u=[];return u.push(s(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(J9(d,f,i))})),()=>{u.forEach(d=>d==null?void 0:d())}}var Z9={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function e7(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:i="absolute"}=e;return{arrow:{position:"absolute",width:mi.arrowSize.reference,height:mi.arrowSize.reference,[mi.arrowSizeHalf.variable]:`calc(${mi.arrowSize.reference} / 2)`,[mi.arrowOffset.variable]:`calc(${mi.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?Z9[t.split("-")[0]]:void 0,background:mi.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var Gs=new WeakMap,Gl=new WeakMap,Xl={},um=0,mT=e=>e&&(e.host||mT(e.parentNode)),t7=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=mT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),n7=new Set(["script","output","status","next-route-announcer"]),r7=e=>n7.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),i7=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:i,followControlledElements:s=!0}=t,u=t7(n,Array.isArray(e)?e:[e]);Xl[r]||(Xl[r]=new WeakMap);const c=Xl[r],d=[],f=new Set,h=new Set(u),m=b=>{!b||f.has(b)||(f.add(b),m(b.parentNode))};u.forEach(b=>{m(b),s&&cn(b)&&kx(b,T=>{m(T)})});const E=b=>{!b||h.has(b)||Array.prototype.forEach.call(b.children,T=>{if(f.has(T))E(T);else try{if(r7(T))return;const I=T.getAttribute(i)==="true",_=(Gs.get(T)||0)+1,N=(c.get(T)||0)+1;Gs.set(T,_),c.set(T,N),d.push(T),_===1&&I&&Gl.set(T,!0),N===1&&T.setAttribute(r,""),I||T.setAttribute(i,"true")}catch(v){console.error("[zag-js > ariaHidden] cannot operate on ",T,v)}})};return E(n),f.clear(),um++,()=>{d.forEach(b=>{const T=Gs.get(b)-1,v=c.get(b)-1;Gs.set(b,T),c.set(b,v),T||(Gl.has(b)||b.removeAttribute(i),Gl.delete(b)),v||b.removeAttribute(r)}),um--,um||(Gs=new WeakMap,Gs=new WeakMap,Gl=new WeakMap,Xl={})}},o7=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,s7=(e,t=o7(e),n="data-aria-hidden",r=!0)=>{if(t)return i7(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},a7=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function gT(e,t={}){const{defer:n=!0}=t,r=n?a7:s=>s(),i=[];return i.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&i.push(s7(u))})),()=>{i.forEach(s=>s==null?void 0:s())}}function u7(e){const t={each(n){var r;for(let i=0;i<((r=e.frames)==null?void 0:r.length);i+=1){const s=e.frames[i];s&&n(s)}},addEventListener(n,r,i){return t.each(s=>{try{s.document.addEventListener(n,r,i)}catch(u){}}),()=>{try{t.removeEventListener(n,r,i)}catch(s){}}},removeEventListener(n,r,i){t.each(s=>{try{s.document.removeEventListener(n,r,i)}catch(u){}})}};return t}function c7(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,i)=>{try{t==null||t.addEventListener(n,r,i)}catch(s){}return()=>{try{t==null||t.removeEventListener(n,r,i)}catch(s){}}},removeEventListener:(n,r,i)=>{try{t==null||t.removeEventListener(n,r,i)}catch(s){}}}}var yT="pointerdown.outside",ET="focus.outside";function l7(e){for(const t of e)if(cn(t)&&Qr(t))return!0;return!1}var bT=e=>"clientY"in e;function d7(e,t){if(!bT(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function f7(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function wT(e,t){if(!t||!bT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,s=i&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},c={x:e.clientX,y:e.clientY};return f7(u,c)?r||s:!1}function p7(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:s,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=Kr(e),f=Ms(e),h=u7(f),m=c7(f);function E(P,B){if(!cn(B)||!B.isConnected||Ds(e,B)||d7(e,P)||c&&Ax(e,B))return!1;const R=d.querySelector(`[aria-controls="${e.id}"]`);if(R){const q=Vh(R);if(wT(P,q))return!1}const O=Vh(e);return wT(P,O)?!1:!(n!=null&&n(B))}const b=new Set,T=Fo(e==null?void 0:e.getRootNode());function v(P){function B(R){var re,H;const O=u&&!Cx()?en:Z=>Z(),q=R!=null?R:P,K=(H=(re=q==null?void 0:q.composedPath)==null?void 0:re.call(q))!=null?H:[q==null?void 0:q.target];O(()=>{const Z=T?K[0]:Cr(P);if(!(!e||!E(P,Z))){if(i||s){const X=Lh(i,s);e.addEventListener(yT,X,{once:!0})}xT(e,yT,{bubbles:!1,cancelable:!0,detail:{originalEvent:q,contextmenu:nM(q),focusable:l7(K),target:Z}})}})}P.pointerType==="touch"?(b.forEach(R=>R()),b.add(ln(d,"click",B,{once:!0})),b.add(m.addEventListener("click",B,{once:!0})),b.add(h.addEventListener("click",B,{once:!0}))):B()}const I=new Set,_=setTimeout(()=>{I.add(ln(d,"pointerdown",v,!0)),I.add(m.addEventListener("pointerdown",v,!0)),I.add(h.addEventListener("pointerdown",v,!0))},0);function N(P){(u?en:R=>R())(()=>{var q,K;const R=(K=(q=P==null?void 0:P.composedPath)==null?void 0:q.call(P))!=null?K:[P==null?void 0:P.target],O=T?R[0]:Cr(P);if(!(!e||!E(P,O))){if(r||s){const re=Lh(r,s);e.addEventListener(ET,re,{once:!0})}xT(e,ET,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:!1,focusable:Qr(O),target:O}})}})}return Cx()||(I.add(ln(d,"focusin",N,!0)),I.add(m.addEventListener("focusin",N,!0)),I.add(h.addEventListener("focusin",N,!0))),()=>{clearTimeout(_),b.forEach(P=>P()),I.forEach(P=>P())}}function h7(e,t){const{defer:n}=t,r=n?en:s=>s(),i=[];return i.push(r(()=>{const s=typeof e=="function"?e():e;i.push(p7(s,t))})),()=>{i.forEach(s=>s==null?void 0:s())}}function xT(e,t,n){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,n);return e.dispatchEvent(i)}function m7(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return ln(Kr(e),"keydown",n,{capture:!0})}var TT="layer:request-dismiss",pr={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Ds(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Ds(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>pr.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];y7(e,TT,i=>{var s;(s=r.requestDismiss)==null||s.call(r,i),i.defaultPrevented||r==null||r.dismiss()}),g7(e,TT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function g7(e,t,n){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(i)}function y7(e,t,n){e.addEventListener(t,n,{once:!0})}var _T;function vT(){pr.layers.forEach(({node:e})=>{e.style.pointerEvents=pr.isBelowPointerBlockingLayer(e)?"none":"auto"})}function E7(e){e.style.pointerEvents=""}function b7(e,t){const n=Kr(e),r=[];return pr.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(_T=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(i=>{const[s,u]=SM(()=>{const c=i();return cn(c)?c:null},{timeout:1e3});s.then(c=>r.push(Dl(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{pr.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=_T,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(i=>i()))}}function w7(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Mh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:i,pointerBlocking:s,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:s,requestDismiss:i};pr.add(f),vT();function h(v){var _,N;const I=Cr(v.detail.originalEvent);pr.isBelowPointerBlockingLayer(e)||pr.isInBranch(I)||((_=t.onPointerDownOutside)==null||_.call(t,v),(N=t.onInteractOutside)==null||N.call(t,v),!v.defaultPrevented&&(c&&console.log("onPointerDownOutside:",v.detail.originalEvent),r==null||r()))}function m(v){var _,N;const I=Cr(v.detail.originalEvent);pr.isInBranch(I)||((_=t.onFocusOutside)==null||_.call(t,v),(N=t.onInteractOutside)==null||N.call(t,v),!v.defaultPrevented&&(c&&console.log("onFocusOutside:",v.detail.originalEvent),r==null||r()))}function E(v){var I;pr.isTopMost(e)&&((I=t.onEscapeKeyDown)==null||I.call(t,v),!v.defaultPrevented&&r&&(v.preventDefault(),r()))}function b(v){var P;if(!e)return!1;const I=typeof u=="function"?u():u,_=Array.isArray(I)?I:[I],N=(P=t.persistentElements)==null?void 0:P.map(B=>B()).filter(cn);return N&&_.push(...N),_.some(B=>Ds(B,v))||pr.isInNestedLayer(e,v)}const T=[s?b7(e,t.persistentElements):void 0,m7(e,E),h7(e,{exclude:b,onFocusOutside:m,onPointerDownOutside:h,defer:t.defer})];return()=>{pr.remove(e),vT(),E7(e),T.forEach(v=>v==null?void 0:v())}}function ST(e,t){const{defer:n}=t,r=n?en:s=>s(),i=[];return i.push(r(()=>{const s=Rs(e)?e():e;i.push(w7(s,t))})),()=>{i.forEach(s=>s==null?void 0:s())}}var x7=Object.defineProperty,T7=(e,t,n)=>t in e?x7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t,n)=>T7(e,typeof t!="symbol"?t+"":t,n),AT={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},_7=[],v7=class{constructor(e,t){Ut(this,"trapStack"),Ut(this,"config"),Ut(this,"doc"),Ut(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ut(this,"portalContainers",new Set),Ut(this,"listenerCleanups",[]),Ut(this,"handleFocus",r=>{const i=Cr(r),s=this.findContainerIndex(i,r)>=0;if(s||Ol(i))s&&(this.state.mostRecentlyFocusedNode=i);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(xu(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const h=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);h>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?h+1<f.length&&(u=f[h+1],c=!1):h-1>=0&&(u=f[h-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>xu(f)>0))||(c=!1);else c=!1;c&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ut(this,"handlePointerDown",r=>{const i=Cr(r);if(!(this.findContainerIndex(i,r)>=0)){if(Cu(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Cu(this.config.allowOutsideClick,r)||r.preventDefault()}}),Ut(this,"handleClick",r=>{const i=Cr(r);this.findContainerIndex(i,r)>=0||Cu(this.config.clickOutsideDeactivates,r)||Cu(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Ut(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const i=this.config.isKeyBackward(r),s=this.findNextNavNode({event:r,isBackward:i});if(!s)return;ku(r)&&r.preventDefault(),this.tryFocus(s)}}),Ut(this,"handleEscapeKey",r=>{S7(r)&&Cu(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Ut(this,"_mutationObserver"),Ut(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(i=>{i.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),i.some(c=>c.type==="attributes"&&(c.attributeName==="aria-controls"||c.attributeName==="aria-expanded")?!0:c.type==="childList"&&c.addedNodes.length>0?Array.from(c.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return Y8(f)?!0:f.id&&!this.state.containers.some(h=>h.contains(f))?G8(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ut(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(i=>{var s;(s=this._mutationObserver)==null||s.observe(i,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(i=>{this.observePortalContainer(i)}))}),Ut(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Qr(r)){const i=Fs(this.doc);if(i&&this.findContainerIndex(i)>=0)r=i;else{const s=this.state.tabbableGroups[0];r=s&&s.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Ut(this,"tryFocus",r=>{if(r!==!1&&r!==Fs(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,A7(r)&&r.select()}}),Ut(this,"deactivate",r=>{if(!this.state.active)return this;const i=U({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),AT.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const s=this.getOption(i,"onDeactivate"),u=this.getOption(i,"onPostDeactivate"),c=this.getOption(i,"checkCanReturnFocus"),d=this.getOption(i,"returnFocus","returnFocusOnDeactivate");s==null||s();const f=()=>{kT(()=>{if(d){const h=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(h)}u==null||u()})};if(d&&c){const h=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(h).then(f,f),this}return f(),this}),Ut(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onPause"),s=this.getOption(r,"onPostPause");return this.state.paused=!0,i==null||i(),this.removeListeners(),this.updateObservedNodes(),s==null||s(),this}),Ut(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onUnpause"),s=this.getOption(r,"onPostUnpause");return this.state.paused=!1,i==null||i(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),s==null||s(),this}),Ut(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ut(this,"getReturnFocusNode",r=>{const i=this.getNodeForOption("setReturnFocus",{params:[r]});return i||(i===!1?!1:r)}),Ut(this,"getOption",(r,i,s)=>r&&r[i]!==void 0?r[i]:this.config[s||i]),Ut(this,"getNodeForOption",(r,{hasFallback:i=!1,params:s=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...s)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let c=u;if(typeof u=="string"){try{c=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!c&&!i)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),Ut(this,"findNextNavNode",r=>{const{event:i,isBackward:s=!1}=r,u=r.target||Cr(i);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,i),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)s?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(s){let h=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(h<0&&((f==null?void 0:f.container)===u||Qr(u)&&!Bo(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(h=d),h>=0){const m=h===0?this.state.tabbableGroups.length-1:h-1,E=this.state.tabbableGroups[m];c=xu(u)>=0?E.lastTabbableNode:E.lastDomTabbableNode}else ku(i)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let h=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(h<0&&((f==null?void 0:f.container)===u||Qr(u)&&!Bo(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(h=d),h>=0){const m=h===this.state.tabbableGroups.length-1?0:h+1,E=this.state.tabbableGroups[m];c=xu(u)>=0?E.firstTabbableNode:E.firstDomTabbableNode}else ku(i)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||_7;const n=U({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return ku(r)&&!r.shiftKey},isKeyBackward(r){return ku(r)&&r.shiftKey}},t);this.doc=n.document||Kr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{V8(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||(n==null?void 0:n.includes(r))||i.find(s=>s===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?Ax(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Us(e,{getShadowRoot:this.config.getShadowRoot}),n=Dx(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],i=t[t.length-1],s=r,u=i;let c=!1;for(let f=0;f<t.length;f++)if(xu(t[f])>0){c=!0;break}function d(f,h=!0){const m=t.indexOf(f);if(m>=0)return t[m+(h?1:-1)];const E=n.indexOf(f);if(!(E<0)){if(h){for(let b=E+1;b<n.length;b++)if(Bo(n[b]))return n[b]}else for(let b=E-1;b>=0;b--)if(Bo(n[b]))return n[b]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:s,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return AT.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?kT(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(ln(this.doc,"focusin",this.handleFocus,!0),ln(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),ln(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),ln(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),ln(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),ln(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Fs(this.doc),t==null||t();const i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},ku=e=>e.key==="Tab",Cu=(e,...t)=>typeof e=="function"?e(...t):e,S7=e=>!e.isComposing&&e.key==="Escape",kT=e=>setTimeout(e,0),A7=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function CT(e,t={}){let n;const r=en(()=>{const i=typeof e=="function"?e():e;if(i){n=new v7(i,ue(U({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i},t),{document:Kr(i)}));try{n.activate()}catch(s){}}});return function(){n==null||n.deactivate(),r()}}var cm="data-scroll-lock";function k7(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function NT(e){const t=Bs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function IT(e){var b;const t=e!=null?e:document,n=(b=t.defaultView)!=null?b:window,{documentElement:r,body:i}=t;if(i.hasAttribute(cm))return;const u=NT(r)||NT(i),c=n.innerWidth-r.clientWidth;i.setAttribute(cm,"");const d=()=>_M(r,"--scrollbar-width",`${c}px`),f=k7(r),h=()=>{const T={overflow:"hidden"};return!u&&c>0&&(T[f]=`${c}px`),Dl(i,T)},m=()=>{var R,O;const{scrollX:T,scrollY:v,visualViewport:I}=n,_=(R=I==null?void 0:I.offsetLeft)!=null?R:0,N=(O=I==null?void 0:I.offsetTop)!=null?O:0,P={position:"fixed",overflow:"hidden",top:`${-(v-Math.floor(N))}px`,left:`${-(T-Math.floor(_))}px`,right:"0"};!u&&c>0&&(P[f]=`${c}px`);const B=Dl(i,P);return()=>{B==null||B(),n.scrollTo({left:T,top:v,behavior:"instant"})}},E=[d(),Pl()?m():h()];return()=>{E.forEach(T=>T==null?void 0:T()),i.removeAttribute(cm)}}var C7=jo("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),ni=C7.build(),OT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},PT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},lm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},RT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},N7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},dm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},fm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},I7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},LT=e=>e.getById(OT(e)),Xs=e=>e.getById(PT(e)),Ks=e=>e.getById(lm(e)),DT=e=>e.getById(RT(e)),O7=e=>e.getById(dm(e)),P7=e=>e.getById(fm(e));function R7(e,t){const{state:n,context:r,send:i,computed:s,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),h=s("currentPortalled"),m=r.get("renderedElements"),E=e7(ue(U({},u("positioning")),{placement:f}));return{portalled:h,open:d,setOpen(b){n.matches("open")!==b&&i({type:b?"OPEN":"CLOSE"})},reposition(b={}){i({type:"POSITIONING.SET",options:b})},getArrowProps(){return t.element(ue(U({id:N7(c)},ni.arrow.attrs),{dir:u("dir"),style:E.arrow}))},getArrowTipProps(){return t.element(ue(U({},ni.arrowTip.attrs),{dir:u("dir"),style:E.arrowTip}))},getAnchorProps(){return t.element(ue(U({},ni.anchor.attrs),{dir:u("dir"),id:OT(c)}))},getTriggerProps(){return t.button(ue(U({},ni.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:PT(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":lm(c),onPointerDown(b){Nx(b)&&eM()&&b.currentTarget.focus()},onClick(b){b.defaultPrevented||i({type:"TOGGLE"})},onBlur(b){i({type:"TRIGGER_BLUR",target:b.relatedTarget})}}))},getIndicatorProps(){return t.element(ue(U({},ni.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ue(U({id:RT(c)},ni.positioner.attrs),{dir:u("dir"),style:E.floating}))},getContentProps(){return t.element(ue(U({},ni.content.attrs),{dir:u("dir"),id:lm(c),tabIndex:-1,role:"dialog","aria-modal":_x(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":Ls(d),"aria-labelledby":m.title?dm(c):void 0,"aria-describedby":m.description?fm(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(ue(U({},ni.title.attrs),{id:dm(c),dir:u("dir")}))},getDescriptionProps(){return t.element(ue(U({},ni.description.attrs),{id:fm(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(ue(U({},ni.closeTrigger.attrs),{dir:u("dir"),id:I7(c),type:"button","aria-label":"close",onClick(b){b.defaultPrevented||(b.stopPropagation(),i({type:"CLOSE"}))}}))}}}var L7={props({props:e}){return ue(U({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:U({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var s;e.set("currentPlacement",t("positioning").placement);const r=(s=LT(n))!=null?s:Xs(n);return hT(r,()=>DT(n),ue(U({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>Ks(n);let i=!0;return ST(r,{type:"popover",pointerBlocking:t("modal"),exclude:Xs(n),defer:!0,onEscapeKeyDown(s){var u;(u=t("onEscapeKeyDown"))==null||u(s),!t("closeOnEscape")&&s.preventDefault()},onInteractOutside(s){var u;(u=t("onInteractOutside"))==null||u(s),!s.defaultPrevented&&(i=!(s.detail.focusable||s.detail.contextmenu),t("closeOnInteractOutside")||s.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:i})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:xM(()=>Ks(t),{triggerElement:Xs(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?gT(()=>[Ks(t),Xs(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return IT(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?CT(()=>Ks(t),{initialFocus:()=>Mx({root:Ks(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const i=(u=LT(n))!=null?u:Xs(n);hT(i,()=>DT(n),ue(U(U({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){en(()=>{Object.assign(e.get("renderedElements"),{title:!!O7(t),description:!!P7(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||en(()=>{const n=Mx({root:Ks(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,i;const n=(i=e.restoreFocus)!=null?i:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||en(()=>{const s=Xs(t);s==null||s.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};$s()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[vV,Kl]=Uo({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[SV,pm]=Uo({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),D7=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,dir:r,getRootNode:n},e),s=Fl(L7,i);return R7(s,Yh)},M7=e=>{const[t,u]=qx(e),c=u,{children:n}=c,r=bn(c,["children"]),i=D7(r),s=Kh(tn({present:i.open},t));return w.jsx(MM,{value:i,children:w.jsx($x,{value:s,children:n})})},MT=S.forwardRef((e,t)=>{const n=Xh(),r=Tu(),i=tn(ue(U({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return w.jsx(Sn.button,ue(U({},i),{ref:t}))});MT.displayName="PopoverTrigger";function F7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function B7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function U7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function j7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function H7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function $7(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function hm(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function FT(e){return ct({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const z7=({className:e,componentType:t,children:n})=>{const[r,i]=S.useState(!1),{globalClassName:s}=at(),u=f=>{i(f.open)},c=S.useCallback(()=>{i(!1)},[]),d=S.useMemo(()=>({closeMenu:c}),[c]);return w.jsxs(M7,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[w.jsx(MT,{"aria-label":`Overflow menu for ${t}`,className:M(`${k}-overflow-menu-button-trigger`,`${k}-icon-button`,s,e,`cim-${t}-component`),children:w.jsx(FT,{})}),w.jsx(Vx,{children:w.jsx(zx,{className:M(`${k}-overflow-menu-list`,s,`cim-${t}-component`),children:w.jsx(hx.Provider,{value:d,children:n})})})]})};function BT(e){return ct({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function UT(e){return ct({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[V7,zo]=Uo({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),mm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getControlProps(),e);return w.jsx(Sn.div,ue(U(U({},r),e),{ref:t}))});mm.displayName="CarouselControl";const gm=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["readOnly","index"]),i=zo(),s=tn(i.getIndicatorProps(n),r);return w.jsx(Sn.button,ue(U({},s),{ref:t}))});gm.displayName="CarouselIndicator";const ym=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getIndicatorGroupProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});ym.displayName="CarouselIndicatorGroup";const Em=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["index","snapAlign"]),i=zo(),s=tn(i.getItemProps(n),r);return w.jsx(Sn.div,ue(U({},s),{ref:t}))});Em.displayName="CarouselItem";const bm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getItemGroupProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});bm.displayName="CarouselItemGroup";const wm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getNextTriggerProps(),e);return w.jsx(Sn.button,ue(U({},r),{ref:t}))});wm.displayName="CarouselNextTrigger";const xm=S.forwardRef((e,t)=>{const n=zo(),r=tn(n.getPrevTriggerProps(),e);return w.jsx(Sn.button,ue(U({},r),{ref:t}))});xm.displayName="CarouselPrevTrigger";function q7(e){const t=Bs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),i=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(E,b){let T=parseFloat(E);return/%/.test(E)&&(T/=100,T*=b),Number.isNaN(T)?0:T}let d=c(r,n.width),f=c(i,n.height),h=c(s,n.width),m=c(u,n.height);return{x:{before:d,after:h},y:{before:f,after:m}}}function W7(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function jT(e){let t=[];for(const n of e.children)t=t.concat(n,jT(n));return t}function HT(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},i=t?jT(e):e.children;for(const s of["x","y"]){const u=s==="x"?"y":"x",c=s==="x"?"left":"top",d=s==="x"?"width":"height",f=s==="x"?"scrollLeft":"scrollTop";for(const h of i){const m=h.getBoundingClientRect();if(!W7(n,m,u))continue;const E=Bs(h);let[b,T]=E.getPropertyValue("scroll-snap-align").split(" ");typeof T=="undefined"&&(T=b);const v=s==="x"?T:b,I=m[c]-n[c]+e[f];switch(v){case"none":break;case"start":r[s].start.push({node:h,position:I});break;case"center":r[s].center.push({node:h,position:I+m[d]/2});break;case"end":r[s].end.push({node:h,position:I+m[d]});break}}}return r}function $T(e){const t=e.getBoundingClientRect(),n=q7(e),r=HT(e),i={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:zT([...r.x.start.map(s=>s.position-n.x.before),...r.x.center.map(s=>s.position-t.width/2),...r.x.end.map(s=>s.position-t.width+n.x.after)].map(VT(0,i.x))),y:zT([...r.y.start.map(s=>s.position-n.y.before),...r.y.center.map(s=>s.position-t.height/2),...r.y.end.map(s=>s.position-t.height+n.y.after)].map(VT(0,i.y)))}}function Y7(e,t,n){const r=HT(e),i=[...r[t].start,...r[t].center,...r[t].end];for(const s of i)if(n(s.node))return s.position}var zT=e=>[...new Set(e)],VT=(e,t)=>n=>Math.max(e,Math.min(t,n)),G7=jo("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),gi=G7.build(),X7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},K7=(e,t)=>{var n,r,i;return(i=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?i:`carousel:${e.id}:item:${t}`},Ql=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},Q7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},J7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},Z7=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},qT=(e,t)=>{var n,r,i;return(i=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?i:`carousel:${e.id}:indicator:${t}`},zn=e=>e.getById(Ql(e)),WT=e=>TM(zn(e),"[data-part=item]"),eF=(e,t)=>e.getById(qT(e,t)),YT=e=>{const t=zn(e);if(!t)return;const n=Us(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function tF(e,t){const{state:n,context:r,computed:i,send:s,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),h=i("canScrollNext"),m=i("canScrollPrev"),E=i("isHorizontal"),b=Array.from(r.get("pageSnapPoints")),T=r.get("page"),v=c("slidesPerPage"),I=c("padding"),_=c("translations");return{isPlaying:d,isDragging:f,page:T,pageSnapPoints:b,canScrollNext:h,canScrollPrev:m,getProgress(){return T/b.length},scrollToIndex(N,P){s({type:"INDEX.SET",index:N,instant:P})},scrollTo(N,P){s({type:"PAGE.SET",index:N,instant:P})},scrollNext(N){s({type:"PAGE.NEXT",instant:N})},scrollPrev(N){s({type:"PAGE.PREV",instant:N})},play(){s({type:"AUTOPLAY.START"})},pause(){s({type:"AUTOPLAY.PAUSE"})},isInView(N){return Array.from(r.get("slidesInView")).includes(N)},refresh(){s({type:"SNAP.REFRESH"})},getRootProps(){return t.element(ue(U({},gi.root.attrs),{id:X7(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":v,"--slide-spacing":c("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(ue(U({},gi.itemGroup.attrs),{id:Ql(u),"data-orientation":c("orientation"),"data-dragging":Ls(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(N){Ds(N.currentTarget,Cr(N))&&s({type:"VIEWPORT.FOCUS"})},onBlur(N){Ds(N.currentTarget,N.relatedTarget)||s({type:"VIEWPORT.BLUR"})},onMouseDown(N){if(N.defaultPrevented||!c("allowMouseDrag")||!Nx(N))return;const P=Cr(N);Qr(P)&&P!==N.currentTarget||(N.preventDefault(),s({type:"DRAGGING.START"}))},onWheel:T8(N=>{const P=c("orientation")==="horizontal"?"deltaX":"deltaY";N[P]<0&&!i("canScrollPrev")||N[P]>0&&!i("canScrollNext")||s({type:"USER.SCROLL"})},150),onTouchStart(){s({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[E?"x":"y",c("snapType")].join(" "),gridAutoFlow:E?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[E?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[E?"scrollPaddingInline":"scrollPaddingBlock"]:I,[E?"paddingInline":"paddingBlock"]:I,[E?"overflowX":"overflowY"]:"auto"}}))},getItemProps(N){const P=r.get("slidesInView").includes(N.index);return t.element(ue(U({},gi.item.attrs),{id:K7(u,N.index),dir:c("dir"),role:"group","data-index":N.index,"data-inview":Ls(P),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":_.item(N.index,c("slideCount")),"aria-hidden":_x(!P),style:{scrollSnapAlign:(()=>{var K;const B=(K=N.snapAlign)!=null?K:"start",R=c("slidesPerMove"),O=R==="auto"?Math.floor(c("slidesPerPage")):R;return(N.index+O)%O===0?B:void 0})()}}))},getControlProps(){return t.element(ue(U({},gi.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(ue(U({},gi.prevTrigger.attrs),{id:J7(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":_.prevTrigger,"data-orientation":c("orientation"),"aria-controls":Ql(u),onClick(N){N.defaultPrevented||s({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(ue(U({},gi.nextTrigger.attrs),{dir:c("dir"),id:Q7(u),type:"button","aria-label":_.nextTrigger,"data-orientation":c("orientation"),"aria-controls":Ql(u),disabled:!h,onClick(N){N.defaultPrevented||s({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(ue(U({},gi.indicatorGroup.attrs),{dir:c("dir"),id:Z7(u),"data-orientation":c("orientation"),onKeyDown(N){if(N.defaultPrevented)return;const P="indicator",B={ArrowDown(q){E||(s({type:"PAGE.NEXT",src:P}),q.preventDefault())},ArrowUp(q){E||(s({type:"PAGE.PREV",src:P}),q.preventDefault())},ArrowRight(q){E&&(s({type:"PAGE.NEXT",src:P}),q.preventDefault())},ArrowLeft(q){E&&(s({type:"PAGE.PREV",src:P}),q.preventDefault())},Home(q){s({type:"PAGE.SET",index:0,src:P}),q.preventDefault()},End(q){s({type:"PAGE.SET",index:b.length-1,src:P}),q.preventDefault()}},R=oM(N,{dir:c("dir"),orientation:c("orientation")}),O=B[R];O==null||O(N)}}))},getIndicatorProps(N){return t.button(ue(U({},gi.indicator.attrs),{dir:c("dir"),id:qT(u,N.index),type:"button","data-orientation":c("orientation"),"data-index":N.index,"data-readonly":Ls(N.readOnly),"data-current":Ls(N.index===T),"aria-label":_.indicator(N.index),onClick(P){P.defaultPrevented||N.readOnly||s({type:"PAGE.SET",index:N.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(ue(U({},gi.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":Ls(d),"aria-label":d?_.autoplayStop:_.autoplayStart,onClick(N){N.defaultPrevented||s({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var nF={props({props:e}){return C8(e,["slideCount"],"carousel"),ue(U({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:U({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const s=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:s[r]})}})),pageSnapPoints:t(()=>({defaultValue:rF(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return d8(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:i}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{i({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{i({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(zn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=zn(e);if(!n)return;const r=e.getWin(),i=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),YT(e)});return YT(e),i.observe(n,{childList:!0,subtree:!0}),()=>i.disconnect()},trackSlideResize({scope:e,send:t}){if(!zn(e))return;const r=e.getWin(),i=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};en(()=>{i(),en(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const s=new r.ResizeObserver(i);return WT(e).forEach(u=>s.observe(u)),()=>s.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=zn(e),i=e.getWin(),s=new i.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var E;const h=f.target,m=Number((E=h.dataset.index)!=null?E:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?s8(d,m):a8(d,m)},n.get("slidesInView"));n.set("slidesInView",u8(c))},{root:r,threshold:t("inViewThreshold")});return WT(e).forEach(u=>s.observe(u)),()=>s.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=zn(n);return r?ln(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return ln(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return bM(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return ln(r,"keydown",s=>{switch(s.key){case"ArrowRight":s.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":s.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":s.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":s.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:i}){var f;const s=t.instant?"instant":"smooth",u=xx((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=zn(n);if(!c)return;const d=r("isHorizontal")?"left":"top";i(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:s})})},setClosestPage({context:e,scope:t,computed:n}){const r=zn(t);if(!r)return;const i=n("isHorizontal")?r.scrollLeft:r.scrollTop,s=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-i)<1);s!==-1&&e.set("page",s)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),i=Ex(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",i)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),i=c8(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",i)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const i=zn(r);if(!i)return;const s=Y7(i,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(s==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-s)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=xx(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=zn(n);if(!r)return;const i=$T(r);e.set("pageSnapPoints",t("isHorizontal")?i.x:i.y)},disableScrollSnap({scope:e}){const t=zn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=zn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=zn(e);if(!r)return;const i=r.scrollLeft,s=r.scrollTop,u=$T(r),c=u.x.reduce((f,h)=>Math.abs(h-i)<Math.abs(f-i)?h:f,u.x[0]),d=u.y.reduce((f,h)=>Math.abs(h-s)<Math.abs(f-s)?h:f,u.y[0]);en(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const h=r.dataset.scrollSnapType;h&&(r.style.setProperty("scroll-snap-type",h),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=eF(n,e.get("page"));r&&en(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function rF(e,t,n){if(e==null||n<=0)return[];const r=[],i=t==="auto"?Math.floor(n):t;if(i<=0)return[];for(let s=0;s<e&&!(s+n>e);s+=i)r.push(s);return r}$s()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),$s()(["index","readOnly"]),$s()(["index","snapAlign"]);const iF=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,dir:r,getRootNode:n},e),s=Fl(nF,i);return tF(s,Yh)},Tm=S.forwardRef((e,t)=>{const[n,r]=_u()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),i=iF(n),s=tn(i.getRootProps(),r);return w.jsx(V7,{value:i,children:w.jsx(Sn.div,ue(U({},s),{ref:t}))})});Tm.displayName="CarouselRoot";const oF=180,sF=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},aF=({globalClassName:e,className:t,itemMinWidth:n=oF,spacing:r="0.5rem",loop:i=!1,allowMouseDrag:s=!0,showIndicators:u=!0,showNavigation:c=!0,navigationVariant:d="chevron",onPageChange:f,ariaLabel:h="Product carousel",children:m})=>{const E=Array.from(m).map((H,Z)=>({node:H,key:S.isValidElement(H)&&H.key!=null?H.key:`carousel-item-${Z}`})),b=E.length,T=S.useRef(null),[v,I]=S.useState(0),{width:_}=$k();S.useLayoutEffect(()=>{T.current&&I(T.current.getBoundingClientRect().width)},[_,b]);const N=sF(r),P=n+N,B=v>0?(v+N)/P:1,R=Math.max(1,Math.floor(B));if(b===0)return null;const O=b>R,q=Math.ceil(b/R),K=O?Math.max(1,B):R,re=d==="circle-arrow";return w.jsxs(Tm,{ref:T,className:M(e,t,`${k}-carousel`,{[`${k}-carousel--circle-arrow-navigation`]:re}),slidesPerPage:K,slidesPerMove:R,spacing:r,loop:i,allowMouseDrag:s,slideCount:b,onPageChange:f,"aria-label":h,children:[w.jsx(bm,{className:M(e,`${k}-carousel__item-group`,{"carousel-row-container":!O}),children:E.map(({node:H,key:Z},X)=>w.jsx(Em,{index:X,className:M(e,`${k}-carousel__item`),children:H},Z))}),c&&O&&w.jsxs(mm,{className:M(e,`${k}-carousel__control`),children:[w.jsx(xm,{className:M(e,`${k}-carousel__prev-trigger`),"aria-label":"Previous slide",children:re?w.jsx(PE,{size:"16px"}):w.jsx(U7,{size:"16px"})}),w.jsx(wm,{className:M(e,`${k}-carousel__next-trigger`),"aria-label":"Next slide",children:re?w.jsx(RE,{size:"16px"}):w.jsx(j7,{size:"16px"})})]}),u&&O&&w.jsx(ym,{className:M(e,`${k}-carousel__indicator-group`),children:Array.from({length:q},(H,Z)=>w.jsx(gm,{index:Z,className:M(e,`${k}-carousel__indicator`),"aria-label":`Go to slide group ${Z+1}`},Z))})]})},[uF,cF]=Uo({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),lF=e=>_u()(e,["lazyMount","unmountOnExit"]),[dF,Nu]=Uo({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),GT=S.forwardRef((e,t)=>{const n=Nu(),r=cF(),i=Kh(ue(U({},r),{present:n.open})),s=tn(n.getBackdropProps(),i.getPresenceProps(),e);return i.unmounted?null:w.jsx(Sn.div,ue(U({},s),{ref:Bl(i.ref,t)}))});GT.displayName="DialogBackdrop";const _m=S.forwardRef((e,t)=>{const n=Nu(),r=Tu(),i=tn(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(Sn.div,ue(U({},i),{ref:Bl(r.ref,t)}))});_m.displayName="DialogContent";const vm=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getDescriptionProps(),e);return w.jsx(Sn.div,ue(U({},r),{ref:t}))});vm.displayName="DialogDescription";const Sm=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getPositionerProps(),e);return Tu().unmounted?null:w.jsx(Sn.div,ue(U({},r),{ref:t}))});Sm.displayName="DialogPositioner";var fF=jo("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Vo=fF.build(),XT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},KT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Am=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},QT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},km=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},Cm=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},JT=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Jl=e=>e.getById(Am(e)),pF=e=>e.getById(XT(e)),hF=e=>e.getById(KT(e)),mF=e=>e.getById(QT(e)),gF=e=>e.getById(km(e)),yF=e=>e.getById(Cm(e)),EF=e=>e.getById(JT(e));function bF(e,t){const{state:n,send:r,context:i,prop:s,scope:u}=e,c=s("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(ue(U({},Vo.trigger.attrs),{dir:s("dir"),id:QT(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Am(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(ue(U({},Vo.backdrop.attrs),{dir:s("dir"),hidden:!d,id:KT(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ue(U({},Vo.positioner.attrs),{dir:s("dir"),id:XT(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=i.get("rendered");return t.element(ue(U({},Vo.content.attrs),{dir:s("dir"),role:s("role"),hidden:!d,id:Am(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:km(u),"aria-describedby":f.description?Cm(u):void 0}))},getTitleProps(){return t.element(ue(U({},Vo.title.attrs),{dir:s("dir"),id:km(u)}))},getDescriptionProps(){return t.element(ue(U({},Vo.description.attrs),{dir:s("dir"),id:Cm(u)}))},getCloseTriggerProps(){return t.button(ue(U({},Vo.closeTrigger.attrs),{dir:s("dir"),id:JT(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var wF={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>EF(t):void 0,i=typeof e.modal=="boolean"?e.modal:!0;return U({role:"dialog",modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ST(()=>Jl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[mF(e)],onInteractOutside(i){var s;(s=n("onInteractOutside"))==null||s(i),n("closeOnInteractOutside")||i.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(i){var s;(s=n("onEscapeKeyDown"))==null||s(i),n("closeOnEscape")||i.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return IT(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?CT(()=>Jl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var i,s;return(s=(i=t("finalFocusEl"))==null?void 0:i())!=null?s:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?gT(()=>[Jl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){en(()=>{e.set("rendered",{title:!!gF(t),description:!!yF(t)})})},syncZIndex({scope:e}){en(()=>{const t=Jl(e);if(!t)return;const n=Bs(t);[pF(e),hF(e)].forEach(i=>{i==null||i.style.setProperty("--z-index",n.zIndex),i==null||i.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};$s()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const xF=e=>{const t=S.useId(),{getRootNode:n}=Kl(),{dir:r}=pm(),i=U({id:t,getRootNode:n,dir:r},e),s=Fl(wF,i);return bF(s,Yh)},ZT=e=>{const[t,c]=qx(e),d=c,{children:n}=d,r=bn(d,["children"]),[i]=lF(t),s=xF(r),u=Kh(tn({present:s.open},t));return w.jsx(dF,{value:s,children:w.jsx(uF,{value:i,children:w.jsx($x,{value:u,children:n})})})},e_=S.forwardRef((e,t)=>{const n=Nu(),r=tn(n.getTitleProps(),e);return w.jsx(Sn.h2,ue(U({},r),{ref:t}))});e_.displayName="DialogTitle";const TF=({children:e})=>{const[t,n]=S.useState(!1),r=S.useMemo(()=>({toggleMenu:()=>n(s=>!s),closeMenu:()=>n(!1)}),[]),i=S.useMemo(()=>({isOpen:t}),[t]);return w.jsx(Rh.Provider,{value:r,children:w.jsx(px.Provider,{value:i,children:e})})},t_=()=>S.useContext(px),n_=()=>{const e=S.useContext(Rh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},_F=`${k}-overflow-menu-button-trigger`,vF=({componentType:e,children:t})=>{const{isOpen:n}=t_(),{closeMenu:r}=n_(),{globalClassName:i}=at(),s=S.useRef(null);return S.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${_F}`)||s.current&&!s.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?w.jsx("div",{ref:s,className:M(`${k}-overflow-panel`,i,`cim-${e}-component`),children:t}):null},SF=({componentType:e,className:t})=>{const{toggleMenu:n}=n_(),{isOpen:r}=t_(),{globalClassName:i}=at();return w.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,className:M(`${k}-overflow-menu-button-trigger`,`${k}-icon-button`,i,t,`cim-${e}-component`),onClick:n,children:w.jsx(FT,{})})};class AF{constructor(){Ye(this,"initialState",C1);Ye(this,"promptsStateProxy");Ye(this,"promptsParamsProxy");Ye(this,"_fullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return NF(n,r),Reflect.set(t,n,r)});Ye(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Ye(this,"updatePromptsParamsProxy",t=>new Proxy(U({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const zi=new AF,kF=e=>{window.addEventListener(Lf,e)},CF=e=>{window.removeEventListener(Lf,e)},NF=(e,t)=>{const n=new CustomEvent(Lf,{detail:{property:e,value:t}});window.dispatchEvent(n)},r_=e=>{const t=zi.isOpen,n=typeof e=="boolean"?e:!t;zi.promptsStateProxy.isOpen=n},IF=e=>{const t=zi.isInline,n=typeof e=="boolean"?e:!t;zi.promptsStateProxy.isInline=n},OF=({elementId:e,entryType:t,params:n,isInline:r})=>{zi.promptsStateProxy.elementId=e,t&&(zi.promptsStateProxy.entryType=t),typeof r=="boolean"&&IF(r),n&&zi.updatePromptsParamsProxy(n),zi.isOpen||r_(!0)},PF=()=>{r1("resetConversation",!0,kc.RESET_CONVERSATION)},RF=()=>{r1("endConversation",!0,kc.END_CONVERSATION)},Nm=()=>{const e=S.useContext(mE);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},LF=()=>{const e=S.useContext(hE);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},Zl=()=>{const e=S.useContext(pE);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},DF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{previousComponentType:r}=Zn(),i=Mo(),s=()=>{fs(r||"dialog"),i()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:s,icon:w.jsx(BT,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-dialog-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(BT,{}),"Show ",r||"dialog"]})},MF=({componentType:e,globalClassName:t,controls:n,showClose:r,closeButtonAriaLabel:i,onClose:s,showOverflowMenu:u,showPrimaryToggle:c})=>{const d=e==="modal"?DF:s_;return w.jsx("div",{className:M(t,`${k}-${e}-controls`),children:n!=null?w.jsxs(w.Fragment,{children:[n,r&&w.jsx(Fp,{className:M(t,`cim-${e}-component`),label:i,onClick:s})]}):w.jsxs(w.Fragment,{children:[u&&w.jsx(SF,{componentType:e}),c&&w.jsx(d,{componentType:e,isIcon:!0}),r&&w.jsx(Fp,{className:M(t,`cim-${e}-component`),label:i,onClick:s})]})})},FF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{isModalFullscreen:r}=Zn(),i=Mo(),s=()=>{Ic(!r),i()},u=r?mO:gO,c="Toggle Fullscreen";return t?w.jsx(Sr,{ariaLabel:c,title:c,className:M(n,`${k}-modal-fullscreen-button`,`cim-${e}-component`),icon:w.jsx(u,{}),onClick:s}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-modal-fullscreen-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(u,{}),c]})},BF=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{dialogPosition:r}=Zn(),i=Mo(),s=r==="bottom-left",u=()=>{Oc(s?"bottom-right":"bottom-left"),i()},c=s?B7:F7,d=s?"Move right":"Move left";return t?w.jsx(Sr,{className:M(n,`${k}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:w.jsx(c,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[w.jsx(c,{}),d]})},UF=({componentType:e,controls:t,showOverflowMenu:n,showSecondaryToggle:r,showMinimize:i,showClearChat:s,showEndConversation:u,showDownloadTranscript:c,onClearChat:d,onEndConversation:f,onDownloadTranscript:h})=>{if(t!=null||!n)return null;const m=e==="modal"?FF:BF;return w.jsxs(vF,{componentType:e,children:[r&&w.jsx(m,{componentType:e}),i&&w.jsx(WF,{componentType:e}),s&&w.jsx(mx,{componentType:e,onClearChat:d}),u&&f&&w.jsx(yx,{componentType:e,onEndConversation:f}),c&&h&&w.jsx(gx,{componentType:e,onDownloadTranscript:h})]})},jF=({componentType:e,overflowActions:t,availableActions:n,controls:r,onClearChat:i,onEndConversation:s,onClose:u,onDownloadTranscript:c})=>{const{headerConfig:d,globalClassName:f,layoutPreset:h}=at(),{mode:m}=Zn(),E=m==="standalone",b=e==="modal",T=re=>n===void 0||n[re],v=(re,H=!0)=>t.includes(re)&&T(re)&&H,I=T("toggleExpanded"),_=v(b?"toggleFullscreen":"toggleDialogPosition"),N=v("minimize"),P=v("clearChat"),B=T("close"),R=v("endConversation",!!s),O=v("downloadTranscript",!!c),q=_||N||P||R||O,K=S.useMemo(()=>d?SO(d):{},[d]);return w.jsx(TF,{children:w.jsxs("div",{className:M(f,`${k}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[w.jsxs("div",{className:M(f,`${k}-${e}-header`,{standalone:E,embedded:!E}),style:K,children:[d!=null&&d.logoUrl?w.jsx("img",{alt:"",className:M(f,`${k}-${e}-logo`,{standalone:E,embedded:!E}),src:d.logoUrl}):h==="commerce"?w.jsx("svg",{className:M(f,`${k}-${e}-logo`,{standalone:E,embedded:!E}),viewBox:"0 0 16 16",width:"24",height:"24",fill:"none",children:w.jsx("path",{d:"M6.62479 10.3342C6.56527 10.1034 6.44502 9.89289 6.27653 9.72441C6.10805 9.55592 5.8975 9.43567 5.66679 9.37615L1.57679 8.32148C1.50701 8.30168 1.4456 8.25965 1.40186 8.20178C1.35813 8.14391 1.33447 8.07335 1.33447 8.00082C1.33447 7.92828 1.35813 7.85772 1.40186 7.79985C1.4456 7.74198 1.50701 7.69996 1.57679 7.68015L5.66679 6.62482C5.89742 6.56535 6.10792 6.4452 6.27639 6.27684C6.44486 6.10849 6.56517 5.89808 6.62479 5.66748L7.67946 1.57748C7.69906 1.50743 7.74105 1.44571 7.799 1.40175C7.85696 1.35778 7.92771 1.33398 8.00046 1.33398C8.0732 1.33398 8.14395 1.35778 8.20191 1.40175C8.25987 1.44571 8.30185 1.50743 8.32146 1.57748L9.37546 5.66748C9.43497 5.8982 9.55523 6.10875 9.72371 6.27723C9.89219 6.44571 10.1027 6.56597 10.3335 6.62548L14.4235 7.67948C14.4938 7.69888 14.5558 7.74082 14.6 7.79887C14.6442 7.85691 14.6682 7.92786 14.6682 8.00082C14.6682 8.07378 14.6442 8.14472 14.6 8.20277C14.5558 8.26081 14.4938 8.30275 14.4235 8.32215L10.3335 9.37615C10.1027 9.43567 9.89219 9.55592 9.72371 9.72441C9.55523 9.89289 9.43497 10.1034 9.37546 10.3342L8.32079 14.4242C8.30118 14.4942 8.2592 14.5559 8.20124 14.5999C8.14328 14.6439 8.07254 14.6677 7.99979 14.6677C7.92704 14.6677 7.85629 14.6439 7.79834 14.5999C7.74038 14.5559 7.69839 14.4942 7.67879 14.4242L6.62479 10.3342Z",stroke:"#ffffff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null,w.jsx(e_,{className:M(f,`${k}-${e}-title`,{standalone:E,embedded:!E}),children:d==null?void 0:d.headerText}),w.jsx(MF,{componentType:e,globalClassName:f,controls:r,showClose:B,closeButtonAriaLabel:d==null?void 0:d.closeButtonAriaLabel,onClose:u,showOverflowMenu:q,showPrimaryToggle:I})]}),w.jsx(UF,{componentType:e,controls:r,showOverflowMenu:q,showSecondaryToggle:_,showMinimize:N,showClearChat:P,showEndConversation:R,showDownloadTranscript:O,onClearChat:i,onEndConversation:s,onDownloadTranscript:c})]})})},Qs="USD",Im=(...e)=>e.flatMap(t=>t!=null?t:[]).reduce((t,n)=>{const r=n.promotionalPrice;return typeof r!="number"||!Number.isFinite(r)?t:t===void 0||r<t?r:t},void 0),yi=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},HF=({retailPrice:e,discountPrice:t,currencyCode:n=Qs})=>{const r=n||Qs,i=typeof t=="number"&&typeof e=="number"&&t<e,s=i?t:e||t||null,u=i?e:null;return{price:yi(s,r),comparePrice:yi(u,r),hasDiscount:i}},ed=e=>typeof e=="number"&&Number.isFinite(e),Om=e=>ed(e==null?void 0:e.min)&&ed(e==null?void 0:e.max),i_=e=>{const t=e==null?void 0:e.type;return typeof t=="string"&&t.length>0?t:void 0},$F=({min:e,max:t,currencyCode:n=Qs})=>{if(!ed(e)||!ed(t))return null;const r=n||Qs,i=yi(e,r),s=yi(t,r);if(i===null||s===null)return null;const u=e!==t;return{value:u?`${i} – ${s}`:i,low:i,high:s,isRange:u}},zF=({priceBreakdown:e,currencyCode:t=Qs})=>{if(!e)return null;const n=t||Qs,r=Om(e.promotional)?e.promotional:null,i=Om(e.sales)?e.sales:null,s=Om(e.original)?e.original:null;if(!r&&!i&&!s)return null;const u=E=>$F({min:E.min,max:E.max,currencyCode:n}),c=(E,b)=>b&&b.value!==E.value?b:null;if(r){const E=u(r);return E?{active:E,compare:c(E,i?u(i):null)}:null}const d=i_(e.sales),f=i_(e.original);if(i&&s&&d&&f&&d!==f){const E=u(i);return E?{active:E,compare:c(E,u(s))}:null}const h=i!=null?i:s;if(!h)return null;const m=u(h);return m?{active:m,compare:null}:null},Pm=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:i,className:s})=>{const{price:u,comparePrice:c,hasDiscount:d}=HF({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return w.jsxs("div",{className:M(i,s,`${k}-price`),style:f,children:[w.jsx("span",{className:`${k}-visually-hidden`,children:"Current price: "}),w.jsx("span",{className:M(i,`${k}-price__amount`),children:u}),d&&c&&w.jsxs("span",{className:M(i,`${k}-price__compare`),children:[w.jsx("span",{className:`${k}-visually-hidden`,children:"Original price: "}),c]})]})},VF={sparkle:hm,plus:H7,"paper-plane":$7},o_=({icon:e,className:t})=>{const n=VF[e];return n?w.jsx(n,{className:t,"aria-hidden":"true"}):null},qF=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:i,onSuggestionClick:s})=>{var b;const{suggestionButtonConfig:u}=at(),c=u==null?void 0:u.icon,d=(b=u==null?void 0:u.iconPosition)!=null?b:"left",f=i?"standalone":"embedded",h=T=>()=>{s(T)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},E=T=>w.jsxs(w.Fragment,{children:[c&&w.jsx(o_,{icon:c,className:`${k}-suggestion-button-icon`}),w.jsx("span",{children:T})]});return w.jsx("div",{className:M(t,`${k}-suggestion-container ${f}`,e),children:n.map(T=>i?w.jsx(Bp,{disabled:r,className:M(t,`${k}-suggestion-button standalone`,m),onClick:h(T),children:E(T)},T):w.jsx("button",{disabled:r,className:M(t,`${k}-suggestion-button embedded`,m),onClick:h(T),children:E(T)},T))})},WF=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=at();if(!r)return null;const i=()=>{zr(!1),yo(!0),nl()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:i,icon:w.jsx(CE,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-minimize-button`,`cim-${e}-component`),onClick:i,children:[w.jsx(CE,{}),"Minimize"]})},s_=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),r=Mo(),i=()=>{fs("modal"),r()};return t?w.jsx(Sr,{className:M(n,`${k}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:i,icon:w.jsx(UT,{})}):w.jsxs("button",{className:M(n,`${k}-overflow-menu-button`,`${k}-toggle-modal-button`,`cim-${e}-component`),onClick:i,children:[w.jsx(UT,{}),"Show modal"]})};function YF(e){return e.includes("-")&&e===e.toLowerCase()}function ri({tagName:e,props:t,label:n,onError:r}){const i=S.useRef(null),s=S.useRef(null),u=S.useRef(e),c=S.useRef(null),d=S.useRef(null),f=S.useRef(r);return f.current=r,S.useEffect(()=>{const h=i.current;if(!h)return;const m=()=>{var b;d.current!==e&&(d.current=e,(b=f.current)==null||b.call(f))};if(u.current!==e&&(u.current=e,s.current=null,d.current=null),!YF(e)){c.current!==e&&(c.current=e,At(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`),m()),s.current=null,h.replaceChildren();return}const E=s.current;if(E&&E.isConnected)try{E.props=t;return}catch(b){At(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,b),m(),s.current=null,h.replaceChildren();return}try{const b=document.createElement(e);b.props=t,h.replaceChildren(b);const T=b.localName;s.current=typeof customElements!="undefined"&&customElements.get(T)?b:null}catch(b){At(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,b),m(),s.current=null,h.replaceChildren()}},[e,t,n]),S.useEffect(()=>{const h=i.current;return()=>{s.current=null,h==null||h.replaceChildren()}},[]),w.jsx("div",{ref:i,"data-override":n||"custom"})}class td extends S.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){var r,i,s;At(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack),(r=this.context)==null||r.failure("override_render_error",{context:{override:this.props.overrideName}}),(s=(i=this.props).onError)==null||s.call(i)}render(){return this.state.hasError?null:this.props.children}}Ye(td,"contextType",Rc);const Or=()=>S.useContext(y1),a_=e=>{try{e()}catch(t){}},u_=()=>{const e=S.useContext(Rc);return S.useMemo(()=>({reportFailure:(t,...[n,r])=>a_(()=>e==null?void 0:e.overrideFailure(t,n,r)),reportEvent:(t,...[n,r])=>a_(()=>e==null?void 0:e.overrideEvent(t,n,r))}),[e])},c_=e=>{const t=u_();return S.useMemo(()=>({reportFailure:(n,r)=>t.reportFailure(e,n,r),reportEvent:(n,r)=>t.reportEvent(e,n,r)}),[t,e])},Ei=e=>{const{sendMessage:t,loading:n,isConnected:r}=$t(),{mode:i,status:s}=Zn(),{reportFailure:u,reportEvent:c}=c_(e);return S.useMemo(()=>({sendMessage:t,isLoading:n,isConnected:r,componentType:s.type,mode:i,reportFailure:u,reportEvent:c}),[t,n,r,s.type,i,u,c])},GF=({componentType:e,availableActions:t,onClose:n,onClearChat:r,onEndConversation:i,onDownloadTranscript:s})=>{const{isModalFullscreen:u,dialogPosition:c,previousComponentType:d}=Zn(),{logger:f}=at(),[h,m]=S.useState(!1),E=S.useRef(t);E.current=t;const b=S.useRef(e);b.current=e;const T=S.useRef(n);T.current=n;const v=S.useRef(r);v.current=r;const I=S.useRef(i);I.current=i;const _=S.useRef(s);_.current=s;const N=S.useRef(u);N.current=u;const P=S.useRef(c);P.current=c;const B=S.useRef(d);B.current=d;const R=S.useRef(f);R.current=f;const O=S.useRef(null),q=S.useMemo(()=>{const re=H=>E.current[H];return{close:()=>{var H;re("close")&&((H=T.current)==null||H.call(T))},toggleExpanded:()=>{if(re("toggleExpanded")){if(b.current==="modal"){fs(B.current||"dialog");return}fs("modal")}},toggleFullscreen:H=>{re("toggleFullscreen")&&Ic(typeof H=="boolean"?H:!N.current)},toggleDialogPosition:H=>{if(!re("toggleDialogPosition"))return;let Z;switch(H){case"left":case"bottom-left":Z="bottom-left";break;case"right":case"bottom-right":Z="bottom-right";break;default:Z=P.current==="bottom-left"?"bottom-right":"bottom-left";break}Oc(Z)},minimize:()=>{re("minimize")&&(zr(!1),yo(!0),nl())},clearChat:()=>Oe(null,null,function*(){var H;re("clearChat")&&(yield(H=v.current)==null?void 0:H.call(v))}),endConversation:()=>Oe(null,null,function*(){var H;re("endConversation")&&(yield(H=I.current)==null?void 0:H.call(I))}),downloadTranscript:()=>{if(!re("downloadTranscript"))return Promise.resolve();const H=O.current;if(H)return H;let Z=()=>{};const X=new Promise(he=>{Z=he});return O.current=X,Oe(null,null,function*(){var he,V;m(!0);try{yield(he=_.current)==null?void 0:he.call(_)}catch(ce){(V=R.current)==null||V.error("Error downloading transcript:",ce)}finally{m(!1),O.current===X&&(O.current=null),Z()}}),X}}},[]),K=S.useMemo(()=>({available:t,isDownloadingTranscript:h,isFullscreen:u,dialogPosition:c}),[t,h,u,c]);return{actions:q,state:K}},l_=()=>{const{overrides:e,isInitialized:t}=Or(),[n,r]=S.useState(null),i=e.HeaderActions,s=t&&typeof i=="string"&&i.length>0&&i!==n,u=S.useCallback(()=>{typeof i=="string"&&i.length>0&&r(i)},[i]);return{active:s,onError:u}},d_=n=>{var r=n,{onError:e}=r,t=bn(r,["onError"]);const{overrides:i,isInitialized:s}=Or(),u=i.HeaderActions,{actions:c,state:d}=GF(t),f=Ei("HeaderActions"),h=S.useMemo(()=>({name:"HeaderActions",payload:{actions:d},api:ue(U({},f),{actions:c})}),[d,f,c]);return!s||typeof u!="string"||u.length===0?null:w.jsx(td,{overrideName:"HeaderActions",onError:e,children:w.jsx(ri,{tagName:u,props:h,label:"HeaderActions",onError:e})})};function qo(){const{sendMessage:e}=$t(),{productId:t}=Nm(),{enablePageContext:n}=at();return S.useCallback((r,i)=>{var f,h,m;if(n)return e(r,i);const u=((h=(f=r.match(/\[SKU:\s*([^\]]+)\]/i))==null?void 0:f[1])==null?void 0:h.trim())||t,{prompt:c,display:d}=bp(r,u);return e(c,ue(U({},i),{displayContent:(m=i==null?void 0:i.displayContent)!=null?m:d}))},[e,t,n])}function Rm(){const{sendFile:e}=$t(),{productId:t}=Nm();return S.useCallback(n=>{if(!n.file||!t)return e(n);const{prompt:r}=bp(n.text,t);return e(ue(U({},n),{text:r,displayContent:n.text}))},[e,t])}const XF=["Hey there! 👋 Getting things ready for you…","Connecting you to our shopping assistant…","Just a moment…"],KF=3e3,QF=400,Lm=({className:e})=>{const t=S.useId();return w.jsxs("svg",{className:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[w.jsx("defs",{children:w.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"1",children:[w.jsx("stop",{offset:"0",stopColor:"#4f7fce"}),w.jsx("stop",{offset:"1",stopColor:"#c85d94"})]})}),w.jsx("path",{d:"M6.62479 10.3342C6.56527 10.1034 6.44502 9.89289 6.27653 9.72441C6.10805 9.55592 5.8975 9.43567 5.66679 9.37615L1.57679 8.32148C1.50701 8.30168 1.4456 8.25965 1.40186 8.20178C1.35813 8.14391 1.33447 8.07335 1.33447 8.00082C1.33447 7.92828 1.35813 7.85772 1.40186 7.79985C1.4456 7.74198 1.50701 7.69996 1.57679 7.68015L5.66679 6.62482C5.89742 6.56535 6.10792 6.4452 6.27639 6.27684C6.44486 6.10849 6.56517 5.89808 6.62479 5.66748L7.67946 1.57748C7.69906 1.50743 7.74105 1.44571 7.799 1.40175C7.85696 1.35778 7.92771 1.33398 8.00046 1.33398C8.0732 1.33398 8.14395 1.35778 8.20191 1.40175C8.25987 1.44571 8.30185 1.50743 8.32146 1.57748L9.37546 5.66748C9.43497 5.8982 9.55523 6.10875 9.72371 6.27723C9.89219 6.44571 10.1027 6.56597 10.3335 6.62548L14.4235 7.67948C14.4938 7.69888 14.5558 7.74082 14.6 7.79887C14.6442 7.85691 14.6682 7.92786 14.6682 8.00082C14.6682 8.07378 14.6442 8.14472 14.6 8.20277C14.5558 8.26081 14.4938 8.30275 14.4235 8.32215L10.3335 9.37615C10.1027 9.43567 9.89219 9.55592 9.72371 9.72441C9.55523 9.89289 9.43497 10.1034 9.37546 10.3342L8.32079 14.4242C8.30118 14.4942 8.2592 14.5559 8.20124 14.5999C8.14328 14.6439 8.07254 14.6677 7.99979 14.6677C7.92704 14.6677 7.85629 14.6439 7.79834 14.5999C7.74038 14.5559 7.69839 14.4942 7.67879 14.4242L6.62479 10.3342Z",fill:`url(#${t})`,stroke:`url(#${t})`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},JF=e=>e===null?[]:Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim()!==""):XF,ZF=({globalClassName:e,isWidgetStandalone:t,messages:n,variant:r="default"})=>{const[i,s]=S.useState(0),[u,c]=S.useState(!0),d=S.useMemo(()=>JF(n),[n]),f=d.length,h=n!==null;return S.useEffect(()=>{if(f<2||!h)return;let m;const E=setInterval(()=>{c(!1),m=setTimeout(()=>{s(b=>(b+1)%f),c(!0)},QF)},KF);return()=>{clearInterval(E),clearTimeout(m),c(!0)}},[f,h]),h?r==="sparkles"?w.jsxs("div",{className:M(e,`${k}-connecting-indicator`,`${k}-connecting-indicator--sparkles`,t?"standalone":"embedded"),role:"status","aria-label":"Loading shopping assistant",children:[w.jsxs("div",{className:`${k}-connecting-sparkles`,"aria-hidden":"true",children:[w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-left`}),w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-main`}),w.jsx(Lm,{className:`${k}-connecting-sparkle sparkle-right`})]}),w.jsx("span",{className:`${k}-connecting-heading`,"aria-hidden":"true",children:"Loading your shopping assistant"}),f>0&&w.jsx("span",{className:M(`${k}-connecting-text`,`${k}-connecting-text--feature`,u&&`${k}-connecting-text--visible`),"aria-hidden":"true",children:d[i%f]})]}):w.jsxs("div",{className:M(e,`${k}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[w.jsxs("div",{className:`${k}-connecting-pulse-wrapper`,"aria-hidden":"true",children:[w.jsx("div",{className:`${k}-connecting-pulse`}),w.jsx("div",{className:`${k}-connecting-ring`})]}),f>0&&w.jsx("span",{className:M(`${k}-connecting-text`,u&&`${k}-connecting-text--visible`),"aria-hidden":"true",children:d[i%f]})]}):null},eB=({shouldShow:e,loadingText:t})=>e?w.jsx("span",{className:`${k}-processing-text`,"aria-hidden":"true",children:t}):null,tB=({shouldShow:e})=>e?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"}),w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"}),w.jsx("div",{className:`${k}-processing-shimmer-bar`,"aria-hidden":"true"})]}):null,Dm=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>w.jsxs("div",{className:M(e,`${k}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[w.jsx(eB,{shouldShow:!!n,loadingText:n}),w.jsx(tB,{shouldShow:!n})]}),nB="(max-width: 576px)";function rB(e){return e?!e.defaultPrevented&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:!0}function iB({event:e,openLinksInNewTab:t,isCartMgmtSupported:n=!1}={}){n||t||rB(e)&&typeof window!="undefined"&&window.matchMedia(nB).matches&&(yo(!0),GA())}function oB(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function sB(e){if(typeof window=="undefined")return!1;try{return new URL(e,window.location.href).origin===window.location.origin}catch(t){return!1}}function Vi({event:e,href:t,openLinksInNewTab:n,onNavigate:r}){if(!r||n||!oB(e)||e.defaultPrevented)return;const i=t||e.currentTarget.href;!i||!sB(i)||r(i,e)}function Iu(n){var r=n,{isCartMgmtSupported:e}=r,t=bn(r,["isCartMgmtSupported"]);iB({event:t.event.nativeEvent,openLinksInNewTab:t.openLinksInNewTab,isCartMgmtSupported:e}),Vi(t)}function f_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function aB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uB(e,t,n){const i=ml((n||{}).ignore||[]),s=cB(t);let u=-1;for(;++u<s.length;)Wb(e,"text",c);function c(f,h){let m=-1,E;for(;++m<h.length;){const b=h[m],T=E?E.children:void 0;if(i(b,T?T.indexOf(b):void 0,E))return;E=b}if(E)return d(f,h)}function d(f,h){const m=h[h.length-1],E=s[u][0],b=s[u][1];let T=0;const I=m.children.indexOf(f);let _=!1,N=[];E.lastIndex=0;let P=E.exec(f.value);for(;P;){const B=P.index,R={index:P.index,input:P.input,stack:[...h,f]};let O=b(...P,R);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?E.lastIndex=B+1:(T!==B&&N.push({type:"text",value:f.value.slice(T,B)}),Array.isArray(O)?N.push(...O):O&&N.push(O),T=B+P[0].length,_=!0),!E.global)break;P=E.exec(f.value)}return _?(T<f.value.length&&N.push({type:"text",value:f.value.slice(T)}),m.children.splice(I,1,...N)):N=[f],I+N.length}}function cB(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([lB(i[0]),dB(i[1])])}return t}function lB(e){return typeof e=="string"?new RegExp(aB(e),"g"):e}function dB(e){return typeof e=="function"?e:function(){return e}}const Mm="phrasing",Fm=["autolink","link","image","label"];function fB(){return{transforms:[bB],enter:{literalAutolink:hB,literalAutolinkEmail:Bm,literalAutolinkHttp:Bm,literalAutolinkWww:Bm},exit:{literalAutolink:EB,literalAutolinkEmail:yB,literalAutolinkHttp:mB,literalAutolinkWww:gB}}}function pB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Fm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Fm},{character:":",before:"[ps]",after:"\\/",inConstruct:Mm,notInConstruct:Fm}]}}function hB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bm(e){this.config.enter.autolinkProtocol.call(this,e)}function mB(e){this.config.exit.autolinkProtocol.call(this,e)}function gB(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yB(e){this.config.exit.autolinkEmail.call(this,e)}function EB(e){this.exit(e)}function bB(e){uB(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xB]],{ignore:["link","linkReference"]})}function wB(e,t,n,r,i){let s="";if(!p_(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!TB(n)))return!1;const u=_B(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:s+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function xB(e,t,n,r){return!p_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function TB(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _B(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=f_(e,"(");let s=f_(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function p_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||No(n)||ul(n))&&(!t||n!==47)}h_.peek=PB;function vB(){this.buffer()}function SB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function AB(){this.buffer()}function kB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NB(e){this.exit(e)}function IB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function OB(e){this.exit(e)}function PB(){return"["}function h_(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),u(),s+=i.move("]"),s}function RB(){return{enter:{gfmFootnoteCallString:vB,gfmFootnoteCall:SB,gfmFootnoteDefinitionLabelString:AB,gfmFootnoteDefinition:kB},exit:{gfmFootnoteCallString:CB,gfmFootnoteCall:NB,gfmFootnoteDefinitionLabelString:IB,gfmFootnoteDefinition:OB}}}function LB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:h_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,u){const c=s.createTracker(u);let d=c.move("[^");const f=s.enter("footnoteDefinition"),h=s.enter("label");return d+=c.move(s.safe(s.associationId(r),{before:d,after:"]"})),h(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
38
38
  `:" ")+s.indentLines(s.containerFlow(r,c.current()),t?m_:DB))),f(),d}}function DB(e,t,n){return t===0?e:m_(e,t,n)}function m_(e,t,n){return(n?"":" ")+e}const MB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];g_.peek=HB;function FB(){return{canContainEols:["delete"],enter:{strikethrough:UB},exit:{strikethrough:jB}}}function BB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:MB}],handlers:{delete:g_}}}function UB(e){this.enter({type:"delete",children:[]},e)}function jB(e){this.exit(e)}function g_(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let u=i.move("~~");return u+=n.containerPhrasing(e,ue(U({},i.current()),{before:u,after:"~"})),u+=i.move("~~"),s(),u}function HB(){return"~"}function $B(e){return e.length}function zB(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||$B,s=[],u=[],c=[],d=[];let f=0,h=-1;for(;++h<e.length;){const v=[],I=[];let _=-1;for(e[h].length>f&&(f=e[h].length);++_<e[h].length;){const N=VB(e[h][_]);if(n.alignDelimiters!==!1){const P=i(N);I[_]=P,(d[_]===void 0||P>d[_])&&(d[_]=P)}v.push(N)}u[h]=v,c[h]=I}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)s[m]=y_(r[m]);else{const v=y_(r);for(;++m<f;)s[m]=v}m=-1;const E=[],b=[];for(;++m<f;){const v=s[m];let I="",_="";v===99?(I=":",_=":"):v===108?I=":":v===114&&(_=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[m]-I.length-_.length);const P=I+"-".repeat(N)+_;n.alignDelimiters!==!1&&(N=I.length+N+_.length,N>d[m]&&(d[m]=N),b[m]=N),E[m]=P}u.splice(1,0,E),c.splice(1,0,b),h=-1;const T=[];for(;++h<u.length;){const v=u[h],I=c[h];m=-1;const _=[];for(;++m<f;){const N=v[m]||"";let P="",B="";if(n.alignDelimiters!==!1){const R=d[m]-(I[m]||0),O=s[m];O===114?P=" ".repeat(R):O===99?R%2?(P=" ".repeat(R/2+.5),B=" ".repeat(R/2-.5)):(P=" ".repeat(R/2),B=P):B=" ".repeat(R)}n.delimiterStart!==!1&&!m&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||m)&&_.push(" "),n.alignDelimiters!==!1&&_.push(P),_.push(N),n.alignDelimiters!==!1&&_.push(B),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&_.push("|")}T.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return T.join(`
39
39
  `)}function VB(e){return e==null?"":String(e)}function y_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qB(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const u=n.indentLines(n.containerFlow(e,s.current()),WB);return i(),u}function WB(e,t,n){return">"+(n?"":" ")+e}function YB(e,t){return E_(e,t.inConstruct,!0)&&!E_(e,t.notInConstruct,!1)}function E_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function b_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
40
40
  `&&YB(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\